import * as React from 'react'; import { FormikProps, GenericFieldHTMLAttributes, FieldMetaProps, FieldHelperProps, FieldInputProps, FieldValidator } from './types'; export interface FieldProps { field: FieldInputProps; form: FormikProps; meta: FieldMetaProps; } export interface FieldConfig { /** * Field component to render. Can either be a string like 'select' or a component. */ component?: string | React.ComponentType> | React.ComponentType | React.ForwardRefExoticComponent; /** * Component to render. Can either be a string e.g. 'select', 'input', or 'textarea', or a component. */ as?: React.ComponentType['field']> | string | React.ComponentType | React.ForwardRefExoticComponent; /** * Render prop (works like React router's } />) * @deprecated */ render?: (props: FieldProps) => React.ReactNode; /** * Children render function {props => ...}) */ children?: ((props: FieldProps) => React.ReactNode) | React.ReactNode; /** * Validate a single field value independently */ validate?: FieldValidator; /** * Field name */ name: string; /** HTML input type */ type?: string; /** Field value */ value?: any; /** Inner ref */ innerRef?: (instance: any) => void; } export declare type FieldAttributes = GenericFieldHTMLAttributes & FieldConfig & T & { name: string; }; export declare type FieldHookConfig = GenericFieldHTMLAttributes & FieldConfig; export declare function useField(propsOrFieldName: string | FieldHookConfig): [FieldInputProps, FieldMetaProps, FieldHelperProps]; export declare function Field({ validate, name, render, children, as: is, // `as` is reserved in typescript lol component, ...props }: FieldAttributes): any;