export interface LockOptions {
    /** Lock timeout in milliseconds (how long the lock is held) */
    lockTimeoutMs?: number;
    /** Maximum time to wait for acquiring the lock */
    acquireTimeoutMs?: number;
    /** Initial retry delay in milliseconds */
    retryDelayMs?: number;
    /** Maximum retry delay in milliseconds */
    maxRetryDelayMs?: number;
    /** Jitter factor (0-1) to add randomness to retry delays */
    jitterFactor?: number;
}
export interface Lock {
    /** Unique lock identifier */
    lockId: string;
    /** Lock key */
    key: string;
    /** Whether the lock is currently held */
    held: boolean;
    /** Release the lock */
    release: () => Promise<boolean>;
    /** Extend the lock timeout */
    extend: (additionalMs: number) => Promise<boolean>;
}
export interface LockResult {
    acquired: boolean;
    lock?: Lock;
    error?: string;
}
/**
 * Distributed Lock Service
 */
export declare class LockService {
    private redis;
    private readonly keyPrefix;
    /**
     * Acquire a distributed lock
     */
    acquire(key: string, options?: LockOptions): Promise<LockResult>;
    /**
     * Release a lock
     */
    private release;
    /**
     * Extend a lock's timeout
     */
    private extend;
    /**
     * Execute a function with a lock
     * Automatically acquires and releases the lock
     */
    withLock<T>(key: string, fn: () => Promise<T>, options?: LockOptions): Promise<{
        success: boolean;
        result?: T;
        error?: string;
    }>;
    /**
     * Check if a lock is currently held
     */
    isLocked(key: string): Promise<boolean>;
    /**
     * Force release a lock (admin operation)
     * Use with caution - this can cause issues if the lock holder is still active
     */
    forceRelease(key: string): Promise<boolean>;
}
/**
 * Get the lock service singleton
 */
export declare function getLockService(): LockService;
//# sourceMappingURL=lock.d.ts.map