@types/async 2.0.49 → 2.4.2
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 +4 -4
- async/index.d.ts +248 -212
- async/package.json +11 -4
async/README.md
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
> `npm install --save @types/async`
|
|
3
3
|
|
|
4
4
|
# Summary
|
|
5
|
-
This package contains type definitions for Async (https://github.com/caolan/async).
|
|
5
|
+
This package contains type definitions for Async ( https://github.com/caolan/async ).
|
|
6
6
|
|
|
7
7
|
# Details
|
|
8
|
-
Files were exported from https://
|
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/async
|
|
9
9
|
|
|
10
10
|
Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Wed, 08 May 2019 18:19:21 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: async
|
|
14
14
|
|
|
15
15
|
# Credits
|
|
16
|
-
These definitions were written by Boris Yankov <https://github.com/borisyankov>, Arseniy Maximov <https://github.com/kern0>, Joe Herman <https://github.com/Penryn>, Angus Fenying <https://github.com/fenying>, Pascal Martin <https://github.com/pascalmartin>.
|
|
16
|
+
These definitions were written by Boris Yankov <https://github.com/borisyankov>, Arseniy Maximov <https://github.com/kern0>, Joe Herman <https://github.com/Penryn>, Angus Fenying <https://github.com/fenying>, Pascal Martin <https://github.com/pascalmartin>, Dmitri Trofimov <https://github.com/Dmitri1337>.
|
async/index.d.ts
CHANGED
|
@@ -1,212 +1,248 @@
|
|
|
1
|
-
// Type definitions for Async 2.
|
|
2
|
-
// Project: https://github.com/caolan/async
|
|
3
|
-
// Definitions by: Boris Yankov <https://github.com/borisyankov
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
export interface
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export interface
|
|
19
|
-
export interface
|
|
20
|
-
export interface
|
|
21
|
-
export interface
|
|
22
|
-
|
|
23
|
-
export interface
|
|
24
|
-
export interface
|
|
25
|
-
|
|
26
|
-
export interface
|
|
27
|
-
export interface
|
|
28
|
-
|
|
29
|
-
export
|
|
30
|
-
|
|
31
|
-
export interface
|
|
32
|
-
export interface
|
|
33
|
-
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
paused: boolean;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
export
|
|
108
|
-
export const
|
|
109
|
-
export function
|
|
110
|
-
export
|
|
111
|
-
export const
|
|
112
|
-
export
|
|
113
|
-
export function
|
|
114
|
-
export
|
|
115
|
-
export
|
|
116
|
-
export
|
|
117
|
-
export const
|
|
118
|
-
export
|
|
119
|
-
export
|
|
120
|
-
export const
|
|
121
|
-
export
|
|
122
|
-
|
|
123
|
-
export
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
export function
|
|
131
|
-
export const
|
|
132
|
-
export function
|
|
133
|
-
export const
|
|
134
|
-
export
|
|
135
|
-
export const
|
|
136
|
-
export
|
|
137
|
-
export
|
|
138
|
-
export const
|
|
139
|
-
export
|
|
140
|
-
export const
|
|
141
|
-
export
|
|
142
|
-
export const
|
|
143
|
-
export
|
|
144
|
-
export const
|
|
145
|
-
export
|
|
146
|
-
export
|
|
147
|
-
export const
|
|
148
|
-
export
|
|
149
|
-
|
|
150
|
-
export
|
|
151
|
-
export
|
|
152
|
-
export
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
export function
|
|
156
|
-
export
|
|
157
|
-
export
|
|
158
|
-
export
|
|
159
|
-
export function
|
|
160
|
-
export
|
|
161
|
-
export function
|
|
162
|
-
export
|
|
163
|
-
export
|
|
164
|
-
export
|
|
165
|
-
|
|
166
|
-
export function
|
|
167
|
-
export function
|
|
168
|
-
export
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
export function
|
|
172
|
-
export function
|
|
173
|
-
export function
|
|
174
|
-
export function
|
|
175
|
-
export function
|
|
176
|
-
export function
|
|
177
|
-
export function
|
|
178
|
-
export function
|
|
179
|
-
export function
|
|
180
|
-
export function
|
|
181
|
-
export function
|
|
182
|
-
export function
|
|
183
|
-
export function
|
|
184
|
-
export
|
|
185
|
-
|
|
186
|
-
export function
|
|
187
|
-
export function
|
|
188
|
-
|
|
189
|
-
export function
|
|
190
|
-
export function
|
|
191
|
-
|
|
192
|
-
export function
|
|
193
|
-
export function
|
|
194
|
-
export function
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
export function
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
export function
|
|
208
|
-
export function
|
|
209
|
-
export function
|
|
210
|
-
export
|
|
211
|
-
|
|
212
|
-
export function
|
|
1
|
+
// Type definitions for Async 2.4
|
|
2
|
+
// Project: https://github.com/caolan/async, https://caolan.github.io/async
|
|
3
|
+
// Definitions by: Boris Yankov <https://github.com/borisyankov>
|
|
4
|
+
// Arseniy Maximov <https://github.com/kern0>
|
|
5
|
+
// Joe Herman <https://github.com/Penryn>
|
|
6
|
+
// Angus Fenying <https://github.com/fenying>
|
|
7
|
+
// Pascal Martin <https://github.com/pascalmartin>
|
|
8
|
+
// Dmitri Trofimov <https://github.com/Dmitri1337>
|
|
9
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
10
|
+
// TypeScript Version: 2.3
|
|
11
|
+
|
|
12
|
+
export as namespace async;
|
|
13
|
+
|
|
14
|
+
export interface Dictionary<T> { [key: string]: T; }
|
|
15
|
+
export type IterableCollection<T> = T[] | IterableIterator<T> | Dictionary<T>;
|
|
16
|
+
|
|
17
|
+
export interface ErrorCallback<E = Error> { (err?: E | null): void; }
|
|
18
|
+
export interface AsyncBooleanResultCallback<E = Error> { (err?: E | null, truthValue?: boolean): void; }
|
|
19
|
+
export interface AsyncResultCallback<T, E = Error> { (err?: E | null, result?: T): void; }
|
|
20
|
+
export interface AsyncResultArrayCallback<T, E = Error> { (err?: E | null, results?: Array<T | undefined>): void; }
|
|
21
|
+
export interface AsyncResultObjectCallback<T, E = Error> { (err: E | undefined, results: Dictionary<T | undefined>): void; }
|
|
22
|
+
|
|
23
|
+
export interface AsyncFunction<T, E = Error> { (callback: (err?: E | null, result?: T) => void): void; }
|
|
24
|
+
export interface AsyncFunctionEx<T, E = Error> { (callback: (err?: E | null, ...results: T[]) => void): void; }
|
|
25
|
+
export interface AsyncIterator<T, E = Error> { (item: T, callback: ErrorCallback<E>): void; }
|
|
26
|
+
export interface AsyncForEachOfIterator<T, E = Error> { (item: T, key: number|string, callback: ErrorCallback<E>): void; }
|
|
27
|
+
export interface AsyncResultIterator<T, R, E = Error> { (item: T, callback: AsyncResultCallback<R, E>): void; }
|
|
28
|
+
export interface AsyncMemoIterator<T, R, E = Error> { (memo: R | undefined, item: T, callback: AsyncResultCallback<R, E>): void; }
|
|
29
|
+
export interface AsyncBooleanIterator<T, E = Error> { (item: T, callback: AsyncBooleanResultCallback<E>): void; }
|
|
30
|
+
|
|
31
|
+
export interface AsyncWorker<T, E = Error> { (task: T, callback: ErrorCallback<E>): void; }
|
|
32
|
+
export interface AsyncVoidFunction<E = Error> { (callback: ErrorCallback<E>): void; }
|
|
33
|
+
|
|
34
|
+
export type AsyncAutoTasks<R extends Dictionary<any>, E> = { [K in keyof R]: AsyncAutoTask<R[K], R, E> };
|
|
35
|
+
export type AsyncAutoTask<R1, R extends Dictionary<any>, E> = AsyncAutoTaskFunctionWithoutDependencies<R1, E> | Array<keyof R | AsyncAutoTaskFunction<R1, R, E>>;
|
|
36
|
+
export interface AsyncAutoTaskFunctionWithoutDependencies<R1, E = Error> { (cb: AsyncResultCallback<R1, E> | ErrorCallback<E>): void; }
|
|
37
|
+
export interface AsyncAutoTaskFunction<R1, R extends Dictionary<any>, E = Error> { (results: R, cb: AsyncResultCallback<R1, E> | ErrorCallback<E>): void; }
|
|
38
|
+
|
|
39
|
+
export interface DataContainer<T> {
|
|
40
|
+
data: T;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface CallbackContainer {
|
|
44
|
+
callback: Function;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface PriorityContainer {
|
|
48
|
+
priority: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface AsyncQueue<T> {
|
|
52
|
+
length(): number;
|
|
53
|
+
started: boolean;
|
|
54
|
+
running(): number;
|
|
55
|
+
idle(): boolean;
|
|
56
|
+
concurrency: number;
|
|
57
|
+
push<R, E = Error>(task: T | T[], callback?: AsyncResultCallback<R, E>): void;
|
|
58
|
+
unshift<E = Error>(task: T | T[], callback?: ErrorCallback<E>): void;
|
|
59
|
+
remove(filter: (node: DataContainer<T>) => boolean): void;
|
|
60
|
+
saturated: () => any;
|
|
61
|
+
empty: () => any;
|
|
62
|
+
drain: () => any;
|
|
63
|
+
paused: boolean;
|
|
64
|
+
pause(): void;
|
|
65
|
+
resume(): void;
|
|
66
|
+
kill(): void;
|
|
67
|
+
workersList<TWorker extends DataContainer<T>, CallbackContainer>(): TWorker[];
|
|
68
|
+
error(error: Error, data: any): void;
|
|
69
|
+
unsaturated(): void;
|
|
70
|
+
buffer: number;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface AsyncPriorityQueue<T> {
|
|
74
|
+
length(): number;
|
|
75
|
+
concurrency: number;
|
|
76
|
+
started: boolean;
|
|
77
|
+
paused: boolean;
|
|
78
|
+
push<R, E = Error>(task: T | T[], priority: number, callback?: AsyncResultArrayCallback<R, E>): void;
|
|
79
|
+
saturated: () => any;
|
|
80
|
+
empty: () => any;
|
|
81
|
+
drain: () => any;
|
|
82
|
+
running(): number;
|
|
83
|
+
idle(): boolean;
|
|
84
|
+
pause(): void;
|
|
85
|
+
resume(): void;
|
|
86
|
+
kill(): void;
|
|
87
|
+
workersList<TWorker extends DataContainer<T>, CallbackContainer, PriorityContainer>(): TWorker[];
|
|
88
|
+
error(error: Error, data: any): void;
|
|
89
|
+
unsaturated(): void;
|
|
90
|
+
buffer: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface AsyncCargo {
|
|
94
|
+
length(): number;
|
|
95
|
+
payload?: number;
|
|
96
|
+
push(task: any, callback?: Function): void;
|
|
97
|
+
saturated(): void;
|
|
98
|
+
empty(): void;
|
|
99
|
+
drain(): void;
|
|
100
|
+
idle(): boolean;
|
|
101
|
+
pause(): void;
|
|
102
|
+
resume(): void;
|
|
103
|
+
kill(): void;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Collections
|
|
107
|
+
export function each<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncIterator<T, E>, callback?: ErrorCallback<E>): void;
|
|
108
|
+
export const eachSeries: typeof each;
|
|
109
|
+
export function eachLimit<T, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncIterator<T, E>, callback?: ErrorCallback<E>): void;
|
|
110
|
+
export const forEach: typeof each;
|
|
111
|
+
export const forEachSeries: typeof each;
|
|
112
|
+
export const forEachLimit: typeof eachLimit;
|
|
113
|
+
export function forEachOf<T, E = Error>(obj: IterableCollection<T>, iterator: AsyncForEachOfIterator<T, E>, callback?: ErrorCallback<E>): void;
|
|
114
|
+
export const forEachOfSeries: typeof forEachOf;
|
|
115
|
+
export function forEachOfLimit<T, E = Error>(obj: IterableCollection<T>, limit: number, iterator: AsyncForEachOfIterator<T, E>, callback?: ErrorCallback<E>): void;
|
|
116
|
+
export const eachOf: typeof forEachOf;
|
|
117
|
+
export const eachOfSeries: typeof forEachOf;
|
|
118
|
+
export const eachOfLimit: typeof forEachOfLimit;
|
|
119
|
+
export function map<T, R, E = Error>(arr: T[] | IterableIterator<T> | Dictionary<T>, iterator: AsyncResultIterator<T, R, E>, callback?: AsyncResultArrayCallback<R, E>): void;
|
|
120
|
+
export const mapSeries: typeof map;
|
|
121
|
+
export function mapLimit<T, R, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncResultIterator<T, R, E>, callback?: AsyncResultArrayCallback<R, E>): void;
|
|
122
|
+
|
|
123
|
+
export function mapValuesLimit<T, R, E = Error>(
|
|
124
|
+
obj: Dictionary<T>,
|
|
125
|
+
limit: number,
|
|
126
|
+
iteratee: (value: T, key: string, callback: AsyncResultCallback<R, E>) => void,
|
|
127
|
+
callback: AsyncResultObjectCallback<R, E>
|
|
128
|
+
): void;
|
|
129
|
+
|
|
130
|
+
export function mapValues<T, R, E = Error>(obj: Dictionary<T>, iteratee: (value: T, key: string, callback: AsyncResultCallback<R, E>) => void, callback: AsyncResultObjectCallback<R, E>): void;
|
|
131
|
+
export const mapValuesSeries: typeof mapValues;
|
|
132
|
+
export function filter<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncResultArrayCallback<T, E>): void;
|
|
133
|
+
export const filterSeries: typeof filter;
|
|
134
|
+
export function filterLimit<T, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncResultArrayCallback<T, E>): void;
|
|
135
|
+
export const select: typeof filter;
|
|
136
|
+
export const selectSeries: typeof filter;
|
|
137
|
+
export const selectLimit: typeof filterLimit;
|
|
138
|
+
export const reject: typeof filter;
|
|
139
|
+
export const rejectSeries: typeof filter;
|
|
140
|
+
export const rejectLimit: typeof filterLimit;
|
|
141
|
+
export function reduce<T, R, E = Error>(arr: T[] | IterableIterator<T>, memo: R, iterator: AsyncMemoIterator<T, R, E>, callback?: AsyncResultCallback<R, E>): void;
|
|
142
|
+
export const inject: typeof reduce;
|
|
143
|
+
export const foldl: typeof reduce;
|
|
144
|
+
export const reduceRight: typeof reduce;
|
|
145
|
+
export const foldr: typeof reduce;
|
|
146
|
+
export function detect<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncResultCallback<T, E>): void;
|
|
147
|
+
export const detectSeries: typeof detect;
|
|
148
|
+
export function detectLimit<T, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncResultCallback<T, E>): void;
|
|
149
|
+
export const find: typeof detect;
|
|
150
|
+
export const findSeries: typeof detect;
|
|
151
|
+
export const findLimit: typeof detectLimit;
|
|
152
|
+
export function sortBy<T, V, E = Error>(arr: T[] | IterableIterator<T>, iterator: AsyncResultIterator<T, V, E>, callback?: AsyncResultArrayCallback<T, E>): void;
|
|
153
|
+
export function some<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncBooleanResultCallback<E>): void;
|
|
154
|
+
export const someSeries: typeof some;
|
|
155
|
+
export function someLimit<T, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncBooleanResultCallback<E>): void;
|
|
156
|
+
export const any: typeof some;
|
|
157
|
+
export const anySeries: typeof someSeries;
|
|
158
|
+
export const anyLimit: typeof someLimit;
|
|
159
|
+
export function every<T, E = Error>(arr: IterableCollection<T>, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncBooleanResultCallback<E>): void;
|
|
160
|
+
export const everySeries: typeof every;
|
|
161
|
+
export function everyLimit<T, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncBooleanIterator<T, E>, callback?: AsyncBooleanResultCallback<E>): void;
|
|
162
|
+
export const all: typeof every;
|
|
163
|
+
export const allSeries: typeof every;
|
|
164
|
+
export const allLimit: typeof everyLimit;
|
|
165
|
+
|
|
166
|
+
export function concat<T, R, E = Error>(arr: IterableCollection<T>, iterator: AsyncResultIterator<T, R[], E>, callback?: AsyncResultArrayCallback<R, E>): void;
|
|
167
|
+
export function concatLimit<T, R, E = Error>(arr: IterableCollection<T>, limit: number, iterator: AsyncResultIterator<T, R[], E>, callback?: AsyncResultArrayCallback<R, E>): void;
|
|
168
|
+
export const concatSeries: typeof concat;
|
|
169
|
+
|
|
170
|
+
// Control Flow
|
|
171
|
+
export function series<T, E = Error>(tasks: Array<AsyncFunction<T, E>>, callback?: AsyncResultArrayCallback<T, E>): void;
|
|
172
|
+
export function series<T, E = Error>(tasks: Dictionary<AsyncFunction<T, E>>, callback?: AsyncResultObjectCallback<T, E>): void;
|
|
173
|
+
export function parallel<T, E = Error>(tasks: Array<AsyncFunction<T, E>>, callback?: AsyncResultArrayCallback<T, E>): void;
|
|
174
|
+
export function parallel<T, E = Error>(tasks: Dictionary<AsyncFunction<T, E>>, callback?: AsyncResultObjectCallback<T, E>): void;
|
|
175
|
+
export function parallelLimit<T, E = Error>(tasks: Array<AsyncFunction<T, E>>, limit: number, callback?: AsyncResultArrayCallback<T, E>): void;
|
|
176
|
+
export function parallelLimit<T, E = Error>(tasks: Dictionary<AsyncFunction<T, E>>, limit: number, callback?: AsyncResultObjectCallback<T, E>): void;
|
|
177
|
+
export function whilst<E = Error>(test: () => boolean, fn: AsyncVoidFunction<E>, callback: ErrorCallback<E>): void;
|
|
178
|
+
export function doWhilst<T, E = Error>(fn: AsyncFunctionEx<T, E>, test: (...results: T[]) => boolean, callback: ErrorCallback<E>): void;
|
|
179
|
+
export function until<E = Error>(test: () => boolean, fn: AsyncVoidFunction<E>, callback: ErrorCallback<E>): void;
|
|
180
|
+
export function doUntil<T, E = Error>(fn: AsyncFunctionEx<T, E>, test: (...results: T[]) => boolean, callback: ErrorCallback<E>): void;
|
|
181
|
+
export function during<E = Error>(test: (testCallback: AsyncBooleanResultCallback<E>) => void, fn: AsyncVoidFunction<E>, callback: ErrorCallback<E>): void;
|
|
182
|
+
export function doDuring<E = Error>(fn: AsyncVoidFunction<E>, test: (testCallback: AsyncBooleanResultCallback<E>) => void, callback: ErrorCallback<E>): void;
|
|
183
|
+
export function forever<E = Error>(next: (next: ErrorCallback<E>) => void, errBack: ErrorCallback<E>): void;
|
|
184
|
+
export function waterfall<T, E = Error>(tasks: Function[], callback?: AsyncResultCallback<T, E>): void;
|
|
185
|
+
export function compose(...fns: Function[]): Function;
|
|
186
|
+
export function seq(...fns: Function[]): Function;
|
|
187
|
+
export function applyEach(fns: Function[], ...argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional.
|
|
188
|
+
export function applyEachSeries(fns: Function[], ...argsAndCallback: any[]): void; // applyEachSeries(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional.
|
|
189
|
+
export function queue<T, E = Error>(worker: AsyncWorker<T, E>, concurrency?: number): AsyncQueue<T>;
|
|
190
|
+
export function queue<T, R, E = Error>(worker: AsyncResultIterator<T, R, E>, concurrency?: number): AsyncQueue<T>;
|
|
191
|
+
export function priorityQueue<T, E = Error>(worker: AsyncWorker<T, E>, concurrency: number): AsyncPriorityQueue<T>;
|
|
192
|
+
export function cargo<E = Error>(worker: (tasks: any[], callback: ErrorCallback<E>) => void, payload?: number): AsyncCargo;
|
|
193
|
+
export function auto<R extends Dictionary<any>, E = Error>(tasks: AsyncAutoTasks<R, E>, concurrency?: number, callback?: AsyncResultCallback<R, E>): void;
|
|
194
|
+
export function auto<R extends Dictionary<any>, E = Error>(tasks: AsyncAutoTasks<R, E>, callback?: AsyncResultCallback<R, E>): void;
|
|
195
|
+
export function autoInject<E = Error>(tasks: any, callback?: AsyncResultCallback<any, E>): void;
|
|
196
|
+
|
|
197
|
+
export function retry<T, E = Error>(
|
|
198
|
+
opts: number | {
|
|
199
|
+
times: number,
|
|
200
|
+
interval: number | ((retryCount: number) => number),
|
|
201
|
+
errorFilter?: (error: Error) => boolean
|
|
202
|
+
},
|
|
203
|
+
task: (callback: AsyncResultCallback<T, E>, results: any) => void,
|
|
204
|
+
callback: AsyncResultCallback<any, E>
|
|
205
|
+
): void;
|
|
206
|
+
|
|
207
|
+
export function retryable<T, E = Error>(opts: number | {times: number, interval: number}, task: AsyncFunction<T, E>): AsyncFunction<T, E>;
|
|
208
|
+
export function apply<E = Error>(fn: Function, ...args: any[]): AsyncFunction<any, E>;
|
|
209
|
+
export function nextTick(callback: Function, ...args: any[]): void;
|
|
210
|
+
export const setImmediate: typeof nextTick;
|
|
211
|
+
|
|
212
|
+
export function reflect<T, E = Error>(fn: AsyncFunction<T, E>): (callback: (err: null, result: {error?: E, value?: T}) => void) => void;
|
|
213
|
+
export function reflectAll<T, E = Error>(tasks: Array<AsyncFunction<T, E>>): Array<(callback: (err: null, result: {error?: E, value?: T}) => void) => void>;
|
|
214
|
+
|
|
215
|
+
export function timeout<T, E = Error>(fn: AsyncFunction<T, E>, milliseconds: number, info?: any): AsyncFunction<T, E>;
|
|
216
|
+
export function timeout<T, R, E = Error>(fn: AsyncResultIterator<T, R, E>, milliseconds: number, info?: any): AsyncResultIterator<T, R, E>;
|
|
217
|
+
|
|
218
|
+
export function times<T, E>(n: number, iterator: AsyncResultIterator<number, T, E>, callback: AsyncResultArrayCallback<T, E>): void;
|
|
219
|
+
export function timesSeries<T, E = Error>(n: number, iterator: AsyncResultIterator<number, T, E>, callback: AsyncResultArrayCallback<T, E>): void;
|
|
220
|
+
export function timesLimit<T, E = Error>(n: number, limit: number, iterator: AsyncResultIterator<number, T, E>, callback: AsyncResultArrayCallback<T, E>): void;
|
|
221
|
+
|
|
222
|
+
export function transform<T, R, E = Error>(arr: T[], iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void, callback?: AsyncResultArrayCallback<T, E>): void;
|
|
223
|
+
export function transform<T, R, E = Error>(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void, callback?: AsyncResultArrayCallback<T, E>): void;
|
|
224
|
+
|
|
225
|
+
export function transform<T, R, E = Error>(
|
|
226
|
+
arr: {[key: string]: T},
|
|
227
|
+
iteratee: (acc: {[key: string]: R}, item: T, key: string, callback: (error?: E) => void) => void,
|
|
228
|
+
callback?: AsyncResultObjectCallback<T, E>
|
|
229
|
+
): void;
|
|
230
|
+
|
|
231
|
+
export function transform<T, R, E = Error>(
|
|
232
|
+
arr: {[key: string]: T},
|
|
233
|
+
acc: {[key: string]: R},
|
|
234
|
+
iteratee: (acc: {[key: string]: R}, item: T, key: string, callback: (error?: E) => void) => void,
|
|
235
|
+
callback?: AsyncResultObjectCallback<T, E>
|
|
236
|
+
): void;
|
|
237
|
+
|
|
238
|
+
export function race<T, E = Error>(tasks: Array<AsyncFunction<T, E>>, callback: AsyncResultCallback<T, E>): void;
|
|
239
|
+
|
|
240
|
+
// Utils
|
|
241
|
+
export function memoize(fn: Function, hasher?: Function): Function;
|
|
242
|
+
export function unmemoize(fn: Function): Function;
|
|
243
|
+
export function ensureAsync(fn: (... argsAndCallback: any[]) => void): Function;
|
|
244
|
+
export function constant(...values: any[]): Function;
|
|
245
|
+
export function asyncify(fn: Function): (...args: any[]) => any;
|
|
246
|
+
export function wrapSync(fn: Function): Function;
|
|
247
|
+
export function log(fn: Function, ...args: any[]): void;
|
|
248
|
+
export function dir(fn: Function, ...args: any[]): void;
|
async/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/async",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "TypeScript definitions for Async",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -28,15 +28,22 @@
|
|
|
28
28
|
"name": "Pascal Martin",
|
|
29
29
|
"url": "https://github.com/pascalmartin",
|
|
30
30
|
"githubUsername": "pascalmartin"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "Dmitri Trofimov",
|
|
34
|
+
"url": "https://github.com/Dmitri1337",
|
|
35
|
+
"githubUsername": "Dmitri1337"
|
|
31
36
|
}
|
|
32
37
|
],
|
|
33
38
|
"main": "",
|
|
39
|
+
"types": "index",
|
|
34
40
|
"repository": {
|
|
35
41
|
"type": "git",
|
|
36
|
-
"url": "https://
|
|
42
|
+
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
|
43
|
+
"directory": "types/async"
|
|
37
44
|
},
|
|
38
45
|
"scripts": {},
|
|
39
46
|
"dependencies": {},
|
|
40
|
-
"typesPublisherContentHash": "
|
|
41
|
-
"typeScriptVersion": "2.
|
|
47
|
+
"typesPublisherContentHash": "716f37fa2c17bb055eb8af84715961d423052cf4c70daba687da45fe4f024206",
|
|
48
|
+
"typeScriptVersion": "2.3"
|
|
42
49
|
}
|