UNPKG

svelte-clerk

Version:

Svelte Clerk is the easiest way to add authentication and user management to your Svelte and SvelteKit applications. Add sign up, sign in, and profile management to your application in minutes.

21 lines (20 loc) 768 B
import type { CustomMenuItem, CustomPage } from '@clerk/shared/types'; type ReorderItemLabel = 'manageAccount' | 'signOut'; type BaseActionItem = Pick<CustomMenuItem, 'label' | 'mountIcon' | 'unmountIcon'>; type BaseLinkItem = Pick<CustomMenuItem, 'label' | 'href' | 'mountIcon' | 'unmountIcon'>; type ActionItem = { label: ReorderItemLabel; } | (BaseActionItem & { open: string; onClick?: never; }) | (BaseActionItem & { onClick: CustomMenuItem['onClick']; open?: never; }); type LinkItem = BaseLinkItem; type MenuItemType = 'action' | 'link'; export type UserButtonContext = { addCustomMenuItem<T extends MenuItemType>(type: T, item: T extends 'action' ? ActionItem : LinkItem): void; addCustomPage(page: CustomPage): void; }; export {};