/** Prefix of the localStorage entry that remembers a dismissed key. */ export declare const DISMISSED_STORAGE_PREFIX = "alfadocs-ui.dismissed."; /** How long a dismissal lasts unless the host says otherwise: 30 days. */ export declare const DISMISSED_DEFAULT_LIFETIME_MS: number; /** The most dismissals the kit keeps; the oldest go first. */ export declare const DISMISSED_MAX_ENTRIES = 200; /** * A usable key, or undefined: an empty key means no persistence. Every * surface taking a `dismissKey` reads it through this, so they agree. */ export declare function usableDismissKey(key: string | undefined): string | undefined; /** Whether `key` has been dismissed in this browser (or this page). */ export declare function isDismissed(key: string): boolean; /** Remember `key` as dismissed, for `lifetimeMs` (default 30 days). */ export declare function rememberDismissal(key: string, lifetimeMs?: number): void; /** Forget a dismissal, so the notice for `key` shows again. */ export declare function forgetDismissal(key: string): void; export interface UseDismissedOptions { /** * How long a dismissal lasts, in ms. Defaults to * DISMISSED_DEFAULT_LIFETIME_MS (30 days). `Infinity` keeps it until * the cap of DISMISSED_MAX_ENTRIES drops it. Read when `dismiss` runs: * the expiry is stored with the entry. */ lifetimeMs?: number; } export interface UseDismissedReturn { /** * True once `key` has been dismissed in this browser. Always false * without a key. True on the server and while hydrating (unknown), so * a dismissed notice is never shown, not even for a frame. */ dismissed: boolean; /** Remember the key as dismissed. Does nothing without a key. */ dismiss: () => void; /** Forget the dismissal, so the notice shows again. */ restore: () => void; } /** * A notice that stays dismissed in this browser, keyed by `key`, for 30 * days or `options.lifetimeMs`. Pass the same key wherever the notice * appears; a new key shows it again, so put the condition in the key. * Keys sit in plain browser storage: never put personal or patient data * in one. * * @example * const { dismissed, dismiss } = useDismissed(`hours-${hoursVersion}`, { * lifetimeMs: 7 * 24 * 60 * 60 * 1000, * }); */ export declare function useDismissed(key: string | undefined, options?: UseDismissedOptions): UseDismissedReturn; /** * Dismissed flags for several keys at once, in order (false for a * missing key). For containers that count their notices, such as * NoticeGroup. Same rules as `useDismissed`. */ export declare function useDismissedKeys(keys: ReadonlyArray): boolean[]; //# sourceMappingURL=use-dismissed.d.ts.map