tiny-mobx-form
Version:
Tiny (~2KB) tree-shakable MobX form library
23 lines (22 loc) • 760 B
TypeScript
import { IField, IFieldOptions, IForm, IFormSchema } from './types';
export declare class Field implements IField {
form: IForm;
name: string;
label: string;
placeholder: string;
initialValue: string;
isTouched: boolean;
isFocused: boolean;
validation: string;
private _value;
private readonly validators;
private readonly validationMessages;
get value(): string;
get isValid(): boolean;
get isDirty(): boolean;
get errors(): string[];
get hasErrors(): boolean;
constructor(form: IForm, { name, label, placeholder, validation, initialValue, validationMessages, }: IFormSchema, { additionalValidators }: IFieldOptions);
set value(value: string);
reset(): void;
}