mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-13 18:14:48 -05:00
Update library types
This commit is contained in:
8
src/lib/es2015.collection.d.ts
vendored
8
src/lib/es2015.collection.d.ts
vendored
@@ -7,7 +7,7 @@ interface Map<K, V> {
|
||||
/**
|
||||
* Executes a provided function once per each key/value pair in the Map, in insertion order.
|
||||
*/
|
||||
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
|
||||
forEach(/** @immediate */ callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
|
||||
/**
|
||||
* Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.
|
||||
* @returns Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
|
||||
@@ -35,7 +35,7 @@ interface MapConstructor {
|
||||
declare var Map: MapConstructor;
|
||||
|
||||
interface ReadonlyMap<K, V> {
|
||||
forEach(callbackfn: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: any): void;
|
||||
forEach(/** @immediate */ callbackfn: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: any): void;
|
||||
get(key: K): V | undefined;
|
||||
has(key: K): boolean;
|
||||
readonly size: number;
|
||||
@@ -83,7 +83,7 @@ interface Set<T> {
|
||||
/**
|
||||
* Executes a provided function once per each value in the Set object, in insertion order.
|
||||
*/
|
||||
forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
|
||||
forEach(/** @immediate */ callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
|
||||
/**
|
||||
* @returns a boolean indicating whether an element with the specified value exists in the Set or not.
|
||||
*/
|
||||
@@ -101,7 +101,7 @@ interface SetConstructor {
|
||||
declare var Set: SetConstructor;
|
||||
|
||||
interface ReadonlySet<T> {
|
||||
forEach(callbackfn: (value: T, value2: T, set: ReadonlySet<T>) => void, thisArg?: any): void;
|
||||
forEach(/** @immediate */ callbackfn: (value: T, value2: T, set: ReadonlySet<T>) => void, thisArg?: any): void;
|
||||
has(value: T): boolean;
|
||||
readonly size: number;
|
||||
}
|
||||
|
||||
14
src/lib/es2015.core.d.ts
vendored
14
src/lib/es2015.core.d.ts
vendored
@@ -8,8 +8,8 @@ interface Array<T> {
|
||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
find<S extends T>(predicate: (value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined;
|
||||
find(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T | undefined;
|
||||
find<S extends T>(/** @immediate */ predicate: (value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined;
|
||||
find(/** @immediate */ predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T | undefined;
|
||||
|
||||
/**
|
||||
* Returns the index of the first element in the array where predicate is true, and -1
|
||||
@@ -20,7 +20,7 @@ interface Array<T> {
|
||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findIndex(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number;
|
||||
findIndex(/** @immediate */ predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number;
|
||||
|
||||
/**
|
||||
* Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
|
||||
@@ -59,7 +59,7 @@ interface ArrayConstructor {
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
||||
from<T, U>(arrayLike: ArrayLike<T>, /** @immediate */ mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
||||
|
||||
/**
|
||||
* Returns a new array from a set of elements.
|
||||
@@ -331,8 +331,8 @@ interface ReadonlyArray<T> {
|
||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
find<S extends T>(predicate: (value: T, index: number, obj: readonly T[]) => value is S, thisArg?: any): S | undefined;
|
||||
find(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): T | undefined;
|
||||
find<S extends T>(/** @immediate */ predicate: (value: T, index: number, obj: readonly T[]) => value is S, thisArg?: any): S | undefined;
|
||||
find(/** @immediate */ predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): T | undefined;
|
||||
|
||||
/**
|
||||
* Returns the index of the first element in the array where predicate is true, and -1
|
||||
@@ -343,7 +343,7 @@ interface ReadonlyArray<T> {
|
||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findIndex(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): number;
|
||||
findIndex(/** @immediate */ predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): number;
|
||||
|
||||
toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
|
||||
}
|
||||
|
||||
20
src/lib/es2015.iterable.d.ts
vendored
20
src/lib/es2015.iterable.d.ts
vendored
@@ -88,7 +88,7 @@ interface ArrayConstructor {
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
||||
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, /** @immediate */ mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
||||
}
|
||||
|
||||
interface ReadonlyArray<T> {
|
||||
@@ -277,7 +277,7 @@ interface Int8ArrayConstructor {
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;
|
||||
from(arrayLike: Iterable<number>, /** @immediate */ mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;
|
||||
}
|
||||
|
||||
interface Uint8Array {
|
||||
@@ -305,7 +305,7 @@ interface Uint8ArrayConstructor {
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;
|
||||
from(arrayLike: Iterable<number>, /** @immediate */ mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;
|
||||
}
|
||||
|
||||
interface Uint8ClampedArray {
|
||||
@@ -335,7 +335,7 @@ interface Uint8ClampedArrayConstructor {
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;
|
||||
from(arrayLike: Iterable<number>, /** @immediate */ mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;
|
||||
}
|
||||
|
||||
interface Int16Array {
|
||||
@@ -365,7 +365,7 @@ interface Int16ArrayConstructor {
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;
|
||||
from(arrayLike: Iterable<number>, /** @immediate */ mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;
|
||||
}
|
||||
|
||||
interface Uint16Array {
|
||||
@@ -393,7 +393,7 @@ interface Uint16ArrayConstructor {
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;
|
||||
from(arrayLike: Iterable<number>, /** @immediate */ mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;
|
||||
}
|
||||
|
||||
interface Int32Array {
|
||||
@@ -421,7 +421,7 @@ interface Int32ArrayConstructor {
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;
|
||||
from(arrayLike: Iterable<number>, /** @immediate */ mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;
|
||||
}
|
||||
|
||||
interface Uint32Array {
|
||||
@@ -449,7 +449,7 @@ interface Uint32ArrayConstructor {
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;
|
||||
from(arrayLike: Iterable<number>, /** @immediate */ mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;
|
||||
}
|
||||
|
||||
interface Float32Array {
|
||||
@@ -477,7 +477,7 @@ interface Float32ArrayConstructor {
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;
|
||||
from(arrayLike: Iterable<number>, /** @immediate */ mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;
|
||||
}
|
||||
|
||||
interface Float64Array {
|
||||
@@ -505,5 +505,5 @@ interface Float64ArrayConstructor {
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
|
||||
from(arrayLike: Iterable<number>, /** @immediate */ mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
|
||||
}
|
||||
|
||||
2
src/lib/es2018.promise.d.ts
vendored
2
src/lib/es2018.promise.d.ts
vendored
@@ -8,5 +8,5 @@ interface Promise<T> {
|
||||
* @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
|
||||
* @returns A Promise for the completion of the callback.
|
||||
*/
|
||||
finally(/** @deferred */ onfinally?: (() => void) | undefined | null): Promise<T>;
|
||||
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
|
||||
}
|
||||
|
||||
4
src/lib/es2019.array.d.ts
vendored
4
src/lib/es2019.array.d.ts
vendored
@@ -16,7 +16,7 @@ interface ReadonlyArray<T> {
|
||||
* thisArg is omitted, undefined is used as the this value.
|
||||
*/
|
||||
flatMap<U, This = undefined>(
|
||||
callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray<U>,
|
||||
/** @immediate */ callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray<U>,
|
||||
thisArg?: This,
|
||||
): U[];
|
||||
|
||||
@@ -44,7 +44,7 @@ interface Array<T> {
|
||||
* thisArg is omitted, undefined is used as the this value.
|
||||
*/
|
||||
flatMap<U, This = undefined>(
|
||||
callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray<U>,
|
||||
/** @immediate */ callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray<U>,
|
||||
thisArg?: This,
|
||||
): U[];
|
||||
|
||||
|
||||
52
src/lib/es2020.bigint.d.ts
vendored
52
src/lib/es2020.bigint.d.ts
vendored
@@ -163,7 +163,7 @@ interface BigInt64Array {
|
||||
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
||||
* If thisArg is omitted, undefined is used as the this value.
|
||||
*/
|
||||
every(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean;
|
||||
every(/** @immediate */ predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean;
|
||||
|
||||
/**
|
||||
* Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
|
||||
@@ -182,7 +182,7 @@ interface BigInt64Array {
|
||||
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
||||
* If thisArg is omitted, undefined is used as the this value.
|
||||
*/
|
||||
filter(predicate: (value: bigint, index: number, array: BigInt64Array) => any, thisArg?: any): BigInt64Array;
|
||||
filter(/** @immediate */ predicate: (value: bigint, index: number, array: BigInt64Array) => any, thisArg?: any): BigInt64Array;
|
||||
|
||||
/**
|
||||
* Returns the value of the first element in the array where predicate is true, and undefined
|
||||
@@ -193,7 +193,7 @@ interface BigInt64Array {
|
||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
find(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): bigint | undefined;
|
||||
find(/** @immediate */ predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): bigint | undefined;
|
||||
|
||||
/**
|
||||
* Returns the index of the first element in the array where predicate is true, and -1
|
||||
@@ -204,7 +204,7 @@ interface BigInt64Array {
|
||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findIndex(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): number;
|
||||
findIndex(/** @immediate */ predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): number;
|
||||
|
||||
/**
|
||||
* Performs the specified action for each element in an array.
|
||||
@@ -213,7 +213,7 @@ interface BigInt64Array {
|
||||
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
|
||||
* If thisArg is omitted, undefined is used as the this value.
|
||||
*/
|
||||
forEach(callbackfn: (value: bigint, index: number, array: BigInt64Array) => void, thisArg?: any): void;
|
||||
forEach(/** @immediate */ callbackfn: (value: bigint, index: number, array: BigInt64Array) => void, thisArg?: any): void;
|
||||
|
||||
/**
|
||||
* Determines whether an array includes a certain element, returning true or false as appropriate.
|
||||
@@ -259,7 +259,7 @@ interface BigInt64Array {
|
||||
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
|
||||
* If thisArg is omitted, undefined is used as the this value.
|
||||
*/
|
||||
map(callbackfn: (value: bigint, index: number, array: BigInt64Array) => bigint, thisArg?: any): BigInt64Array;
|
||||
map(/** @immediate */ callbackfn: (value: bigint, index: number, array: BigInt64Array) => bigint, thisArg?: any): BigInt64Array;
|
||||
|
||||
/**
|
||||
* Calls the specified callback function for all the elements in an array. The return value of
|
||||
@@ -271,7 +271,7 @@ interface BigInt64Array {
|
||||
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
||||
* instead of an array value.
|
||||
*/
|
||||
reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint;
|
||||
reduce(/** @immediate */ callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint;
|
||||
|
||||
/**
|
||||
* Calls the specified callback function for all the elements in an array. The return value of
|
||||
@@ -283,7 +283,7 @@ interface BigInt64Array {
|
||||
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
||||
* instead of an array value.
|
||||
*/
|
||||
reduce<U>(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U;
|
||||
reduce<U>(/** @immediate */ callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U;
|
||||
|
||||
/**
|
||||
* Calls the specified callback function for all the elements in an array, in descending order.
|
||||
@@ -295,7 +295,7 @@ interface BigInt64Array {
|
||||
* the accumulation. The first call to the callbackfn function provides this value as an
|
||||
* argument instead of an array value.
|
||||
*/
|
||||
reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint;
|
||||
reduceRight(/** @immediate */ callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint;
|
||||
|
||||
/**
|
||||
* Calls the specified callback function for all the elements in an array, in descending order.
|
||||
@@ -307,7 +307,7 @@ interface BigInt64Array {
|
||||
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
||||
* instead of an array value.
|
||||
*/
|
||||
reduceRight<U>(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U;
|
||||
reduceRight<U>(/** @immediate */ callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U;
|
||||
|
||||
/** Reverses the elements in the array. */
|
||||
reverse(): this;
|
||||
@@ -334,13 +334,13 @@ interface BigInt64Array {
|
||||
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
||||
* If thisArg is omitted, undefined is used as the this value.
|
||||
*/
|
||||
some(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean;
|
||||
some(/** @immediate */ predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean;
|
||||
|
||||
/**
|
||||
* Sorts the array.
|
||||
* @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order.
|
||||
*/
|
||||
sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this;
|
||||
sort(/** @immediate */ compareFn?: (a: bigint, b: bigint) => number | bigint): this;
|
||||
|
||||
/**
|
||||
* Gets a new BigInt64Array view of the ArrayBuffer store for this array, referencing the elements
|
||||
@@ -391,7 +391,7 @@ interface BigInt64ArrayConstructor {
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: ArrayLike<bigint>): BigInt64Array;
|
||||
from<U>(arrayLike: ArrayLike<U>, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigInt64Array;
|
||||
from<U>(arrayLike: ArrayLike<U>, /** @immediate */ mapfn: (v: U, k: number) => bigint, thisArg?: any): BigInt64Array;
|
||||
}
|
||||
|
||||
declare var BigInt64Array: BigInt64ArrayConstructor;
|
||||
@@ -435,7 +435,7 @@ interface BigUint64Array {
|
||||
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
||||
* If thisArg is omitted, undefined is used as the this value.
|
||||
*/
|
||||
every(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean;
|
||||
every(/** @immediate */ predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean;
|
||||
|
||||
/**
|
||||
* Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
|
||||
@@ -454,7 +454,7 @@ interface BigUint64Array {
|
||||
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
||||
* If thisArg is omitted, undefined is used as the this value.
|
||||
*/
|
||||
filter(predicate: (value: bigint, index: number, array: BigUint64Array) => any, thisArg?: any): BigUint64Array;
|
||||
filter(/** @immediate */ predicate: (value: bigint, index: number, array: BigUint64Array) => any, thisArg?: any): BigUint64Array;
|
||||
|
||||
/**
|
||||
* Returns the value of the first element in the array where predicate is true, and undefined
|
||||
@@ -465,7 +465,7 @@ interface BigUint64Array {
|
||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
find(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): bigint | undefined;
|
||||
find(/** @immediate */ predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): bigint | undefined;
|
||||
|
||||
/**
|
||||
* Returns the index of the first element in the array where predicate is true, and -1
|
||||
@@ -476,7 +476,7 @@ interface BigUint64Array {
|
||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findIndex(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): number;
|
||||
findIndex(/** @immediate */ predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): number;
|
||||
|
||||
/**
|
||||
* Performs the specified action for each element in an array.
|
||||
@@ -485,7 +485,7 @@ interface BigUint64Array {
|
||||
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
|
||||
* If thisArg is omitted, undefined is used as the this value.
|
||||
*/
|
||||
forEach(callbackfn: (value: bigint, index: number, array: BigUint64Array) => void, thisArg?: any): void;
|
||||
forEach(/** @immediate */ callbackfn: (value: bigint, index: number, array: BigUint64Array) => void, thisArg?: any): void;
|
||||
|
||||
/**
|
||||
* Determines whether an array includes a certain element, returning true or false as appropriate.
|
||||
@@ -531,7 +531,7 @@ interface BigUint64Array {
|
||||
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
|
||||
* If thisArg is omitted, undefined is used as the this value.
|
||||
*/
|
||||
map(callbackfn: (value: bigint, index: number, array: BigUint64Array) => bigint, thisArg?: any): BigUint64Array;
|
||||
map(/** @immediate */ callbackfn: (value: bigint, index: number, array: BigUint64Array) => bigint, thisArg?: any): BigUint64Array;
|
||||
|
||||
/**
|
||||
* Calls the specified callback function for all the elements in an array. The return value of
|
||||
@@ -543,7 +543,7 @@ interface BigUint64Array {
|
||||
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
||||
* instead of an array value.
|
||||
*/
|
||||
reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint;
|
||||
reduce(/** @immediate */ callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint;
|
||||
|
||||
/**
|
||||
* Calls the specified callback function for all the elements in an array. The return value of
|
||||
@@ -555,7 +555,7 @@ interface BigUint64Array {
|
||||
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
||||
* instead of an array value.
|
||||
*/
|
||||
reduce<U>(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U;
|
||||
reduce<U>(/** @immediate */ callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U;
|
||||
|
||||
/**
|
||||
* Calls the specified callback function for all the elements in an array, in descending order.
|
||||
@@ -567,7 +567,7 @@ interface BigUint64Array {
|
||||
* the accumulation. The first call to the callbackfn function provides this value as an
|
||||
* argument instead of an array value.
|
||||
*/
|
||||
reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint;
|
||||
reduceRight(/** @immediate */ callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint;
|
||||
|
||||
/**
|
||||
* Calls the specified callback function for all the elements in an array, in descending order.
|
||||
@@ -579,7 +579,7 @@ interface BigUint64Array {
|
||||
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
||||
* instead of an array value.
|
||||
*/
|
||||
reduceRight<U>(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U;
|
||||
reduceRight<U>(/** @immediate */ callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U;
|
||||
|
||||
/** Reverses the elements in the array. */
|
||||
reverse(): this;
|
||||
@@ -606,13 +606,13 @@ interface BigUint64Array {
|
||||
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
||||
* If thisArg is omitted, undefined is used as the this value.
|
||||
*/
|
||||
some(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean;
|
||||
some(/** @immediate */ predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean;
|
||||
|
||||
/**
|
||||
* Sorts the array.
|
||||
* @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order.
|
||||
*/
|
||||
sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this;
|
||||
sort(/** @immediate */ compareFn?: (a: bigint, b: bigint) => number | bigint): this;
|
||||
|
||||
/**
|
||||
* Gets a new BigUint64Array view of the ArrayBuffer store for this array, referencing the elements
|
||||
@@ -663,7 +663,7 @@ interface BigUint64ArrayConstructor {
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: ArrayLike<bigint>): BigUint64Array;
|
||||
from<U>(arrayLike: ArrayLike<U>, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigUint64Array;
|
||||
from<U>(arrayLike: ArrayLike<U>, /** @immediate */ mapfn: (v: U, k: number) => bigint, thisArg?: any): BigUint64Array;
|
||||
}
|
||||
|
||||
declare var BigUint64Array: BigUint64ArrayConstructor;
|
||||
|
||||
104
src/lib/es2023.array.d.ts
vendored
104
src/lib/es2023.array.d.ts
vendored
@@ -8,8 +8,8 @@ interface Array<T> {
|
||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLast<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S | undefined;
|
||||
findLast(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T | undefined;
|
||||
findLast<S extends T>(/** @immediate */ predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S | undefined;
|
||||
findLast(/** @immediate */ predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T | undefined;
|
||||
|
||||
/**
|
||||
* Returns the index of the last element in the array where predicate is true, and -1
|
||||
@@ -20,7 +20,7 @@ interface Array<T> {
|
||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLastIndex(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): number;
|
||||
findLastIndex(/** @immediate */ predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): number;
|
||||
|
||||
/**
|
||||
* Returns a copy of an array with its elements reversed.
|
||||
@@ -36,7 +36,7 @@ interface Array<T> {
|
||||
* [11, 2, 22, 1].toSorted((a, b) => a - b) // [1, 2, 11, 22]
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFn?: (a: T, b: T) => number): T[];
|
||||
toSorted(/** @immediate */ compareFn?: (a: T, b: T) => number): T[];
|
||||
|
||||
/**
|
||||
* Copies an array and removes elements and, if necessary, inserts new elements in their place. Returns the copied array.
|
||||
@@ -78,11 +78,11 @@ interface ReadonlyArray<T> {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLast<S extends T>(
|
||||
predicate: (value: T, index: number, array: readonly T[]) => value is S,
|
||||
/** @immediate */ predicate: (value: T, index: number, array: readonly T[]) => value is S,
|
||||
thisArg?: any,
|
||||
): S | undefined;
|
||||
findLast(
|
||||
predicate: (value: T, index: number, array: readonly T[]) => unknown,
|
||||
/** @immediate */ predicate: (value: T, index: number, array: readonly T[]) => unknown,
|
||||
thisArg?: any,
|
||||
): T | undefined;
|
||||
|
||||
@@ -96,7 +96,7 @@ interface ReadonlyArray<T> {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLastIndex(
|
||||
predicate: (value: T, index: number, array: readonly T[]) => unknown,
|
||||
/** @immediate */ predicate: (value: T, index: number, array: readonly T[]) => unknown,
|
||||
thisArg?: any,
|
||||
): number;
|
||||
|
||||
@@ -114,7 +114,7 @@ interface ReadonlyArray<T> {
|
||||
* [11, 2, 22, 1].toSorted((a, b) => a - b) // [1, 2, 11, 22]
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFn?: (a: T, b: T) => number): T[];
|
||||
toSorted(/** @immediate */ compareFn?: (a: T, b: T) => number): T[];
|
||||
|
||||
/**
|
||||
* Copies an array and removes elements while, if necessary, inserting new elements in their place, returning the remaining elements.
|
||||
@@ -156,7 +156,7 @@ interface Int8Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLast<S extends number>(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Int8Array,
|
||||
@@ -164,7 +164,7 @@ interface Int8Array {
|
||||
thisArg?: any,
|
||||
): S | undefined;
|
||||
findLast(
|
||||
predicate: (value: number, index: number, array: Int8Array) => unknown,
|
||||
/** @immediate */ predicate: (value: number, index: number, array: Int8Array) => unknown,
|
||||
thisArg?: any,
|
||||
): number | undefined;
|
||||
|
||||
@@ -178,7 +178,7 @@ interface Int8Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLastIndex(
|
||||
predicate: (value: number, index: number, array: Int8Array) => unknown,
|
||||
/** @immediate */ predicate: (value: number, index: number, array: Int8Array) => unknown,
|
||||
thisArg?: any,
|
||||
): number;
|
||||
|
||||
@@ -197,7 +197,7 @@ interface Int8Array {
|
||||
* myNums.toSorted((a, b) => a - b) // Int8Array(4) [1, 2, 11, 22]
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFn?: (a: number, b: number) => number): Int8Array;
|
||||
toSorted(/** @immediate */ compareFn?: (a: number, b: number) => number): Int8Array;
|
||||
|
||||
/**
|
||||
* Copies the array and inserts the given number at the provided index.
|
||||
@@ -220,7 +220,7 @@ interface Uint8Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLast<S extends number>(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Uint8Array,
|
||||
@@ -228,7 +228,7 @@ interface Uint8Array {
|
||||
thisArg?: any,
|
||||
): S | undefined;
|
||||
findLast(
|
||||
predicate: (value: number, index: number, array: Uint8Array) => unknown,
|
||||
/** @immediate */ predicate: (value: number, index: number, array: Uint8Array) => unknown,
|
||||
thisArg?: any,
|
||||
): number | undefined;
|
||||
|
||||
@@ -242,7 +242,7 @@ interface Uint8Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLastIndex(
|
||||
predicate: (value: number, index: number, array: Uint8Array) => unknown,
|
||||
/** @immediate */ predicate: (value: number, index: number, array: Uint8Array) => unknown,
|
||||
thisArg?: any,
|
||||
): number;
|
||||
|
||||
@@ -261,7 +261,7 @@ interface Uint8Array {
|
||||
* myNums.toSorted((a, b) => a - b) // Uint8Array(4) [1, 2, 11, 22]
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFn?: (a: number, b: number) => number): Uint8Array;
|
||||
toSorted(/** @immediate */ compareFn?: (a: number, b: number) => number): Uint8Array;
|
||||
|
||||
/**
|
||||
* Copies the array and inserts the given number at the provided index.
|
||||
@@ -284,7 +284,7 @@ interface Uint8ClampedArray {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLast<S extends number>(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Uint8ClampedArray,
|
||||
@@ -292,7 +292,7 @@ interface Uint8ClampedArray {
|
||||
thisArg?: any,
|
||||
): S | undefined;
|
||||
findLast(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Uint8ClampedArray,
|
||||
@@ -310,7 +310,7 @@ interface Uint8ClampedArray {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLastIndex(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Uint8ClampedArray,
|
||||
@@ -333,7 +333,7 @@ interface Uint8ClampedArray {
|
||||
* myNums.toSorted((a, b) => a - b) // Uint8ClampedArray(4) [1, 2, 11, 22]
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFn?: (a: number, b: number) => number): Uint8ClampedArray;
|
||||
toSorted(/** @immediate */ compareFn?: (a: number, b: number) => number): Uint8ClampedArray;
|
||||
|
||||
/**
|
||||
* Copies the array and inserts the given number at the provided index.
|
||||
@@ -356,7 +356,7 @@ interface Int16Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLast<S extends number>(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Int16Array,
|
||||
@@ -364,7 +364,7 @@ interface Int16Array {
|
||||
thisArg?: any,
|
||||
): S | undefined;
|
||||
findLast(
|
||||
predicate: (value: number, index: number, array: Int16Array) => unknown,
|
||||
/** @immediate */ predicate: (value: number, index: number, array: Int16Array) => unknown,
|
||||
thisArg?: any,
|
||||
): number | undefined;
|
||||
|
||||
@@ -378,7 +378,7 @@ interface Int16Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLastIndex(
|
||||
predicate: (value: number, index: number, array: Int16Array) => unknown,
|
||||
/** @immediate */ predicate: (value: number, index: number, array: Int16Array) => unknown,
|
||||
thisArg?: any,
|
||||
): number;
|
||||
|
||||
@@ -397,7 +397,7 @@ interface Int16Array {
|
||||
* myNums.toSorted((a, b) => a - b) // Int16Array(4) [-22, 1, 2, 11]
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFn?: (a: number, b: number) => number): Int16Array;
|
||||
toSorted(/** @immediate */ compareFn?: (a: number, b: number) => number): Int16Array;
|
||||
|
||||
/**
|
||||
* Copies the array and inserts the given number at the provided index.
|
||||
@@ -420,7 +420,7 @@ interface Uint16Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLast<S extends number>(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Uint16Array,
|
||||
@@ -428,7 +428,7 @@ interface Uint16Array {
|
||||
thisArg?: any,
|
||||
): S | undefined;
|
||||
findLast(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Uint16Array,
|
||||
@@ -446,7 +446,7 @@ interface Uint16Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLastIndex(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Uint16Array,
|
||||
@@ -469,7 +469,7 @@ interface Uint16Array {
|
||||
* myNums.toSorted((a, b) => a - b) // Uint16Array(4) [1, 2, 11, 22]
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFn?: (a: number, b: number) => number): Uint16Array;
|
||||
toSorted(/** @immediate */ compareFn?: (a: number, b: number) => number): Uint16Array;
|
||||
|
||||
/**
|
||||
* Copies the array and inserts the given number at the provided index.
|
||||
@@ -492,7 +492,7 @@ interface Int32Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLast<S extends number>(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Int32Array,
|
||||
@@ -500,7 +500,7 @@ interface Int32Array {
|
||||
thisArg?: any,
|
||||
): S | undefined;
|
||||
findLast(
|
||||
predicate: (value: number, index: number, array: Int32Array) => unknown,
|
||||
/** @immediate */ predicate: (value: number, index: number, array: Int32Array) => unknown,
|
||||
thisArg?: any,
|
||||
): number | undefined;
|
||||
|
||||
@@ -514,7 +514,7 @@ interface Int32Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLastIndex(
|
||||
predicate: (value: number, index: number, array: Int32Array) => unknown,
|
||||
/** @immediate */ predicate: (value: number, index: number, array: Int32Array) => unknown,
|
||||
thisArg?: any,
|
||||
): number;
|
||||
|
||||
@@ -533,7 +533,7 @@ interface Int32Array {
|
||||
* myNums.toSorted((a, b) => a - b) // Int32Array(4) [-22, 1, 2, 11]
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFn?: (a: number, b: number) => number): Int32Array;
|
||||
toSorted(/** @immediate */ compareFn?: (a: number, b: number) => number): Int32Array;
|
||||
|
||||
/**
|
||||
* Copies the array and inserts the given number at the provided index.
|
||||
@@ -556,7 +556,7 @@ interface Uint32Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLast<S extends number>(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Uint32Array,
|
||||
@@ -564,7 +564,7 @@ interface Uint32Array {
|
||||
thisArg?: any,
|
||||
): S | undefined;
|
||||
findLast(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Uint32Array,
|
||||
@@ -582,7 +582,7 @@ interface Uint32Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLastIndex(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Uint32Array,
|
||||
@@ -605,7 +605,7 @@ interface Uint32Array {
|
||||
* myNums.toSorted((a, b) => a - b) // Uint32Array(4) [1, 2, 11, 22]
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFn?: (a: number, b: number) => number): Uint32Array;
|
||||
toSorted(/** @immediate */ compareFn?: (a: number, b: number) => number): Uint32Array;
|
||||
|
||||
/**
|
||||
* Copies the array and inserts the given number at the provided index.
|
||||
@@ -628,7 +628,7 @@ interface Float32Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLast<S extends number>(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Float32Array,
|
||||
@@ -636,7 +636,7 @@ interface Float32Array {
|
||||
thisArg?: any,
|
||||
): S | undefined;
|
||||
findLast(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Float32Array,
|
||||
@@ -654,7 +654,7 @@ interface Float32Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLastIndex(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Float32Array,
|
||||
@@ -677,7 +677,7 @@ interface Float32Array {
|
||||
* myNums.toSorted((a, b) => a - b) // Float32Array(4) [-22.5, 1, 2, 11.5]
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFn?: (a: number, b: number) => number): Float32Array;
|
||||
toSorted(/** @immediate */ compareFn?: (a: number, b: number) => number): Float32Array;
|
||||
|
||||
/**
|
||||
* Copies the array and inserts the given number at the provided index.
|
||||
@@ -700,7 +700,7 @@ interface Float64Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLast<S extends number>(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Float64Array,
|
||||
@@ -708,7 +708,7 @@ interface Float64Array {
|
||||
thisArg?: any,
|
||||
): S | undefined;
|
||||
findLast(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Float64Array,
|
||||
@@ -726,7 +726,7 @@ interface Float64Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLastIndex(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: number,
|
||||
index: number,
|
||||
array: Float64Array,
|
||||
@@ -749,7 +749,7 @@ interface Float64Array {
|
||||
* myNums.toSorted((a, b) => a - b) // Float64Array(4) [-22.5, 1, 2, 11.5]
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFn?: (a: number, b: number) => number): Float64Array;
|
||||
toSorted(/** @immediate */ compareFn?: (a: number, b: number) => number): Float64Array;
|
||||
|
||||
/**
|
||||
* Copies the array and inserts the given number at the provided index.
|
||||
@@ -772,7 +772,7 @@ interface BigInt64Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLast<S extends bigint>(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: bigint,
|
||||
index: number,
|
||||
array: BigInt64Array,
|
||||
@@ -780,7 +780,7 @@ interface BigInt64Array {
|
||||
thisArg?: any,
|
||||
): S | undefined;
|
||||
findLast(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: bigint,
|
||||
index: number,
|
||||
array: BigInt64Array,
|
||||
@@ -798,7 +798,7 @@ interface BigInt64Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLastIndex(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: bigint,
|
||||
index: number,
|
||||
array: BigInt64Array,
|
||||
@@ -821,7 +821,7 @@ interface BigInt64Array {
|
||||
* myNums.toSorted((a, b) => Number(a - b)) // BigInt64Array(4) [-22n, 1n, 2n, 11n]
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFn?: (a: bigint, b: bigint) => number): BigInt64Array;
|
||||
toSorted(/** @immediate */ compareFn?: (a: bigint, b: bigint) => number): BigInt64Array;
|
||||
|
||||
/**
|
||||
* Copies the array and inserts the given bigint at the provided index.
|
||||
@@ -844,7 +844,7 @@ interface BigUint64Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLast<S extends bigint>(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: bigint,
|
||||
index: number,
|
||||
array: BigUint64Array,
|
||||
@@ -852,7 +852,7 @@ interface BigUint64Array {
|
||||
thisArg?: any,
|
||||
): S | undefined;
|
||||
findLast(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: bigint,
|
||||
index: number,
|
||||
array: BigUint64Array,
|
||||
@@ -870,7 +870,7 @@ interface BigUint64Array {
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findLastIndex(
|
||||
predicate: (
|
||||
/** @immediate */ predicate: (
|
||||
value: bigint,
|
||||
index: number,
|
||||
array: BigUint64Array,
|
||||
@@ -893,7 +893,7 @@ interface BigUint64Array {
|
||||
* myNums.toSorted((a, b) => Number(a - b)) // BigUint64Array(4) [1n, 2n, 11n, 22n]
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFn?: (a: bigint, b: bigint) => number): BigUint64Array;
|
||||
toSorted(/** @immediate */ compareFn?: (a: bigint, b: bigint) => number): BigUint64Array;
|
||||
|
||||
/**
|
||||
* Copies the array and inserts the given bigint at the provided index.
|
||||
|
||||
336
src/lib/es5.d.ts
vendored
336
src/lib/es5.d.ts
vendored
File diff suppressed because it is too large
Load Diff
2
src/lib/esnext.array.d.ts
vendored
2
src/lib/esnext.array.d.ts
vendored
@@ -13,5 +13,5 @@ interface ArrayConstructor {
|
||||
* Each return value is awaited before being added to result array.
|
||||
* @param thisArg Value of 'this' used when executing mapfn.
|
||||
*/
|
||||
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
||||
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, /** @immediate */ mapFn: (value: Awaited<T>) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
||||
}
|
||||
|
||||
2
src/lib/esnext.collection.d.ts
vendored
2
src/lib/esnext.collection.d.ts
vendored
@@ -6,7 +6,7 @@ interface MapConstructor {
|
||||
*/
|
||||
groupBy<K, T>(
|
||||
items: Iterable<T>,
|
||||
keySelector: (item: T, index: number) => K,
|
||||
/** @immediate */ keySelector: (item: T, index: number) => K,
|
||||
): Map<K, T[]>;
|
||||
}
|
||||
|
||||
|
||||
24
src/lib/esnext.iterator.d.ts
vendored
24
src/lib/esnext.iterator.d.ts
vendored
@@ -29,19 +29,19 @@ declare global {
|
||||
* Creates an iterator whose values are the result of applying the callback to the values from this iterator.
|
||||
* @param callbackfn A function that accepts up to two arguments to be used to transform values from the underlying iterator.
|
||||
*/
|
||||
map<U>(callbackfn: (value: T, index: number) => U): IteratorObject<U, undefined, unknown>;
|
||||
map<U>(/** @immediate */ callbackfn: (value: T, index: number) => U): IteratorObject<U, undefined, unknown>;
|
||||
|
||||
/**
|
||||
* Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
|
||||
* @param predicate A function that accepts up to two arguments to be used to test values from the underlying iterator.
|
||||
*/
|
||||
filter<S extends T>(predicate: (value: T, index: number) => value is S): IteratorObject<S, undefined, unknown>;
|
||||
filter<S extends T>(/** @immediate */ predicate: (value: T, index: number) => value is S): IteratorObject<S, undefined, unknown>;
|
||||
|
||||
/**
|
||||
* Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
|
||||
* @param predicate A function that accepts up to two arguments to be used to test values from the underlying iterator.
|
||||
*/
|
||||
filter(predicate: (value: T, index: number) => unknown): IteratorObject<T, undefined, unknown>;
|
||||
filter(/** @immediate */ predicate: (value: T, index: number) => unknown): IteratorObject<T, undefined, unknown>;
|
||||
|
||||
/**
|
||||
* Creates an iterator whose values are the values from this iterator, stopping once the provided limit is reached.
|
||||
@@ -59,22 +59,22 @@ declare global {
|
||||
* Creates an iterator whose values are the result of applying the callback to the values from this iterator and then flattening the resulting iterators or iterables.
|
||||
* @param callback A function that accepts up to two arguments to be used to transform values from the underlying iterator into new iterators or iterables to be flattened into the result.
|
||||
*/
|
||||
flatMap<U>(callback: (value: T, index: number) => Iterator<U, unknown, undefined> | Iterable<U, unknown, undefined>): IteratorObject<U, undefined, unknown>;
|
||||
flatMap<U>(/** @immediate */ callback: (value: T, index: number) => Iterator<U, unknown, undefined> | Iterable<U, unknown, undefined>): IteratorObject<U, undefined, unknown>;
|
||||
|
||||
/**
|
||||
* Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
|
||||
* @param callbackfn A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the iterator.
|
||||
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of a value from the iterator.
|
||||
*/
|
||||
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T): T;
|
||||
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T, initialValue: T): T;
|
||||
reduce(/** @immediate */ callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T): T;
|
||||
reduce(/** @immediate */ callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T, initialValue: T): T;
|
||||
|
||||
/**
|
||||
* Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
|
||||
* @param callbackfn A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the iterator.
|
||||
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of a value from the iterator.
|
||||
*/
|
||||
reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U;
|
||||
reduce<U>(/** @immediate */ callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U;
|
||||
|
||||
/**
|
||||
* Creates a new array from the values yielded by this iterator.
|
||||
@@ -85,7 +85,7 @@ declare global {
|
||||
* Performs the specified action for each element in the iterator.
|
||||
* @param callbackfn A function that accepts up to two arguments. forEach calls the callbackfn function one time for each element in the iterator.
|
||||
*/
|
||||
forEach(callbackfn: (value: T, index: number) => void): void;
|
||||
forEach(/** @immediate */ callbackfn: (value: T, index: number) => void): void;
|
||||
|
||||
/**
|
||||
* Determines whether the specified callback function returns true for any element of this iterator.
|
||||
@@ -93,7 +93,7 @@ declare global {
|
||||
* the predicate function for each element in this iterator until the predicate returns a value
|
||||
* true, or until the end of the iterator.
|
||||
*/
|
||||
some(predicate: (value: T, index: number) => unknown): boolean;
|
||||
some(/** @immediate */ predicate: (value: T, index: number) => unknown): boolean;
|
||||
|
||||
/**
|
||||
* Determines whether all the members of this iterator satisfy the specified test.
|
||||
@@ -101,7 +101,7 @@ declare global {
|
||||
* the predicate function for each element in this iterator until the predicate returns
|
||||
* false, or until the end of this iterator.
|
||||
*/
|
||||
every(predicate: (value: T, index: number) => unknown): boolean;
|
||||
every(/** @immediate */ predicate: (value: T, index: number) => unknown): boolean;
|
||||
|
||||
/**
|
||||
* Returns the value of the first element in this iterator where predicate is true, and undefined
|
||||
@@ -110,8 +110,8 @@ declare global {
|
||||
* order, until it finds one where predicate returns true. If such an element is found, find
|
||||
* immediately returns that element value. Otherwise, find returns undefined.
|
||||
*/
|
||||
find<S extends T>(predicate: (value: T, index: number) => value is S): S | undefined;
|
||||
find(predicate: (value: T, index: number) => unknown): T | undefined;
|
||||
find<S extends T>(/** @immediate */ predicate: (value: T, index: number) => value is S): S | undefined;
|
||||
find(/** @immediate */ predicate: (value: T, index: number) => unknown): T | undefined;
|
||||
|
||||
readonly [Symbol.toStringTag]: string;
|
||||
}
|
||||
|
||||
2
src/lib/esnext.object.d.ts
vendored
2
src/lib/esnext.object.d.ts
vendored
@@ -6,6 +6,6 @@ interface ObjectConstructor {
|
||||
*/
|
||||
groupBy<K extends PropertyKey, T>(
|
||||
items: Iterable<T>,
|
||||
keySelector: (item: T, index: number) => K,
|
||||
/** @immediate */ keySelector: (item: T, index: number) => K,
|
||||
): Partial<Record<K, T[]>>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user