import { ReactNode } from 'react'; import { ProfileUser, AuthTokens, ProfileMeta } from './ProfileStorageManager'; export type { ProfileUser as User, AuthTokens, ProfileMeta }; export interface Account { id: string; email: string; name: string; firstName?: string; lastName?: string; avatar?: string; isActive?: boolean; lastLogin?: string; } export interface AuthContextValue { user: ProfileUser | null; tokens: AuthTokens | null; isAuthenticated: boolean; isLoading: boolean; login: (user: ProfileUser, accessToken: string, refreshToken?: string) => void; logout: (options?: { authoritative?: boolean; }) => void; updateUser: (user: Partial) => void; refreshAccessToken: () => Promise; hasPermission: (permission: string) => boolean; setWorkspaceToken: (token: string | null) => void; workspaceToken: string | null; mfaRequired: boolean; mfaChallengeId: string | null; setMfaState: (required: boolean, challengeId?: string | null) => void; activeProfileId: string | null; accounts: Account[]; switchAccount: (accountId: string) => void; addAccount: (user: ProfileUser, accessToken: string, refreshToken?: string) => void; removeAccount: (accountId: string) => void; logoutAll: () => void; currentUser: ProfileUser | null; } export interface AuthProviderProps { children: ReactNode; onTokenExpired?: () => void; /** Called when a session is about to expire (5 minutes before). Use to show warning toast. */ onSessionExpiringSoon?: () => void; onRefreshToken?: (refreshToken: string) => Promise<{ accessToken: string; refreshToken?: string; expiresAt?: number; }>; /** URL of the auth session bridge page (e.g., /auth/session-bridge). Enables cross-domain auth. */ bridgeUrl?: string; /** Comma-separated allowed origins for the bridge postMessage (e.g., "http://localhost:5149,...") */ bridgeAllowedOrigins?: string; /** Enable debug logging for the auth bridge */ bridgeDebug?: boolean; /** Called when the auth bridge has finished initializing (responded or timed out) */ onBridgeReady?: () => void; } export declare function AuthProvider({ children, onTokenExpired, onSessionExpiringSoon, onRefreshToken, bridgeUrl, bridgeAllowedOrigins, bridgeDebug, onBridgeReady, }: AuthProviderProps): import("react/jsx-runtime").JSX.Element; export declare function useAuth(): AuthContextValue; //# sourceMappingURL=AuthProvider.d.ts.map