Browse Source

revert unknown to any

pull/17249/head
afc163 5 years ago
parent
commit
57c28def68
No known key found for this signature in database GPG Key ID: 738F973FCE5C6B48
  1. 2
      components/auto-complete/InputElement.tsx
  2. 6
      components/auto-complete/index.tsx
  3. 4
      components/breadcrumb/Breadcrumb.tsx
  4. 4
      components/button/button.tsx
  5. 2
      components/checkbox/Checkbox.tsx
  6. 2
      components/checkbox/Group.tsx
  7. 2
      components/date-picker/interface.tsx
  8. 2
      components/icon/IconFont.tsx
  9. 16
      components/mention/index.tsx
  10. 2
      components/mentions/index.tsx
  11. 4
      components/menu/index.tsx
  12. 2
      components/message/index.tsx
  13. 6
      components/modal/Modal.tsx
  14. 8
      components/radio/interface.tsx
  15. 6
      components/select/index.tsx
  16. 2
      components/table/Table.tsx
  17. 2
      components/table/filterDropdown.tsx
  18. 10
      components/table/interface.tsx
  19. 2
      components/tabs/index.tsx
  20. 12
      components/tree-select/interface.tsx
  21. 2
      components/tree/Tree.tsx

2
components/auto-complete/InputElement.tsx

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

6
components/auto-complete/index.tsx

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

4
components/breadcrumb/Breadcrumb.tsx

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

4
components/button/button.tsx

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

2
components/checkbox/Checkbox.tsx

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

2
components/checkbox/Group.tsx

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

2
components/date-picker/interface.tsx

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

2
components/icon/IconFont.tsx

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

16
components/mention/index.tsx

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

2
components/mentions/index.tsx

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

4
components/menu/index.tsx

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

2
components/message/index.tsx

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

6
components/modal/Modal.tsx

@ -74,7 +74,7 @@ export interface ModalProps {
maskStyle?: React.CSSProperties;
mask?: boolean;
keyboard?: boolean;
wrapProps?: unknown;
wrapProps?: any;
prefixCls?: string;
}
@ -85,8 +85,8 @@ export interface ModalFuncProps {
title?: React.ReactNode;
content?: React.ReactNode;
// TODO: find out exact types
onOk?: (...args: unknown[]) => unknown;
onCancel?: (...args: unknown[]) => unknown;
onOk?: (...args: any[]) => any;
onCancel?: (...args: any[]) => any;
okButtonProps?: NativeButtonProps;
cancelButtonProps?: NativeButtonProps;
centered?: boolean;

8
components/radio/interface.tsx

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

6
components/select/index.tsx

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

2
components/table/Table.tsx

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

2
components/table/filterDropdown.tsx

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

10
components/table/interface.tsx

@ -29,10 +29,10 @@ export interface ColumnProps<T> {
| ((options: { filters: TableStateFilters; sortOrder?: SortOrder }) => React.ReactNode);
key?: React.Key;
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';
filters?: ColumnFilterItem[];
onFilter?: (value: unknown, record: T) => boolean;
onFilter?: (value: any, record: T) => boolean;
filterMultiple?: boolean;
filterDropdown?: React.ReactNode | ((props: FilterDropdownProps) => React.ReactNode);
filterDropdownVisible?: boolean;
@ -44,7 +44,7 @@ export interface ColumnProps<T> {
className?: string;
fixed?: boolean | ('left' | 'right');
filterIcon?: React.ReactNode | ((filtered: boolean) => React.ReactNode);
filteredValue?: unknown[];
filteredValue?: any[];
sortOrder?: SortOrder | boolean;
children?: ColumnProps<T>[];
onCellClick?: (record: T, event: Event) => void;
@ -219,7 +219,7 @@ export interface SelectionCheckboxAllProps<T> {
getRecordKey: (record: T, index?: number) => string;
data: T[];
prefixCls: string | undefined;
onSelect: (key: string, index: number, selectFunc: unknown) => void;
onSelect: (key: string, index: number, selectFunc: any) => void;
hideDefaultSelections?: boolean;
selections?: SelectionItem[] | boolean;
getPopupContainer?: GetPopupContainer;
@ -256,7 +256,7 @@ export interface FilterMenuProps<T> {
locale: TableLocale;
selectedKeys: string[];
column: ColumnProps<T>;
confirmFilter: (column: ColumnProps<T>, selectedKeys: string[]) => unknown;
confirmFilter: (column: ColumnProps<T>, selectedKeys: string[]) => any;
prefixCls: string;
dropdownPrefixCls: string;
getPopupContainer?: GetPopupContainer;

2
components/tabs/index.tsx

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

12
components/tree-select/interface.tsx

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

2
components/tree/Tree.tsx

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

Loading…
Cancel
Save