import React, { type ReactNode } from 'react'; import { type AuthService } from '../services'; import type { AuthResponse, CustomAuthConfig } from '../types'; /** * Base auth configuration interface that can be extended */ export interface AppAuthConfig extends CustomAuthConfig { UserInfo: { id: string | number; userName: string; roles: string[]; [key: string]: unknown; }; TokenInfo: { token: string; expiresIn: number; }; Credentials: { username: string; password: string; }; Error: { code: string; message: string; }; } /** * Authentication context state with generic type parameter */ type AuthContextState = { user: T['UserInfo'] | null; isAuthenticated: boolean; isLoading: boolean; error: T['Error'] | null; }; /** * Authentication context actions with generic type parameter */ interface AuthContextActions { login: (response: T['Credentials'], rememberMe?: boolean) => Promise>; logout: () => Promise; updateUser: (userData: Partial) => void; clearError: () => void; } type AuthContextValue = AuthContextState & AuthContextActions & { authService: AuthService; }; /** * Authentication context with generic type parameter */ export declare const AuthContext: React.Context>; interface AuthProviderProps { children: ReactNode; authService: AuthService; validateOnInit?: boolean; } /** * Authentication context provider component with generic type parameter */ export declare function AuthProvider({ children, authService, validateOnInit, }: Readonly>): import("react/jsx-runtime").JSX.Element; /** * Custom hook for using auth context with generic type parameter */ export declare function useAuth(): AuthContextValue; export {};