context.d.ts
1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import * as React from 'react';
import { FormProviderProps as RcFormProviderProps } from 'rc-field-form/lib/FormContext';
import { ColProps } from '../grid/col';
import { FormLabelAlign } from './interface';
import { RequiredMark } from './Form';
import { ValidateStatus } from './FormItem';
/**
* Form Context
* Set top form style and pass to Form Item usage.
*/
export interface FormContextProps {
vertical: boolean;
name?: string;
colon?: boolean;
labelAlign?: FormLabelAlign;
labelCol?: ColProps;
wrapperCol?: ColProps;
requiredMark?: RequiredMark;
itemRef: (name: (string | number)[]) => (node: React.ReactElement) => void;
}
export declare const FormContext: React.Context<FormContextProps>;
/**
* Form Item Context
* Used for Form noStyle Item error collection
*/
export interface FormItemContextProps {
updateItemErrors: (name: string, errors: string[]) => void;
}
export declare const FormItemContext: React.Context<FormItemContextProps>;
/**
* Form Provider
*
*/
export interface FormProviderProps extends Omit<RcFormProviderProps, 'validateMessages'> {
}
export declare const FormProvider: React.FC<FormProviderProps>;
/**
* Used for ErrorList only
*/
export interface FormItemPrefixContextProps {
prefixCls: string;
status?: ValidateStatus;
}
export declare const FormItemPrefixContext: React.Context<FormItemPrefixContextProps>;