/** * Lock Instance Class * Represents an acquired lock with extension and release capabilities */ import { LockOptions, LockExtensionResult, LockReleaseResult, LockSignal, ActiveLockInfo } from "./types"; /** * Represents an acquired distributed lock */ export declare class Lock { readonly resources: string[]; readonly identifier: string; private readonly lockManager; private readonly options; private _expiration; private _extensions; private _released; private readonly acquisitionTime; constructor(resources: string[], identifier: string, expiration: number, lockManager: { extend: (lock: Lock, ttl: number, options?: Partial) => Promise; release: (lock: Lock, options?: Partial) => Promise; }, options: Required); /** * Get current expiration time */ get expiration(): number; /** * Get number of extensions performed */ get extensions(): number; /** * Check if lock is released */ get released(): boolean; /** * Get lock duration so far */ get duration(): number; /** * Get time until expiration */ get timeToExpiration(): number; /** * Check if lock is expired */ get isExpired(): boolean; /** * Check if lock is valid (not expired and not released) */ get isValid(): boolean; /** * Get active lock information */ getInfo(): ActiveLockInfo; /** * Extend the lock with new TTL */ extend(ttl?: number, options?: Partial): Promise; /** * Release the lock */ release(options?: Partial): Promise; /** * Create auto-extending lock context */ using(routine: (signal: LockSignal) => Promise, options?: Partial): Promise; /** * Wait for lock to expire naturally */ waitForExpiration(): Promise; /** * Convert lock to JSON representation */ toJSON(): Record; /** * String representation of the lock */ toString(): string; } //# sourceMappingURL=lock.d.ts.map