1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export declare type Options = {
|
8 | clearTimeout: typeof globalThis['clearTimeout'];
|
9 | fail: (error: Error) => void;
|
10 | onException: (error: Error) => void;
|
11 | queueableFns: Array<QueueableFn>;
|
12 | setTimeout: typeof globalThis['setTimeout'];
|
13 | userContext: unknown;
|
14 | };
|
15 | export interface DoneFn {
|
16 | (error?: any): void;
|
17 | fail: (error: Error) => void;
|
18 | }
|
19 | export declare type QueueableFn = {
|
20 | fn: (done: DoneFn) => void;
|
21 | timeout?: () => number;
|
22 | initError?: Error;
|
23 | };
|
24 | declare type PromiseCallback = (() => void | PromiseLike<void>) | undefined | null;
|
25 | export default function queueRunner(options: Options): PromiseLike<void> & {
|
26 | cancel: () => void;
|
27 | catch: (onRejected?: PromiseCallback) => Promise<void>;
|
28 | };
|
29 | export {};
|