// Type definitions for async-lock // Project: https://github.com/rain1017/async-lock // Definitions by: Elisée MAURER , Alejandro // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 interface AsyncLockDoneCallback { (err?: Error, ret?: T): void; } interface AsyncLockOptions { timeout?: number; maxPending?: number; domainReentrant?: boolean; Promise?: any; } declare class AsyncLock { constructor(options?: AsyncLockOptions); acquire(key: string | string[], fn: (() => T | PromiseLike) | ((done: AsyncLockDoneCallback) => any), opts?: AsyncLockOptions): PromiseLike; acquire(key: string | string[], fn: (done: AsyncLockDoneCallback) => any, cb: AsyncLockDoneCallback, opts?: AsyncLockOptions): void; isBusy(): boolean; } declare namespace AsyncLock { } export = AsyncLock;