Skip to content

Commit 53a4c6e

Browse files
committed
Merge branch 'main' into rootDir
2 parents 8636f8c + 3a68348 commit 53a4c6e

File tree

81 files changed

+877
-763
lines changed

Some content is hidden

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

81 files changed

+877
-763
lines changed

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ const libEntries: [string, string][] = [
248248
["esnext.iterator", "lib.esnext.iterator.d.ts"],
249249
["esnext.promise", "lib.esnext.promise.d.ts"],
250250
["esnext.float16", "lib.esnext.float16.d.ts"],
251+
["esnext.typedarrays", "lib.esnext.typedarrays.d.ts"],
251252
["esnext.error", "lib.esnext.error.d.ts"],
252253
["esnext.sharedmemory", "lib.esnext.sharedmemory.d.ts"],
253254
["decorators", "lib.decorators.d.ts"],

src/compiler/utilities.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,6 +1783,12 @@ export const getScriptTargetFeatures: () => ScriptTargetFeatures = /* @__PURE__
17831783
"toSpliced",
17841784
"with",
17851785
],
1786+
esnext: [
1787+
"toBase64",
1788+
"setFromBase64",
1789+
"toHex",
1790+
"setFromHex",
1791+
],
17861792
})),
17871793
Uint8ClampedArray: new Map(Object.entries({
17881794
es2022: [
@@ -1911,6 +1917,12 @@ export const getScriptTargetFeatures: () => ScriptTargetFeatures = /* @__PURE__
19111917
"cause",
19121918
],
19131919
})),
1920+
Uint8ArrayConstructor: new Map(Object.entries({
1921+
esnext: [
1922+
"fromBase64",
1923+
"fromHex",
1924+
],
1925+
})),
19141926
}))
19151927
);
19161928

src/lib/esnext.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
/// <reference lib="esnext.float16" />
1010
/// <reference lib="esnext.error" />
1111
/// <reference lib="esnext.sharedmemory" />
12+
/// <reference lib="esnext.typedarrays" />

src/lib/esnext.typedarrays.d.ts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
interface Uint8Array<TArrayBuffer extends ArrayBufferLike> {
2+
/**
3+
* Converts the `Uint8Array` to a base64-encoded string.
4+
* @param options If provided, sets the alphabet and padding behavior used.
5+
* @returns A base64-encoded string.
6+
*/
7+
toBase64(
8+
options?: {
9+
alphabet?: "base64" | "base64url" | undefined;
10+
omitPadding?: boolean | undefined;
11+
},
12+
): string;
13+
14+
/**
15+
* Sets the `Uint8Array` from a base64-encoded string.
16+
* @param string The base64-encoded string.
17+
* @param options If provided, specifies the alphabet and handling of the last chunk.
18+
* @returns An object containing the number of bytes read and written.
19+
* @throws {SyntaxError} If the input string contains characters outside the specified alphabet, or if the last
20+
* chunk is inconsistent with the `lastChunkHandling` option.
21+
*/
22+
setFromBase64(
23+
string: string,
24+
options?: {
25+
alphabet?: "base64" | "base64url" | undefined;
26+
lastChunkHandling?: "loose" | "strict" | "stop-before-partial" | undefined;
27+
},
28+
): {
29+
read: number;
30+
written: number;
31+
};
32+
33+
/**
34+
* Converts the `Uint8Array` to a base16-encoded string.
35+
* @returns A base16-encoded string.
36+
*/
37+
toHex(): string;
38+
39+
/**
40+
* Sets the `Uint8Array` from a base16-encoded string.
41+
* @param string The base16-encoded string.
42+
* @returns An object containing the number of bytes read and written.
43+
*/
44+
setFromHex(string: string): {
45+
read: number;
46+
written: number;
47+
};
48+
}
49+
50+
interface Uint8ArrayConstructor {
51+
/**
52+
* Creates a new `Uint8Array` from a base64-encoded string.
53+
* @param string The base64-encoded string.
54+
* @param options If provided, specifies the alphabet and handling of the last chunk.
55+
* @returns A new `Uint8Array` instance.
56+
* @throws {SyntaxError} If the input string contains characters outside the specified alphabet, or if the last
57+
* chunk is inconsistent with the `lastChunkHandling` option.
58+
*/
59+
fromBase64(
60+
string: string,
61+
options?: {
62+
alphabet?: "base64" | "base64url" | undefined;
63+
lastChunkHandling?: "loose" | "strict" | "stop-before-partial" | undefined;
64+
},
65+
): Uint8Array<ArrayBuffer>;
66+
67+
/**
68+
* Creates a new `Uint8Array` from a base16-encoded string.
69+
* @returns A new `Uint8Array` instance.
70+
*/
71+
fromHex(
72+
string: string,
73+
): Uint8Array<ArrayBuffer>;
74+
}

src/lib/libs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"esnext.iterator",
8888
"esnext.promise",
8989
"esnext.float16",
90+
"esnext.typedarrays",
9091
"esnext.error",
9192
"esnext.sharedmemory",
9293
"decorators",

tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,7 @@
193193
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
194194
"File '/package.json' does not exist according to earlier cached lookups.",
195195
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
196+
"File '/package.json' does not exist according to earlier cached lookups.",
197+
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
196198
"File '/package.json' does not exist according to earlier cached lookups."
197199
]

tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ CompilerOptions::
3030
"configFilePath": "/apath/tsconfig.json"
3131
}
3232
Errors::
33-
error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'.
33+
error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'esnext.object', 'esnext.regexp', 'esnext.iterator', 'esnext.float16', 'esnext.typedarrays', 'esnext.error', 'esnext.sharedmemory', 'decorators', 'decorators.legacy'.
3434

0 commit comments

Comments
 (0)