import * as React from "react"; type FormResult = { fieldName: string; valid: boolean; value: any; data: Object; dataOrigin: Object; }; /** * default * { * smooth: true, * offset: 50, * delay: 100, * duration: 1000 * } */ type scrollOptions = { duration: number; delay: number; offset: number; smooth: boolean; }; declare class FormStore { forms: Array; _value: any; _labelStyle: React.CSSProperties; _containerStyle: React.CSSProperties; errorMessage: string; top: FormStore; parent: FormStore; isEmpty: boolean; labelStyle: React.CSSProperties; containerStyle: React.CSSProperties; isRequired: boolean; value: any; errors: Array; isFormValid: boolean; validating: boolean; readonly childFormMap: { [key: string]: FormStore }; setupForm(): void; tearDownForm(): void; updateFormConfig(): void; changeValue(value: any): void; findFormByFieldName(name: string): FormStore | null; $(name: string): FormStore | null; has(name: string): boolean; brother(name: string): FormStore | null; hasBrother(name: string): boolean; resetValue(resetChildren?: boolean): void; validate(): boolean; validateAsync(): Promise; getResult(): FormResult; getFormData(): Object; scrollTo(options?: scrollOptions): Function; } type FormRule = {}; type RootFormProps = { labelStyle: React.CSSProperties; onPressEnter(target: HTMLElement): void; format: (data: any) => Function | any; afterInit: (form: FormStore) => void; }; type RootFormState = { form: FormStore; }; type BoxFormProps = { fieldName: string; form: FormStore; style: React.CSSProperties; containerStyle: React.CSSProperties; children: (form: FormStore) => JSX.Element | JSX.Element; format: (data: any) => Function | any; mode?: "array" | "object"; }; type ConnectFormProps = { fieldName: string; initialValue: any; rules: Array | Function; label: string | JSX.Element; labelStyle: React.CSSProperties; containerStyle: React.CSSProperties; children: (form: FormStore) => JSX.Element | null; hint: string | number | JSX.Element; form: FormStore; format: (data: any) => Function | any; }; declare class FormBox extends React.Component { static defaultProps: { style: {}; containerStyle: {}; }; } declare class Connect extends React.Component { static defaultProps: { rules: []; containerStyle: {}; }; } declare class Hidden extends React.Component { static defaultProps: { rules: []; containerStyle: {}; type: "hidden"; }; } declare class Clear extends React.Component< { visible: boolean; }, {} > { static defaultProps: { size: 14; visible: true; title: "清除"; }; } declare class Spin extends React.Component< { visible: boolean; }, {} > { static defaultProps: { size: 14; visible: true; }; } type FormatPresets = { DELETE: () => (data: any) => any; MERGE: (mergeObject: any) => (data: any) => any; }; declare class ErrorFields extends React.Component {} declare class FormTrack extends React.Component<{ children: Function; }> {} export default class Form extends React.Component { static defaultProps: { labelStyle: { width: "30%"; paddingRight: 10; }; }; static Box: FormBox; static Connect: Connect; static ErrorFields: ErrorFields; static Hidden: Hidden; static Track: FormTrack; static Clear: Clear; static Spin: Spin; static UI_Container: Function; static UI_Label: Function; static UI_Content: Function; static UI_Message: Function; static UI_Clear: Clear; static UI_Spin: Spin; static FormatPresets: FormatPresets; static withForm: Function; getForm(): FormStore; }