Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/lib/esnext.array.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ interface ArrayConstructor {
/**
* Creates an array from an async iterator or iterable object.
* @param iterableOrArrayLike An async iterator or array-like object to convert to an array.
* @returns A Promise that resolves to an array of the values from the async iterable.
*/
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;

Expand All @@ -12,6 +13,7 @@ interface ArrayConstructor {
* @param mapfn A mapping function to call on every element of itarableOrArrayLike.
* Each return value is awaited before being added to result array.
* @param thisArg Value of 'this' used when executing mapfn.
* @returns A Promise that resolves to an array of mapped values from the async iterable.
*/
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
}
8 changes: 8 additions & 0 deletions src/lib/esnext.collection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ interface Map<K, V> {
/**
* Returns a specified element from the Map object.
* If no element is associated with the specified key, a new element with the value `defaultValue` will be inserted into the Map and returned.
* @param key The key of the element to return.
* @param defaultValue The value to insert if no element exists for the given key.
* @returns The element associated with the specified key, which will be `defaultValue` if no element previously existed.
*/
getOrInsert(key: K, defaultValue: V): V;
/**
* Returns a specified element from the Map object.
* If no element is associated with the specified key, the result of passing the specified key to the `callback` function will be inserted into the Map and returned.
* @param key The key of the element to return.
* @param callback A function that produces the value to insert if no element exists for the given key.
* @returns The element associated with the specific key, which will be the newly computed value if no element previously existed.
*/
getOrInsertComputed(key: K, callback: (key: K) => V): V;
Expand All @@ -19,12 +23,16 @@ interface WeakMap<K extends WeakKey, V> {
/**
* Returns a specified element from the WeakMap object.
* If no element is associated with the specified key, a new element with the value `defaultValue` will be inserted into the WeakMap and returned.
* @param key The key of the element to return.
* @param defaultValue The value to insert if no element exists for the given key.
* @returns The element associated with the specified key, which will be `defaultValue` if no element previously existed.
*/
getOrInsert(key: K, defaultValue: V): V;
/**
* Returns a specified element from the WeakMap object.
* If no element is associated with the specified key, the result of passing the specified key to the `callback` function will be inserted into the WeakMap and returned.
* @param key The key of the element to return.
* @param callback A function that produces the value to insert if no element exists for the given key.
* @returns The element associated with the specific key, which will be the newly computed value if no element previously existed.
*/
getOrInsertComputed(key: K, callback: (key: K) => V): V;
Expand Down
4 changes: 4 additions & 0 deletions src/lib/esnext.date.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/// <reference lib="esnext.temporal" />

interface Date {
/**
* Converts a Date object to a Temporal.Instant object.
* @returns A Temporal.Instant representing the same instant as this Date.
*/
toTemporalInstant(): Temporal.Instant;
}
2 changes: 2 additions & 0 deletions src/lib/esnext.error.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
interface ErrorConstructor {
/**
* Indicates whether the argument provided is a built-in Error instance or not.
* @param error The value to check.
* @returns `true` if the argument is a built-in Error instance, otherwise `false`.
*/
isError(error: unknown): error is Error;
}
1 change: 1 addition & 0 deletions src/lib/esnext.sharedmemory.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ interface Atomics {
/**
* Performs a finite-time microwait by signaling to the operating system or
* CPU that the current executing code is in a spin-wait loop.
* @param n The number of times the pause hint should be issued. If omitted, a platform-defined default is used.
*/
pause(n?: number): void;
}
1 change: 1 addition & 0 deletions src/lib/esnext.typedarrays.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ interface Uint8ArrayConstructor {

/**
* Creates a new `Uint8Array` from a base16-encoded string.
* @param string The base16-encoded string.
* @returns A new `Uint8Array` instance.
*/
fromHex(
Expand Down