export interface Lock extends Promise { resolve: (value?: T | PromiseLike) => void; reject: (reason: Error) => void; cancel: () => void; lock: () => void; unlock: () => void; } /** Creates a lock that resolves when it's lock count reaches 0. * If a timeout is provided, the lock rejects if it has not unlocked * by the specified number of milliseconds (default 1000). */ export declare function Lock(count?: number, ms?: number): Lock;