/**
 * @module Lock
 */
import { type IReadableContext } from "../../../../execution-context/contracts/_module.js";
import { type ILockAdapter, type ILockAdapterState } from "../../../../lock/contracts/_module.js";
import { type TimeSpan } from "../../../../time-span/implementations/_module.js";
import { type IDeinitizable } from "../../../../utilities/_module.js";
/**
 * IMPORT_PATH: `"@daiso-tech/core/lock/memory-lock-adapter"`
 * @group Adapters
 */
export type MemoryLockData = {
    owner: string;
    hasExpiration: true;
    timeoutId: string | number | NodeJS.Timeout;
    expiration: Date;
} | {
    owner: string;
    hasExpiration: false;
};
/**
 * Note the `MemoryLockAdapter` is limited to single process usage and cannot be shared across multiple servers or different processes.
 * This adapter is meant for easily faking{@link ILockFactory | `ILockFactory`} for testing.
 *
 * IMPORT_PATH: `"@daiso-tech/core/lock/memory-lock-adapter"`
 * @group Adapters
 */
export declare class MemoryLockAdapter implements ILockAdapter, IDeinitizable {
    private readonly map;
    /**
     *  @example
     * ```ts
     * import { MemoryLockAdapter } from "@daiso-tech/core/lock/memory-lock-adapter";
     *
     * const lockAdapter = new MemoryLockAdapter();
     * ```
     * You can also provide an `Map`.
     * @example
     * ```ts
     * import { MemoryLockAdapter } from "@daiso-tech/core/lock/memory-lock-adapter";
     *
     * const map = new Map<any, any>();
     * const lockAdapter = new MemoryLockAdapter(map);
     * ```
     */
    constructor(map?: Map<string, MemoryLockData>);
    /**
     * Removes all in-memory lock data.
     */
    deInit(): Promise<void>;
    acquire(_context: IReadableContext, key: string, lockId: string, ttl: TimeSpan | null): Promise<boolean>;
    release(_context: IReadableContext, key: string, lockId: string): Promise<boolean>;
    forceRelease(_context: IReadableContext, key: string): Promise<boolean>;
    refresh(_context: IReadableContext, key: string, lockId: string, ttl: TimeSpan): Promise<boolean>;
    getState(_context: IReadableContext, key: string): Promise<ILockAdapterState | null>;
}
