Outlook_Addin_LLM/node_modules/async-mutex/lib/MutexInterface.d.ts

19 lines
522 B
TypeScript

interface MutexInterface {
acquire(): Promise<MutexInterface.Releaser>;
runExclusive<T>(callback: MutexInterface.Worker<T>): Promise<T>;
waitForUnlock(): Promise<void>;
isLocked(): boolean;
/** @deprecated Deprecated in 0.3.0, will be removed in 0.4.0. Use runExclusive instead. */
release(): void;
cancel(): void;
}
declare namespace MutexInterface {
interface Releaser {
(): void;
}
interface Worker<T> {
(): Promise<T> | T;
}
}
export default MutexInterface;