/** * Pure utility functions for OnboardingStepper form state management. * * Extracted for: * - Single Responsibility: each function does one thing * - Testability: pure functions with no React dependencies * - Reusability: shared across stepper consumers and step components */ import type { SelectChangeEvent } from "@mui/material"; export type FieldEvent = React.ChangeEvent | SelectChangeEvent; /** * Normalizes a DOM or synthetic event into a consistent shape * for form state updates. * * Handles four event categories: * 1. **Custom selection events** — members, insumos, activity selections * 2. **File inputs** — creates object URL for preview * 3. **Checkboxes** — uses `checked` instead of `value` * 4. **Default text/select** — standard `name`/`value` extraction */ export declare const normalizeFieldEvent: (e: FieldEvent) => { readonly name: string; readonly value: unknown; readonly checked: undefined; readonly isCheckbox: false; readonly files?: undefined; readonly isFile?: undefined; } | { readonly name: string; readonly value: string; readonly files: FileList | null; readonly checked: undefined; readonly isCheckbox: false; readonly isFile: true; } | { readonly name: string; readonly value: string; readonly checked: boolean; readonly isCheckbox: true; readonly files?: undefined; readonly isFile?: undefined; }; /** * Immutably sets a nested value in an object using a path array. * * @example * setNestedValue({ location: { city: "SP" } }, ["location", "city"], "RJ") * // => { location: { city: "RJ" } } */ export declare const setNestedValue: (obj: Record, path: string[], value: unknown) => Record; /** * Creates a synthetic field event compatible with `handleChange`. * * Use for programmatic components (DatePicker, TimePicker, custom selects) * that don't emit native DOM events. * * **Prefer `setFieldValue` when available** — this is a backward-compat fallback. */ export declare const createFieldEvent: (name: string, value: unknown, type?: string, checked?: boolean) => { target: { checked?: boolean | undefined; name: string; value: unknown; type: string; }; };