import * as React from 'react';
import { User, OAuthProvider, AuthConfig } from '../auth/index.js';
export { AuthAdapter, AuthConfig, AuthState, AuthStatus, OAuthProvider, User, canAccessAdmin, canAccessReviewer, getAssignableRoles, getDefaultPortal, hasAllRoles, hasAnyRole, hasRole } from '../auth/index.js';

interface AuthContextValue {
    user: User | null;
    isLoading: boolean;
    isAuthenticated: boolean;
    signIn: (email: string, password: string) => Promise<User>;
    signInWithOAuth: (provider: OAuthProvider) => Promise<User>;
    signUp: (email: string, password: string, displayName: string) => Promise<User>;
    signOut: () => Promise<void>;
    resetPassword: (email: string) => Promise<void>;
    getToken: () => Promise<string | null>;
}
interface AuthProviderProps extends AuthConfig {
    children: React.ReactNode;
}
/**
 * AuthProvider — wraps your app with auth context.
 * You must provide an AuthAdapter implementation.
 *
 * ```tsx
 * import { AuthProvider } from './index.js'
 * import { myCustomAdapter } from './auth'
 *
 * <AuthProvider adapter={myCustomAdapter}>
 *   <App />
 * </AuthProvider>
 * ```
 */
declare function AuthProvider({ children, ...config }: AuthProviderProps): React.FunctionComponentElement<React.ProviderProps<AuthContextValue | null>>;
/**
 * useAuth — access auth state and methods.
 * Must be used within <AuthProvider>.
 */
declare function useAuth(): AuthContextValue;

interface AuthGuardProps {
    children: React.ReactNode;
    /** Custom loading UI */
    fallback?: React.ReactNode;
    /** URL to redirect to when unauthenticated (if using a router) */
    redirectTo?: string;
    /** Roles required (if any) */
    roles?: string[];
    /** UI to show when user lacks required roles */
    unauthorized?: React.ReactNode;
}
/**
 * AuthGuard — wraps content that requires authentication.
 * Shows loading fallback while auth state resolves.
 * Optionally restricts by role.
 */
declare function AuthGuard({ children, fallback, roles, unauthorized, }: AuthGuardProps): React.FunctionComponentElement<{
    children?: React.ReactNode | undefined;
}>;

export { type AuthContextValue, AuthGuard, type AuthGuardProps, AuthProvider, type AuthProviderProps, useAuth };
