/** * Prevents overlapping narration.generate runs for the same entry + field + voice. * * A second request fails immediately (no ElevenLabs call) so accidental * double-submit or parallel tabs do not double-charge. The lock entry stores * an acquisition timestamp; entries older than {@link DEFAULT_LOCK_TTL_MS} * are treated as stale (e.g. crashed handler that never reached `finally`) * and the new request is allowed to take over. */ /** Default 10 minutes — must comfortably exceed any realistic TTS timeout. */ export declare const DEFAULT_LOCK_TTL_MS: number; export declare function makeNarrationGenerateLockKey(parts: { uid: string; documentId: string; attributeName: string; locale?: string | null; voiceId: string; }): string; export type AcquireLockOptions = { /** Acquired entries older than this are treated as stale. */ staleAfterMs?: number; /** Override the clock for tests / fault injection. */ now?: () => number; }; export declare function acquireNarrationGenerateLock(lockKey: string, opts?: AcquireLockOptions): void; export declare function releaseNarrationGenerateLock(lockKey: string): void; /** * Drop all in-memory generate locks. Called from the plugin `destroy()` hook; * re-exported as `*ForTesting` for vitest cases that need a clean slate. */ export declare function clearNarrationGenerateLocks(): void; export declare const resetNarrationGenerateLocksForTesting: typeof clearNarrationGenerateLocks;