import { DateFormatOrder, FileDescriptor, HydratedFileInput, HydratedInput, InputDescriptor, Locale } from 'types'; /** * The minimal state shape the editable-leaf hydration reads. Both the * questionnaire's `DescriptorState` and parallel components (e.g. curing) * structurally satisfy it. `hydrateField` is generic over the concrete * `TState` so descriptor callbacks receive the exact state they were typed * against — no narrowing, no contravariance problem. */ export type HydratableState = { fields: Partial>; ui: { language: Locale; isShowingErrors: boolean; setValue: (key: TKey, value: string | undefined) => void; /** * File-typed write path, used only for descriptors whose `getInputType` * returns `'file'`. Optional because the questionnaire path doesn't have * file inputs and need not implement it. Required at runtime when a * file-typed descriptor is hydrated — `hydrateField` throws if absent. */ setFile?: (key: TKey, file: File | null) => void; hideErrors: () => void; }; config: { dateFormat?: DateFormatOrder; }; }; export declare const formatLabel: (label: string, aka: string | undefined) => string; /** * Hydrate a single editable input descriptor into the pure `HydratedInput` * a renderer consumes — value, onChange, label, options, error/status text, * and aria. Generic over the descriptor's state shape, so it serves both the * questionnaire (`DescriptorState`) and parallel components with their own * state. The caller resolves `errorKeys` (the questionnaire layers in its * aggregated-validation fallback; a parallel component can pass its own * `getErrors` result), so this function stays free of questionnaire-only * validation machinery. * * File-typed fields go through `hydrateFile`, not this function — file is * its own descriptor kind because its value is `File`, not string. * * Callers must only pass visible descriptors — visibility gating lives in the * orchestrating walker, not here. */ export declare const hydrateField: >(descriptor: InputDescriptor, state: TState, errorKeys: string[] | undefined) => HydratedInput; /** * Hydrate a `FileDescriptor` into the pure `HydratedFileInput` a renderer * consumes. Peer of `hydrateField` — file is its own descriptor kind * because its value is `File`, not string. Reuses `computeError` / * `computeAria` by structural type (FileDescriptor and InputDescriptor * share the relevant fields: `stateKey`, `getShouldShowErrors?`, * `getStatus?`). * * Throws at runtime if `state.ui.setFile` isn't provided — that's a wiring * error (a file descriptor was registered against a state hook that doesn't * know about files). */ export declare const hydrateFile: >(descriptor: FileDescriptor, state: TState, errorKeys: string[] | undefined) => HydratedFileInput;