/** * Entra (Azure AD) token refresh timers extracted from connection.ts. * * Two timers: * - retryTimer: when a server `entra_auth_failed` rejection happens, poll * every 5 minutes for a fresh cached token to recover automatically. * - refreshTimer: proactive refresh, scheduled to fire 5 minutes before * the current id_token's `exp` claim. * * Both timers are owned by this module — caller passes a getter for the * current token state plus a `send` callback to push refreshed tokens * back to the relay. */ import { type EntraToken } from './entra.js'; export interface EntraTimerDeps { /** Read the current token (may be null if uninitialized). */ getToken: () => EntraToken | null; /** Set the token after a successful refresh. */ setToken: (token: EntraToken) => void; /** Send a message to the relay (used for `entra_auth` push after retry). */ send: (msg: Record) => void; } export declare function initEntraTimers(d: EntraTimerDeps): void; export declare function startEntraRetryTimer(): void; export declare function stopEntraRetryTimer(): void; export declare function scheduleEntraRefresh(): void; export declare function cancelEntraRefresh(): void; /** Stop both timers — call on disconnect/shutdown. */ export declare function stopAllEntraTimers(): void; export declare function computeRefreshDelay(token: EntraToken | null, now?: number): number | null;