ui-developer-fab/dist/types.d.ts
autocommit 705d74a49f chore: initial package split from monorepo
Package: @lilith/ui-developer-fab
Split from: lilith/ui.git or lilith/build.git
Publish workflow: calls lilith/workflows/.forgejo/workflows/publish-npm.yml@main
2026-04-20 01:11:35 -07:00

90 lines
No EOL
2.6 KiB
TypeScript

/**
* Types for the unified developer tools FAB component
*/
/**
* Access level option for the access level switcher category
*/
export interface AccessLevel {
value: string;
label: string;
}
/**
* Profile option for the profile switcher category
*/
export interface Profile {
id: string;
name: string;
}
/**
* Props for the DeveloperFab component
*/
export interface DeveloperFabProps {
/**
* Position of the FAB
* @default 'bottom-right'
*/
position?: 'bottom-left' | 'bottom-right';
/**
* Access level options to display
* If undefined, the access level category will not be shown
*/
accessLevels?: AccessLevel[];
/**
* Profile options to display
* If undefined, the profile category will not be shown
*/
profiles?: Profile[];
/**
* Whether to show the storage management category
* @default true
*/
showStorage?: boolean;
/**
* Whether to show the content editor category
* Enables toggle for @lilith/ui-dev-content overlay
* @default false
*/
showContentEditor?: boolean;
/**
* DevUserProvider context for state management
* Optional - only needed if access level/profile switching should update context
*/
devUserContext?: DevUserContextForFAB;
/**
* Callback when access level changes
* Optional - maps access level to user types and updates devUserContext
*/
onAccessLevelChange?: (level: string, context: DevUserContextForFAB) => void;
/**
* Callback when profiles change
* Optional - updates devUserContext with profile changes
*/
onProfileChange?: (profileId: string, context: DevUserContextForFAB) => void;
}
/**
* Storage entry for the storage manager
*/
export interface StorageEntry {
key: string;
value: string;
type: 'localStorage' | 'sessionStorage';
}
/**
* Simplified DevUserContext interface for DeveloperFAB integration
* This matches the subset of DevUserContextValue needed for FAB functionality
*/
export interface DevUserContextForFAB {
/** Array of selected user type IDs */
userTypes: string[];
/** Currently primary/active type ID */
primaryType: string | null;
/** Add a type to the user's account */
addType: (typeId: string) => void;
/** Remove a type from the user's account */
removeType: (typeId: string) => void;
/** Set the primary type (must be one the user has) */
setPrimaryType: (typeId: string) => void;
/** Toggle a type on/off */
toggleType: (typeId: string) => void;
}
//# sourceMappingURL=types.d.ts.map