import { Serialize } from '@conform-to/dom/future';
import type { ControlOptions, ErrorContext, FormRef, IntentDispatcher } from './types';
export declare function getFormElement(formRef: FormRef | undefined): HTMLFormElement | null;
export declare function getSubmitEvent(event: React.FormEvent<HTMLFormElement>): SubmitEvent;
export declare function initializeField(element: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement, options: {
    defaultValue?: unknown;
    defaultChecked?: boolean | undefined;
    value?: string | undefined;
} | undefined): void;
export declare function resolveControlPayload(input: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | HTMLFieldSetElement | Array<HTMLInputElement>): unknown;
export declare function deriveDefaultPayload(options: ControlOptions): unknown;
/**
 * Focuses the first field with validation errors on default form submission.
 * Does nothing if the submission was triggered with a specific intent (e.g. validate / insert)
 */
export declare function focusFirstInvalidField<ErrorShape>(ctx: ErrorContext<ErrorShape>): void;
export declare function updateFormValue(form: HTMLFormElement, targetValue: Record<string, unknown>, serialize: Serialize): void;
export declare function resetFormValue(form: HTMLFormElement, defaultValue: Record<string, unknown>, serialize: Serialize): void;
/**
 * Creates a proxy that dynamically generates intent dispatch functions.
 * Each property access returns a function that submits the intent to the form.
 */
export declare function createIntentDispatcher<FormShape extends Record<string, any>>(formElement: HTMLFormElement | (() => HTMLFormElement | null), intentName: string): IntentDispatcher<FormShape>;
/**
 * Restores values from preserved inputs and removes them.
 * Called when PreserveBoundary mounts.
 */
export declare function cleanupPreservedInputs(boundary: HTMLElement, form: HTMLFormElement, name?: string): void;
/**
 * Clones inputs as hidden elements to preserve their values.
 * Called when PreserveBoundary unmounts.
 */
export declare function preserveInputs(inputs: Iterable<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>, form: HTMLFormElement, name?: string): void;
//# sourceMappingURL=dom.d.ts.map