interface MutexInterface { acquire(): Promise; runExclusive(callback: MutexInterface.Worker): Promise; isLocked(): boolean; release(): void; } declare namespace MutexInterface { interface Releaser { (): void; } interface Worker { (): Promise | T; } } export default MutexInterface;