UNPKG

mobx-react-form

Version:
50 lines (47 loc) 1.7 kB
import Base from "./Base"; import Field from "./Field"; import ValidatorInterface from "./models/ValidatorInterface"; import { FieldConstructor } from "./models/FieldInterface"; import { FormInterface, FieldsDefinitions, FormConfig } from "./models/FormInterface"; export default class Form extends Base implements FormInterface { name: string; path: any; validator: ValidatorInterface; debouncedValidation: any; constructor(setup?: FieldsDefinitions, { name, options, plugins, bindings, hooks, handlers, }?: FormConfig); get validatedValues(): object; get error(): string | null; get hasError(): boolean; get isValid(): boolean; get isPristine(): boolean; get isDirty(): boolean; get isDefault(): boolean; get isEmpty(): boolean; get focused(): boolean; get touched(): boolean; get disabled(): boolean; makeField(data: FieldConstructor, FieldClass?: typeof Field): Field; /** DEPRECATED Init Form Fields and Nested Fields init($fields: any = null): void { _.set(this, "fields", observable.map({})); this.state.initial.props.values = $fields; // eslint-disable-line this.state.current.props.values = $fields; // eslint-disable-line this.initFields({ fields: $fields || this.state.struct(), }); } */ invalidate(message?: string | null, deep?: boolean): void; showErrors(show?: boolean): void; resetValidation(deep?: boolean): void; /** Clear Form Fields */ clear(deep?: boolean, execHook?: boolean): void; /** Reset Form Fields */ reset(deep?: boolean, execHook?: boolean): void; } //# sourceMappingURL=Form.d.ts.map