/** * SessionManager — Central session lifecycle manager. * * Responsibilities: * 1. Track user activity (mousemove, keydown, click, scroll, touch) * 2. Send heartbeat at configurable intervals — only when user has been active * 3. Show warning popup after idle timeout * 4. Auto-logout after warning countdown expires * 5. Sync activity across same-origin tabs via BroadcastChannel so one * active tab keeps other tabs' sessions alive (no cascading logout). */ import { SessionCallbacks, SessionConfig } from './sessionTypes'; export declare class SessionManager { private config; private callbacks; /** Timestamps and timers */ private lastActivityTime; /** Timestamp of the last heartbeat fire (initial/periodic/continue/activity). */ private lastHeartbeatTime; /** Set to true whenever user (or any same-origin tab) shows activity. */ private hadActivitySinceLastHeartbeat; private idleCheckInterval; private heartbeatInterval; private countdownInterval; private activityDebounceTimer; /** State */ private running; private warningActive; private secondsRemaining; /** Wall-clock timestamp when the warning countdown began (for background-tab accuracy). */ private warningStartTime; /** Cross-tab activity sync */ private broadcastChannel; /** Bound handlers for event listener cleanup. */ private boundOnActivity; private boundOnVisibilityChange; private boundOnBroadcastMessage; start(config: Partial | undefined, callbacks: SessionCallbacks): void; stop(): void; continueSession(): void; isWarningActive(): boolean; getSecondsRemaining(): number; private onActivity; private onVisibilityChange; /** Single source of truth for marking activity locally. */ private registerActivity; private checkIdle; private startWarning; private startHeartbeat; private fireHeartbeat; private setupBroadcastChannel; private teardownBroadcastChannel; private broadcast; private onBroadcastMessage; private clearTimer; }