/** * Protected Route * * Wrapper component that redirects unauthenticated users. * Provides loading state and fallback content. * * Canon: Protection is invisible when valid; only the content remains. */ import type { Snippet } from 'svelte'; import type { User } from '../types.js'; interface Props { /** Current user (null if not authenticated) */ user: User | null; /** Whether auth state is still loading */ isLoading?: boolean; /** Redirect URL for unauthenticated users */ loginUrl?: string; /** Include redirect parameter in login URL */ includeRedirect?: boolean; /** Content to render when authenticated */ children?: Snippet; /** Content to render while loading */ loading?: Snippet; /** Content to render when not authenticated (before redirect) */ fallback?: Snippet; /** Called when redirect happens (for SPA navigation) */ onRedirect?: (url: string) => void; } declare const ProtectedRoute: import("svelte").Component; type ProtectedRoute = ReturnType; export default ProtectedRoute;