/** * Aggregate promises efficiently */ export declare class Mutex { private _pushCount; private readonly _arr; private get arr(); get pushCount(): number; push(f: () => Promise): Promise; /** * Run f() after all prior-enqueued promises have resolved. */ serial(f: () => Promise): Promise; /** * Only run f() if all prior have finished, otherwise, no-op and wait until * all pending have resolved. */ runIfIdle(f: () => Promise): undefined | Promise; get pendingCount(): number; get pending(): boolean; get settled(): boolean; /** * @return a promise that will be resolved when all previously-pushed Promises * are resolved. Any promise rejection will throw the whole chain. */ awaitAll(): Promise; }