Skip to content

Commit 0cbbb34

Browse files
committed
feat(microsoft#48863): Split ES5 lib into individual parts
1 parent 1622247 commit 0cbbb34

File tree

3,205 files changed

+51526
-17117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,205 files changed

+51526
-17117
lines changed

Diff for: src/compiler/commandLineParser.ts

+53-10
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,59 @@ namespace ts {
4242
["webworker.importscripts", "lib.webworker.importscripts.d.ts"],
4343
["webworker.iterable", "lib.webworker.iterable.d.ts"],
4444
["scripthost", "lib.scripthost.d.ts"],
45-
// ES2015 Or ESNext By-feature options
46-
["es2015.core", "lib.es2015.core.d.ts"],
47-
["es2015.collection", "lib.es2015.collection.d.ts"],
48-
["es2015.generator", "lib.es2015.generator.d.ts"],
49-
["es2015.iterable", "lib.es2015.iterable.d.ts"],
50-
["es2015.promise", "lib.es2015.promise.d.ts"],
51-
["es2015.proxy", "lib.es2015.proxy.d.ts"],
52-
["es2015.reflect", "lib.es2015.reflect.d.ts"],
53-
["es2015.symbol", "lib.es2015.symbol.d.ts"],
54-
["es2015.symbol.wellknown", "lib.es2015.symbol.wellknown.d.ts"],
45+
// Utilities
46+
["utils.import", "lib.utils.import.d.ts"],
47+
["utils.modifiers", "lib.utils.modifiers.d.ts"],
48+
// ES20XX Or ESNext By-feature options
49+
["es2009.array", "lib.es2009.array.d.ts"],
50+
["es2009.arraybuffer", "lib.es2009.arraybuffer.d.ts"],
51+
["es2009.boolean", "lib.es2009.boolean.d.ts"],
52+
["es2009.core", "lib.es2009.core.d.ts"],
53+
["es2009.dataview", "lib.es2009.dataview.d.ts"],
54+
["es2009.date", "lib.es2009.date.d.ts"],
55+
["es2009.error", "lib.es2009.error.d.ts"],
56+
["es2009.evalerror", "lib.es2009.evalerror.d.ts"],
57+
["es2009.float32array", "lib.es2009.float32array.d.ts"],
58+
["es2009.float64array", "lib.es2009.float64array.d.ts"],
59+
["es2009.function", "lib.es2009.function.d.ts"],
60+
["es2009.int16array", "lib.es2009.int16array.d.ts"],
61+
["es2009.int32array", "lib.es2009.int32array.d.ts"],
62+
["es2009.int8array", "lib.es2009.int8array.d.ts"],
63+
["es2009.intl", "lib.es2009.intl.d.ts"],
64+
["es2009.json", "lib.es2009.json.d.ts"],
65+
["es2009.math", "lib.es2009.math.d.ts"],
66+
["es2009.number", "lib.es2009.number.d.ts"],
67+
["es2009.object", "lib.es2009.object.d.ts"],
68+
["es2009.promise", "lib.es2009.promise.d.ts"],
69+
["es2009.rangeerror", "lib.es2009.rangeerror.d.ts"],
70+
["es2009.referenceerror", "lib.es2009.referenceerror.d.ts"],
71+
["es2009.regexp", "lib.es2009.regexp.d.ts"],
72+
["es2009.string", "lib.es2009.string.d.ts"],
73+
["es2009.symbol", "lib.es2009.symbol.d.ts"],
74+
["es2009.syntaxerror", "lib.es2009.syntaxerror.d.ts"],
75+
["es2009.typeerror", "lib.es2009.typeerror.d.ts"],
76+
["es2009.uint16array", "lib.es2009.uint16array.d.ts"],
77+
["es2009.uint32array", "lib.es2009.uint32array.d.ts"],
78+
["es2009.uint8array", "lib.es2009.uint8array.d.ts"],
79+
["es2009.uint8clampedarray", "lib.es2009.uint8clampedarray.d.ts"],
80+
["es2009.urierror", "lib.es2009.urierror.d.ts"],
81+
["es2015.array", "lib.es2015.array.d.ts" ],
82+
["es2015.collection", "lib.es2015.collection.d.ts" ],
83+
["es2015.core", "lib.es2015.core.d.ts" ],
84+
["es2015.date", "lib.es2015.date.d.ts" ],
85+
["es2015.function", "lib.es2015.function.d.ts" ],
86+
["es2015.generator", "lib.es2015.generator.d.ts" ],
87+
["es2015.iterable", "lib.es2015.iterable.d.ts" ],
88+
["es2015.math", "lib.es2015.math.d.ts" ],
89+
["es2015.number", "lib.es2015.number.d.ts" ],
90+
["es2015.object", "lib.es2015.object.d.ts" ],
91+
["es2015.promise", "lib.es2015.promise.d.ts" ],
92+
["es2015.proxy", "lib.es2015.proxy.d.ts" ],
93+
["es2015.reflect", "lib.es2015.reflect.d.ts" ],
94+
["es2015.regexp", "lib.es2015.regexp.d.ts" ],
95+
["es2015.string", "lib.es2015.string.d.ts" ],
96+
["es2015.symbol", "lib.es2015.symbol.d.ts" ],
97+
["es2015.symbol.wellknown", "lib.es2015.symbol.wellknown.d.ts" ],
5598
["es2016.array.include", "lib.es2016.array.include.d.ts"],
5699
["es2017.object", "lib.es2017.object.d.ts"],
57100
["es2017.sharedmemory", "lib.es2017.sharedmemory.d.ts"],

Diff for: src/lib/es2009.array.d.ts

+261
Large diffs are not rendered by default.

Diff for: src/lib/es2009.arraybuffer.d.ts

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* Represents a raw buffer of binary data, which is used to store data for the
3+
* different typed arrays. ArrayBuffers cannot be read from or written to directly,
4+
* but can be passed to a typed array or DataView Object to interpret the raw
5+
* buffer as needed.
6+
*/
7+
interface ArrayBuffer {
8+
/**
9+
* Read-only. The length of the ArrayBuffer (in bytes).
10+
*/
11+
readonly byteLength: number;
12+
13+
/**
14+
* Returns a section of an ArrayBuffer.
15+
*/
16+
slice(begin: number, end?: number): ArrayBuffer;
17+
}
18+
19+
/**
20+
* Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays.
21+
*/
22+
interface ArrayBufferTypes {
23+
ArrayBuffer: ArrayBuffer;
24+
}
25+
type ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];
26+
27+
interface ArrayBufferConstructor {
28+
readonly prototype: ArrayBuffer;
29+
new(byteLength: number): ArrayBuffer;
30+
isView(arg: any): arg is ArrayBufferView;
31+
}
32+
declare var ArrayBuffer: ArrayBufferConstructor;
33+
34+
interface ArrayBufferView {
35+
/**
36+
* The ArrayBuffer instance referenced by the array.
37+
*/
38+
buffer: ArrayBufferLike;
39+
40+
/**
41+
* The length in bytes of the array.
42+
*/
43+
byteLength: number;
44+
45+
/**
46+
* The offset in bytes of the array.
47+
*/
48+
byteOffset: number;
49+
}

Diff for: src/lib/es2009.boolean.d.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
interface Boolean {
2+
/** Returns the primitive value of the specified object. */
3+
valueOf(): boolean;
4+
}
5+
6+
interface BooleanConstructor {
7+
new(value?: any): Boolean;
8+
<T>(value?: T): boolean;
9+
readonly prototype: Boolean;
10+
}
11+
12+
declare var Boolean: BooleanConstructor;

Diff for: src/lib/es2009.core.d.ts

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
declare var NaN: number;
2+
declare var Infinity: number;
3+
4+
/**
5+
* Evaluates JavaScript code and executes it.
6+
* @param x A String value that contains valid JavaScript code.
7+
*/
8+
declare function eval(x: string): any;
9+
10+
/**
11+
* Converts a string to an integer.
12+
* @param string A string to convert into a number.
13+
* @param radix A value between 2 and 36 that specifies the base of the number in `string`.
14+
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
15+
* All other strings are considered decimal.
16+
*/
17+
declare function parseInt(string: string, radix?: number): number;
18+
19+
/**
20+
* Converts a string to a floating-point number.
21+
* @param string A string that contains a floating-point number.
22+
*/
23+
declare function parseFloat(string: string): number;
24+
25+
/**
26+
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).
27+
* @param number A numeric value.
28+
*/
29+
declare function isNaN(number: number): boolean;
30+
31+
/**
32+
* Determines whether a supplied number is finite.
33+
* @param number Any numeric value.
34+
*/
35+
declare function isFinite(number: number): boolean;
36+
37+
/**
38+
* Gets the unencoded version of an encoded Uniform Resource Identifier (URI).
39+
* @param encodedURI A value representing an encoded URI.
40+
*/
41+
declare function decodeURI(encodedURI: string): string;
42+
43+
/**
44+
* Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).
45+
* @param encodedURIComponent A value representing an encoded URI component.
46+
*/
47+
declare function decodeURIComponent(encodedURIComponent: string): string;
48+
49+
/**
50+
* Encodes a text string as a valid Uniform Resource Identifier (URI)
51+
* @param uri A value representing an unencoded URI.
52+
*/
53+
declare function encodeURI(uri: string): string;
54+
55+
/**
56+
* Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
57+
* @param uriComponent A value representing an unencoded URI component.
58+
*/
59+
declare function encodeURIComponent(uriComponent: string | number | boolean): string;
60+
61+
/**
62+
* Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.
63+
* @deprecated A legacy feature for browser compatibility
64+
* @param string A string value
65+
*/
66+
declare function escape(string: string): string;
67+
68+
/**
69+
* Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.
70+
* @deprecated A legacy feature for browser compatibility
71+
* @param string A string value
72+
*/
73+
declare function unescape(string: string): string;

Diff for: src/lib/es2009.dataview.d.ts

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
/// <reference lib="es2009.arraybuffer" />
2+
3+
interface DataView {
4+
readonly buffer: ArrayBuffer;
5+
readonly byteLength: number;
6+
readonly byteOffset: number;
7+
/**
8+
* Gets the Float32 value at the specified byte offset from the start of the view. There is
9+
* no alignment constraint; multi-byte values may be fetched from any offset.
10+
* @param byteOffset The place in the buffer at which the value should be retrieved.
11+
* @param littleEndian If false or undefined, a big-endian value should be read.
12+
*/
13+
getFloat32(byteOffset: number, littleEndian?: boolean): number;
14+
15+
/**
16+
* Gets the Float64 value at the specified byte offset from the start of the view. There is
17+
* no alignment constraint; multi-byte values may be fetched from any offset.
18+
* @param byteOffset The place in the buffer at which the value should be retrieved.
19+
* @param littleEndian If false or undefined, a big-endian value should be read.
20+
*/
21+
getFloat64(byteOffset: number, littleEndian?: boolean): number;
22+
23+
/**
24+
* Gets the Int8 value at the specified byte offset from the start of the view. There is
25+
* no alignment constraint; multi-byte values may be fetched from any offset.
26+
* @param byteOffset The place in the buffer at which the value should be retrieved.
27+
*/
28+
getInt8(byteOffset: number): number;
29+
30+
/**
31+
* Gets the Int16 value at the specified byte offset from the start of the view. There is
32+
* no alignment constraint; multi-byte values may be fetched from any offset.
33+
* @param byteOffset The place in the buffer at which the value should be retrieved.
34+
* @param littleEndian If false or undefined, a big-endian value should be read.
35+
*/
36+
getInt16(byteOffset: number, littleEndian?: boolean): number;
37+
/**
38+
* Gets the Int32 value at the specified byte offset from the start of the view. There is
39+
* no alignment constraint; multi-byte values may be fetched from any offset.
40+
* @param byteOffset The place in the buffer at which the value should be retrieved.
41+
* @param littleEndian If false or undefined, a big-endian value should be read.
42+
*/
43+
getInt32(byteOffset: number, littleEndian?: boolean): number;
44+
45+
/**
46+
* Gets the Uint8 value at the specified byte offset from the start of the view. There is
47+
* no alignment constraint; multi-byte values may be fetched from any offset.
48+
* @param byteOffset The place in the buffer at which the value should be retrieved.
49+
*/
50+
getUint8(byteOffset: number): number;
51+
52+
/**
53+
* Gets the Uint16 value at the specified byte offset from the start of the view. There is
54+
* no alignment constraint; multi-byte values may be fetched from any offset.
55+
* @param byteOffset The place in the buffer at which the value should be retrieved.
56+
* @param littleEndian If false or undefined, a big-endian value should be read.
57+
*/
58+
getUint16(byteOffset: number, littleEndian?: boolean): number;
59+
60+
/**
61+
* Gets the Uint32 value at the specified byte offset from the start of the view. There is
62+
* no alignment constraint; multi-byte values may be fetched from any offset.
63+
* @param byteOffset The place in the buffer at which the value should be retrieved.
64+
* @param littleEndian If false or undefined, a big-endian value should be read.
65+
*/
66+
getUint32(byteOffset: number, littleEndian?: boolean): number;
67+
68+
/**
69+
* Stores an Float32 value at the specified byte offset from the start of the view.
70+
* @param byteOffset The place in the buffer at which the value should be set.
71+
* @param value The value to set.
72+
* @param littleEndian If false or undefined, a big-endian value should be written.
73+
*/
74+
setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
75+
76+
/**
77+
* Stores an Float64 value at the specified byte offset from the start of the view.
78+
* @param byteOffset The place in the buffer at which the value should be set.
79+
* @param value The value to set.
80+
* @param littleEndian If false or undefined, a big-endian value should be written.
81+
*/
82+
setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
83+
84+
/**
85+
* Stores an Int8 value at the specified byte offset from the start of the view.
86+
* @param byteOffset The place in the buffer at which the value should be set.
87+
* @param value The value to set.
88+
*/
89+
setInt8(byteOffset: number, value: number): void;
90+
91+
/**
92+
* Stores an Int16 value at the specified byte offset from the start of the view.
93+
* @param byteOffset The place in the buffer at which the value should be set.
94+
* @param value The value to set.
95+
* @param littleEndian If false or undefined, a big-endian value should be written.
96+
*/
97+
setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
98+
99+
/**
100+
* Stores an Int32 value at the specified byte offset from the start of the view.
101+
* @param byteOffset The place in the buffer at which the value should be set.
102+
* @param value The value to set.
103+
* @param littleEndian If false or undefined, a big-endian value should be written.
104+
*/
105+
setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
106+
107+
/**
108+
* Stores an Uint8 value at the specified byte offset from the start of the view.
109+
* @param byteOffset The place in the buffer at which the value should be set.
110+
* @param value The value to set.
111+
*/
112+
setUint8(byteOffset: number, value: number): void;
113+
114+
/**
115+
* Stores an Uint16 value at the specified byte offset from the start of the view.
116+
* @param byteOffset The place in the buffer at which the value should be set.
117+
* @param value The value to set.
118+
* @param littleEndian If false or undefined, a big-endian value should be written.
119+
*/
120+
setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
121+
122+
/**
123+
* Stores an Uint32 value at the specified byte offset from the start of the view.
124+
* @param byteOffset The place in the buffer at which the value should be set.
125+
* @param value The value to set.
126+
* @param littleEndian If false or undefined, a big-endian value should be written.
127+
*/
128+
setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
129+
}
130+
131+
interface DataViewConstructor {
132+
readonly prototype: DataView;
133+
new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;
134+
}
135+
declare var DataView: DataViewConstructor;

0 commit comments

Comments
 (0)