zent
Version:
一套前端设计语言和基于React的实现
24 lines (22 loc) • 631 B
text/typescript
import { IMaybeError, IValidators, ValidateOption } from '../validate';
import type { FormModel } from './form';
export interface IModel<Value> {
readonly id: string;
getRawValue(): Value;
getSubmitValue(): any;
pristine(): boolean;
touched(): boolean;
dirty(): boolean;
valid(): boolean;
patchValue(value: Value): void;
validate(strategy: ValidateOption): Promise<any>;
reset(): void;
clear(): void;
clearError(): void;
initialize(value: Value): void;
error: IMaybeError<Value>;
owner: IModel<any> | null;
form: FormModel | null | undefined;
dispose(): void;
validators: IValidators<Value>;
}