/** * An extremely simple mutual-exclusion mechanism for asynconrous activities. * Only one operation can execute at a given time; subsequent operations will be triggered when their predecessors resolve, reject, or error. * Each invocation of `run` returns a promise that will resolve when that particular action has finished executing (unless an error is * caught), and will pass through the return value of the inner function. * Rejection will not cancel the execution sequence, as in traditional promise chains. */ export declare class AlMutex { protected queue: { action: { (): Promise; }; resolve: { (v: any): void; }; reject: { (e: any): void; }; }[]; protected running?: Promise; /** * This is the only exposed method of a mutex instance. */ run(action: { (): Promise; }): Promise; protected exec(action: { (): Promise; }, resolve: { (value: any): void; }, reject: { (error: any): void; }): Promise; protected execNext(): void; }