import { type Extend } from "./utils.js";
/**
* Describe a mutex.
*/
export type Mutex = [Promise<void>];
/**
* Create a mutex.
*/
export declare const init: () => Mutex;
/**
* Acquire a mutex.
*/
export declare const acquire: (mu: Extend<Mutex>) => Promise<() => void>;
/**
* Automatically acquire and run a task.
*/
export declare const run: <const T extends (...args: any[]) => Promise<any>>(mu: Extend<Mutex>, fn: T, ...args: Parameters<T>) => ReturnType<T>;
