@conform-to/react
Version:
Conform view adapter for react
39 lines • 1.7 kB
TypeScript
export type FormRef = React.RefObject<HTMLFormElement | HTMLFieldSetElement | HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | HTMLButtonElement | null> | string;
export declare function getFormElement(formRef: FormRef | undefined): HTMLFormElement | null;
export declare function focusable(element: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement): void;
export declare function initializeField(element: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement, options: {
defaultValue?: string | string[] | File | File[] | null;
defaultChecked?: boolean;
value?: string;
} | undefined): void;
export declare function getRadioGroupValue(inputs: Array<HTMLInputElement>): string | undefined;
export declare function getCheckboxGroupValue(inputs: Array<HTMLInputElement>): string[] | undefined;
export type InputSnapshot = {
value?: string;
options?: string[];
checked?: boolean;
files?: File[];
};
export declare function getInputSnapshot(input: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement): {
files: File[] | undefined;
value?: undefined;
checked?: undefined;
options?: undefined;
} | {
value: string;
checked: boolean;
files?: undefined;
options?: undefined;
} | {
options: string[];
files?: undefined;
value?: undefined;
checked?: undefined;
} | {
value: string;
files?: undefined;
checked?: undefined;
options?: undefined;
};
export declare function getDefaultSnapshot(defaultValue: string | string[] | File | File[] | FileList | null | undefined, defaultChecked: boolean | undefined, value: string | undefined): InputSnapshot;
//# sourceMappingURL=util.d.ts.map