import { type Dispatch, type SetStateAction } from "react"; import type { SortState } from "./sort_header"; /** `read` is required: stored data came from an earlier page version or by hand, so `JSON.parse` as `T` is * a lie that surfaces as a filter matching nothing. Validate and return `undefined` to fall back. `write` * only for types `JSON.stringify` cannot round-trip (`Set`, `Map`, `Date`). */ export interface PersistedCodec { read: (raw: unknown) => T | undefined; write?: (value: T) => unknown; } /** `useState` that remembers what a reader arranged (filters, grouping, folded bands), with the same * signature. Storage is per browser and origin — private to the app on that machine, never shared or * synced — so it is for convenience only; durable facts belong in a record. Every access is guarded * (absent, full, or throwing storage), and `fallback` makes the screen work with nothing stored. A new * `key` (a viewer named once the host knows them) reads what that key holds. */ export declare function usePersistedState(key: string, fallback: T, codec: PersistedCodec): [T, Dispatch>]; /** A string from a known set (an option key, a grouping): an allowlist, since a deleted option's key would * filter everything away. `""` is always allowed — the kit's "off". */ export declare function oneOf(allowed: readonly T[]): PersistedCodec; export declare const asText: PersistedCodec; /** Stored as an array, since JSON has no set; used for folded bands. */ export declare const asStringSet: PersistedCodec>; /** Takes the sortable columns, so a stored key from a renamed or removed column falls back to the * register's order. */ export declare function asSortState(keys: readonly string[]): PersistedCodec;