/** * @fileoverview Unknown-key detection for enrichment leaves. * * Valibot's `v.object` strips keys the schema does not declare — a * misspelled optional key (`submitLabl` for `submitLabel`) parses cleanly * and the generator silently sees the default. `findUnknownKeys` walks a * value against its schema and reports every key the schema would drop, * so `parseEnrichmentUmbrella` can surface them as * `UNKNOWN_ENRICHMENT_KEY` warnings. * * Comparing against the *schema* (not the parsed output) keeps the check * immune to `v.pipe` transforms that legitimately reshape output, and * gives correct "did you mean …?" suggestions — the intended key is in * the schema's entries even when it is optional and absent from the * parsed value. This is deliberately a warning layer, not * `v.strictObject`: a shared client.json paired with an older generator * version stays survivable under version skew instead of hard-failing. * * The walk is fail-open: unions, intersections, loose objects, and any * shape it cannot attribute keys to are left alone. * * @module findUnknownKeys */ /** * One key the schema would silently drop. `path` runs from the walked * root down to the unknown key (array indices as strings); `suggestion` * is the nearest declared key at the same level, when a plausible typo * target exists. */ export type UnknownKey = { path: string[]; suggestion?: string; }; /** * Every key in `value` that `schema` does not declare and `v.parse` would * therefore drop. Wrong-typed values are not this function's concern — * the subsequent `v.parse` throws on those as before. */ export declare const findUnknownKeys: (schema: unknown, value: unknown) => UnknownKey[];