diff options
Diffstat (limited to 'lib/epub.js/types/utils/queue.d.ts')
-rw-r--r-- | lib/epub.js/types/utils/queue.d.ts | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/epub.js/types/utils/queue.d.ts b/lib/epub.js/types/utils/queue.d.ts new file mode 100644 index 0000000..4813ef6 --- /dev/null +++ b/lib/epub.js/types/utils/queue.d.ts @@ -0,0 +1,34 @@ +import { defer } from "./core"; + +export interface QueuedTask { + task: any | Task, + args: any[], + deferred: any, // should be defer, but not working + promise: Promise<any> +} + +export default class Queue { + constructor(context: any); + + enqueue(func: Promise<Function> | Function, ...args: any[]): Promise<any>; + + dequeue(): Promise<QueuedTask>; + + dump(): void; + + run(): Promise<void>; + + flush(): Promise<void>; + + clear(): void; + + length(): number; + + pause(): void; + + stop(): void; +} + +declare class Task { + constructor(task: any, args: any[], context: any); +} |