import * as react_jsx_runtime from 'react/jsx-runtime'; import { ReactNode } from 'react'; interface AuthGuardClassNames { root?: string; fallback?: string; skeleton?: string; loading?: string; /** Centered/fullscreen layout wrapper */ layout?: string; } type AuthGuardLayout = "inline" | "centered" | "fullscreen"; interface AuthGuardProps { children: ReactNode; /** Shown when not authenticated. Default: */ fallback?: ReactNode; /** Redirect unauthenticated users to this path (e.g. "/login"). Uses onRedirect if provided, else window.location. */ redirectTo?: string; /** Custom redirect function for SPA routers (Next.js, React Router). e.g. (path) => router.replace(path) */ onRedirect?: (path: string) => void; /** Query param for return URL when redirecting. Default: "returnUrl" */ returnUrlParam?: string; /** Layout for fallback content. "centered" and "fullscreen" give polished auth UX. */ layout?: AuthGuardLayout; /** Root class when showing fallback */ className?: string; classNames?: AuthGuardClassNames; /** When true, show fallback (login) instead of redirecting. When false, redirect when redirectTo is set, else render null. */ showFallback?: boolean; /** When true, show skeleton while loading. When false, show "Loading..." text. */ useSkeleton?: boolean; } /** * Wraps content and shows fallback (e.g. LoginForm) when the user is not authenticated. * Use inside CilantroProvider. * * For Next.js: pass onRedirect={(path) => router.replace(path)} and redirectTo="/login". * For return-after-login flow: set redirectTo="/login"; AuthGuard will redirect with ?returnUrl=currentPath. */ declare function AuthGuard({ children, fallback, redirectTo, onRedirect, returnUrlParam, layout, className, classNames, showFallback, useSkeleton, }: AuthGuardProps): react_jsx_runtime.JSX.Element | null; export { AuthGuard as A, type AuthGuardClassNames as a, type AuthGuardLayout as b, type AuthGuardProps as c };