export interface AuthUser { id: string; email?: string; username?: string; [key: string]: unknown; } /** Best display label for a user: email, then username, then id. */ export declare function userLabel(u: AuthUser | null | undefined): string; export type AuthStatus = "checking" | "authed" | "guest"; export interface AuthState { status: AuthStatus; user: AuthUser | null; } export interface AuthContextValue extends AuthState { /** Identifier field in use ("email" | "username") — drives input type/labels. */ usernameField: string; /** Re-read the session (`GET {basePath}/me`) and update state. */ refresh: () => Promise; /** Resolves to null on success, or an error message on failure. */ signIn: (email: string, password: string) => Promise; signUp: (email: string, password: string) => Promise; signOut: () => Promise; changePassword: (currentPassword: string, newPassword: string) => Promise; } /** Endpoint configuration shared by the provider and the bare api helpers. */ export interface AuthApiConfig { /** Base path the route handlers live under. Default "/api/auth". */ basePath?: string; }