export type PromiseCallback = () => Promise; export type QueueCallback = PromiseCallback | (() => T); /** * SerialQueue runs 1 promise at a time, very useful for reducing load and working around lock files */ export declare class SerialQueue { private name; private debug; private items; private isProcessing; constructor(name: string, debug?: boolean); private processQueue; /** * Add a new promise callback to the queue * * in case you provide a key it will be used to de-duplicate against existing items in the queue * if there is an existing item, the callback of that item will be used and this function will * return the result of that callback instead */ add(callback: QueueCallback, key?: string): Promise; }