UNPKG

tdesign-react

Version:
64 lines (63 loc) 2.77 kB
import React from 'react'; import type { FormItemInstance } from './FormItem'; import type { InternalFormInstance } from './hooks/interface'; import type { NamePath, TdFormListProps, TdFormProps } from './type'; declare const FormContext: React.Context<{ form?: InternalFormInstance; labelWidth?: TdFormProps["labelWidth"]; statusIcon?: TdFormProps["statusIcon"]; labelAlign: TdFormProps["labelAlign"]; layout: TdFormProps["layout"]; colon: TdFormProps["colon"]; initialData: TdFormProps["initialData"]; requiredMark: TdFormProps["requiredMark"]; requiredMarkPosition: TdFormProps["requiredMarkPosition"]; scrollToFirstError: TdFormProps["scrollToFirstError"]; showErrorMessage: TdFormProps["showErrorMessage"]; resetType: TdFormProps["resetType"]; disabled: TdFormProps["disabled"]; readOnly: TdFormProps["readOnly"]; rules: TdFormProps["rules"]; errorMessage: TdFormProps["errorMessage"]; formMapRef: React.RefObject<Map<any, React.RefObject<FormItemInstance>>>; floatingFormDataRef: React.RefObject<Record<any, any>>; onFormItemValueChange: (changedValue: Record<string, unknown>) => void; }>; export declare const useFormContext: () => { form?: InternalFormInstance; labelWidth?: TdFormProps["labelWidth"]; statusIcon?: TdFormProps["statusIcon"]; labelAlign: TdFormProps["labelAlign"]; layout: TdFormProps["layout"]; colon: TdFormProps["colon"]; initialData: TdFormProps["initialData"]; requiredMark: TdFormProps["requiredMark"]; requiredMarkPosition: TdFormProps["requiredMarkPosition"]; scrollToFirstError: TdFormProps["scrollToFirstError"]; showErrorMessage: TdFormProps["showErrorMessage"]; resetType: TdFormProps["resetType"]; disabled: TdFormProps["disabled"]; readOnly: TdFormProps["readOnly"]; rules: TdFormProps["rules"]; errorMessage: TdFormProps["errorMessage"]; formMapRef: React.RefObject<Map<any, React.RefObject<FormItemInstance>>>; floatingFormDataRef: React.RefObject<Record<any, any>>; onFormItemValueChange: (changedValue: Record<string, unknown>) => void; }; export default FormContext; export declare const FormListContext: React.Context<{ name: NamePath; fullPath?: NamePath; rules: TdFormListProps["rules"]; formListMapRef: React.RefObject<Map<NamePath, React.RefObject<FormItemInstance>>>; initialData: TdFormListProps["initialData"]; form?: InternalFormInstance; }>; export declare const useFormListContext: () => { name: NamePath; fullPath?: NamePath; rules: TdFormListProps["rules"]; formListMapRef: React.RefObject<Map<NamePath, React.RefObject<FormItemInstance>>>; initialData: TdFormListProps["initialData"]; form?: InternalFormInstance; };