/** * A simple asynchronous lock utility class that allows controlling access to a critical section. * It provides a mechanism to create a lock and wait for its release using promises. */ export declare class AsyncLock { unlock?: any; promise?: Promise | undefined; /** * Creates an instance of the AsyncLock class. * * @param {boolean} [lock=false] - Optional parameter to lock the instance immediately upon creation. */ constructor(lock?: boolean); /** * Locks the instance, making it awaitable until unlocked. * A new promise is created for the lock, and the existing unlock function is replaced with a new one. */ lock(): void; }