import React, { HTMLProps, Ref } from 'react';
import { SectionProps } from '../Section';
import { FormStore } from './FormStore';
import { InputType } from './Input';
export declare type FormProps = Omit & Pick, 'action' | 'method' | 'target' | 'name'> & {
nodeRef?: Ref;
submitButton?: string | boolean;
fields?: A;
errors?: FormErrors;
onSubmit?: (e: React.FormEvent, values: FormValues) => FormErrors | Promise>;
children?: React.ReactNode;
useForm?: FormStore;
size?: number;
};
export declare type FormValues = {
[key in keyof FormFieldsObj]: any;
};
export declare type FormFieldsObj = {
[key: string]: FormFieldType;
};
export declare type FormErrors = {
[key in keyof A]: string;
} | string | null | true | void;
export declare type FormFieldType = {
label: string;
type?: InputType;
value?: any;
required?: boolean;
description?: string;
validate?: (val: any) => string;
} | {
label: string;
type: 'select';
value: {
label: string;
value: string;
}[];
required?: boolean;
description?: string;
validate?: (val: any) => string;
} | {
label: string;
type: 'custom';
children: React.ReactNode;
value?: any;
required?: boolean;
validate?: (val: any) => string;
};
export declare type FormStoreProps = Pick, 'fields' | 'errors'>;
//# sourceMappingURL=types.d.ts.map