Changeset e29cc2e for trip-planner-front/node_modules/p-limit/index.d.ts
- Timestamp:
- 11/25/21 22:08:24 (3 years ago)
- Branches:
- master
- Children:
- 8d391a1
- Parents:
- 59329aa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/node_modules/p-limit/index.d.ts
r59329aa re29cc2e 1 declare namespace pLimit { 2 interface Limit { 3 /** 4 The number of promises that are currently running. 5 */ 6 readonly activeCount: number; 1 export interface Limit { 2 /** 3 @param fn - Promise-returning/async function. 4 @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions. 5 @returns The promise returned by calling `fn(...arguments)`. 6 */ 7 <Arguments extends unknown[], ReturnType>( 8 fn: (...arguments: Arguments) => PromiseLike<ReturnType> | ReturnType, 9 ...arguments: Arguments 10 ): Promise<ReturnType>; 7 11 8 9 The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).10 11 readonly pendingCount: number;12 /** 13 The number of promises that are currently running. 14 */ 15 readonly activeCount: number; 12 16 13 /** 14 Discard pending promises that are waiting to run. 17 /** 18 The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). 19 */ 20 readonly pendingCount: number; 15 21 16 This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. 22 /** 23 Discard pending promises that are waiting to run. 17 24 18 Note: This does not cancel promises that are already running. 19 */ 20 clearQueue: () => void; 25 This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. 21 26 22 /** 23 @param fn - Promise-returning/async function. 24 @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions. 25 @returns The promise returned by calling `fn(...arguments)`. 26 */ 27 <Arguments extends unknown[], ReturnType>( 28 fn: (...arguments: Arguments) => PromiseLike<ReturnType> | ReturnType, 29 ...arguments: Arguments 30 ): Promise<ReturnType>; 31 } 27 Note: This does not cancel promises that are already running. 28 */ 29 clearQueue(): void; 32 30 } 33 31 … … 38 36 @returns A `limit` function. 39 37 */ 40 declare function pLimit(concurrency: number): pLimit.Limit; 41 42 export = pLimit; 38 export default function pLimit(concurrency: number): Limit;
Note:
See TracChangeset
for help on using the changeset viewer.