/** * CODAI Authentication React Hooks * * Simplified React hooks for authentication state management that align * with the existing AuthContextType interface. */ import type { User, Session, AuthState, LoginCredentials, RegisterCredentials, LoginResponse, RegisterResponse, AuthError, UserRole, AuthContextType } from './types'; /** * Main authentication hook that provides all auth functionality */ export declare function useAuth(): AuthContextType; /** * Hook for current user data */ export declare function useUser(): { user: User | null; updateUser: (updates: Partial) => Promise; isLoading: boolean; error: AuthError | null; }; /** * Hook for session management */ export declare function useSession(): { session: Session | null; isValid: boolean; validateSession: () => Promise; logout: () => Promise; }; /** * Hook for permission checking */ export declare function usePermissions(): { permissions: Set; hasPermission: (permission: string) => boolean; hasRole: (role: UserRole) => boolean; hasAnyPermission: (permissionList: string[]) => boolean; hasAllPermissions: (permissionList: string[]) => boolean; }; /** * Hook for authentication forms */ export declare function useAuthForm(): { login: (credentials: LoginCredentials) => Promise; register: (credentials: RegisterCredentials) => Promise; isLoading: boolean; error: AuthError | null; clearError: () => void; }; /** * Hook for route protection */ export declare function useAuthGuard(): { isAuthenticated: boolean; isLoading: boolean; canAccess: boolean; }; /** * Subscribe to auth state changes */ export declare function useAuthSubscription(callback: (state: AuthState) => void): void; //# sourceMappingURL=hooks-new.d.ts.map