export declare function createPromiseCapability(): {
    promise: Promise<any>;
    resolve: Function;
    reject: Function;
};
export declare function createPromiseCapabilityWithTimeout(rejectTimeout?: number, timeoutMessage?: string): {
    promise: Promise<any>;
    resolve: Function;
    reject: Function;
};
/**
 * Asynchronous lock.
 * @example
 * ```typescript
 * // Usage example:
 * const lockObj = new AsyncLock();
 * await lockObj.lock();
 * try {
 *   // code
 * } finally {
 *   lockObj.unlock();
 * }
 * ```
 **/
export declare class AsyncLock {
    private _queue;
    private _isLocked;
    /**
     * Indicates whether the lock is currently held.
     */
    get locked(): boolean;
    /**
     * Lock code execution.
     * @example
     * ```typescript
     * await lockObj.lock();
     * ```
     **/
    lock(): Promise<void>;
    /**
     * Unlock code execution.
     * @example
     * ```typescript
     * lockObj.unlock();
     * ```
     **/
    unlock(): void;
}
/**
 * Simple promises queue;
 *
 * @example
 * //Usage example:
 * ```javascript
 * var queue = new PromiseQueue();
 * queue.enqueue(async ()=>{ });
 * queue.enqueue(async ()=>{ });
 * queue.clear();
 * queue.enqueue(async ()=>{ });
 * ```
 **/
export declare class PromiseQueue {
    private _queue;
    private _queueId;
    constructor();
    /**
     * Enqueue async action.
     **/
    enqueue(action: Function): Promise<unknown>;
    /**
     * Clear queue.
     **/
    clear(): void;
}
