112 lines
2.6 KiB
TypeScript
112 lines
2.6 KiB
TypeScript
import { SessionCookie as _SessionCookie } from "../../routes/auth/callback.ts";
|
|
|
|
/**
|
|
* Props for the main WelcomeBar component
|
|
*/
|
|
export interface WelcomeBarProps {
|
|
publicId: string;
|
|
user_name: string;
|
|
currentRoute: string;
|
|
isEncrypted: boolean;
|
|
stateId: string;
|
|
/** Server calendar path for hydration-safe nav (layout should pass from server Date). */
|
|
serverCalendarPath?: string;
|
|
}
|
|
|
|
/**
|
|
* Consolidated state interface for WelcomeBar
|
|
* Single state object optimized for V8 hidden class caching
|
|
*/
|
|
export interface WelcomeBarState {
|
|
photoUrl: string;
|
|
}
|
|
|
|
/**
|
|
* Props for the EncryptionModal component
|
|
*/
|
|
export interface EncryptionModalProps {
|
|
showModal: boolean;
|
|
tempPassword: string;
|
|
passwordError: string;
|
|
isChangeMode?: boolean;
|
|
showRemovePinConfirm?: boolean;
|
|
persistAcrossDevices: boolean;
|
|
onPasswordChange: (password: string) => void;
|
|
onSetPassword: () => Promise<void>;
|
|
onSkip: () => void;
|
|
onClose?: () => void;
|
|
onRemovePinConfirm?: () => void;
|
|
onPersistAcrossDevicesChange: (persist: boolean) => void;
|
|
}
|
|
|
|
/**
|
|
* Navigation item configuration
|
|
*/
|
|
export interface NavigationItem {
|
|
path: string;
|
|
label: string;
|
|
requiresAuth?: boolean;
|
|
matchPrefixes?: string[];
|
|
isForm?: boolean;
|
|
formAction?: string;
|
|
formMethod?: string;
|
|
onClick?: () => void;
|
|
disabled?: boolean;
|
|
}
|
|
|
|
/**
|
|
* Navigation group configuration
|
|
*/
|
|
export interface NavigationGroup {
|
|
id: string;
|
|
label: string;
|
|
items: NavigationItem[];
|
|
}
|
|
|
|
/**
|
|
* Props for the NavigationMenu component
|
|
*/
|
|
export interface NavigationMenuProps {
|
|
isLoggedIn: boolean;
|
|
currentRoute: string;
|
|
navigationGroups?: NavigationGroup[];
|
|
serverCalendarPath?: string;
|
|
}
|
|
|
|
/**
|
|
* Props for the LockIcons component
|
|
*/
|
|
export interface LockIconsProps {
|
|
isPasswordSet: boolean;
|
|
isSkipped: boolean;
|
|
onClearSkip: () => void;
|
|
onChangePin: () => void;
|
|
isEncrypted: boolean;
|
|
onRequestPin: () => void;
|
|
}
|
|
|
|
/**
|
|
* Return type for useEncryption hook
|
|
*/
|
|
export interface UseEncryptionReturn {
|
|
isPasswordSet: boolean;
|
|
isSkipped: boolean;
|
|
showPasswordModal: boolean;
|
|
showChangePinModal: boolean;
|
|
showRemovePinConfirm: boolean;
|
|
tempPassword: string;
|
|
passwordError: string;
|
|
persistAcrossDevices: boolean;
|
|
handlePasswordChange: (password: string) => void;
|
|
handleSetPassword: () => Promise<void>;
|
|
handleSkipEncryption: () => void;
|
|
handleClearSkip: () => void;
|
|
handleChangePin: () => void;
|
|
handleCloseChangePin: () => void;
|
|
handleChangePinSubmit: () => Promise<void>;
|
|
handleRemovePinConfirm: () => void;
|
|
handleCancelRemovePin: () => void;
|
|
handlePersistAcrossDevicesChange: (persist: boolean) => void;
|
|
handleOpenPasswordModal: () => void;
|
|
}
|