Skip to content

Commit e07c71e

Browse files
committed
Merge branch 'main' of https://github.com/microsoft/TypeScript into feat/51086
2 parents 62b9c22 + d6de73b commit e07c71e

File tree

93 files changed

+236304
-167318
lines changed

Some content is hidden

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

93 files changed

+236304
-167318
lines changed

Herebyfile.mjs

+12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { task } from "hereby";
66
import _glob from "glob";
77
import util from "util";
88
import chalk from "chalk";
9+
import fsExtra from "fs-extra";
910
import { Debouncer, Deferred, exec, getDiffTool, getDirSize, memoize, needsUpdate, readJson } from "./scripts/build/utils.mjs";
1011
import { localBaseline, localRwcBaseline, refBaseline, refRwcBaseline, runConsoleTests } from "./scripts/build/tests.mjs";
1112
import { buildProject, cleanProject, watchProject } from "./scripts/build/projects.mjs";
@@ -854,3 +855,14 @@ export const help = task({
854855
hiddenFromTaskList: true,
855856
run: () => exec("hereby", ["--tasks"], { hidePrompt: true }),
856857
});
858+
859+
export const bumpLkgToNightly = task({
860+
name: "bump-lkg-to-nightly",
861+
description: "Bumps typescript in package.json to the latest nightly and copies it to LKG.",
862+
run: async () => {
863+
await exec("npm", ["install", "--save-dev", "--save-exact", "typescript@next"]);
864+
await fs.promises.rm("lib", { recursive: true, force: true });
865+
await fsExtra.copy("node_modules/typescript/lib", "lib");
866+
await fs.promises.writeFile("lib/.gitattributes", "* text eol=lf");
867+
}
868+
});

lib/cancellationToken.js

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/lib.es2021.intl.d.ts

+15
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ declare namespace Intl {
8585
style?: ListFormatStyle | undefined;
8686
}
8787

88+
interface ResolvedListFormatOptions {
89+
locale: string;
90+
style: ListFormatStyle;
91+
type: ListFormatType;
92+
}
93+
8894
interface ListFormat {
8995
/**
9096
* Returns a string with a language-specific representation of the list.
@@ -111,6 +117,15 @@ declare namespace Intl {
111117
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/formatToParts).
112118
*/
113119
formatToParts(list: Iterable<string>): { type: "element" | "literal", value: string; }[];
120+
121+
/**
122+
* Returns a new object with properties reflecting the locale and style
123+
* formatting options computed during the construction of the current
124+
* `Intl.ListFormat` object.
125+
*
126+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/resolvedOptions).
127+
*/
128+
resolvedOptions(): ResolvedListFormatOptions;
114129
}
115130

116131
const ListFormat: {

lib/lib.es2022.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ and limitations under the License.
2525
/// <reference lib="es2022.object" />
2626
/// <reference lib="es2022.sharedmemory" />
2727
/// <reference lib="es2022.string" />
28+
/// <reference lib="es2022.regexp" />

lib/lib.es2022.regexp.d.ts

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*! *****************************************************************************
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4+
this file except in compliance with the License. You may obtain a copy of the
5+
License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10+
MERCHANTABLITY OR NON-INFRINGEMENT.
11+
12+
See the Apache Version 2.0 License for specific language governing permissions
13+
and limitations under the License.
14+
***************************************************************************** */
15+
16+
17+
18+
/// <reference no-default-lib="true"/>
19+
20+
21+
interface RegExpMatchArray {
22+
indices?: RegExpIndicesArray;
23+
}
24+
25+
interface RegExpExecArray {
26+
indices?: RegExpIndicesArray;
27+
}
28+
29+
interface RegExpIndicesArray extends Array<[number, number]> {
30+
groups?: {
31+
[key: string]: [number, number];
32+
};
33+
}
34+
35+
interface RegExp {
36+
/**
37+
* Returns a Boolean value indicating the state of the hasIndices flag (d) used with with a regular expression.
38+
* Default is false. Read-only.
39+
*/
40+
readonly hasIndices: boolean;
41+
}

lib/lib.es2022.sharedmemory.d.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ interface Atomics {
2222
/**
2323
* A non-blocking, asynchronous version of wait which is usable on the main thread.
2424
* Waits asynchronously on a shared memory location and returns a Promise
25+
* @param typedArray A shared Int32Array or BigInt64Array.
26+
* @param index The position in the typedArray to wait on.
27+
* @param value The expected value to test.
28+
* @param [timeout] The expected value to test.
2529
*/
26-
waitAsync(typedArray: BigInt64Array | Int32Array, index: number, value: bigint, timeout?: number): { async: false, value: "ok" | "not-equal" | "timed-out" } | { async: true, value: Promise<"ok" | "not-equal" | "timed-out"> };
30+
waitAsync(typedArray: Int32Array, index: number, value: number, timeout?: number): { async: false, value: "not-equal" | "timed-out" } | { async: true, value: Promise<"ok" | "timed-out"> };
31+
32+
/**
33+
* A non-blocking, asynchronous version of wait which is usable on the main thread.
34+
* Waits asynchronously on a shared memory location and returns a Promise
35+
* @param typedArray A shared Int32Array or BigInt64Array.
36+
* @param index The position in the typedArray to wait on.
37+
* @param value The expected value to test.
38+
* @param [timeout] The expected value to test.
39+
*/
40+
waitAsync(typedArray: BigInt64Array, index: number, value: bigint, timeout?: number): { async: false, value: "not-equal" | "timed-out" } | { async: true, value: Promise<"ok" | "timed-out"> };
2741
}

lib/lib.es5.d.ts

+7
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,13 @@ interface JSON {
11371137
* If a member contains nested objects, the nested objects are transformed before the parent object is.
11381138
*/
11391139
parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;
1140+
/**
1141+
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
1142+
* @param value A JavaScript value, usually an object or array, to be converted.
1143+
* @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
1144+
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
1145+
*/
1146+
stringify(value: Function | Symbol | undefined, replacer?: (number | string)[] | null, space?: string | number): undefined;
11401147
/**
11411148
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
11421149
* @param value A JavaScript value, usually an object or array, to be converted.

0 commit comments

Comments
 (0)