import type { SessionState, SessionManagerStatus } from '@/types'; /** * Session information returned by useAriaSession hook */ export interface AriaSessionInfo { /** Current session state including token, expiry, and readiness */ sessionState: SessionState; /** Current status of the session manager */ status: SessionManagerStatus; /** Whether the session is preloaded and ready for instant use */ isPreloaded: boolean; /** Whether the session is currently paused (widget closed with persistSession: true) */ isPaused: boolean; /** Whether the session is connected */ isConnected: boolean; /** Whether the session is currently loading */ isLoading: boolean; /** Current session ID if available */ sessionId: string | null; /** Whether the session token is expired */ isExpired: boolean; /** Whether the session is expiring soon (within refresh buffer) */ isExpiringSoon: boolean; /** Time until session expires in milliseconds (null if no expiry) */ timeUntilExpiry: number | null; } /** * Session control actions returned by useAriaSession hook */ export interface AriaSessionActions { /** End the current session explicitly (for logout scenarios) */ endSession: () => Promise; /** Refresh the session token proactively */ refreshSession: () => Promise; /** Start a new session (if not already active) */ startSession: () => Promise; /** Trigger a session with optional user trigger flag */ triggerSession: (userTrigger?: boolean) => void; } /** * Return type for useAriaSession hook */ export interface UseAriaSessionReturn { /** Session information and state */ session: AriaSessionInfo; /** Session control actions */ actions: AriaSessionActions; } /** * Hook to access and control Aria session state. * * This hook provides: * - Session state information (token, expiry, status) * - Session control actions (end, refresh, start) * - Expiry tracking utilities * * @example * ```tsx * const { session, actions } = useAriaSession(); * * // Check session state * if (session.isExpiringSoon) { * console.log('Session expiring soon, will auto-refresh'); * } * * // End session on logout * const handleLogout = async () => { * await actions.endSession(); * // ... rest of logout logic * }; * ``` */ export declare const useAriaSession: () => UseAriaSessionReturn; export default useAriaSession; //# sourceMappingURL=useAriaSession.d.ts.map