import { CardProps } from '@heroui/react'; import { ComponentType, ReactNode } from 'react'; import { AuthorizationSnapshotView } from '../authorization/authorization-snapshot.js'; import { AuthUiSettingsView } from '../../../lib/auth/core/auth-view.js'; import { AthenaAuthUiOptions } from '../../../lib/auth/core/ui-options.js'; import { ResolvedSettingsModel, ResolvedSettingsNavigationItem } from '../../../lib/auth/settings/settings-surface-types.js'; export interface SettingsTabEntry { href: string; label: ReactNode; view: AuthUiSettingsView; } export type ResolvedSettingsTabEntry = Omit & SettingsTabEntry & { isHidden: boolean; sortOrder: number; }; export interface SettingsPluginPanel { component?: unknown; key: string; label?: unknown; view?: unknown; } export type SettingsPluginPanelComponent = ComponentType<{ variant?: CardProps["variant"]; }>; export interface ResolvedSettingsRoute { matched: boolean; path: string; view: AuthUiSettingsView | null; } /** * Settings URL segment, or `null` when `pathname` is not under the settings * base. Bare `/settings` is the account segment. Does not invent Account for * unknown plugin paths. */ export declare function extractSettingsPathFromPathname(pathname: string | null | undefined, settingsBasePath?: string): string | null; export declare function resolveSettingsPathFromPathname(pathname: string | null | undefined, settingsBasePath?: string): string; /** * URL segment → view. First view that claims a path wins so deprecated * aliases (workspaceNotifications → "notifications") cannot overwrite the * canonical tab view and drop SettingsPanel to Account. */ export declare function invertSettingsPathViews(pairs: ReadonlyArray): Record; export declare function resolveSettingsRoute({ pathname, settingsBasePath, viewPaths }: { pathname: string | null | undefined; settingsBasePath: string; viewPaths: ReadonlyArray; }): ResolvedSettingsRoute; /** * Diagnostics SSOT: catalog `viewPaths` first, then requested path/view * coherence. Never maps an unmatched settings URL to Account. */ export declare function resolveSettingsRouteFromCatalog({ catalog, pathname }: { catalog: Record | null | undefined; pathname: string | null | undefined; }): ResolvedSettingsRoute & { underSettings: boolean; }; export declare function useSettingsCatalog(options: { authorizationError?: Error | null; authorizationSnapshot?: AuthorizationSnapshotView | null; authorizationStatus?: "pending" | "success" | "error" | "unavailable"; path?: string; ui?: AthenaAuthUiOptions; view?: AuthUiSettingsView; }): { activePluginPanel: { component?: unknown; label?: unknown; view?: unknown; key: string; pluginId: string; requiresCapability: import('../../../lib/auth/core/plugin-capability.js').AuthPluginRequiredCapability | undefined; } | undefined; activeSurface: import('../../../lib/auth/settings/settings-surface-types.js').ResolvedSettingsSurface | null; activeTab: ResolvedSettingsTabEntry | undefined; auth: import('../../../lib/auth/settings/normalize-settings-auth.js').NormalizedSettingsAuth; authorizationError: Error | null; authorizationSnapshot: AuthorizationSnapshotView | null; authorizationStatus: "success" | "unavailable" | "error" | "pending"; canonicalModel: ResolvedSettingsModel; currentView: string; navTabs: ResolvedSettingsTabEntry[]; pluginPanels: { component?: unknown; label?: unknown; view?: unknown; key: string; pluginId: string; requiresCapability: import('../../../lib/auth/core/plugin-capability.js').AuthPluginRequiredCapability | undefined; }[]; requestedView: AuthUiSettingsView; resolvedUi: AthenaAuthUiOptions | undefined; settingsLocalization: { account?: string; cancel?: string; security?: string; settings?: string; }; visibleNavTabs: ResolvedSettingsTabEntry[]; }; export type SettingsCatalog = ReturnType;