UNPKG

@altiore/form

Version:

Form helper for building powerful forms

11 lines (10 loc) 588 B
import { FieldArrayState, FieldMeta, FieldType, FormContextState, ValidateFunc } from '../types'; declare type ResType = { isInsideForm: boolean; isRegistered: boolean; name: string; field?: FieldMeta; validators: Array<ValidateFunc>; }; export declare const useRegisterField: <FormState extends Record<string, any> = Record<string, any>>(fieldArrayState: FieldArrayState, formState: FormContextState, providedName: keyof FormState, validate: ValidateFunc | Array<ValidateFunc>, fieldType?: FieldType, isArray?: boolean, defaultValue?: unknown) => ResType; export {};