site/node_modules/async-mutex/lib/Mutex.d.ts

13 lines
454 B
TypeScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
import MutexInterface from './MutexInterface';
declare class Mutex implements MutexInterface {
constructor(cancelError?: Error);
acquire(priority?: number): Promise<MutexInterface.Releaser>;
runExclusive<T>(callback: MutexInterface.Worker<T>, priority?: number): Promise<T>;
isLocked(): boolean;
waitForUnlock(priority?: number): Promise<void>;
release(): void;
cancel(): void;
private _semaphore;
}
export default Mutex;