type Universe = Buffer; type DriverFactory = (universe: Universe) => Driver; type Driver = () => Promise; declare const UNIVERSE_SIZE = 512; declare const MAX_VALUE = 255; declare function deferred(): { promise: Promise; resolve: (value: T) => void; }; /** * @example * ```ts * const lock = createAsyncLock(); * * await lock.run(async () => { * // * }); * * lock.isLocked(); // false * * void lock.run(async () => { * // * }); * * lock.isLocked(); // true * * await lock.flush(); * * lock.isLocked(); // false * ``` */ declare function createAsyncLock(): { run(fn: () => Promise): Promise; isLocked(): boolean; flush: () => Promise; }; export { type Driver, type DriverFactory, MAX_VALUE, UNIVERSE_SIZE, type Universe, createAsyncLock, deferred };