/** * `@nifrajs/web-react/auth` - React bindings for `@nifrajs/authjs`. `` * seeds the subtree with a session (from a loader on the server, refreshed in the browser) and * `useAuthSession()` reads it; `signIn`/`signOut` delegate to the shared client. Imports only * `react` + `@nifrajs/authjs/client`; no JSX (the package builds with plain `tsc`). */ import { type AuthClient, type Session, type SignInOptions, type SignOutOptions } from "@nifrajs/authjs/client"; import { type ReactNode } from "react"; export type { Session }; export type AuthStatus = "loading" | "authenticated" | "unauthenticated"; export interface AuthSession { readonly status: AuthStatus; readonly session: Session | null; /** Re-read the session from the server (after an out-of-band change, for example). */ readonly refresh: () => Promise; readonly signIn: (providerId: string, options?: SignInOptions) => Promise; readonly signOut: (options?: SignOutOptions) => Promise; } export interface AuthSessionProviderProps { /** Shared client (base path, custom fetch). Default `createAuthClient()`. */ readonly client?: AuthClient; /** SSR seed from a loader (`await getSession(request, config)`). `undefined` (default) fetches * on mount instead - the subtree renders `loading` until it resolves. */ readonly initialSession?: Session | null; readonly children?: ReactNode; } /** Provide the Auth.js session to the subtree. Memoized on client + seed; refresh re-reads. A new * `initialSession` (a loader re-run on navigation) replaces the session, as a remount would. */ export declare function AuthSessionProvider(props: AuthSessionProviderProps): ReactNode; /** Read the Auth.js session (`{ status, session }`). Throws if no `` is above. */ export declare function useAuthSession(): AuthSession; //# sourceMappingURL=auth.d.ts.map