import { Component, ComponentType } from "react";
import { Formatter, Parser, Validator, WrappedFieldProps } from "../index";
export type FieldsWarnerOrValidator =
| Validator
| Validator[]
| { [name: string]: Validator | Validator[] };
interface BaseFieldsProps
{
names: string[];
component?: ComponentType | undefined;
format?: Formatter | null | undefined;
props?: P | undefined;
parse?: Parser | undefined;
forwardRef?: boolean | undefined;
validate?: FieldsWarnerOrValidator | undefined;
warn?: FieldsWarnerOrValidator | undefined;
}
export interface GenericFields extends Component & P> {
dirty: boolean;
names: string[];
pristine: boolean;
values: { [name: string]: any };
getRenderedComponent(): Component;
}
export class Fields extends Component & P> implements GenericFields {
dirty: boolean;
names: string[];
pristine: boolean;
values: { [name: string]: any };
getRenderedComponent(): Component;
}
interface WrappedFieldsProps {
[name: string]: WrappedFieldsProps & WrappedFieldProps;
}