-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.d.ts
31 lines (24 loc) · 1.32 KB
/
index.d.ts
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
// Type definitions for react-antd-formutil@>=1.0.0
// Project: react-antd-formutil
// Definitions by: qiqiboy <https://github.com/qiqiboy>
import { FormItemProps } from 'antd/es/form/FormItem';
// If the next line occur error, please install rc-field-form or add 'skipLibCheck' to tsconfig.json for disable t.ds check.
import { FieldProps } from 'rc-field-form/es/Field';
import React from 'react';
import { BaseEasyFieldComponentProps, $FieldHandler, Omit, OtherKeys } from 'react-formutil';
export * from 'react-formutil';
export type ErrorLevel = 0 | 1 | 2 | 'off';
// Compatible with antd@3 & antd@4
type FilterPropNames = any extends FieldProps ? '__NO__' : keyof FieldProps;
export interface FormItemComponentProps<T = any, P = {}, Fields = {}, WeakFields = Fields>
extends BaseEasyFieldComponentProps<T, P, Fields, WeakFields>,
Omit<FormItemProps, FilterPropNames> {
itemProps?: Omit<FormItemProps, FilterPropNames>;
errorLevel?: ErrorLevel;
noStyle?: boolean;
children: React.ReactElement<any> | (($fieldHandler: Partial<$FieldHandler<T>> & OtherKeys) => React.ReactNode);
}
export class FormItem<T = any, P = {}, Fields = {}, WeakFields = Fields> extends React.Component<
FormItemComponentProps<T, P, Fields, WeakFields> & OtherKeys
> {}
export function setErrorLevel(errorLevel: ErrorLevel): void;