/** * Hook to access authentication state */ import type { User } from '../state/app-state.js'; /** * Access authentication state and permission checking * * @example * ```svelte * * * {#if auth.isAuthenticated} *
Welcome, {auth.user?.email}
* * {#if auth.hasPermission('articles.create')} * * {/if} * {:else} * Sign In * {/if} * ``` */ export declare function useAuth(): { /** The authenticated user (null if not authenticated) */ readonly user: User | null; /** Whether a user is authenticated */ readonly isAuthenticated: boolean; /** List of user's permissions */ readonly permissions: readonly string[]; /** Check if user has a specific permission */ hasPermission: (permission: string) => boolean; /** Check if user has all of the specified permissions */ hasAllPermissions: (permissions: string[]) => boolean; /** Check if user has any of the specified permissions */ hasAnyPermission: (permissions: string[]) => boolean; }; //# sourceMappingURL=useAuth.svelte.d.ts.map