/** * @file Santd Form createDOMForm * @author mayihui@baidu.com **/ import san from 'san'; import { FieldsStore } from './createFieldsStore'; import Base from 'santd/base'; import { DecoratorOptions, FieldMeta, Field, FormCreateOptions, Mixins, ValidateFieldsOptions, ValidateFieldsCallback, RequiredPartKey } from '../interface'; import FormItem from '../FormItem'; export interface PrivateState { submiting: boolean; } export interface PrivateProps { form: san.DefinedTemplateComponentClass; } export interface Methods { getRules(fieldMeta: FieldMeta, action?: string): RuleItem[]; setFields(maybeNestedFields: Record, _callback?: () => void): void; setFieldsValue(changedValues: Record, callback: () => void): void; validateFieldsInternal(fields: Field[], { fieldNames, action, options }: { fieldNames?: string[] | undefined; action?: string | undefined; options?: ValidateFieldsOptions | undefined; }, callback?: ValidateFieldsCallback): void; validateFields: Mixins['validateFieldsAndScroll']; getCacheBind(name: string, action: string, fn: (innerName: string, action: string, ...args: unknown[]) => void): any; onCollectCommon(name: string, action: string, args: unknown[]): { name: string; fieldMeta: FieldMeta; field: RequiredPartKey, 'touched'>; }; onCollectValidate(name: string, action: string, ...args: unknown[]): void; onCollect(innerName: string, action: string, ...args: unknown[]): void; getFieldProps(name: string, options: DecoratorOptions): { [x: string]: any; } | undefined; getDecoratorComponent(name: string): Base | undefined; resetFields(ns: string[]): void; setDecoratorPropValue(decorator: DecoratorOptions, decoratorComponent: FormItem, options: FormCreateOptions): void; clearField(name: string): void; updated(): void; attached(): void; } export interface Attributes { getFieldsValue: FieldsStore['getFieldsValue']; getFieldValue: FieldsStore['getFieldValue']; setFieldsInitialValue: FieldsStore['setFieldsInitialValue']; getFieldsError: FieldsStore['getFieldsError']; getFieldError: FieldsStore['getFieldError']; isFieldValidating: FieldsStore['isFieldValidating']; isFieldsValidating: FieldsStore['isFieldsValidating']; isFieldsTouched: FieldsStore['isFieldsTouched']; isFieldTouched: FieldsStore['isFieldTouched']; getFieldInstance: (name: string) => FormItem; items: FormItem[]; fieldsStore: FieldsStore; renderFields: Record; cachedBind: Record; validateFieldsAndScroll: Mixins['validateFieldsAndScroll']; } export type BaseForm = san.ComponentDefineOptionsWithThis> & Attributes & OptionsT>; export default function (options?: FormCreateOptions, mixins?: {}): (wrappedComponent: san.ComponentDefineOptionsWithThis) => san.DefinedComponentClass, Methods> & Attributes>;