/**
 * @module Lock
 */
import { type IEventDispatcher } from "../../../../event-bus/contracts/_module.js";
import { type IExecutionContext } from "../../../../execution-context/contracts/_module.js";
import { type ILock, type ILockAdapter, type LockEventMap, type ILockState, type LockAdapterVariants } from "../../../../lock/contracts/_module.js";
import { type Use } from "../../../../middleware/contracts/_module.js";
import { type IKey, type INamespace } from "../../../../namespace/contracts/_module.js";
import { type ITimeSpan } from "../../../../time-span/contracts/_module.js";
import { TimeSpan } from "../../../../time-span/implementations/_module.js";
import { type AsyncLazy, type WaitUntil } from "../../../../utilities/_module.js";
/**
 * @internal
 */
export type ISerializedLock = {
    version: "1";
    key: string;
    lockId: string;
    ttlInMs: number | null;
};
/**
 * @internal
 */
export type LockSettings = {
    serdeTransformerName: string;
    namespace: INamespace;
    adapter: ILockAdapter;
    originalAdapter: LockAdapterVariants;
    eventDispatcher: IEventDispatcher<LockEventMap>;
    key: IKey;
    lockId: string;
    ttl: TimeSpan | null;
    defaultRefreshTime: TimeSpan;
    waitUntil: WaitUntil;
    executionContext: IExecutionContext;
    use: Use;
};
/**
 * @internal
 */
export declare class Lock implements ILock {
    /**
     * @internal
     */
    static _serialize(deserializedValue: Lock): ISerializedLock;
    private readonly namespace;
    private readonly adapter;
    private readonly originalAdapter;
    private readonly eventDispatcher;
    private readonly _key;
    private readonly lockId;
    private _ttl;
    private readonly defaultRefreshTime;
    private readonly serdeTransformerName;
    private readonly waitUntil;
    private readonly executionContext;
    private readonly use;
    constructor(settings: LockSettings);
    _getNamespace(): INamespace;
    _getSerdeTransformerName(): string;
    _getAdapter(): LockAdapterVariants;
    runOrFail<TValue = void>(asyncFn: AsyncLazy<TValue>): Promise<TValue>;
    acquire(): Promise<boolean>;
    acquireOrFail(): Promise<void>;
    release(): Promise<boolean>;
    releaseOrFail(): Promise<void>;
    forceRelease(): Promise<boolean>;
    refresh(ttl?: ITimeSpan): Promise<boolean>;
    refreshOrFail(ttl?: ITimeSpan): Promise<void>;
    get key(): IKey;
    get id(): string;
    get ttl(): TimeSpan | null;
    getState(): Promise<ILockState>;
}
