export declare const ACTIVE_CONTEXT_STORAGE_KEY = "burdenoff-active-context"; export type ActiveContextStorageField = 'organization' | 'workspace' | 'project' | 'tenant'; export interface ActiveContextUrlParams { organization?: string; workspace?: string; project?: string; tenant?: string; } export declare const DEFAULT_ACTIVE_CONTEXT_URL_PARAMS: Required; export interface ActiveContextSnapshot { organizationId: string | null; workspaceId: string | null; projectId: string | null; tenantId: string | null; } export declare function getUrlParam(paramName: string): string | null; export declare function readActiveContextStorageValue(field: ActiveContextStorageField, storageKey?: string): string | null; export declare function writeActiveContextStorageValue(field: ActiveContextStorageField, value: string | null, storageKey?: string): void; /** * Writes a context value to localStorage as a fallback, bypassing the normal * "write then remove" pattern in writeActiveContextStorageValue. * * Storage contract: * - sessionStorage is the primary store for current tab context * - localStorage is used in two ways: * 1. As a legacy migration source (read by readActiveContextStorageValue, * then removed after migration to sessionStorage) * 2. As a fallback when profile context isn't yet hydrated (profileId is null) * * When the profile context isn't available (profileId returns null), we need * to persist to localStorage so that on full page reload (which clears * sessionStorage), the context can be restored. The value will be picked up * by readActiveContextStorageValue's profile context fallback. * * This helper does NOT clear localStorage afterwards, unlike the main write * function, because we intentionally want to re-seed it for reload recovery. */ export declare function writeActiveContextFallback(field: ActiveContextStorageField, value: string | null, storageKey?: string): void; export declare function clearActiveContextStorage(storageKey?: string): void; /** zustand `persist` name used by the microfe-auth store. */ export declare const AUTH_STORE_PERSIST_NAME = "auth-storage"; /** The subset of the persisted auth store usable as an ActiveContext fallback. */ export interface AuthStoreContextSnapshot { organizationId: string | null; workspaceId: string | null; projectId: string | null; } /** localStorage key the microfe-auth store persists to for a given profile. */ export declare function getAuthStoreStorageKey(profileId: string): string; /** * Tolerantly parse a persisted auth-store payload. Any shape this does not * recognise yields an all-null snapshot ("no fallback available"); it never * throws. */ export declare function parseAuthStoreContext(raw: string | null): AuthStoreContextSnapshot; /** * Read the persisted auth-store context for the active profile. * * Purely a read: unlike `readActiveContextStorageValue`, this never seeds * sessionStorage or the profile context with what it finds. Profile * resolution uses `resolveActiveProfileId()` — the same scheme the rest of * this module uses — so the fallback can never come from another account. */ export declare function readAuthStoreContext(): AuthStoreContextSnapshot; export declare function readActiveContextValueWithUrlPrecedence(field: ActiveContextStorageField, options?: { storageKey?: string; urlParam?: string; }): string | null; export declare function readActiveContextSnapshot(storageKey?: string, urlParams?: ActiveContextUrlParams): ActiveContextSnapshot; //# sourceMappingURL=ActiveContextStorage.d.ts.map