Merge pull request #17249 from ant-design/revert-form-type

fix: revert `unknown` to `any`
This commit is contained in:
偏右 2019-06-24 12:02:19 +08:00 committed by GitHub
commit f6121aa1cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 68 additions and 75 deletions

View File

@ -2,7 +2,7 @@ import * as React from 'react';
import * as ReactDOM from 'react-dom'; import * as ReactDOM from 'react-dom';
export interface InputElementProps { export interface InputElementProps {
children: React.ReactElement<unknown>; children: React.ReactElement<any>;
} }
export default class InputElement extends React.Component<InputElementProps, any> { export default class InputElement extends React.Component<InputElementProps, any> {

View File

@ -17,8 +17,8 @@ export type DataSourceItemType =
| React.ReactElement<OptGroupProps>; | React.ReactElement<OptGroupProps>;
export interface AutoCompleteInputProps { export interface AutoCompleteInputProps {
onChange?: React.FormEventHandler<unknown>; onChange?: React.FormEventHandler<any>;
value: unknown; value: any;
} }
export type ValidInputElement = export type ValidInputElement =
@ -34,7 +34,7 @@ export interface AutoCompleteProps extends AbstractSelectProps {
backfill?: boolean; backfill?: boolean;
optionLabelProp?: string; optionLabelProp?: string;
onChange?: (value: SelectValue) => void; onChange?: (value: SelectValue) => void;
onSelect?: (value: SelectValue, option: Object) => unknown; onSelect?: (value: SelectValue, option: Object) => any;
onBlur?: (value: SelectValue) => void; onBlur?: (value: SelectValue) => void;
onFocus?: () => void; onFocus?: () => void;
children?: children?:

View File

@ -17,11 +17,11 @@ export interface Route {
export interface BreadcrumbProps { export interface BreadcrumbProps {
prefixCls?: string; prefixCls?: string;
routes?: Route[]; routes?: Route[];
params?: unknown; params?: any;
separator?: React.ReactNode; separator?: React.ReactNode;
itemRender?: ( itemRender?: (
route: Route, route: Route,
params: unknown, params: any,
routes: Array<Route>, routes: Array<Route>,
paths: Array<string>, paths: Array<string>,
) => React.ReactNode; ) => React.ReactNode;

View File

@ -93,13 +93,13 @@ export type AnchorButtonProps = {
target?: string; target?: string;
onClick?: React.MouseEventHandler<HTMLElement>; onClick?: React.MouseEventHandler<HTMLElement>;
} & BaseButtonProps & } & BaseButtonProps &
Omit<React.AnchorHTMLAttributes<unknown>, 'type' | 'onClick'>; Omit<React.AnchorHTMLAttributes<any>, 'type' | 'onClick'>;
export type NativeButtonProps = { export type NativeButtonProps = {
htmlType?: ButtonHTMLType; htmlType?: ButtonHTMLType;
onClick?: React.MouseEventHandler<HTMLElement>; onClick?: React.MouseEventHandler<HTMLElement>;
} & BaseButtonProps & } & BaseButtonProps &
Omit<React.ButtonHTMLAttributes<unknown>, 'type' | 'onClick'>; Omit<React.ButtonHTMLAttributes<any>, 'type' | 'onClick'>;
export type ButtonProps = Partial<AnchorButtonProps & NativeButtonProps>; export type ButtonProps = Partial<AnchorButtonProps & NativeButtonProps>;

View File

@ -20,7 +20,7 @@ export interface AbstractCheckboxProps<T> {
onMouseLeave?: React.MouseEventHandler<HTMLElement>; onMouseLeave?: React.MouseEventHandler<HTMLElement>;
onKeyPress?: React.KeyboardEventHandler<HTMLElement>; onKeyPress?: React.KeyboardEventHandler<HTMLElement>;
onKeyDown?: React.KeyboardEventHandler<HTMLElement>; onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
value?: unknown; value?: any;
tabIndex?: number; tabIndex?: number;
name?: string; name?: string;
children?: React.ReactNode; children?: React.ReactNode;

View File

@ -39,7 +39,7 @@ export interface CheckboxGroupState {
export interface CheckboxGroupContext { export interface CheckboxGroupContext {
checkboxGroup: { checkboxGroup: {
toggleOption: (option: CheckboxOptionType) => void; toggleOption: (option: CheckboxOptionType) => void;
value: unknown; value: any;
disabled: boolean; disabled: boolean;
}; };
} }

View File

@ -16,7 +16,7 @@ export interface PickerProps {
style?: React.CSSProperties; style?: React.CSSProperties;
popupStyle?: React.CSSProperties; popupStyle?: React.CSSProperties;
dropdownClassName?: string; dropdownClassName?: string;
locale?: unknown; locale?: any;
size?: 'large' | 'small' | 'default'; size?: 'large' | 'small' | 'default';
getCalendarContainer?: (triggerNode: Element) => HTMLElement; getCalendarContainer?: (triggerNode: Element) => HTMLElement;
open?: boolean; open?: boolean;

View File

@ -13,15 +13,15 @@ import { FIELD_META_PROP, FIELD_DATA_PROP } from './constants';
import { FormContext } from './context'; import { FormContext } from './context';
import { FormWrappedProps } from './interface'; import { FormWrappedProps } from './interface';
type FormCreateOptionMessagesCallback = (...args: unknown[]) => string; type FormCreateOptionMessagesCallback = (...args: any[]) => string;
interface FormCreateOptionMessages { interface FormCreateOptionMessages {
[messageId: string]: string | FormCreateOptionMessagesCallback | FormCreateOptionMessages; [messageId: string]: string | FormCreateOptionMessagesCallback | FormCreateOptionMessages;
} }
export interface FormCreateOption<T> { export interface FormCreateOption<T> {
onFieldsChange?: (props: T, fields: unknown, allFields: unknown) => void; onFieldsChange?: (props: T, fields: any, allFields: any) => void;
onValuesChange?: (props: T, changedValues: unknown, allValues: unknown) => void; onValuesChange?: (props: T, changedValues: any, allValues: any) => void;
mapPropsToFields?: (props: T) => void; mapPropsToFields?: (props: T) => void;
validateMessages?: FormCreateOptionMessages; validateMessages?: FormCreateOptionMessages;
withRef?: boolean; withRef?: boolean;
@ -71,30 +71,24 @@ export type ValidationRule = {
/** validate from a regular expression */ /** validate from a regular expression */
pattern?: RegExp; pattern?: RegExp;
/** transform a value before validation */ /** transform a value before validation */
transform?: (value: unknown) => unknown; transform?: (value: any) => any;
/** custom validate function (Note: callback must be called) */ /** custom validate function (Note: callback must be called) */
validator?: ( validator?: (rule: any, value: any, callback: any, source?: any, options?: any) => any;
rule: unknown,
value: unknown,
callback: unknown,
source?: unknown,
options?: unknown,
) => unknown;
}; };
export type ValidateCallback<V> = (errors: unknown, values: V) => void; export type ValidateCallback<V> = (errors: any, values: V) => void;
export type GetFieldDecoratorOptions = { export type GetFieldDecoratorOptions = {
/** 子节点的值的属性,如 Checkbox 的是 'checked' */ /** 子节点的值的属性,如 Checkbox 的是 'checked' */
valuePropName?: string; valuePropName?: string;
/** 子节点的初始值,类型、可选值均由子节点决定 */ /** 子节点的初始值,类型、可选值均由子节点决定 */
initialValue?: unknown; initialValue?: any;
/** 收集子节点的值的时机 */ /** 收集子节点的值的时机 */
trigger?: string; trigger?: string;
/** 可以把 onChange 的参数转化为控件的值,例如 DatePicker 可设为:(date, dateString) => dateString */ /** 可以把 onChange 的参数转化为控件的值,例如 DatePicker 可设为:(date, dateString) => dateString */
getValueFromEvent?: (...args: unknown[]) => unknown; getValueFromEvent?: (...args: any[]) => any;
/** Get the component props according to field value. */ /** Get the component props according to field value. */
getValueProps?: (value: unknown) => unknown; getValueProps?: (value: any) => any;
/** 校验子节点值的时机 */ /** 校验子节点值的时机 */
validateTrigger?: string | string[]; validateTrigger?: string | string[];
/** 校验规则,参见 [async-validator](https://github.com/yiminghe/async-validator) */ /** 校验规则,参见 [async-validator](https://github.com/yiminghe/async-validator) */
@ -102,7 +96,7 @@ export type GetFieldDecoratorOptions = {
/** 是否和其他控件互斥,特别用于 Radio 单选控件 */ /** 是否和其他控件互斥,特别用于 Radio 单选控件 */
exclusive?: boolean; exclusive?: boolean;
/** Normalize value to form component */ /** Normalize value to form component */
normalize?: (value: unknown, prevValue: unknown, allValues: unknown) => unknown; normalize?: (value: any, prevValue: any, allValues: any) => any;
/** Whether stop validate on first rule of error for this field. */ /** Whether stop validate on first rule of error for this field. */
validateFirst?: boolean; validateFirst?: boolean;
/** 是否一直保留子节点的信息 */ /** 是否一直保留子节点的信息 */
@ -141,11 +135,11 @@ export type ValidateFieldsOptions = {
}; };
// function create // function create
export type WrappedFormUtils<V = unknown> = { export type WrappedFormUtils<V = any> = {
/** 获取一组输入控件的值,如不传入参数,则获取全部组件的值 */ /** 获取一组输入控件的值,如不传入参数,则获取全部组件的值 */
getFieldsValue(fieldNames?: Array<string>): { [field: string]: unknown }; getFieldsValue(fieldNames?: Array<string>): { [field: string]: any };
/** 获取一个输入控件的值 */ /** 获取一个输入控件的值 */
getFieldValue(fieldName: string): unknown; getFieldValue(fieldName: string): any;
/** 设置一组输入控件的值 */ /** 设置一组输入控件的值 */
setFieldsValue(obj: Object): void; setFieldsValue(obj: Object): void;
/** 设置一组输入控件的值 */ /** 设置一组输入控件的值 */
@ -192,17 +186,15 @@ export type WrappedFormUtils<V = unknown> = {
): (node: React.ReactNode) => React.ReactNode; ): (node: React.ReactNode) => React.ReactNode;
}; };
export interface WrappedFormInternalProps<V = unknown> { export interface WrappedFormInternalProps<V = any> {
form: WrappedFormUtils<V>; form: WrappedFormUtils<V>;
} }
export interface RcBaseFormProps { export interface RcBaseFormProps {
wrappedComponentRef?: unknown; wrappedComponentRef?: any;
} }
export interface FormComponentProps<V = unknown> export interface FormComponentProps<V = any> extends WrappedFormInternalProps<V>, RcBaseFormProps {
extends WrappedFormInternalProps<V>,
RcBaseFormProps {
form: WrappedFormUtils<V>; form: WrappedFormUtils<V>;
} }

View File

@ -5,7 +5,7 @@ const customCache = new Set<string>();
export interface CustomIconOptions { export interface CustomIconOptions {
scriptUrl?: string; scriptUrl?: string;
extraCommonProps?: { [key: string]: unknown }; extraCommonProps?: { [key: string]: any };
} }
export default function create(options: CustomIconOptions = {}): React.SFC<IconProps> { export default function create(options: CustomIconOptions = {}): React.SFC<IconProps> {

View File

@ -14,14 +14,14 @@ export interface MentionProps {
prefixCls?: string; prefixCls?: string;
suggestionStyle?: React.CSSProperties; suggestionStyle?: React.CSSProperties;
defaultSuggestions?: Array<SuggestionItme>; defaultSuggestions?: Array<SuggestionItme>;
suggestions?: Array<React.ReactElement<unknown>>; suggestions?: Array<React.ReactElement<any>>;
onSearchChange?: (value: string, trigger: string) => unknown; onSearchChange?: (value: string, trigger: string) => any;
onChange?: (contentState: unknown) => void; onChange?: (contentState: any) => void;
notFoundContent?: unknown; notFoundContent?: any;
loading?: boolean; loading?: boolean;
style?: React.CSSProperties; style?: React.CSSProperties;
defaultValue?: unknown; defaultValue?: any;
value?: unknown; value?: any;
className?: string; className?: string;
multiLines?: boolean; multiLines?: boolean;
prefix?: string | string[]; prefix?: string | string[];
@ -29,14 +29,14 @@ export interface MentionProps {
getSuggestionContainer?: (triggerNode: Element) => HTMLElement; getSuggestionContainer?: (triggerNode: Element) => HTMLElement;
onFocus?: React.FocusEventHandler<HTMLElement>; onFocus?: React.FocusEventHandler<HTMLElement>;
onBlur?: React.FocusEventHandler<HTMLElement>; onBlur?: React.FocusEventHandler<HTMLElement>;
onSelect?: (suggestion: string, data?: unknown) => void; onSelect?: (suggestion: string, data?: any) => void;
readOnly?: boolean; readOnly?: boolean;
disabled?: boolean; disabled?: boolean;
placement?: MentionPlacement; placement?: MentionPlacement;
} }
export interface MentionState { export interface MentionState {
filteredSuggestions?: Array<unknown>; filteredSuggestions?: Array<any>;
focus?: Boolean; focus?: Boolean;
} }

View File

@ -19,7 +19,7 @@ export type MentionPlacement = 'top' | 'bottom';
export interface OptionProps { export interface OptionProps {
value: string; value: string;
children: React.ReactNode; children: React.ReactNode;
[key: string]: unknown; [key: string]: any;
} }
export interface MentionProps extends RcMentionsProps { export interface MentionProps extends RcMentionsProps {

View File

@ -15,7 +15,7 @@ import raf from '../_util/raf';
export interface SelectParam { export interface SelectParam {
key: string; key: string;
keyPath: Array<string>; keyPath: Array<string>;
item: unknown; item: any;
domEvent: Event; domEvent: Event;
selectedKeys: Array<string>; selectedKeys: Array<string>;
} }
@ -23,7 +23,7 @@ export interface SelectParam {
export interface ClickParam { export interface ClickParam {
key: string; key: string;
keyPath: Array<string>; keyPath: Array<string>;
item: unknown; item: any;
domEvent: Event; domEvent: Event;
} }

View File

@ -39,7 +39,7 @@ function getMessageInstance(callback: (i: any) => void) {
type NoticeType = 'info' | 'success' | 'error' | 'warning' | 'loading'; type NoticeType = 'info' | 'success' | 'error' | 'warning' | 'loading';
export interface ThenableArgument { export interface ThenableArgument {
(val: unknown): void; (val: any): void;
} }
export interface MessageType { export interface MessageType {

View File

@ -74,7 +74,7 @@ export interface ModalProps {
maskStyle?: React.CSSProperties; maskStyle?: React.CSSProperties;
mask?: boolean; mask?: boolean;
keyboard?: boolean; keyboard?: boolean;
wrapProps?: unknown; wrapProps?: any;
prefixCls?: string; prefixCls?: string;
} }
@ -85,8 +85,8 @@ export interface ModalFuncProps {
title?: React.ReactNode; title?: React.ReactNode;
content?: React.ReactNode; content?: React.ReactNode;
// TODO: find out exact types // TODO: find out exact types
onOk?: (...args: unknown[]) => unknown; onOk?: (...args: any[]) => any;
onCancel?: (...args: unknown[]) => unknown; onCancel?: (...args: any[]) => any;
okButtonProps?: NativeButtonProps; okButtonProps?: NativeButtonProps;
cancelButtonProps?: NativeButtonProps; cancelButtonProps?: NativeButtonProps;
centered?: boolean; centered?: boolean;
@ -214,7 +214,7 @@ export default class Modal extends React.Component<ModalProps, {}> {
const closeIcon = ( const closeIcon = (
<span className={`${prefixCls}-close-x`}> <span className={`${prefixCls}-close-x`}>
<Icon className={`${prefixCls}-close-icon`} type={'close'} /> <Icon className={`${prefixCls}-close-icon`} type="close" />
</span> </span>
); );

View File

@ -5,8 +5,8 @@ import { AbstractCheckboxProps } from '../checkbox/Checkbox';
export type RadioGroupButtonStyle = 'outline' | 'solid'; export type RadioGroupButtonStyle = 'outline' | 'solid';
export interface RadioGroupProps extends AbstractCheckboxGroupProps { export interface RadioGroupProps extends AbstractCheckboxGroupProps {
defaultValue?: unknown; defaultValue?: any;
value?: unknown; value?: any;
onChange?: (e: RadioChangeEvent) => void; onChange?: (e: RadioChangeEvent) => void;
size?: 'large' | 'default' | 'small'; size?: 'large' | 'default' | 'small';
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>; onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
@ -18,13 +18,13 @@ export interface RadioGroupProps extends AbstractCheckboxGroupProps {
} }
export interface RadioGroupState { export interface RadioGroupState {
value: unknown; value: any;
} }
export interface RadioGroupContext { export interface RadioGroupContext {
radioGroup: { radioGroup: {
onChange: React.ChangeEventHandler<HTMLInputElement>; onChange: React.ChangeEventHandler<HTMLInputElement>;
value: unknown; value: any;
disabled: boolean; disabled: boolean;
name: string; name: string;
}; };

View File

@ -59,9 +59,9 @@ export interface SelectProps<T = SelectValue> extends AbstractSelectProps {
firstActiveValue?: string | string[]; firstActiveValue?: string | string[];
onChange?: ( onChange?: (
value: T, value: T,
option: React.ReactElement<unknown> | React.ReactElement<unknown>[], option: React.ReactElement<any> | React.ReactElement<any>[],
) => void; ) => void;
onSelect?: (value: T extends (infer I)[] ? I : T, option: React.ReactElement<unknown>) => void; onSelect?: (value: T extends (infer I)[] ? I : T, option: React.ReactElement<any>) => void;
onDeselect?: (value: T extends (infer I)[] ? I : T) => void; onDeselect?: (value: T extends (infer I)[] ? I : T) => void;
onBlur?: (value: T) => void; onBlur?: (value: T) => void;
onFocus?: () => void; onFocus?: () => void;
@ -75,7 +75,7 @@ export interface SelectProps<T = SelectValue> extends AbstractSelectProps {
optionFilterProp?: string; optionFilterProp?: string;
labelInValue?: boolean; labelInValue?: boolean;
tokenSeparators?: string[]; tokenSeparators?: string[];
getInputElement?: () => React.ReactElement<unknown>; getInputElement?: () => React.ReactElement<any>;
autoFocus?: boolean; autoFocus?: boolean;
suffixIcon?: React.ReactNode; suffixIcon?: React.ReactNode;
removeIcon?: React.ReactNode; removeIcon?: React.ReactNode;

View File

@ -43,7 +43,7 @@ import warning from '../_util/warning';
function noop() {} function noop() {}
function stopPropagation(e: React.SyntheticEvent<unknown>) { function stopPropagation(e: React.SyntheticEvent<any>) {
e.stopPropagation(); e.stopPropagation();
if (e.nativeEvent.stopImmediatePropagation) { if (e.nativeEvent.stopImmediatePropagation) {
e.nativeEvent.stopImmediatePropagation(); e.nativeEvent.stopImmediatePropagation();

View File

@ -13,7 +13,7 @@ import FilterDropdownMenuWrapper from './FilterDropdownMenuWrapper';
import { FilterMenuProps, FilterMenuState, ColumnProps, ColumnFilterItem } from './interface'; import { FilterMenuProps, FilterMenuState, ColumnProps, ColumnFilterItem } from './interface';
import { generateValueMaps } from './util'; import { generateValueMaps } from './util';
function stopPropagation(e: React.SyntheticEvent<unknown>) { function stopPropagation(e: React.SyntheticEvent<any>) {
e.stopPropagation(); e.stopPropagation();
if (e.nativeEvent.stopImmediatePropagation) { if (e.nativeEvent.stopImmediatePropagation) {
e.nativeEvent.stopImmediatePropagation(); e.nativeEvent.stopImmediatePropagation();

View File

@ -29,10 +29,10 @@ export interface ColumnProps<T> {
| ((options: { filters: TableStateFilters; sortOrder?: SortOrder }) => React.ReactNode); | ((options: { filters: TableStateFilters; sortOrder?: SortOrder }) => React.ReactNode);
key?: React.Key; key?: React.Key;
dataIndex?: string; // Note: We can not use generic type here, since we need to support nested key, see #9393 dataIndex?: string; // Note: We can not use generic type here, since we need to support nested key, see #9393
render?: (text: unknown, record: T, index: number) => React.ReactNode; render?: (text: any, record: T, index: number) => React.ReactNode;
align?: 'left' | 'right' | 'center'; align?: 'left' | 'right' | 'center';
filters?: ColumnFilterItem[]; filters?: ColumnFilterItem[];
onFilter?: (value: unknown, record: T) => boolean; onFilter?: (value: any, record: T) => boolean;
filterMultiple?: boolean; filterMultiple?: boolean;
filterDropdown?: React.ReactNode | ((props: FilterDropdownProps) => React.ReactNode); filterDropdown?: React.ReactNode | ((props: FilterDropdownProps) => React.ReactNode);
filterDropdownVisible?: boolean; filterDropdownVisible?: boolean;
@ -44,7 +44,7 @@ export interface ColumnProps<T> {
className?: string; className?: string;
fixed?: boolean | ('left' | 'right'); fixed?: boolean | ('left' | 'right');
filterIcon?: React.ReactNode | ((filtered: boolean) => React.ReactNode); filterIcon?: React.ReactNode | ((filtered: boolean) => React.ReactNode);
filteredValue?: unknown[]; filteredValue?: any[];
sortOrder?: SortOrder | boolean; sortOrder?: SortOrder | boolean;
children?: ColumnProps<T>[]; children?: ColumnProps<T>[];
onCellClick?: (record: T, event: Event) => void; onCellClick?: (record: T, event: Event) => void;
@ -135,6 +135,7 @@ export interface TableEventListeners {
onContextMenu?: (arg: React.SyntheticEvent) => void; onContextMenu?: (arg: React.SyntheticEvent) => void;
onMouseEnter?: (arg: React.SyntheticEvent) => void; onMouseEnter?: (arg: React.SyntheticEvent) => void;
onMouseLeave?: (arg: React.SyntheticEvent) => void; onMouseLeave?: (arg: React.SyntheticEvent) => void;
[name: string]: any; // https://github.com/ant-design/ant-design/issues/17245#issuecomment-504807714
} }
export interface TableProps<T> { export interface TableProps<T> {
@ -218,7 +219,7 @@ export interface SelectionCheckboxAllProps<T> {
getRecordKey: (record: T, index?: number) => string; getRecordKey: (record: T, index?: number) => string;
data: T[]; data: T[];
prefixCls: string | undefined; prefixCls: string | undefined;
onSelect: (key: string, index: number, selectFunc: unknown) => void; onSelect: (key: string, index: number, selectFunc: any) => void;
hideDefaultSelections?: boolean; hideDefaultSelections?: boolean;
selections?: SelectionItem[] | boolean; selections?: SelectionItem[] | boolean;
getPopupContainer?: GetPopupContainer; getPopupContainer?: GetPopupContainer;
@ -255,7 +256,7 @@ export interface FilterMenuProps<T> {
locale: TableLocale; locale: TableLocale;
selectedKeys: string[]; selectedKeys: string[];
column: ColumnProps<T>; column: ColumnProps<T>;
confirmFilter: (column: ColumnProps<T>, selectedKeys: string[]) => unknown; confirmFilter: (column: ColumnProps<T>, selectedKeys: string[]) => any;
prefixCls: string; prefixCls: string;
dropdownPrefixCls: string; dropdownPrefixCls: string;
getPopupContainer?: GetPopupContainer; getPopupContainer?: GetPopupContainer;

View File

@ -31,7 +31,7 @@ export interface TabsProps {
className?: string; className?: string;
animated?: boolean | { inkBar: boolean; tabPane: boolean }; animated?: boolean | { inkBar: boolean; tabPane: boolean };
tabBarGutter?: number; tabBarGutter?: number;
renderTabBar?: (props: TabsProps, DefaultTabBar: React.ReactNode) => React.ReactElement<unknown>; renderTabBar?: (props: TabsProps, DefaultTabBar: React.ReactNode) => React.ReactElement<any>;
destroyInactiveTabPane?: boolean; destroyInactiveTabPane?: boolean;
} }

View File

@ -35,16 +35,16 @@ export interface TreeSelectProps<T extends TreeNodeValue> extends AbstractSelect
autoFocus?: boolean; autoFocus?: boolean;
defaultValue?: T; defaultValue?: T;
dropdownStyle?: React.CSSProperties; dropdownStyle?: React.CSSProperties;
filterTreeNode?: (inputValue: string, treeNode: unknown) => boolean | boolean; filterTreeNode?: (inputValue: string, treeNode: any) => boolean | boolean;
labelInValue?: boolean; labelInValue?: boolean;
loadData?: (node: unknown) => void; loadData?: (node: any) => void;
maxTagCount?: number; maxTagCount?: number;
maxTagPlaceholder?: React.ReactNode | ((omittedValues: unknown[]) => React.ReactNode); maxTagPlaceholder?: React.ReactNode | ((omittedValues: any[]) => React.ReactNode);
multiple?: boolean; multiple?: boolean;
notFoundContent?: React.ReactNode; notFoundContent?: React.ReactNode;
onChange?: (value: T, label: unknown, extra: unknown) => void; onChange?: (value: T, label: any, extra: any) => void;
onSearch?: (value: unknown) => void; onSearch?: (value: any) => void;
onSelect?: (value: unknown) => void; onSelect?: (value: any) => void;
onTreeExpand?: (keys: Array<string>) => void; onTreeExpand?: (keys: Array<string>) => void;
onFocus?: React.FocusEventHandler<HTMLInputElement>; onFocus?: React.FocusEventHandler<HTMLInputElement>;
onBlur?: React.FocusEventHandler<HTMLInputElement>; onBlur?: React.FocusEventHandler<HTMLInputElement>;

View File

@ -148,7 +148,7 @@ export interface TreeProps {
style?: React.CSSProperties; style?: React.CSSProperties;
showIcon?: boolean; showIcon?: boolean;
icon?: ((nodeProps: AntdTreeNodeAttribute) => React.ReactNode) | React.ReactNode; icon?: ((nodeProps: AntdTreeNodeAttribute) => React.ReactNode) | React.ReactNode;
switcherIcon?: React.ReactElement<unknown>; switcherIcon?: React.ReactElement<any>;
prefixCls?: string; prefixCls?: string;
filterTreeNode?: (node: AntTreeNode) => boolean; filterTreeNode?: (node: AntTreeNode) => boolean;
children?: React.ReactNode; children?: React.ReactNode;

View File

@ -134,7 +134,7 @@
"eslint-plugin-jest": "^22.6.4", "eslint-plugin-jest": "^22.6.4",
"eslint-plugin-jsx-a11y": "^6.2.1", "eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-markdown": "~1.0.0", "eslint-plugin-markdown": "~1.0.0",
"eslint-plugin-react": "^7.13.0", "eslint-plugin-react": "~7.13.0",
"eslint-tinker": "^0.5.0", "eslint-tinker": "^0.5.0",
"fetch-jsonp": "^1.1.3", "fetch-jsonp": "^1.1.3",
"glob": "^7.1.4", "glob": "^7.1.4",