/** Bounds a locked token request so a stalled fetch or body read releases the lock. */ export declare const TOKEN_REQUEST_TIMEOUT_MS = 30000; export declare const isTokenRequestTimeout: (error: unknown) => boolean; /** * One deadline for a request and its body. * Settle it before storing a result: a later abort must not count as success. */ export declare const createTokenRequestDeadline: (timeoutMs?: number, createTimeoutError?: () => DOMException) => { signal: AbortSignal; settle(): void; assertWithinDeadline(): void; readBody(read: () => Promise): Promise; }; /** * Runs a callback on the current token-session turn. * Browsers without async context reject lock requests made before this * callback awaits. An active AsyncLocalStorage operation keeps its owner, so * a lock request after `await` is still rejected. */ export declare const callWithTokenSession: (fn: () => T) => T; /** * Coordinates a complete token operation, including reading its credentials. * Web Locks cover cooperating browser contexts using the same storage prefix. * The fallback coordinates only callers in this module instance. * The lock is not reentrant: a nested call from the operation already holding * it is rejected instead of waiting on that lock. */ export declare const withTokenSessionLock: (task: () => Promise) => Promise;