/** * Pure utilities for the FormCacheSelector component. * * Mirrors Architecture §9.6. */ import type { FormCacheDTO } from './FormCacheSelector.types'; /** * Lenient field-level merge that restores a stored filter without ever * throwing — the resilience strategy for schema drift (FR-FFCS-011, FFCS-D006). * * Algorithm: * 1. If `rawJson` is null/undefined/non-object/array → return a fresh copy * of `emptyFilter`. * 2. For every key declared in `emptyFilter`, copy `rawJson[key]` only when * `typeof rawJson[key] === typeof emptyFilter[key]` — otherwise keep the * default value. * * The function never mutates `emptyFilter`; callers may pass a frozen object. * * @typeParam TFilter - The expected filter shape (drives the key set). * @param rawJson - The opaque JSON value retrieved from the backend. * @param emptyFilter - Default values used for missing or type-mismatched keys. * @returns A new object with the same keys as `emptyFilter`. */ export declare function safeParse>(rawJson: unknown, emptyFilter: TFilter): TFilter; /** * Returns a new array of caches sorted alphabetically by `name` (FR-FFCS-012). * * Uses `localeCompare` with `sensitivity: 'base'` so: * - sorting is case-insensitive ("apple" < "Banana"), * - accented Spanish characters are ordered correctly (e.g. "Año" before * "Beneficios") instead of the broken codepoint order a default `<` * comparator would produce. * * Pure — never mutates the input array. */ export declare function sortCaches(caches: FormCacheDTO[]): FormCacheDTO[]; //# sourceMappingURL=FormCacheSelector.utils.d.ts.map