/** * Copyright (c) 2025 Elara AI Pty Ltd * Licensed under BSL 1.1. See LICENSE for details. */ /** * Run `fn` exclusively with respect to other callers sharing `key`. * * @param key - The serialization key; only tasks with an equal key are ordered. * @param fn - The work to run once the key is free. * @returns A promise for `fn`'s result (it rejects iff `fn` rejects; a prior * task's failure never blocks or fails a later one). */ export declare function withKeyedLock(key: string, fn: () => Promise): Promise; /** * Number of keys with an in-flight or queued task. Exposed for tests to assert * the map drains to empty (no leak); not part of the coordination contract. * * @internal */ export declare function pendingKeyCount(): number; //# sourceMappingURL=keyedMutex.d.ts.map