/** * Background token refresh loop. * Runs in main wizard process, refreshes tokens before expiry, * writes to credentials file for proxy to read. */ export interface BackgroundRefreshOptions { /** AuthKit domain for refresh endpoint */ authkitDomain: string; /** OAuth client ID */ clientId: string; /** Check interval in ms (default: 30000) */ intervalMs?: number; /** Refresh threshold in ms before expiry (default: 120000 = 2 min) */ refreshThresholdMs?: number; /** Callback when refresh fails permanently */ onRefreshExpired?: () => void; /** Callback when refresh succeeds */ onRefreshSuccess?: () => void; } export interface BackgroundRefreshHandle { /** Stop the refresh loop */ stop: () => void; /** Check if the loop is running */ isRunning: () => boolean; } /** * Start background token refresh loop. */ export declare function startBackgroundRefresh(options: BackgroundRefreshOptions): BackgroundRefreshHandle;