1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

feat: TypeScript 5.3 (#21480)

https://github.com/denoland/TypeScript/pull/9
This commit is contained in:
David Sherret 2023-12-06 18:49:34 -05:00 committed by GitHub
parent a931a47511
commit 68d356eed9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 24822 additions and 6431 deletions

View file

@ -428,7 +428,7 @@ fn main() {
); );
let ts_version = ts::version(); let ts_version = ts::version();
debug_assert_eq!(ts_version, "5.2.2"); // bump this assertion when it changes debug_assert_eq!(ts_version, "5.3.3"); // bump this assertion when it changes
println!("cargo:rustc-env=TS_VERSION={}", ts_version); println!("cargo:rustc-env=TS_VERSION={}", ts_version);
println!("cargo:rerun-if-env-changed=TS_VERSION"); println!("cargo:rerun-if-env-changed=TS_VERSION");

View file

@ -9109,11 +9109,11 @@ fn lsp_workspace_symbol() {
"uri": "deno:/asset/lib.decorators.d.ts", "uri": "deno:/asset/lib.decorators.d.ts",
"range": { "range": {
"start": { "start": {
"line": 346, "line": 343,
"character": 0, "character": 0,
}, },
"end": { "end": {
"line": 388, "line": 385,
"character": 1, "character": 1,
}, },
}, },

View file

@ -6,5 +6,5 @@ Deno.test(function version() {
const pattern = /^\d+\.\d+\.\d+/; const pattern = /^\d+\.\d+\.\d+/;
assert(pattern.test(Deno.version.deno)); assert(pattern.test(Deno.version.deno));
assert(pattern.test(Deno.version.v8)); assert(pattern.test(Deno.version.v8));
assertEquals(Deno.version.typescript, "5.2.2"); assertEquals(Deno.version.typescript, "5.3.3");
}); });

25552
cli/tsc/00_typescript.js vendored

File diff suppressed because one or more lines are too long

View file

@ -226,6 +226,8 @@ delete Object.prototype.__proto__;
impliedNodeFormat: isCjsCache.has(fileName) impliedNodeFormat: isCjsCache.has(fileName)
? ts.ModuleKind.CommonJS ? ts.ModuleKind.CommonJS
: ts.ModuleKind.ESNext, : ts.ModuleKind.ESNext,
// in the lsp we want to be able to show documentation
jsDocParsingMode: ts.JSDocParsingMode.ParseAll,
}, },
version, version,
true, true,
@ -537,11 +539,12 @@ delete Object.prototype.__proto__;
_onError, _onError,
_shouldCreateNewSourceFile, _shouldCreateNewSourceFile,
) { ) {
const createOptions = getCreateSourceFileOptions(languageVersion);
if (logDebug) { if (logDebug) {
debug( debug(
`host.getSourceFile("${specifier}", ${ `host.getSourceFile("${specifier}", ${
ts.ScriptTarget[createOptions.languageVersion] ts.ScriptTarget[
getCreateSourceFileOptions(languageVersion).languageVersion
]
})`, })`,
); );
} }
@ -568,10 +571,12 @@ delete Object.prototype.__proto__;
specifier, specifier,
data, data,
{ {
...createOptions, ...getCreateSourceFileOptions(languageVersion),
impliedNodeFormat: isCjsCache.has(specifier) impliedNodeFormat: isCjsCache.has(specifier)
? ts.ModuleKind.CommonJS ? ts.ModuleKind.CommonJS
: ts.ModuleKind.ESNext, : ts.ModuleKind.ESNext,
// no need to parse docs for `deno check`
jsDocParsingMode: ts.JSDocParsingMode.ParseForTypeErrors,
}, },
false, false,
scriptKind, scriptKind,

View file

@ -24,21 +24,18 @@ type ClassMemberDecoratorContext =
| ClassGetterDecoratorContext | ClassGetterDecoratorContext
| ClassSetterDecoratorContext | ClassSetterDecoratorContext
| ClassFieldDecoratorContext | ClassFieldDecoratorContext
| ClassAccessorDecoratorContext | ClassAccessorDecoratorContext;
;
/** /**
* The decorator context types provided to any decorator. * The decorator context types provided to any decorator.
*/ */
type DecoratorContext = type DecoratorContext =
| ClassDecoratorContext | ClassDecoratorContext
| ClassMemberDecoratorContext | ClassMemberDecoratorContext;
;
type DecoratorMetadataObject = Record<PropertyKey, unknown> & object; type DecoratorMetadataObject = Record<PropertyKey, unknown> & object;
type DecoratorMetadata = type DecoratorMetadata = typeof globalThis extends { Symbol: { readonly metadata: symbol; }; } ? DecoratorMetadataObject : DecoratorMetadataObject | undefined;
typeof globalThis extends { Symbol: { readonly metadata: symbol } } ? DecoratorMetadataObject : DecoratorMetadataObject | undefined;
/** /**
* Context provided to a class decorator. * Context provided to a class decorator.

View file

@ -1436,6 +1436,7 @@ interface RTCInboundRtpStreamStats extends RTCReceivedRtpStreamStats {
keyFramesDecoded?: number; keyFramesDecoded?: number;
kind: string; kind: string;
lastPacketReceivedTimestamp?: DOMHighResTimeStamp; lastPacketReceivedTimestamp?: DOMHighResTimeStamp;
mid?: string;
nackCount?: number; nackCount?: number;
packetsDiscarded?: number; packetsDiscarded?: number;
pliCount?: number; pliCount?: number;
@ -1450,6 +1451,7 @@ interface RTCInboundRtpStreamStats extends RTCReceivedRtpStreamStats {
totalSamplesDuration?: number; totalSamplesDuration?: number;
totalSamplesReceived?: number; totalSamplesReceived?: number;
totalSquaredInterFrameDelay?: number; totalSquaredInterFrameDelay?: number;
trackIdentifier: string;
} }
interface RTCLocalSessionDescriptionInit { interface RTCLocalSessionDescriptionInit {
@ -8209,7 +8211,7 @@ interface EventTarget {
*/ */
addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void; addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void;
/** /**
* Dispatches a synthetic event to event target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
* *
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
*/ */
@ -21844,7 +21846,9 @@ interface SubtleCrypto {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>; exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>; exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
exportKey(format: KeyFormat, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
generateKey(algorithm: "Ed25519", extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>; generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>; generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
@ -27428,7 +27432,7 @@ declare function scrollTo(x: number, y: number): void;
declare function stop(): void; declare function stop(): void;
declare function toString(): string; declare function toString(): string;
/** /**
* Dispatches a synthetic event to event target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
* *
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
*/ */

View file

@ -17,7 +17,6 @@ and limitations under the License.
/// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
interface Map<K, V> { interface Map<K, V> {
clear(): void; clear(): void;
/** /**
* @returns true if an element in the Map existed and has been removed, or false if the element does not exist. * @returns true if an element in the Map existed and has been removed, or false if the element does not exist.
@ -47,7 +46,7 @@ interface Map<K, V> {
} }
interface MapConstructor { interface MapConstructor {
new(): Map<any, any>; new (): Map<any, any>;
new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>; new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
readonly prototype: Map<any, any>; readonly prototype: Map<any, any>;
} }

View file

@ -553,5 +553,5 @@ interface StringConstructor {
* @param template A well-formed template string call site representation. * @param template A well-formed template string call site representation.
* @param substitutions A set of substitution values. * @param substitutions A set of substitution values.
*/ */
raw(template: { raw: readonly string[] | ArrayLike<string>}, ...substitutions: any[]): string; raw(template: { raw: readonly string[] | ArrayLike<string>; }, ...substitutions: any[]): string;
} }

View file

@ -155,11 +155,11 @@ interface ReadonlyMap<K, V> {
} }
interface MapConstructor { interface MapConstructor {
new(): Map<any, any>; new (): Map<any, any>;
new <K, V>(iterable?: Iterable<readonly [K, V]> | null): Map<K, V>; new <K, V>(iterable?: Iterable<readonly [K, V]> | null): Map<K, V>;
} }
interface WeakMap<K extends WeakKey, V> { } interface WeakMap<K extends WeakKey, V> {}
interface WeakMapConstructor { interface WeakMapConstructor {
new <K extends WeakKey, V>(iterable: Iterable<readonly [K, V]>): WeakMap<K, V>; new <K extends WeakKey, V>(iterable: Iterable<readonly [K, V]>): WeakMap<K, V>;
@ -207,13 +207,13 @@ interface SetConstructor {
new <T>(iterable?: Iterable<T> | null): Set<T>; new <T>(iterable?: Iterable<T> | null): Set<T>;
} }
interface WeakSet<T extends WeakKey> { } interface WeakSet<T extends WeakKey> {}
interface WeakSetConstructor { interface WeakSetConstructor {
new <T extends WeakKey = WeakKey>(iterable: Iterable<T>): WeakSet<T>; new <T extends WeakKey = WeakKey>(iterable: Iterable<T>): WeakSet<T>;
} }
interface Promise<T> { } interface Promise<T> {}
interface PromiseConstructor { interface PromiseConstructor {
/** /**
@ -315,7 +315,6 @@ interface Uint8ClampedArray {
interface Uint8ClampedArrayConstructor { interface Uint8ClampedArrayConstructor {
new (elements: Iterable<number>): Uint8ClampedArray; new (elements: Iterable<number>): Uint8ClampedArray;
/** /**
* Creates an array from an array-like or iterable object. * Creates an array from an array-like or iterable object.
* @param arrayLike An array-like or iterable object to convert to an array. * @param arrayLike An array-like or iterable object to convert to an array.

View file

@ -36,7 +36,7 @@ interface PromiseConstructor {
* @param values An array of Promises. * @param values An array of Promises.
* @returns A new Promise. * @returns A new Promise.
*/ */
all<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]> }>; all<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]>; }>;
// see: lib.es2015.iterable.d.ts // see: lib.es2015.iterable.d.ts
// all<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>; // all<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>;

View file

@ -43,4 +43,4 @@ interface SymbolConstructor {
keyFor(sym: symbol): string | undefined; keyFor(sym: symbol): string | undefined;
} }
declare var Symbol: SymbolConstructor; declare var Symbol: SymbolConstructor;

View file

@ -113,4 +113,4 @@ interface Float64Array {
* @param fromIndex The position in this array at which to begin searching for searchElement. * @param fromIndex The position in this array at which to begin searching for searchElement.
*/ */
includes(searchElement: number, fromIndex?: number): boolean; includes(searchElement: number, fromIndex?: number): boolean;
} }

