/** * header.ts * * Type definitions for header-related domain models. * These represent user, organization, and menu item data structures. */ /** * User object containing information about the logged-in user */ export interface User { /** Full name of the user */ name: string; /** Short name or initials (deprecated) */ shortname?: string; /** Last login timestamp (ISO string or Date) */ lastLoggedIn?: Date | string; } /** * Representation object containing information about the organization/entity being represented */ export interface Representing { /** Name of the organization or entity */ name: string; /** Short name or initials (deprecated) */ shortname?: string; /** Organization number */ orgNumber?: string | number; } /** * Menu item in the user menu * The iconName will be typed as PktIconName in package-specific implementations */ export interface UserMenuItem { /** Icon name to display */ iconName?: IconType; /** Text for the menu item */ title: string; /** Link URL or click handler function */ target: string | (() => void); } /** * Internal type for rendering links/buttons (supports both href and onClick) * Base interface for discriminated union */ export interface InternalMenuItemBase { title: string; iconName?: IconType; } /** * Internal menu item that is a link */ export interface InternalMenuLink extends InternalMenuItemBase { href: string; } /** * Internal menu item that is a button */ export interface InternalMenuButton extends InternalMenuItemBase { onClick: () => void; } /** * Union type for internal menu items (discriminated by href vs onClick) */ export type TInternalMenuItem = InternalMenuLink | InternalMenuButton; /** * Helper to convert UserMenuItem (with target) to internal format */ export declare const convertUserMenuItem: (item: UserMenuItem) => TInternalMenuItem; /** * Variant for the slot menu button in tablet/mobile mode */ export type TSlotMenuVariant = 'icon-only' | 'icon-right'; /** * Type for which menu is currently open in the header */ export type THeaderMenu = 'none' | 'slot' | 'search' | 'user'; /** * Placement options for the logout button */ export type TLogOutButtonPlacement = 'userMenu' | 'header' | 'both' | 'none'; /** * Position options for the header */ export type THeaderPosition = 'fixed' | 'relative'; /** * Scroll behavior options for the header */ export type THeaderScrollBehavior = 'hide' | 'none';