import { ChangeEvent, Component, ComponentType, DragEvent, FocusEvent, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes, } from "react"; import { Dispatch } from "redux"; export type Normalizer = (value: any, previousValue?: any, allValues?: any, previousAllValues?: any) => any; export type Formatter = (value: any, name: string) => any; export type Parser = (value: any, name: string) => any; export type Validator = (value: any, allValues?: any, props?: any, name?: any) => any; export type EventHandler = (event: Event, name?: string) => void; export type EventWithDataHandler = (event?: Event, newValue?: any, previousValue?: any, name?: string) => void; export interface EventOrValueHandler extends EventHandler { (value: any): void; } export interface CommonFieldInputProps { name: string; onDragStart: EventHandler>; onDrop: EventHandler>; onFocus: EventHandler>; } export interface CommonFieldProps extends CommonFieldInputProps { onBlur: EventWithDataHandler>; onChange: EventWithDataHandler>; } export interface BaseFieldProps

extends Partial { name: string; component?: ComponentType | "input" | "select" | "textarea" | undefined; format?: Formatter | null | undefined; normalize?: Normalizer | undefined; props?: P | undefined; parse?: Parser | undefined; validate?: Validator | Validator[] | undefined; warn?: Validator | Validator[] | undefined; forwardRef?: boolean | undefined; immutableProps?: string[] | undefined; } export interface GenericField

extends Component & P> { dirty: boolean; name: string; pristine: boolean; value: any; getRenderedComponent(): Component; } export type GenericFieldHTMLAttributes = | InputHTMLAttributes | SelectHTMLAttributes | TextareaHTMLAttributes; export class Field

extends Component

{ dirty: boolean; name: string; pristine: boolean; value: any; getRenderedComponent(): Component; } export interface WrappedFieldProps { input: WrappedFieldInputProps; meta: WrappedFieldMetaProps; } export interface WrappedFieldInputProps extends CommonFieldInputProps { checked?: boolean | undefined; value: any; onBlur: EventOrValueHandler>; onChange: EventOrValueHandler>; } export interface WrappedFieldMetaProps { active?: boolean | undefined; autofilled: boolean; asyncValidating: boolean; dirty: boolean; dispatch: Dispatch; error?: any; form: string; initial: any; invalid: boolean; pristine: boolean; submitting: boolean; submitFailed: boolean; touched: boolean; valid: boolean; visited: boolean; warning?: any; } export default Field;