@types/async 3.2.24 → 3.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- async/README.md +1 -1
- async/index.d.ts +41 -23
- async/package.json +4 -3
async/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for async (https://github.com/caolan/asyn
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/async.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated: Wed,
|
|
11
|
+
* Last updated: Wed, 09 Sep 2026 17:32:37 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
|
|
14
14
|
# Credits
|
async/index.d.ts
CHANGED
|
@@ -125,26 +125,30 @@ export interface QueueObject<T> {
|
|
|
125
125
|
* Instead of a single task, a tasks array can be submitted.
|
|
126
126
|
* The respective callback is used for every task in the list.
|
|
127
127
|
*/
|
|
128
|
-
push<R>(task: T
|
|
128
|
+
push<R>(task: T): Promise<R>;
|
|
129
|
+
push<R>(task: T[]): Promise<R>[] | undefined;
|
|
129
130
|
push<R, E = Error>(task: T | T[], callback: AsyncResultCallback<R, E>): void;
|
|
130
131
|
|
|
131
132
|
/**
|
|
132
133
|
* Add a new task to the front of the queue
|
|
133
134
|
*/
|
|
134
|
-
unshift<R>(task: T
|
|
135
|
+
unshift<R>(task: T): Promise<R>;
|
|
136
|
+
unshift<R>(task: T[]): Promise<R>[] | undefined;
|
|
135
137
|
unshift<R, E = Error>(task: T | T[], callback: AsyncResultCallback<R, E>): void;
|
|
136
138
|
|
|
137
139
|
/**
|
|
138
140
|
* The same as `q.push`, except this returns a promise that rejects if an error occurs.
|
|
139
141
|
* The `callback` arg is ignored
|
|
140
142
|
*/
|
|
141
|
-
pushAsync<R>(task: T
|
|
143
|
+
pushAsync<R>(task: T): Promise<R>;
|
|
144
|
+
pushAsync<R>(task: T[]): Promise<R>[] | undefined;
|
|
142
145
|
|
|
143
146
|
/**
|
|
144
147
|
* The same as `q.unshift`, except this returns a promise that rejects if an error occurs.
|
|
145
148
|
* The `callback` arg is ignored
|
|
146
149
|
*/
|
|
147
|
-
unshiftAsync<R>(task: T
|
|
150
|
+
unshiftAsync<R>(task: T): Promise<R>;
|
|
151
|
+
unshiftAsync<R>(task: T[]): Promise<R>[] | undefined;
|
|
148
152
|
|
|
149
153
|
/**
|
|
150
154
|
* Remove items from the queue that match a test function.
|
|
@@ -239,7 +243,8 @@ export interface QueueObject<T> {
|
|
|
239
243
|
*/
|
|
240
244
|
// FIXME: can not use Omit due to ts version restriction. Replace Pick with Omit, when ts 3.5+ will be allowed
|
|
241
245
|
export interface AsyncPriorityQueue<T> extends Pick<QueueObject<T>, Exclude<keyof QueueObject<T>, "push" | "unshift">> {
|
|
242
|
-
push<R>(task: T
|
|
246
|
+
push<R>(task: T, priority?: number): Promise<R>;
|
|
247
|
+
push<R>(task: T[], priority?: number): undefined | Promise<R>[];
|
|
243
248
|
push<R, E = Error>(task: T | T[], priority: number, callback: AsyncResultCallback<R, E>): void;
|
|
244
249
|
}
|
|
245
250
|
|
|
@@ -431,8 +436,13 @@ export function someLimit<T, E = Error>(
|
|
|
431
436
|
arr: IterableCollection<T>,
|
|
432
437
|
limit: number,
|
|
433
438
|
iterator: AsyncBooleanIterator<T, E>,
|
|
434
|
-
callback
|
|
439
|
+
callback: AsyncBooleanResultCallback<E>,
|
|
435
440
|
): void;
|
|
441
|
+
export function someLimit<T, E = Error>(
|
|
442
|
+
arr: IterableCollection<T>,
|
|
443
|
+
limit: number,
|
|
444
|
+
iterator: AsyncBooleanIterator<T, E>,
|
|
445
|
+
): Promise<boolean>;
|
|
436
446
|
export const any: typeof some;
|
|
437
447
|
export const anySeries: typeof someSeries;
|
|
438
448
|
export const anyLimit: typeof someLimit;
|
|
@@ -576,16 +586,6 @@ export function doUntil<T, R, E = Error>(
|
|
|
576
586
|
test: (/* ...results: T[], */ cb: AsyncBooleanResultCallback) => void,
|
|
577
587
|
): Promise<R>;
|
|
578
588
|
|
|
579
|
-
export function during<E = Error>(
|
|
580
|
-
test: (testCallback: AsyncBooleanResultCallback<E>) => void,
|
|
581
|
-
fn: AsyncVoidFunction<E>,
|
|
582
|
-
callback: ErrorCallback<E>,
|
|
583
|
-
): void;
|
|
584
|
-
export function doDuring<E = Error>(
|
|
585
|
-
fn: AsyncVoidFunction<E>,
|
|
586
|
-
test: (testCallback: AsyncBooleanResultCallback<E>) => void,
|
|
587
|
-
callback: ErrorCallback<E>,
|
|
588
|
-
): void;
|
|
589
589
|
export function forever<E = Error>(next: (next: ErrorCallback<E>) => void, errBack: ErrorCallback<E>): void;
|
|
590
590
|
export function waterfall<T>(tasks: Function[]): Promise<T>;
|
|
591
591
|
export function waterfall<T, E = Error>(tasks: Function[], callback: AsyncResultCallback<T, E>): void;
|
|
@@ -615,7 +615,8 @@ export function auto<R extends Dictionary<any>, E = Error>(
|
|
|
615
615
|
tasks: AsyncAutoTasks<R, E>,
|
|
616
616
|
callback: AsyncResultCallback<R, E>,
|
|
617
617
|
): void;
|
|
618
|
-
export function autoInject<E = Error>(tasks: any, callback
|
|
618
|
+
export function autoInject<E = Error>(tasks: any, callback: AsyncResultCallback<any, E>): void;
|
|
619
|
+
export function autoInject(tasks: any): Promise<any>;
|
|
619
620
|
|
|
620
621
|
export interface RetryOptions<E> {
|
|
621
622
|
times?: number | undefined;
|
|
@@ -688,29 +689,46 @@ export function timesLimit<T, E = Error>(
|
|
|
688
689
|
export function transform<T, R, E = Error>(
|
|
689
690
|
arr: T[],
|
|
690
691
|
iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void,
|
|
691
|
-
callback
|
|
692
|
+
callback: AsyncResultArrayCallback<T, E>,
|
|
692
693
|
): void;
|
|
694
|
+
export function transform<T, R, E = Error>(
|
|
695
|
+
arr: T[],
|
|
696
|
+
iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void,
|
|
697
|
+
): Promise<Array<T | undefined>>;
|
|
693
698
|
export function transform<T, R, E = Error>(
|
|
694
699
|
arr: T[],
|
|
695
700
|
acc: R[],
|
|
696
701
|
iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void,
|
|
697
|
-
callback
|
|
702
|
+
callback: AsyncResultArrayCallback<T, E>,
|
|
698
703
|
): void;
|
|
699
|
-
|
|
704
|
+
export function transform<T, R, E = Error>(
|
|
705
|
+
arr: T[],
|
|
706
|
+
acc: R[],
|
|
707
|
+
iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void,
|
|
708
|
+
): Promise<Array<T | undefined>>;
|
|
700
709
|
export function transform<T, R, E = Error>(
|
|
701
710
|
arr: { [key: string]: T },
|
|
702
711
|
iteratee: (acc: { [key: string]: R }, item: T, key: string, callback: (error?: E) => void) => void,
|
|
703
|
-
callback
|
|
712
|
+
callback: AsyncResultObjectCallback<T, E>,
|
|
704
713
|
): void;
|
|
705
|
-
|
|
714
|
+
export function transform<T, R, E = Error>(
|
|
715
|
+
arr: { [key: string]: T },
|
|
716
|
+
iteratee: (acc: { [key: string]: R }, item: T, key: string, callback: (error?: E) => void) => void,
|
|
717
|
+
): Promise<Dictionary<T | undefined>>;
|
|
706
718
|
export function transform<T, R, E = Error>(
|
|
707
719
|
arr: { [key: string]: T },
|
|
708
720
|
acc: { [key: string]: R },
|
|
709
721
|
iteratee: (acc: { [key: string]: R }, item: T, key: string, callback: (error?: E) => void) => void,
|
|
710
|
-
callback
|
|
722
|
+
callback: AsyncResultObjectCallback<T, E>,
|
|
711
723
|
): void;
|
|
724
|
+
export function transform<T, R, E = Error>(
|
|
725
|
+
arr: { [key: string]: T },
|
|
726
|
+
acc: { [key: string]: R },
|
|
727
|
+
iteratee: (acc: { [key: string]: R }, item: T, key: string, callback: (error?: E) => void) => void,
|
|
728
|
+
): Promise<Dictionary<T | undefined>>;
|
|
712
729
|
|
|
713
730
|
export function race<T, E = Error>(tasks: Array<AsyncFunction<T, E>>, callback: AsyncResultCallback<T, E>): void;
|
|
731
|
+
export function race<T, E = Error>(tasks: Array<AsyncFunction<T, E>>): Promise<T>;
|
|
714
732
|
|
|
715
733
|
export function tryEach<T, E = Error>(
|
|
716
734
|
tasks: IterableCollection<AsyncFunction<T>>,
|
async/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/async",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.26",
|
|
4
4
|
"description": "TypeScript definitions for async",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/async",
|
|
6
6
|
"license": "MIT",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"scripts": {},
|
|
57
57
|
"dependencies": {},
|
|
58
|
-
"
|
|
59
|
-
"
|
|
58
|
+
"peerDependencies": {},
|
|
59
|
+
"typesPublisherContentHash": "dec5da0bd45e207433d691e0700576c19c19470ddc6dbf0ff0432ad0426fb154",
|
|
60
|
+
"typeScriptVersion": "5.6"
|
|
60
61
|
}
|