View file

@ -17,4 +17,4 @@ and limitations under the License.
/// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
/// <reference lib="es2015" /> /// <reference lib="es2015" />
/// <reference lib="es2016.array.include" /> /// <reference lib="es2016.array.include" />

View file

@ -20,4 +20,4 @@ and limitations under the License.
/// <reference lib="dom" /> /// <reference lib="dom" />
/// <reference lib="webworker.importscripts" /> /// <reference lib="webworker.importscripts" />
/// <reference lib="scripthost" /> /// <reference lib="scripthost" />
/// <reference lib="dom.iterable" /> /// <reference lib="dom.iterable" />

View file

@ -20,4 +20,4 @@ and limitations under the License.
/// <reference lib="dom" /> /// <reference lib="dom" />
/// <reference lib="webworker.importscripts" /> /// <reference lib="webworker.importscripts" />
/// <reference lib="scripthost" /> /// <reference lib="scripthost" />
/// <reference lib="dom.iterable" /> /// <reference lib="dom.iterable" />

View file

@ -17,19 +17,18 @@ and limitations under the License.
/// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
declare namespace Intl { declare namespace Intl {
interface DateTimeFormatPartTypesRegistry { interface DateTimeFormatPartTypesRegistry {
day: any day: any;
dayPeriod: any dayPeriod: any;
era: any era: any;
hour: any hour: any;
literal: any literal: any;
minute: any minute: any;
month: any month: any;
second: any second: any;
timeZoneName: any timeZoneName: any;
weekday: any weekday: any;
year: any year: any;
} }
type DateTimeFormatPartTypes = keyof DateTimeFormatPartTypesRegistry; type DateTimeFormatPartTypes = keyof DateTimeFormatPartTypesRegistry;

View file

@ -21,7 +21,7 @@ interface ObjectConstructor {
* Returns an array of values of the enumerable properties of an object * Returns an array of values of the enumerable properties of an object
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/ */
values<T>(o: { [s: string]: T } | ArrayLike<T>): T[]; values<T>(o: { [s: string]: T; } | ArrayLike<T>): T[];
/** /**
* Returns an array of values of the enumerable properties of an object * Returns an array of values of the enumerable properties of an object
@ -33,7 +33,7 @@ interface ObjectConstructor {
* Returns an array of key/values of the enumerable properties of an object * Returns an array of key/values of the enumerable properties of an object
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/ */
entries<T>(o: { [s: string]: T } | ArrayLike<T>): [string, T][]; entries<T>(o: { [s: string]: T; } | ArrayLike<T>): [string, T][];
/** /**
* Returns an array of key/values of the enumerable properties of an object * Returns an array of key/values of the enumerable properties of an object
@ -45,5 +45,5 @@ interface ObjectConstructor {
* Returns an object containing all own property descriptors of an object * Returns an object containing all own property descriptors of an object
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/ */
getOwnPropertyDescriptors<T>(o: T): {[P in keyof T]: TypedPropertyDescriptor<T[P]>} & { [x: string]: PropertyDescriptor }; getOwnPropertyDescriptors<T>(o: T): { [P in keyof T]: TypedPropertyDescriptor<T[P]>; } & { [x: string]: PropertyDescriptor; };
} }

View file

@ -40,4 +40,4 @@ interface AsyncIterable<T> {
interface AsyncIterableIterator<T> extends AsyncIterator<T> { interface AsyncIterableIterator<T> extends AsyncIterator<T> {
[Symbol.asyncIterator](): AsyncIterableIterator<T>; [Symbol.asyncIterator](): AsyncIterableIterator<T>;
} }

View file

@ -20,4 +20,4 @@ and limitations under the License.
/// <reference lib="dom" /> /// <reference lib="dom" />
/// <reference lib="webworker.importscripts" /> /// <reference lib="webworker.importscripts" />
/// <reference lib="scripthost" /> /// <reference lib="scripthost" />
/// <reference lib="dom.iterable" /> /// <reference lib="dom.iterable" />

View file

@ -17,7 +17,6 @@ and limitations under the License.
/// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
declare namespace Intl { declare namespace Intl {
// http://cldr.unicode.org/index/cldr-spec/plural-rules#TOC-Determining-Plural-Categories // http://cldr.unicode.org/index/cldr-spec/plural-rules#TOC-Determining-Plural-Categories
type LDMLPluralRule = "zero" | "one" | "two" | "few" | "many" | "other"; type LDMLPluralRule = "zero" | "one" | "two" | "few" | "many" | "other";
type PluralRuleType = "cardinal" | "ordinal"; type PluralRuleType = "cardinal" | "ordinal";
@ -52,7 +51,7 @@ declare namespace Intl {
new (locales?: string | string[], options?: PluralRulesOptions): PluralRules; new (locales?: string | string[], options?: PluralRulesOptions): PluralRules;
(locales?: string | string[], options?: PluralRulesOptions): PluralRules; (locales?: string | string[], options?: PluralRulesOptions): PluralRules;
supportedLocalesOf(locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit" }): string[]; supportedLocalesOf(locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[];
}; };
// We can only have one definition for 'type' in TypeScript, and so you can learn where the keys come from here: // We can only have one definition for 'type' in TypeScript, and so you can learn where the keys come from here:

View file

@ -26,5 +26,5 @@ interface Promise<T> {
* @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
* @returns A Promise for the completion of the callback. * @returns A Promise for the completion of the callback.
*/ */
finally(onfinally?: (() => void) | undefined | null): Promise<T> finally(onfinally?: (() => void) | undefined | null): Promise<T>;
} }

View file

@ -18,14 +18,14 @@ and limitations under the License.
interface RegExpMatchArray { interface RegExpMatchArray {
groups?: { groups?: {
[key: string]: string [key: string]: string;
} };
} }
interface RegExpExecArray { interface RegExpExecArray {
groups?: { groups?: {
[key: string]: string [key: string]: string;
} };
} }
interface RegExp { interface RegExp {
@ -34,4 +34,4 @@ interface RegExp {
* Default is false. Read-only. * Default is false. Read-only.
*/ */
readonly dotAll: boolean; readonly dotAll: boolean;
} }

View file

@ -17,14 +17,12 @@ and limitations under the License.
/// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
type FlatArray<Arr, Depth extends number> = { type FlatArray<Arr, Depth extends number> = {
"done": Arr, done: Arr;
"recur": Arr extends ReadonlyArray<infer InnerArr> recur: Arr extends ReadonlyArray<infer InnerArr> ? FlatArray<InnerArr, [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]>
? FlatArray<InnerArr, [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]> : Arr;
: Arr
}[Depth extends -1 ? "done" : "recur"]; }[Depth extends -1 ? "done" : "recur"];
interface ReadonlyArray<T> { interface ReadonlyArray<T> {
/** /**
* Calls a defined callback function on each element of an array. Then, flattens the result into * Calls a defined callback function on each element of an array. Then, flattens the result into
* a new array. * a new array.
@ -35,11 +33,10 @@ interface ReadonlyArray<T> {
* @param thisArg An object to which the this keyword can refer in the callback function. If * @param thisArg An object to which the this keyword can refer in the callback function. If
* thisArg is omitted, undefined is used as the this value. * thisArg is omitted, undefined is used as the this value.
*/ */
flatMap<U, This = undefined> ( flatMap<U, This = undefined>(
callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray<U>, callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray<U>,
thisArg?: This thisArg?: This,
): U[] ): U[];
/** /**
* Returns a new array with all sub-array elements concatenated into it recursively up to the * Returns a new array with all sub-array elements concatenated into it recursively up to the
@ -49,12 +46,11 @@ interface ReadonlyArray<T> {
*/ */
flat<A, D extends number = 1>( flat<A, D extends number = 1>(
this: A, this: A,
depth?: D depth?: D,
): FlatArray<A, D>[] ): FlatArray<A, D>[];
} }
interface Array<T> { interface Array<T> {
/** /**
* Calls a defined callback function on each element of an array. Then, flattens the result into * Calls a defined callback function on each element of an array. Then, flattens the result into
* a new array. * a new array.
@ -65,10 +61,10 @@ interface Array<T> {
* @param thisArg An object to which the this keyword can refer in the callback function. If * @param thisArg An object to which the this keyword can refer in the callback function. If
* thisArg is omitted, undefined is used as the this value. * thisArg is omitted, undefined is used as the this value.
*/ */
flatMap<U, This = undefined> ( flatMap<U, This = undefined>(
callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray<U>, callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray<U>,
thisArg?: This thisArg?: This,
): U[] ): U[];
/** /**
* Returns a new array with all sub-array elements concatenated into it recursively up to the * Returns a new array with all sub-array elements concatenated into it recursively up to the
@ -78,6 +74,6 @@ interface Array<T> {
*/ */
flat<A, D extends number = 1>( flat<A, D extends number = 1>(
this: A, this: A,
depth?: D depth?: D,
): FlatArray<A, D>[] ): FlatArray<A, D>[];
} }

View file

@ -18,6 +18,6 @@ and limitations under the License.
declare namespace Intl { declare namespace Intl {
interface DateTimeFormatPartTypesRegistry { interface DateTimeFormatPartTypesRegistry {
unknown: any unknown: any;
} }
} }

View file

@ -23,7 +23,7 @@ interface ObjectConstructor {
* Returns an object created by key-value entries for properties and methods * Returns an object created by key-value entries for properties and methods
* @param entries An iterable object that contains key-value entries for properties and methods. * @param entries An iterable object that contains key-value entries for properties and methods.
*/ */
fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): { [k: string]: T }; fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): { [k: string]: T; };
/** /**
* Returns an object created by key-value entries for properties and methods * Returns an object created by key-value entries for properties and methods

View file

@ -389,9 +389,9 @@ interface BigInt64Array {
interface BigInt64ArrayConstructor { interface BigInt64ArrayConstructor {
readonly prototype: BigInt64Array; readonly prototype: BigInt64Array;
new(length?: number): BigInt64Array; new (length?: number): BigInt64Array;
new(array: Iterable<bigint>): BigInt64Array; new (array: Iterable<bigint>): BigInt64Array;
new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigInt64Array; new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigInt64Array;
/** The size in bytes of each element in the array. */ /** The size in bytes of each element in the array. */
readonly BYTES_PER_ELEMENT: number; readonly BYTES_PER_ELEMENT: number;
@ -661,9 +661,9 @@ interface BigUint64Array {
interface BigUint64ArrayConstructor { interface BigUint64ArrayConstructor {
readonly prototype: BigUint64Array; readonly prototype: BigUint64Array;
new(length?: number): BigUint64Array; new (length?: number): BigUint64Array;
new(array: Iterable<bigint>): BigUint64Array; new (array: Iterable<bigint>): BigUint64Array;
new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array; new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array;
/** The size in bytes of each element in the array. */ /** The size in bytes of each element in the array. */
readonly BYTES_PER_ELEMENT: number; readonly BYTES_PER_ELEMENT: number;
@ -720,7 +720,7 @@ interface DataView {
setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void; setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
} }
declare namespace Intl{ declare namespace Intl {
interface NumberFormat { interface NumberFormat {
format(value: number | bigint): string; format(value: number | bigint): string;
resolvedOptions(): ResolvedNumberFormatOptions; resolvedOptions(): ResolvedNumberFormatOptions;

View file

@ -39,4 +39,4 @@ interface Date {
* @param options An object that contains one or more properties that specify comparison options. * @param options An object that contains one or more properties that specify comparison options.
*/ */
toLocaleTimeString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; toLocaleTimeString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
} }

View file

@ -18,7 +18,6 @@ and limitations under the License.
/// <reference lib="es2018.intl" /> /// <reference lib="es2018.intl" />
declare namespace Intl { declare namespace Intl {
/** /**
* [Unicode BCP 47 Locale Identifiers](https://unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers) definition. * [Unicode BCP 47 Locale Identifiers](https://unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers) definition.
* *
@ -58,7 +57,7 @@ declare namespace Intl {
* *
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts). * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts).
*/ */
type RelativeTimeFormatUnitSingular = type RelativeTimeFormatUnitSingular =
| "year" | "year"
| "quarter" | "quarter"
| "month" | "month"
@ -140,14 +139,14 @@ declare namespace Intl {
*/ */
type RelativeTimeFormatPart = type RelativeTimeFormatPart =
| { | {
type: "literal"; type: "literal";
value: string; value: string;
} }
| { | {
type: Exclude<NumberFormatPartTypes, "literal">; type: Exclude<NumberFormatPartTypes, "literal">;
value: string; value: string;
unit: RelativeTimeFormatUnitSingular; unit: RelativeTimeFormatUnitSingular;
}; };
interface RelativeTimeFormat { interface RelativeTimeFormat {
/** /**
@ -218,7 +217,7 @@ declare namespace Intl {
* *
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat). * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat).
*/ */
new( new (
locales?: UnicodeBCP47LocaleIdentifier | UnicodeBCP47LocaleIdentifier[], locales?: UnicodeBCP47LocaleIdentifier | UnicodeBCP47LocaleIdentifier[],
options?: RelativeTimeFormatOptions, options?: RelativeTimeFormatOptions,
): RelativeTimeFormat; ): RelativeTimeFormat;
@ -410,7 +409,7 @@ declare namespace Intl {
* *
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames). * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames).
*/ */
new(locales: LocalesArgument, options: DisplayNamesOptions): DisplayNames; new (locales: LocalesArgument, options: DisplayNamesOptions): DisplayNames;
/** /**
* Returns an array containing those of the provided locales that are supported in display names without having to fall back to the runtime's default locale. * Returns an array containing those of the provided locales that are supported in display names without having to fall back to the runtime's default locale.
@ -425,7 +424,6 @@ declare namespace Intl {
* *
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf). * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf).
*/ */
supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher }): BCP47LanguageTag[]; supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }): BCP47LanguageTag[];
}; };
} }

View file

@ -35,7 +35,7 @@ interface PromiseConstructor {
* @param values An array of Promises. * @param values An array of Promises.
* @returns A new Promise. * @returns A new Promise.
*/ */
allSettled<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>> }>; allSettled<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>>; }>;
/** /**
* Creates a Promise that is resolved with an array of results when all * Creates a Promise that is resolved with an array of results when all

View file

@ -17,10 +17,9 @@ and limitations under the License.
/// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
declare namespace Intl { declare namespace Intl {
interface DateTimeFormatPartTypesRegistry { interface DateTimeFormatPartTypesRegistry {
fractionalSecond: any fractionalSecond: any;
} }
interface DateTimeFormatOptions { interface DateTimeFormatOptions {
formatMatcher?: "basic" | "best fit" | "best fit" | undefined; formatMatcher?: "basic" | "best fit" | "best fit" | undefined;
@ -31,7 +30,7 @@ declare namespace Intl {
} }
interface DateTimeRangeFormatPart extends DateTimeFormatPart { interface DateTimeRangeFormatPart extends DateTimeFormatPart {
source: "startRange" | "endRange" | "shared" source: "startRange" | "endRange" | "shared";
} }
interface DateTimeFormat { interface DateTimeFormat {
@ -114,7 +113,7 @@ declare namespace Intl {
* *
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/formatToParts). * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/formatToParts).
*/ */
formatToParts(list: Iterable<string>): { type: "element" | "literal", value: string; }[]; formatToParts(list: Iterable<string>): { type: "element" | "literal"; value: string; }[];
/** /**
* Returns a new object with properties reflecting the locale and style * Returns a new object with properties reflecting the locale and style
@ -144,7 +143,7 @@ declare namespace Intl {
* *
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat). * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat).
*/ */
new(locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: ListFormatOptions): ListFormat; new (locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: ListFormatOptions): ListFormat;
/** /**
* Returns an array containing those of the provided locales that are * Returns an array containing those of the provided locales that are

View file

@ -17,11 +17,11 @@ and limitations under the License.
/// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
interface AggregateError extends Error { interface AggregateError extends Error {
errors: any[] errors: any[];
} }
interface AggregateErrorConstructor { interface AggregateErrorConstructor {
new(errors: Iterable<any>, message?: string): AggregateError; new (errors: Iterable<any>, message?: string): AggregateError;
(errors: Iterable<any>, message?: string): AggregateError; (errors: Iterable<any>, message?: string): AggregateError;
readonly prototype: AggregateError; readonly prototype: AggregateError;
} }
@ -44,7 +44,7 @@ interface PromiseConstructor {
* @param values An array or iterable of Promises. * @param values An array or iterable of Promises.
* @returns A new Promise. * @returns A new Promise.
*/ */
any<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>> any<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
/** /**
* Creates a Promise that can be resolved or rejected using provided functions. * Creates a Promise that can be resolved or rejected using provided functions.

View file

@ -35,7 +35,7 @@ interface WeakRefConstructor {
* In es2023 the value can be either a symbol or an object, in previous versions only object is permissible. * In es2023 the value can be either a symbol or an object, in previous versions only object is permissible.
* @param target The target value for the WeakRef instance. * @param target The target value for the WeakRef instance.
*/ */
new<T extends WeakKey>(target: T): WeakRef<T>; new <T extends WeakKey>(target: T): WeakRef<T>;
} }
declare var WeakRef: WeakRefConstructor; declare var WeakRef: WeakRefConstructor;
@ -70,7 +70,7 @@ interface FinalizationRegistryConstructor {
* Creates a finalization registry with an associated cleanup callback * Creates a finalization registry with an associated cleanup callback
* @param cleanupCallback The callback to call after a value in the registry has been reclaimed. * @param cleanupCallback The callback to call after a value in the registry has been reclaimed.
*/ */
new<T>(cleanupCallback: (heldValue: T) => void): FinalizationRegistry<T>; new <T>(cleanupCallback: (heldValue: T) => void): FinalizationRegistry<T>;
} }
declare var FinalizationRegistry: FinalizationRegistryConstructor; declare var FinalizationRegistry: FinalizationRegistryConstructor;

