import { ReactNode } from 'react'; import { FieldMetaState, FieldInputProps, UseFieldConfig } from 'react-final-form'; import { ValidatorDefinition } from './validator-helpers'; import { ValidatorFunction } from '../validators/validators'; import { AnyObject } from '../common-types'; import { DataType } from '../data-types/data-types'; export interface ValidatorType extends Object { type: string; message?: ReactNode; } export interface UseFieldApiConfig extends AnyObject { name: string; validate?: (ValidatorDefinition | ValidatorFunction)[]; skipRegistration?: boolean; useWarnings?: boolean; resolveProps?: (props: any, fieldProps: any, formOptions: any) => any; initializeOnMount?: boolean; component?: string; render?: any; clearOnUnmount?: boolean; dataType?: DataType; FieldProps?: any; clearedValue?: any; initialValue?: any; value?: any; type?: string; } export interface UseFieldApiComponentConfig extends UseFieldConfig { name: string; } export interface Meta extends FieldMetaState { warning?: any; } export interface UseFieldApiProps extends AnyObject { input: FieldInputProps; meta: Meta; arrayValidator?: ValidatorFunction; } export type BaseFieldProps

= UseFieldApiConfig & P; declare const useFieldApi: ({ name, resolveProps, skipRegistration, ...props }: UseFieldApiConfig) => UseFieldApiProps; export default useFieldApi;