Skip to content

Commit f6447d2

Browse files
committed
Split included types depending on TypeScript version
1 parent 0f7694b commit f6447d2

File tree

8 files changed

+57
-0
lines changed

8 files changed

+57
-0
lines changed

packages/core-js-types/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,33 @@
3636
},
3737
"exports": {
3838
".": {
39+
"types@>=5.6": "./dist/56/actual.d.ts",
3940
"types": "./dist/56/actual.d.ts",
4041
"default": "./dist/56/actual.d.ts"
4142
},
4243
"./actual": {
44+
"types@>=5.6": "./dist/56/actual.d.ts",
4345
"types": "./dist/56/actual.d.ts",
4446
"default": "./dist/56/actual.d.ts"
4547
},
4648
"./es": {
49+
"types@>=5.6": "./dist/56/es.d.ts",
4750
"types": "./dist/56/es.d.ts",
4851
"default": "./dist/56/es.d.ts"
4952
},
5053
"./full": {
54+
"types@>=5.6": "./dist/56/full.d.ts",
5155
"types": "./dist/56/full.d.ts",
5256
"default": "./dist/56/full.d.ts"
5357
},
5458
"./pure": {
59+
"types@>=5.6": "./dist/56/pure.d.ts",
5560
"types": "./dist/56/pure.d.ts",
5661
"default": "./dist/56/pure.d.ts"
5762

5863
},
5964
"./stable": {
65+
"types@>=5.6": "./dist/56/stable.d.ts",
6066
"types": "./dist/56/stable.d.ts",
6167
"default": "./dist/56/stable.d.ts"
6268
}

packages/core-js-types/src/52/proposals/async-iteration.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@
88
interface SymbolConstructor {
99
readonly asyncIterator: unique symbol;
1010
}
11+
12+
interface AsyncIteratorConstructor {
13+
14+
}
15+
16+
declare var AsyncIterator: AsyncIteratorConstructor;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// proposal stage: 0
2+
// https://github.com/bakkot/proposal-iterator-join
3+
4+
interface Iterator<T> {
5+
join(separator?: unknown): string;
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Decodes a string of data which has been encoded using Base64 encoding.
3+
* @param data A base64-encoded string, using the alphabet produced by btoa().
4+
* @returns A binary string containing raw bytes decoded from encodedData.
5+
*/
6+
declare function atob(data: string): string;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* Creates a Base64-encoded ASCII string from a binary string
3+
* (i.e., a string in which each character in the string is treated as a byte of binary data)
4+
* @param data The binary string to encode
5+
* @returns An ASCII string containing the Base64 representation of data
6+
*/
7+
declare function btoa(data: string): string;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
interface VoidFunction {
2+
(): void;
3+
}
4+
5+
/**
6+
* Queues a microtask to be executed at a later time.
7+
* @param callback A function to be executed in the microtask.
8+
*/
9+
declare function queueMicrotask(callback: VoidFunction): void;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
interface CoreJSStructuredSerializeOptions {
2+
readonly __brand?: unique symbol;
3+
4+
transfer?: any[];
5+
}
6+
7+
/**
8+
* Creates a deep clone of a given value using the structured clone algorithm.
9+
* @param value The value to be cloned.
10+
* @param options An optional object that may contain a transfer property,
11+
* which is an array of transferable objects to be transferred rather than cloned.
12+
* @returns A deep clone of the provided value.
13+
*/
14+
declare function structuredClone<T = any>(value: T, options?: CoreJSStructuredSerializeOptions): T;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
interface URL {
2+
toJSON(): string;
3+
}

0 commit comments

Comments
 (0)