View file

@ -63,11 +63,11 @@ interface AggregateErrorConstructor {
new ( new (
errors: Iterable<any>, errors: Iterable<any>,
message?: string, message?: string,
options?: ErrorOptions options?: ErrorOptions,
): AggregateError; ): AggregateError;
( (
errors: Iterable<any>, errors: Iterable<any>,
message?: string, message?: string,
options?: ErrorOptions options?: ErrorOptions,
): AggregateError; ): AggregateError;
} }

View file

@ -17,7 +17,6 @@ and limitations under the License.
/// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
declare namespace Intl { declare namespace Intl {
/** /**
* An object with some or all properties of the `Intl.Segmenter` constructor `options` parameter. * An object with some or all properties of the `Intl.Segmenter` constructor `options` parameter.
* *
@ -90,7 +89,7 @@ declare namespace Intl {
* *
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter). * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter).
*/ */
new(locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: SegmenterOptions): Segmenter; new (locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: SegmenterOptions): Segmenter;
/** /**
* Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. * Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.

View file

@ -25,7 +25,7 @@ interface Atomics {
* @param value The expected value to test. * @param value The expected value to test.
* @param [timeout] The expected value to test. * @param [timeout] The expected value to test.
*/ */
waitAsync(typedArray: Int32Array, index: number, value: number, timeout?: number): { async: false, value: "not-equal" | "timed-out" } | { async: true, value: Promise<"ok" | "timed-out"> }; waitAsync(typedArray: Int32Array, index: number, value: number, timeout?: number): { async: false; value: "not-equal" | "timed-out"; } | { async: true; value: Promise<"ok" | "timed-out">; };
/** /**
* A non-blocking, asynchronous version of wait which is usable on the main thread. * A non-blocking, asynchronous version of wait which is usable on the main thread.
@ -35,5 +35,5 @@ interface Atomics {
* @param value The expected value to test. * @param value The expected value to test.
* @param [timeout] The expected value to test. * @param [timeout] The expected value to test.
*/ */
waitAsync(typedArray: BigInt64Array, index: number, value: bigint, timeout?: number): { async: false, value: "not-equal" | "timed-out" } | { async: true, value: Promise<"ok" | "timed-out"> }; waitAsync(typedArray: BigInt64Array, index: number, value: bigint, timeout?: number): { async: false; value: "not-equal" | "timed-out"; } | { async: true; value: Promise<"ok" | "timed-out">; };
} }

