//#region src/utilities/form-object.d.ts /** Leaf value a single control contributes to the extracted object. */ type FormObjectValue = string | number | boolean | File | null; /** A nested plain object built from a form's dot-notation field names. */ type FormValues = { [key: string]: unknown; }; /** Named controls FormObject reads from and writes to. */ type NamedControl = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement; /** * One control's contribution, as seen by transforms before the nested object * is assembled. `value` is the raw extracted value; `checked` is present only * for checkbox / radio controls. */ interface Field { control: NamedControl; /** Dot-notation path. Transforms may rewrite it to remap the output key. */ name: string; /** `string | string[] | File | File[] | boolean` depending on control type. */ value: unknown; /** Whether the control is checked — checkbox / radio only. */ checked?: boolean; } /** * Per-field transform. Return the (possibly modified) field to keep it, or * `null` to drop it from the output. Run in order during {@link FormObject.toObject}. */ type FormFieldTransform = (field: Field) => Field | null; interface FormObjectOptions { /** * Pipeline applied to each field during `toObject()`. Defaults to * {@link defaultTransforms}. Providing this **replaces** the defaults — * spread `...defaultTransforms` to extend them. */ transforms?: FormFieldTransform[]; } /** Drop disabled controls (mirrors native `FormData`). */ declare const skipDisabled: FormFieldTransform; /** Drop submit / reset / button / image controls and `