import type { MutexInterface } from 'async-mutex'; export type MemoryLock = { resource: string; owner: string; ttl: number; expiresAt?: number; mutex: MutexInterface; }; /** * In-memory lock store for managing resource locks using mutexes. */ export declare class MemoryStore { #private; private readonly logger; /** * For a given key, get or create a new lock. */ getOrCreateForKey(key: string, owner: string, ttl: number): MemoryLock; /** * Extend the lock expiration. Throws an error if the lock is not owned by the owner. * Duration is in milliseconds. */ extend(key: string, owner: string, duration: number): Promise; /** * Save the lock in the store if not already locked by another owner. */ save(key: string, owner: string, ttl: number): Promise; /** * Delete the lock from the store if it is owned by the owner. * Otherwise throws a E_LOCK_NOT_OWNED error. */ delete(key: string, owner: string): Promise; /** * Force delete the lock from the store. No check is made on the owner. */ forceDelete(key: string): Promise; /** * Check if the lock exists. */ exists(key: string): Promise; /** * Get the lock. */ get(key: string): Promise; /** * Clear all locks. */ clear(): Promise; } //# sourceMappingURL=memory-store.d.ts.map