import React, { ReactNode } from 'react'; import { FormInstance } from 'acud/lib/form'; export declare type DISPLAY_ITEM_RELATION = '&&' | '||' | '' | undefined; export declare type DISPLAY_ITEM_EXP = '===' | '!==' | '>' | '>=' | '<' | '<=' | 'in' | 'not-in' | 'custom'; export interface OnDisplayItemContent { relation?: DISPLAY_ITEM_RELATION; exp: DISPLAY_ITEM_EXP; value: any; customMethod?: () => boolean; } export interface OnDisplayItem { name: string; relation?: DISPLAY_ITEM_RELATION; content: OnDisplayItemContent[]; } export interface DuFormItemControl { type: string; name?: string; label?: string; disabled?: boolean; rules?: any[]; extra?: string; events?: object; style?: object; defaultValue?: any; onDisplay?: OnDisplayItem[]; config?: object[] | object; dynamic?: boolean | object; content?: React.ComponentType; } export interface FetchDataAction { formData?: object; fetchFormAction?: string; fetchFormPayload?: object; $onFetchFormRequest?: (params: object) => void; $onFetchFormResponse?: (data: object) => void; } export interface FetchOptionsAction { name: string; action: string; fetchKey?: string[]; payload?: object; $onFetchOptionsRequest?: (params: any) => any; $onFetchOptionsResponse?: (data: any) => any[]; } export interface SubmitAction { submitFormAction: string; payload?: any; $onSubmitRequest?: (params: any) => any; $onSubmitResponse?: (data: any) => void; $onSubmitError?: (error: object) => void; $toastSuccessMessage?: string; $toastErrorMessage?: string; $toastSuccessMessageFn?: (data: any) => void; $toastErrorMessageFn?: (data: any) => void; } export interface ActionConfig { fetchDataAction?: FetchDataAction; fetchOptionsAction?: FetchOptionsAction[]; submitAction?: SubmitAction; } export interface StepControls { title: string; controls: DuFormItemControl[]; } export interface HooksFormProps { title?: string | ReactNode; description?: string | ReactNode; prefixCls?: string; className?: string; form: FormInstance; controlsConfig: DuFormItemControl[] | StepControls[]; formData: object; doSubmit: (values: any) => void; type?: string; stepIndex: number; stepButtonConfig: () => DuFormItemControl; formItemOptionMerge: object; formExtraConfig?: object; moreSettingCollapsed?: any; defaultValueForceUpdate?: boolean; } export interface StepFormConfig { prevText?: string; prevClick?: () => boolean; nextText?: string; nextClick?: (formData: object) => boolean; endText?: string; isSavedRealTime?: boolean; } export interface UseFormOptions { type?: string; controls: (props: HooksFormProps, options: object, customFunctions: object, values: object) => DuFormItemControl[] | StepControls[]; actionConfig: ActionConfig; customFunctions?: object; formItemOption?: object; stepConfig?: StepFormConfig; } export interface SelectOption { value: string; label: string; } export interface DuFormItemProps { prefixCls?: string; control: any; option: any; formData?: any; [fetch: string]: any; } export interface RelationFormItemsProps extends React.Props { prefixCls?: string; controls: DuFormItemControl[]; option?: any; formData?: any; [fetch: string]: any; moreSettingCollapsed?: any; } export interface StepFormProps { form: FormInstance; steps: StepControls[]; stepConfig?: StepFormConfig; option?: any; formData?: any; onSubmit: (values: any) => void; [fetch: string]: any; }