UNPKG

1.59 kBTypeScriptView Raw
1import React from 'react';
2import type { ReactNode } from 'react';
3import { NativeProps } from '../../utils/native-props';
4import { ListProps } from '../list';
5import type { FormProps as RcFormProps, FormInstance as RCFormInstance } from 'rc-field-form';
6import { FormContextType } from './context';
7export declare type FormInstance = Pick<RCFormInstance, 'getFieldValue' | 'getFieldsValue' | 'getFieldError' | 'getFieldsError' | 'isFieldTouched' | 'isFieldsTouched' | 'resetFields' | 'setFields' | 'setFieldValue' | 'setFieldsValue' | 'submit' | 'validateFields'>;
8export declare type FormProps = Pick<RcFormProps, 'form' | 'initialValues' | 'name' | 'preserve' | 'validateMessages' | 'validateTrigger' | 'onFieldsChange' | 'onFinish' | 'onFinishFailed' | 'onValuesChange' | 'children'> & NativeProps<'--border-inner' | '--border-top' | '--border-bottom' | '--prefix-width'> & Partial<FormContextType> & {
9 footer?: ReactNode;
10 mode?: ListProps['mode'];
11};
12export declare const Form: React.ForwardRefExoticComponent<Pick<RcFormProps<any>, "form" | "children" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & {
13 className?: string | undefined;
14 style?: (React.CSSProperties & Partial<Record<"--border-bottom" | "--border-inner" | "--border-top" | "--prefix-width", string>>) | undefined;
15 tabIndex?: number | undefined;
16} & React.AriaAttributes & Partial<FormContextType> & {
17 footer?: ReactNode;
18 mode?: ListProps['mode'];
19} & React.RefAttributes<FormInstance>>;