import { Defer } from 'thingies/lib/Defer';
declare class Entry<T> {
    readonly code: () => Promise<T>;
    readonly future: Defer<T>;
    constructor(code: () => Promise<T>, future: Defer<T>);
}
export declare class Mutex {
    protected readonly queue: Map<string, Entry<unknown>[]>;
    readonly acquire: <T>(key: string, code: () => Promise<T>) => Promise<T>;
    protected run<T>(key: string, entry: Entry<T>): Promise<void>;
}
export {};