View file

@ -97,11 +97,11 @@ interface ReadonlyArray<T> {
*/ */
findLast<S extends T>( findLast<S extends T>(
predicate: (value: T, index: number, array: readonly T[]) => value is S, predicate: (value: T, index: number, array: readonly T[]) => value is S,
thisArg?: any thisArg?: any,
): S | undefined; ): S | undefined;
findLast( findLast(
predicate: (value: T, index: number, array: readonly T[]) => unknown, predicate: (value: T, index: number, array: readonly T[]) => unknown,
thisArg?: any thisArg?: any,
): T | undefined; ): T | undefined;
/** /**
@ -115,7 +115,7 @@ interface ReadonlyArray<T> {
*/ */
findLastIndex( findLastIndex(
predicate: (value: T, index: number, array: readonly T[]) => unknown, predicate: (value: T, index: number, array: readonly T[]) => unknown,
thisArg?: any thisArg?: any,
): number; ): number;
/** /**
@ -177,13 +177,13 @@ interface Int8Array {
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Int8Array array: Int8Array,
) => value is S, ) => value is S,
thisArg?: any thisArg?: any,
): S | undefined; ): S | undefined;
findLast( findLast(
predicate: (value: number, index: number, array: Int8Array) => unknown, predicate: (value: number, index: number, array: Int8Array) => unknown,
thisArg?: any thisArg?: any,
): number | undefined; ): number | undefined;
/** /**
@ -197,7 +197,7 @@ interface Int8Array {
*/ */
findLastIndex( findLastIndex(
predicate: (value: number, index: number, array: Int8Array) => unknown, predicate: (value: number, index: number, array: Int8Array) => unknown,
thisArg?: any thisArg?: any,
): number; ): number;
/** /**
@ -209,7 +209,7 @@ interface Int8Array {
* Copies and sorts the array. * Copies and sorts the array.
* @param compareFn Function used to determine the order of the elements. It is expected to return * @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. * value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts * ```ts
* const myNums = Uint8Array.from([11, 2, 22, 1]); * const myNums = Uint8Array.from([11, 2, 22, 1]);
* myNums.toSorted((a, b) => a - b) // Uint8Array(4) [1, 2, 11, 22] * myNums.toSorted((a, b) => a - b) // Uint8Array(4) [1, 2, 11, 22]
@ -241,13 +241,13 @@ interface Uint8Array {
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Uint8Array array: Uint8Array,
) => value is S, ) => value is S,
thisArg?: any thisArg?: any,
): S | undefined; ): S | undefined;
findLast( findLast(
predicate: (value: number, index: number, array: Uint8Array) => unknown, predicate: (value: number, index: number, array: Uint8Array) => unknown,
thisArg?: any thisArg?: any,
): number | undefined; ): number | undefined;
/** /**
@ -261,7 +261,7 @@ interface Uint8Array {
*/ */
findLastIndex( findLastIndex(
predicate: (value: number, index: number, array: Uint8Array) => unknown, predicate: (value: number, index: number, array: Uint8Array) => unknown,
thisArg?: any thisArg?: any,
): number; ): number;
/** /**
@ -273,7 +273,7 @@ interface Uint8Array {
* Copies and sorts the array. * Copies and sorts the array.
* @param compareFn Function used to determine the order of the elements. It is expected to return * @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. * value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts * ```ts
* const myNums = Uint8Array.from([11, 2, 22, 1]); * const myNums = Uint8Array.from([11, 2, 22, 1]);
* myNums.toSorted((a, b) => a - b) // Uint8Array(4) [1, 2, 11, 22] * myNums.toSorted((a, b) => a - b) // Uint8Array(4) [1, 2, 11, 22]
@ -305,17 +305,17 @@ interface Uint8ClampedArray {
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Uint8ClampedArray array: Uint8ClampedArray,
) => value is S, ) => value is S,
thisArg?: any thisArg?: any,
): S | undefined; ): S | undefined;
findLast( findLast(
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Uint8ClampedArray array: Uint8ClampedArray,
) => unknown, ) => unknown,
thisArg?: any thisArg?: any,
): number | undefined; ): number | undefined;
/** /**
@ -331,9 +331,9 @@ interface Uint8ClampedArray {
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Uint8ClampedArray array: Uint8ClampedArray,
) => unknown, ) => unknown,
thisArg?: any thisArg?: any,
): number; ): number;
/** /**
@ -345,7 +345,7 @@ interface Uint8ClampedArray {
* Copies and sorts the array. * Copies and sorts the array.
* @param compareFn Function used to determine the order of the elements. It is expected to return * @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. * value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts * ```ts
* const myNums = Uint8ClampedArray.from([11, 2, 22, 1]); * const myNums = Uint8ClampedArray.from([11, 2, 22, 1]);
* myNums.toSorted((a, b) => a - b) // Uint8ClampedArray(4) [1, 2, 11, 22] * myNums.toSorted((a, b) => a - b) // Uint8ClampedArray(4) [1, 2, 11, 22]
@ -377,13 +377,13 @@ interface Int16Array {
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Int16Array array: Int16Array,
) => value is S, ) => value is S,
thisArg?: any thisArg?: any,
): S | undefined; ): S | undefined;
findLast( findLast(
predicate: (value: number, index: number, array: Int16Array) => unknown, predicate: (value: number, index: number, array: Int16Array) => unknown,
thisArg?: any thisArg?: any,
): number | undefined; ): number | undefined;
/** /**
@ -397,7 +397,7 @@ interface Int16Array {
*/ */
findLastIndex( findLastIndex(
predicate: (value: number, index: number, array: Int16Array) => unknown, predicate: (value: number, index: number, array: Int16Array) => unknown,
thisArg?: any thisArg?: any,
): number; ): number;
/** /**
@ -409,7 +409,7 @@ interface Int16Array {
* Copies and sorts the array. * Copies and sorts the array.
* @param compareFn Function used to determine the order of the elements. It is expected to return * @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. * value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts * ```ts
* const myNums = Int16Array.from([11, 2, -22, 1]); * const myNums = Int16Array.from([11, 2, -22, 1]);
* myNums.toSorted((a, b) => a - b) // Int16Array(4) [-22, 1, 2, 11] * myNums.toSorted((a, b) => a - b) // Int16Array(4) [-22, 1, 2, 11]
@ -441,17 +441,17 @@ interface Uint16Array {
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Uint16Array array: Uint16Array,
) => value is S, ) => value is S,
thisArg?: any thisArg?: any,
): S | undefined; ): S | undefined;
findLast( findLast(
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Uint16Array array: Uint16Array,
) => unknown, ) => unknown,
thisArg?: any thisArg?: any,
): number | undefined; ): number | undefined;
/** /**
@ -467,9 +467,9 @@ interface Uint16Array {
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Uint16Array array: Uint16Array,
) => unknown, ) => unknown,
thisArg?: any thisArg?: any,
): number; ): number;
/** /**
@ -481,7 +481,7 @@ interface Uint16Array {
* Copies and sorts the array. * Copies and sorts the array.
* @param compareFn Function used to determine the order of the elements. It is expected to return * @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. * value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts * ```ts
* const myNums = Uint16Array.from([11, 2, 22, 1]); * const myNums = Uint16Array.from([11, 2, 22, 1]);
* myNums.toSorted((a, b) => a - b) // Uint16Array(4) [1, 2, 11, 22] * myNums.toSorted((a, b) => a - b) // Uint16Array(4) [1, 2, 11, 22]
@ -513,13 +513,13 @@ interface Int32Array {
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Int32Array array: Int32Array,
) => value is S, ) => value is S,
thisArg?: any thisArg?: any,
): S | undefined; ): S | undefined;
findLast( findLast(
predicate: (value: number, index: number, array: Int32Array) => unknown, predicate: (value: number, index: number, array: Int32Array) => unknown,
thisArg?: any thisArg?: any,
): number | undefined; ): number | undefined;
/** /**
@ -533,7 +533,7 @@ interface Int32Array {
*/ */
findLastIndex( findLastIndex(
predicate: (value: number, index: number, array: Int32Array) => unknown, predicate: (value: number, index: number, array: Int32Array) => unknown,
thisArg?: any thisArg?: any,
): number; ): number;
/** /**
@ -545,7 +545,7 @@ interface Int32Array {
* Copies and sorts the array. * Copies and sorts the array.
* @param compareFn Function used to determine the order of the elements. It is expected to return * @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. * value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts * ```ts
* const myNums = Int32Array.from([11, 2, -22, 1]); * const myNums = Int32Array.from([11, 2, -22, 1]);
* myNums.toSorted((a, b) => a - b) // Int32Array(4) [-22, 1, 2, 11] * myNums.toSorted((a, b) => a - b) // Int32Array(4) [-22, 1, 2, 11]
@ -577,17 +577,17 @@ interface Uint32Array {
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Uint32Array array: Uint32Array,
) => value is S, ) => value is S,
thisArg?: any thisArg?: any,
): S | undefined; ): S | undefined;
findLast( findLast(
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Uint32Array array: Uint32Array,
) => unknown, ) => unknown,
thisArg?: any thisArg?: any,
): number | undefined; ): number | undefined;
/** /**
@ -603,9 +603,9 @@ interface Uint32Array {
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Uint32Array array: Uint32Array,
) => unknown, ) => unknown,
thisArg?: any thisArg?: any,
): number; ): number;
/** /**
@ -617,7 +617,7 @@ interface Uint32Array {
* Copies and sorts the array. * Copies and sorts the array.
* @param compareFn Function used to determine the order of the elements. It is expected to return * @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. * value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts * ```ts
* const myNums = Uint32Array.from([11, 2, 22, 1]); * const myNums = Uint32Array.from([11, 2, 22, 1]);
* myNums.toSorted((a, b) => a - b) // Uint32Array(4) [1, 2, 11, 22] * myNums.toSorted((a, b) => a - b) // Uint32Array(4) [1, 2, 11, 22]
@ -649,17 +649,17 @@ interface Float32Array {
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Float32Array array: Float32Array,
) => value is S, ) => value is S,
thisArg?: any thisArg?: any,
): S | undefined; ): S | undefined;
findLast( findLast(
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Float32Array array: Float32Array,
) => unknown, ) => unknown,
thisArg?: any thisArg?: any,
): number | undefined; ): number | undefined;
/** /**
@ -675,9 +675,9 @@ interface Float32Array {
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Float32Array array: Float32Array,
) => unknown, ) => unknown,
thisArg?: any thisArg?: any,
): number; ): number;
/** /**
@ -689,7 +689,7 @@ interface Float32Array {
* Copies and sorts the array. * Copies and sorts the array.
* @param compareFn Function used to determine the order of the elements. It is expected to return * @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. * value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts * ```ts
* const myNums = Float32Array.from([11.25, 2, -22.5, 1]); * const myNums = Float32Array.from([11.25, 2, -22.5, 1]);
* myNums.toSorted((a, b) => a - b) // Float32Array(4) [-22.5, 1, 2, 11.5] * myNums.toSorted((a, b) => a - b) // Float32Array(4) [-22.5, 1, 2, 11.5]
@ -721,17 +721,17 @@ interface Float64Array {
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Float64Array array: Float64Array,
) => value is S, ) => value is S,
thisArg?: any thisArg?: any,
): S | undefined; ): S | undefined;
findLast( findLast(
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Float64Array array: Float64Array,
) => unknown, ) => unknown,
thisArg?: any thisArg?: any,
): number | undefined; ): number | undefined;
/** /**
@ -747,9 +747,9 @@ interface Float64Array {
predicate: ( predicate: (
value: number, value: number,
index: number, index: number,
array: Float64Array array: Float64Array,
) => unknown, ) => unknown,
thisArg?: any thisArg?: any,
): number; ): number;
/** /**
@ -761,7 +761,7 @@ interface Float64Array {
* Copies and sorts the array. * Copies and sorts the array.
* @param compareFn Function used to determine the order of the elements. It is expected to return * @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. * value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts * ```ts
* const myNums = Float64Array.from([11.25, 2, -22.5, 1]); * const myNums = Float64Array.from([11.25, 2, -22.5, 1]);
* myNums.toSorted((a, b) => a - b) // Float64Array(4) [-22.5, 1, 2, 11.5] * myNums.toSorted((a, b) => a - b) // Float64Array(4) [-22.5, 1, 2, 11.5]
@ -793,17 +793,17 @@ interface BigInt64Array {
predicate: ( predicate: (
value: bigint, value: bigint,
index: number, index: number,
array: BigInt64Array array: BigInt64Array,
) => value is S, ) => value is S,
thisArg?: any thisArg?: any,
): S | undefined; ): S | undefined;
findLast( findLast(
predicate: ( predicate: (
value: bigint, value: bigint,
index: number, index: number,
array: BigInt64Array array: BigInt64Array,
) => unknown, ) => unknown,
thisArg?: any thisArg?: any,
): bigint | undefined; ): bigint | undefined;
/** /**
@ -819,9 +819,9 @@ interface BigInt64Array {
predicate: ( predicate: (
value: bigint, value: bigint,
index: number, index: number,
array: BigInt64Array array: BigInt64Array,
) => unknown, ) => unknown,
thisArg?: any thisArg?: any,
): number; ): number;
/** /**
@ -833,7 +833,7 @@ interface BigInt64Array {
* Copies and sorts the array. * Copies and sorts the array.
* @param compareFn Function used to determine the order of the elements. It is expected to return * @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. * value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts * ```ts
* const myNums = BigInt64Array.from([11n, 2n, -22n, 1n]); * const myNums = BigInt64Array.from([11n, 2n, -22n, 1n]);
* myNums.toSorted((a, b) => Number(a - b)) // BigInt64Array(4) [-22n, 1n, 2n, 11n] * myNums.toSorted((a, b) => Number(a - b)) // BigInt64Array(4) [-22n, 1n, 2n, 11n]
@ -865,17 +865,17 @@ interface BigUint64Array {
predicate: ( predicate: (
value: bigint, value: bigint,
index: number, index: number,
array: BigUint64Array array: BigUint64Array,
) => value is S, ) => value is S,
thisArg?: any thisArg?: any,
): S | undefined; ): S | undefined;
findLast( findLast(
predicate: ( predicate: (
value: bigint, value: bigint,
index: number, index: number,
array: BigUint64Array array: BigUint64Array,
) => unknown, ) => unknown,
thisArg?: any thisArg?: any,
): bigint | undefined; ): bigint | undefined;
/** /**
@ -891,9 +891,9 @@ interface BigUint64Array {
predicate: ( predicate: (
value: bigint, value: bigint,
index: number, index: number,
array: BigUint64Array array: BigUint64Array,
) => unknown, ) => unknown,
thisArg?: any thisArg?: any,
): number; ): number;
/** /**
@ -905,7 +905,7 @@ interface BigUint64Array {
* Copies and sorts the array. * Copies and sorts the array.
* @param compareFn Function used to determine the order of the elements. It is expected to return * @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. * value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts * ```ts
* const myNums = BigUint64Array.from([11n, 2n, 22n, 1n]); * const myNums = BigUint64Array.from([11n, 2n, 22n, 1n]);
* myNums.toSorted((a, b) => Number(a - b)) // BigUint64Array(4) [1n, 2n, 11n, 22n] * myNums.toSorted((a, b) => Number(a - b)) // BigUint64Array(4) [1n, 2n, 11n, 22n]

View file

@ -153,7 +153,7 @@ interface Object {
} }
interface ObjectConstructor { interface ObjectConstructor {
new(value?: any): Object; new (value?: any): Object;
(): any; (): any;
(value: any): any; (value: any): any;
@ -225,7 +225,7 @@ interface ObjectConstructor {
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties. * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
* @param o Object on which to lock the attributes. * @param o Object on which to lock the attributes.
*/ */
freeze<T extends {[idx: string]: U | null | undefined | object}, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>; freeze<T extends { [idx: string]: U | null | undefined | object; }, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
/** /**
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties. * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
@ -311,7 +311,7 @@ interface FunctionConstructor {
* Creates a new function. * Creates a new function.
* @param args A list of arguments the function accepts. * @param args A list of arguments the function accepts.
*/ */
new(...args: string[]): Function; new (...args: string[]): Function;
(...args: string[]): Function; (...args: string[]): Function;
readonly prototype: Function; readonly prototype: Function;
} }
@ -532,7 +532,7 @@ interface String {
} }
interface StringConstructor { interface StringConstructor {
new(value?: any): String; new (value?: any): String;
(value?: any): string; (value?: any): string;
readonly prototype: String; readonly prototype: String;
fromCharCode(...codes: number[]): string; fromCharCode(...codes: number[]): string;
@ -549,7 +549,7 @@ interface Boolean {
} }
interface BooleanConstructor { interface BooleanConstructor {
new(value?: any): Boolean; new (value?: any): Boolean;
<T>(value?: T): boolean; <T>(value?: T): boolean;
readonly prototype: Boolean; readonly prototype: Boolean;
} }
@ -586,7 +586,7 @@ interface Number {
} }
interface NumberConstructor { interface NumberConstructor {
new(value?: any): Number; new (value?: any): Number;
(value?: any): number; (value?: any): number;
readonly prototype: Number; readonly prototype: Number;
@ -638,8 +638,8 @@ interface ImportMeta {
* augmented via interface merging. * augmented via interface merging.
*/ */
interface ImportCallOptions { interface ImportCallOptions {
assert?: ImportAssertions; /** @deprecated*/ assert?: ImportAssertions;
with?: ImportAssertions; with?: ImportAttributes;
} }
/** /**
@ -649,6 +649,13 @@ interface ImportAssertions {
[key: string]: string; [key: string]: string;
} }
/**
* The type for the `with` property of the optional second argument to `import()`.
*/
interface ImportAttributes {
[key: string]: string;
}
interface Math { interface Math {
/** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */
readonly E: number; readonly E: number;
@ -915,8 +922,8 @@ interface Date {
} }
interface DateConstructor { interface DateConstructor {
new(): Date; new (): Date;
new(value: number | string): Date; new (value: number | string): Date;
/** /**
* Creates a new Date. * Creates a new Date.
* @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
@ -927,7 +934,7 @@ interface DateConstructor {
* @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds. * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
* @param ms A number from 0 to 999 that specifies the milliseconds. * @param ms A number from 0 to 999 that specifies the milliseconds.
*/ */
new(year: number, monthIndex: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; new (year: number, monthIndex: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
(): string; (): string;
readonly prototype: Date; readonly prototype: Date;
/** /**
@ -1015,49 +1022,49 @@ interface RegExp {
} }
interface RegExpConstructor { interface RegExpConstructor {
new(pattern: RegExp | string): RegExp; new (pattern: RegExp | string): RegExp;
new(pattern: string, flags?: string): RegExp; new (pattern: string, flags?: string): RegExp;
(pattern: RegExp | string): RegExp; (pattern: RegExp | string): RegExp;
(pattern: string, flags?: string): RegExp; (pattern: string, flags?: string): RegExp;
readonly prototype: RegExp; readonly "prototype": RegExp;
// Non-standard extensions // Non-standard extensions
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
$1: string; "$1": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
$2: string; "$2": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
$3: string; "$3": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
$4: string; "$4": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
$5: string; "$5": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
$6: string; "$6": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
$7: string; "$7": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
$8: string; "$8": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
$9: string; "$9": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
input: string; "input": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
$_: string; "$_": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
lastMatch: string; "lastMatch": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
"$&": string; "$&": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
lastParen: string; "lastParen": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
"$+": string; "$+": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
leftContext: string; "leftContext": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
"$`": string; "$`": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
rightContext: string; "rightContext": string;
/** @deprecated A legacy feature for browser compatibility */ /** @deprecated A legacy feature for browser compatibility */
"$'": string; "$'": string;
} }
@ -1071,7 +1078,7 @@ interface Error {
} }
interface ErrorConstructor { interface ErrorConstructor {
new(message?: string): Error; new (message?: string): Error;
(message?: string): Error; (message?: string): Error;
readonly prototype: Error; readonly prototype: Error;
} }
@ -1082,7 +1089,7 @@ interface EvalError extends Error {
} }
interface EvalErrorConstructor extends ErrorConstructor { interface EvalErrorConstructor extends ErrorConstructor {
new(message?: string): EvalError; new (message?: string): EvalError;
(message?: string): EvalError; (message?: string): EvalError;
readonly prototype: EvalError; readonly prototype: EvalError;
} }
@ -1093,7 +1100,7 @@ interface RangeError extends Error {
} }
interface RangeErrorConstructor extends ErrorConstructor { interface RangeErrorConstructor extends ErrorConstructor {
new(message?: string): RangeError; new (message?: string): RangeError;
(message?: string): RangeError; (message?: string): RangeError;
readonly prototype: RangeError; readonly prototype: RangeError;
} }
@ -1104,7 +1111,7 @@ interface ReferenceError extends Error {
} }
interface ReferenceErrorConstructor extends ErrorConstructor { interface ReferenceErrorConstructor extends ErrorConstructor {
new(message?: string): ReferenceError; new (message?: string): ReferenceError;
(message?: string): ReferenceError; (message?: string): ReferenceError;
readonly prototype: ReferenceError; readonly prototype: ReferenceError;
} }
@ -1115,7 +1122,7 @@ interface SyntaxError extends Error {
} }
interface SyntaxErrorConstructor extends ErrorConstructor { interface SyntaxErrorConstructor extends ErrorConstructor {
new(message?: string): SyntaxError; new (message?: string): SyntaxError;
(message?: string): SyntaxError; (message?: string): SyntaxError;
readonly prototype: SyntaxError; readonly prototype: SyntaxError;
} }
@ -1126,7 +1133,7 @@ interface TypeError extends Error {
} }
interface TypeErrorConstructor extends ErrorConstructor { interface TypeErrorConstructor extends ErrorConstructor {
new(message?: string): TypeError; new (message?: string): TypeError;
(message?: string): TypeError; (message?: string): TypeError;
readonly prototype: TypeError; readonly prototype: TypeError;
} }
@ -1137,7 +1144,7 @@ interface URIError extends Error {
} }
interface URIErrorConstructor extends ErrorConstructor { interface URIErrorConstructor extends ErrorConstructor {
new(message?: string): URIError; new (message?: string): URIError;
(message?: string): URIError; (message?: string): URIError;
readonly prototype: URIError; readonly prototype: URIError;
} }
@ -1173,7 +1180,6 @@ interface JSON {
*/ */
declare var JSON: JSON; declare var JSON: JSON;
///////////////////////////// /////////////////////////////
/// ECMAScript Array API (specially handled by compiler) /// ECMAScript Array API (specially handled by compiler)
///////////////////////////// /////////////////////////////
@ -1497,7 +1503,7 @@ interface Array<T> {
} }
interface ArrayConstructor { interface ArrayConstructor {
new(arrayLength?: number): any[]; new (arrayLength?: number): any[];
new <T>(arrayLength: number): T[]; new <T>(arrayLength: number): T[];
new <T>(...items: T[]): T[]; new <T>(...items: T[]): T[];
(arrayLength?: number): any[]; (arrayLength?: number): any[];
@ -1553,13 +1559,12 @@ interface Promise<T> {
/** /**
* Recursively unwraps the "awaited type" of a type. Non-promise "thenables" should resolve to `never`. This emulates the behavior of `await`. * Recursively unwraps the "awaited type" of a type. Non-promise "thenables" should resolve to `never`. This emulates the behavior of `await`.
*/ */
type Awaited<T> = type Awaited<T> = T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode
T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode T extends object & { then(onfulfilled: infer F, ...args: infer _): any; } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
T extends object & { then(onfulfilled: infer F, ...args: infer _): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped F extends ((value: infer V, ...args: infer _) => any) ? // if the argument to `then` is callable, extracts the first argument
F extends ((value: infer V, ...args: infer _) => any) ? // if the argument to `then` is callable, extracts the first argument Awaited<V> : // recursively unwrap the value
Awaited<V> : // recursively unwrap the value never : // the argument to `then` was not callable
never : // the argument to `then` was not callable T; // non-object or non-thenable
T; // non-object or non-thenable
interface ArrayLike<T> { interface ArrayLike<T> {
readonly length: number; readonly length: number;
@ -1664,7 +1669,7 @@ type Uncapitalize<S extends string> = intrinsic;
/** /**
* Marker for contextual 'this' type * Marker for contextual 'this' type
*/ */
interface ThisType<T> { } interface ThisType<T> {}
/** /**
* Stores types to be used with WeakSet, WeakMap, WeakRef, and FinalizationRegistry * Stores types to be used with WeakSet, WeakMap, WeakRef, and FinalizationRegistry
@ -1703,7 +1708,7 @@ type ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];
interface ArrayBufferConstructor { interface ArrayBufferConstructor {
readonly prototype: ArrayBuffer; readonly prototype: ArrayBuffer;
new(byteLength: number): ArrayBuffer; new (byteLength: number): ArrayBuffer;
isView(arg: any): arg is ArrayBufferView; isView(arg: any): arg is ArrayBufferView;
} }
declare var ArrayBuffer: ArrayBufferConstructor; declare var ArrayBuffer: ArrayBufferConstructor;
@ -1855,7 +1860,7 @@ interface DataView {
interface DataViewConstructor { interface DataViewConstructor {
readonly prototype: DataView; readonly prototype: DataView;
new(buffer: ArrayBufferLike & { BYTES_PER_ELEMENT?: never }, byteOffset?: number, byteLength?: number): DataView; new (buffer: ArrayBufferLike & { BYTES_PER_ELEMENT?: never; }, byteOffset?: number, byteLength?: number): DataView;
} }
declare var DataView: DataViewConstructor; declare var DataView: DataViewConstructor;
@ -2108,9 +2113,9 @@ interface Int8Array {
} }
interface Int8ArrayConstructor { interface Int8ArrayConstructor {
readonly prototype: Int8Array; readonly prototype: Int8Array;
new(length: number): Int8Array; new (length: number): Int8Array;
new(array: ArrayLike<number> | ArrayBufferLike): Int8Array; new (array: ArrayLike<number> | ArrayBufferLike): Int8Array;
new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int8Array; new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int8Array;
/** /**
* The size in bytes of each element in the array. * The size in bytes of each element in the array.
@ -2136,8 +2141,6 @@ interface Int8ArrayConstructor {
* @param thisArg Value of 'this' used to invoke the mapfn. * @param thisArg Value of 'this' used to invoke the mapfn.
*/ */
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array;
} }
declare var Int8Array: Int8ArrayConstructor; declare var Int8Array: Int8ArrayConstructor;
@ -2391,9 +2394,9 @@ interface Uint8Array {
interface Uint8ArrayConstructor { interface Uint8ArrayConstructor {
readonly prototype: Uint8Array; readonly prototype: Uint8Array;
new(length: number): Uint8Array; new (length: number): Uint8Array;
new(array: ArrayLike<number> | ArrayBufferLike): Uint8Array; new (array: ArrayLike<number> | ArrayBufferLike): Uint8Array;
new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8Array; new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8Array;
/** /**
* The size in bytes of each element in the array. * The size in bytes of each element in the array.
@ -2419,7 +2422,6 @@ interface Uint8ArrayConstructor {
* @param thisArg Value of 'this' used to invoke the mapfn. * @param thisArg Value of 'this' used to invoke the mapfn.
*/ */
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array;
} }
declare var Uint8Array: Uint8ArrayConstructor; declare var Uint8Array: Uint8ArrayConstructor;
@ -2673,9 +2675,9 @@ interface Uint8ClampedArray {
interface Uint8ClampedArrayConstructor { interface Uint8ClampedArrayConstructor {
readonly prototype: Uint8ClampedArray; readonly prototype: Uint8ClampedArray;
new(length: number): Uint8ClampedArray; new (length: number): Uint8ClampedArray;
new(array: ArrayLike<number> | ArrayBufferLike): Uint8ClampedArray; new (array: ArrayLike<number> | ArrayBufferLike): Uint8ClampedArray;
new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8ClampedArray; new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8ClampedArray;
/** /**
* The size in bytes of each element in the array. * The size in bytes of each element in the array.
@ -2953,9 +2955,9 @@ interface Int16Array {
interface Int16ArrayConstructor { interface Int16ArrayConstructor {
readonly prototype: Int16Array; readonly prototype: Int16Array;
new(length: number): Int16Array; new (length: number): Int16Array;
new(array: ArrayLike<number> | ArrayBufferLike): Int16Array; new (array: ArrayLike<number> | ArrayBufferLike): Int16Array;
new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int16Array; new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int16Array;
/** /**
* The size in bytes of each element in the array. * The size in bytes of each element in the array.
@ -2981,8 +2983,6 @@ interface Int16ArrayConstructor {
* @param thisArg Value of 'this' used to invoke the mapfn. * @param thisArg Value of 'this' used to invoke the mapfn.
*/ */
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array;
} }
declare var Int16Array: Int16ArrayConstructor; declare var Int16Array: Int16ArrayConstructor;
@ -3236,9 +3236,9 @@ interface Uint16Array {
interface Uint16ArrayConstructor { interface Uint16ArrayConstructor {
readonly prototype: Uint16Array; readonly prototype: Uint16Array;
new(length: number): Uint16Array; new (length: number): Uint16Array;
new(array: ArrayLike<number> | ArrayBufferLike): Uint16Array; new (array: ArrayLike<number> | ArrayBufferLike): Uint16Array;
new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint16Array; new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint16Array;
/** /**
* The size in bytes of each element in the array. * The size in bytes of each element in the array.
@ -3264,8 +3264,6 @@ interface Uint16ArrayConstructor {
* @param thisArg Value of 'this' used to invoke the mapfn. * @param thisArg Value of 'this' used to invoke the mapfn.
*/ */
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array;
} }
declare var Uint16Array: Uint16ArrayConstructor; declare var Uint16Array: Uint16ArrayConstructor;
/** /**
@ -3518,9 +3516,9 @@ interface Int32Array {
interface Int32ArrayConstructor { interface Int32ArrayConstructor {
readonly prototype: Int32Array; readonly prototype: Int32Array;
new(length: number): Int32Array; new (length: number): Int32Array;
new(array: ArrayLike<number> | ArrayBufferLike): Int32Array; new (array: ArrayLike<number> | ArrayBufferLike): Int32Array;
new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int32Array; new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int32Array;
/** /**
* The size in bytes of each element in the array. * The size in bytes of each element in the array.
@ -3546,7 +3544,6 @@ interface Int32ArrayConstructor {
* @param thisArg Value of 'this' used to invoke the mapfn. * @param thisArg Value of 'this' used to invoke the mapfn.
*/ */
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array;
} }
declare var Int32Array: Int32ArrayConstructor; declare var Int32Array: Int32ArrayConstructor;
@ -3799,9 +3796,9 @@ interface Uint32Array {
interface Uint32ArrayConstructor { interface Uint32ArrayConstructor {
readonly prototype: Uint32Array; readonly prototype: Uint32Array;
new(length: number): Uint32Array; new (length: number): Uint32Array;
new(array: ArrayLike<number> | ArrayBufferLike): Uint32Array; new (array: ArrayLike<number> | ArrayBufferLike): Uint32Array;
new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint32Array; new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint32Array;
/** /**
* The size in bytes of each element in the array. * The size in bytes of each element in the array.
@ -3827,7 +3824,6 @@ interface Uint32ArrayConstructor {
* @param thisArg Value of 'this' used to invoke the mapfn. * @param thisArg Value of 'this' used to invoke the mapfn.
*/ */
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array;
} }
declare var Uint32Array: Uint32ArrayConstructor; declare var Uint32Array: Uint32ArrayConstructor;
@ -4081,9 +4077,9 @@ interface Float32Array {
interface Float32ArrayConstructor { interface Float32ArrayConstructor {
readonly prototype: Float32Array; readonly prototype: Float32Array;
new(length: number): Float32Array; new (length: number): Float32Array;
new(array: ArrayLike<number> | ArrayBufferLike): Float32Array; new (array: ArrayLike<number> | ArrayBufferLike): Float32Array;
new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float32Array; new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float32Array;
/** /**
* The size in bytes of each element in the array. * The size in bytes of each element in the array.
@ -4109,8 +4105,6 @@ interface Float32ArrayConstructor {
* @param thisArg Value of 'this' used to invoke the mapfn. * @param thisArg Value of 'this' used to invoke the mapfn.
*/ */
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array;
} }
declare var Float32Array: Float32ArrayConstructor; declare var Float32Array: Float32ArrayConstructor;
@ -4364,9 +4358,9 @@ interface Float64Array {
interface Float64ArrayConstructor { interface Float64ArrayConstructor {
readonly prototype: Float64Array; readonly prototype: Float64Array;
new(length: number): Float64Array; new (length: number): Float64Array;
new(array: ArrayLike<number> | ArrayBufferLike): Float64Array; new (array: ArrayLike<number> | ArrayBufferLike): Float64Array;
new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float64Array; new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float64Array;
/** /**
* The size in bytes of each element in the array. * The size in bytes of each element in the array.
@ -4392,7 +4386,6 @@ interface Float64ArrayConstructor {
* @param thisArg Value of 'this' used to invoke the mapfn. * @param thisArg Value of 'this' used to invoke the mapfn.
*/ */
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array;
} }
declare var Float64Array: Float64ArrayConstructor; declare var Float64Array: Float64ArrayConstructor;
@ -4426,7 +4419,7 @@ declare namespace Intl {
resolvedOptions(): ResolvedCollatorOptions; resolvedOptions(): ResolvedCollatorOptions;
} }
var Collator: { var Collator: {
new(locales?: string | string[], options?: CollatorOptions): Collator; new (locales?: string | string[], options?: CollatorOptions): Collator;
(locales?: string | string[], options?: CollatorOptions): Collator; (locales?: string | string[], options?: CollatorOptions): Collator;
supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[]; supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];
}; };
@ -4462,7 +4455,7 @@ declare namespace Intl {
resolvedOptions(): ResolvedNumberFormatOptions; resolvedOptions(): ResolvedNumberFormatOptions;
} }
var NumberFormat: { var NumberFormat: {
new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat; new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
(locales?: string | string[], options?: NumberFormatOptions): NumberFormat; (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];
readonly prototype: NumberFormat; readonly prototype: NumberFormat;
@ -4506,7 +4499,7 @@ declare namespace Intl {
resolvedOptions(): ResolvedDateTimeFormatOptions; resolvedOptions(): ResolvedDateTimeFormatOptions;
} }
var DateTimeFormat: { var DateTimeFormat: {
new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; new (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];
readonly prototype: DateTimeFormat; readonly prototype: DateTimeFormat;

View file

@ -15,283 +15,6 @@ and limitations under the License.
/// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
interface Array<T> {
/** Copies and reverses the elements in an array.*/
toReversed(): T[];
/**
* Copies and sorts an array.
* @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
toSorted(compareFn?: (a: T, b: T) => number): T[];
/**
* Copies and elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
* @param start The zero-based location in the array from which to start removing elements.
* @param deleteCount The number of elements to remove.
* @returns An array containing the elements that were deleted.
*/
toSpliced(start: number, deleteCount?: number): T[];
/**
* Copies and removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
* @param start The zero-based location in the array from which to start removing elements.
* @param deleteCount The number of elements to remove.
* @param items Elements to insert into the array in place of the deleted elements.
* @returns An array containing the elements that were deleted.
*/
toSpliced<F>(start: number, deleteCount: number, ...items: F[]): (F | T)[];
/**
* Copies and replaces the element at the given index with the provided value.
* @param index The zero-based location in the array for which to replace an element.
* @param value Element to insert into the array in place of the replaced element.
*/
with<F>(index: number, value: F): (F | T)[];
}
interface ReadonlyArray<T> {
/** Copies and reverses the elements in an array.*/
toReversed(): T[];
/**
* Copies and sorts an array.
* @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
toSorted(compareFn?: (a: T, b: T) => number): T[];
/**
* Copies and elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
* @param start The zero-based location in the array from which to start removing elements.
* @param deleteCount The number of elements to remove.
* @returns An array containing the elements that were deleted.
*/
toSpliced(start: number, deleteCount?: number): T[];
/**
* Copies and removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
* @param start The zero-based location in the array from which to start removing elements.
* @param deleteCount The number of elements to remove.
* @param items Elements to insert into the array in place of the deleted elements.
* @returns An array containing the elements that were deleted.
*/
toSpliced<F>(start: number, deleteCount: number, ...items: F[]): (F | T)[];
/**
* Copies and replaces the element at the given index with the provided value.
* @param index The zero-based location in the array for which to replace an element.
* @param value Element to insert into the array in place of the replaced element.
*/
with<F>(index: number, value: F): (F | T)[];
}
interface Int8Array {
/** Copies and reverses the elements in an array.*/
toReversed(): Int8Array;
/**
* Copies and sorts an array.
* @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if first argument is less than second argument, zero if they're equal and a positive
* value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
toSorted(compareFn?: (a: number, b: number) => number): Int8Array;
with(index: number, value: number): Int8Array;
}
interface Uint8Array {
/** Copies and reverses the elements in an array.*/
toReversed(): Uint8Array;
/**
* Copies and sorts an array.
* @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if first argument is less than second argument, zero if they're equal and a positive
* value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
toSorted(compareFn?: (a: number, b: number) => number): Uint8Array;
with(index: number, value: number): Uint8Array;
}
interface Uint8ClampedArray {
/** Copies and reverses the elements in an array.*/
toReversed(): Uint8ClampedArray;
/**
* Copies and sorts an array.
* @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if first argument is less than second argument, zero if they're equal and a positive
* value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
toSorted(compareFn?: (a: number, b: number) => number): Uint8ClampedArray;
with(index: number, value: number): Uint8ClampedArray;
}
interface Int16Array {
/** Copies and reverses the elements in an array.*/
toReversed(): Int16Array;
/**
* Copies and sorts an array.
* @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if first argument is less than second argument, zero if they're equal and a positive
* value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
toSorted(compareFn?: (a: number, b: number) => number): Int16Array;
with(index: number, value: number): Int16Array;
}
interface Uint16Array {
/** Copies and reverses the elements in an array.*/
toReversed(): Uint16Array;
/**
* Copies and sorts an array.
* @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if first argument is less than second argument, zero if they're equal and a positive
* value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
toSorted(compareFn?: (a: number, b: number) => number): Uint16Array;
with(index: number, value: number): Uint16Array;
}
interface Int32Array {
/** Copies and reverses the elements in an array.*/
toReversed(): Int32Array;
/**
* Copies and sorts an array.
* @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if first argument is less than second argument, zero if they're equal and a positive
* value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
toSorted(compareFn?: (a: number, b: number) => number): Int32Array;
with(index: number, value: number): Int32Array;
}
interface Uint32Array {
/** Copies and reverses the elements in an array.*/
toReversed(): Uint32Array;
/**
* Copies and sorts an array.
* @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if first argument is less than second argument, zero if they're equal and a positive
* value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
toSorted(compareFn?: (a: number, b: number) => number): Uint32Array;
with(index: number, value: number): Uint32Array;
}
interface Float32Array {
/** Copies and reverses the elements in an array.*/
toReversed(): Float32Array;
/**
* Copies and sorts an array.
* @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if first argument is less than second argument, zero if they're equal and a positive
* value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
toSorted(compareFn?: (a: number, b: number) => number): Float32Array;
with(index: number, value: number): Float32Array;
}
interface Float64Array {
/** Copies and reverses the elements in an array.*/
toReversed(): Float64Array;
/**
* Copies and sorts an array.
* @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if first argument is less than second argument, zero if they're equal and a positive
* value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
toSorted(compareFn?: (a: number, b: number) => number): Float64Array;
with(index: number, value: number): Float64Array;
}
interface BigInt64Array {
/** Copies and reverses the elements in an array.*/
toReversed(): BigInt64Array;
/**
* Copies and sorts an array.
* @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if first argument is less than second argument, zero if they're equal and a positive
* value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
toSorted(compareFn?: (a: bigint, b: bigint) => number | bigint): BigInt64Array;
with(index: number, value: number): BigInt64Array;
}
interface BigUint64Array {
/** Copies and reverses the elements in an array.*/
toReversed(): BigUint64Array;
/**
* Copies and sorts an array.
* @param compareFn Function used to determine the order of the elements. It is expected to return
* a negative value if first argument is less than second argument, zero if they're equal and a positive
* value otherwise. If omitted, the elements are sorted in ascending order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
toSorted(compareFn?: (a: bigint, b: bigint) => number | bigint): BigUint64Array;
with(index: number, value: number): BigUint64Array;
}
// NOTE(bartlomieju): taken from https://github.com/microsoft/TypeScript/issues/50803#issuecomment-1249030430 // NOTE(bartlomieju): taken from https://github.com/microsoft/TypeScript/issues/50803#issuecomment-1249030430
// while we wait for these types to officially ship // while we wait for these types to officially ship
interface ArrayConstructor { interface ArrayConstructor {

View file

@ -88,18 +88,18 @@ interface DisposableStack {
* constructor() { * constructor() {
* // stack will be disposed when exiting constructor for any reason * // stack will be disposed when exiting constructor for any reason
* using stack = new DisposableStack(); * using stack = new DisposableStack();
* *
* // get first resource * // get first resource
* this.#res1 = stack.use(getResource1()); * this.#res1 = stack.use(getResource1());
* *
* // get second resource. If this fails, both `stack` and `#res1` will be disposed. * // get second resource. If this fails, both `stack` and `#res1` will be disposed.
* this.#res2 = stack.use(getResource2()); * this.#res2 = stack.use(getResource2());
* *
* // all operations succeeded, move resources out of `stack` so that they aren't disposed * // all operations succeeded, move resources out of `stack` so that they aren't disposed
* // when constructor exits * // when constructor exits
* this.#disposables = stack.move(); * this.#disposables = stack.move();
* } * }
* *
* [Symbol.dispose]() { * [Symbol.dispose]() {
* this.#disposables.dispose(); * this.#disposables.dispose();
* } * }
@ -112,7 +112,7 @@ interface DisposableStack {
} }
interface DisposableStackConstructor { interface DisposableStackConstructor {
new(): DisposableStack; new (): DisposableStack;
readonly prototype: DisposableStack; readonly prototype: DisposableStack;
} }
declare var DisposableStack: DisposableStackConstructor; declare var DisposableStack: DisposableStackConstructor;
@ -155,18 +155,18 @@ interface AsyncDisposableStack {
* constructor() { * constructor() {
* // stack will be disposed when exiting constructor for any reason * // stack will be disposed when exiting constructor for any reason
* using stack = new DisposableStack(); * using stack = new DisposableStack();
* *
* // get first resource * // get first resource
* this.#res1 = stack.use(getResource1()); * this.#res1 = stack.use(getResource1());
* *
* // get second resource. If this fails, both `stack` and `#res1` will be disposed. * // get second resource. If this fails, both `stack` and `#res1` will be disposed.
* this.#res2 = stack.use(getResource2()); * this.#res2 = stack.use(getResource2());
* *
* // all operations succeeded, move resources out of `stack` so that they aren't disposed * // all operations succeeded, move resources out of `stack` so that they aren't disposed
* // when constructor exits * // when constructor exits
* this.#disposables = stack.move(); * this.#disposables = stack.move();
* } * }
* *
* [Symbol.dispose]() { * [Symbol.dispose]() {
* this.#disposables.dispose(); * this.#disposables.dispose();
* } * }
@ -179,7 +179,7 @@ interface AsyncDisposableStack {
} }
interface AsyncDisposableStackConstructor { interface AsyncDisposableStackConstructor {
new(): AsyncDisposableStack; new (): AsyncDisposableStack;
readonly prototype: AsyncDisposableStack; readonly prototype: AsyncDisposableStack;
} }
declare var AsyncDisposableStack: AsyncDisposableStackConstructor; declare var AsyncDisposableStack: AsyncDisposableStackConstructor;

View file

@ -20,4 +20,4 @@ and limitations under the License.
/// <reference lib="dom" /> /// <reference lib="dom" />
/// <reference lib="webworker.importscripts" /> /// <reference lib="webworker.importscripts" />
/// <reference lib="scripthost" /> /// <reference lib="scripthost" />
/// <reference lib="dom.iterable" /> /// <reference lib="dom.iterable" />

View file

@ -17,12 +17,12 @@ and limitations under the License.
/// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
declare namespace Intl { declare namespace Intl {
interface NumberRangeFormatPart extends NumberFormatPart { interface NumberRangeFormatPart extends NumberFormatPart {
source: "startRange" | "endRange" | "shared" source: "startRange" | "endRange" | "shared";
} }
interface NumberFormat { interface NumberFormat {
formatRange(start: number | bigint, end: number | bigint): string; formatRange(start: number | bigint, end: number | bigint): string;
formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[]; formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[];
} }
} }

View file

@ -16,13 +16,10 @@ and limitations under the License.
/// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
///////////////////////////// /////////////////////////////
/// Windows Script Host APIS /// Windows Script Host APIS
///////////////////////////// /////////////////////////////
interface ActiveXObject { interface ActiveXObject {
new (s: string): any; new (s: string): any;
} }
@ -262,7 +259,7 @@ interface Enumerator<T = any> {
interface EnumeratorConstructor { interface EnumeratorConstructor {
new <T = any>(safearray: SafeArray<T>): Enumerator<T>; new <T = any>(safearray: SafeArray<T>): Enumerator<T>;
new <T = any>(collection: { Item(index: any): T }): Enumerator<T>; new <T = any>(collection: { Item(index: any): T; }): Enumerator<T>;
new <T = any>(collection: any): Enumerator<T>; new <T = any>(collection: any): Enumerator<T>;
} }

View file

@ -2628,7 +2628,7 @@ interface EventTarget {
*/ */
addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void; addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void;
/** /**
* Dispatches a synthetic event to event target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
* *
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
*/ */
@ -5340,7 +5340,9 @@ interface SubtleCrypto {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>; exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>; exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
exportKey(format: KeyFormat, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
generateKey(algorithm: "Ed25519", extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>; generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>; generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
@ -9098,7 +9100,7 @@ declare function close(): void;
declare function postMessage(message: any, transfer: Transferable[]): void; declare function postMessage(message: any, transfer: Transferable[]): void;
declare function postMessage(message: any, options?: StructuredSerializeOptions): void; declare function postMessage(message: any, options?: StructuredSerializeOptions): void;
/** /**
* Dispatches a synthetic event to event target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
* *
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
*/ */
@ -9138,7 +9140,7 @@ declare var self: WorkerGlobalScope & typeof globalThis;
*/ */
declare function importScripts(...urls: (string | URL)[]): void; declare function importScripts(...urls: (string | URL)[]): void;
/** /**
* Dispatches a synthetic event to event target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
* *
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
*/ */

View file

@ -16,7 +16,6 @@ and limitations under the License.
/// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
///////////////////////////// /////////////////////////////
/// WorkerGlobalScope APIs /// WorkerGlobalScope APIs
///////////////////////////// /////////////////////////////

File diff suppressed because it is too large Load diff