mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
upgrade ts 2.0
This commit is contained in:
parent
5179ffbbe1
commit
8afe3965c1
@ -18,7 +18,7 @@ export interface AlertProps {
|
||||
/** Additional content of Alert */
|
||||
description?: React.ReactNode;
|
||||
/** Callback when close Alert */
|
||||
onClose?: React.MouseEventHandler;
|
||||
onClose?: React.MouseEventHandler<any>;
|
||||
/** Whether to show icon */
|
||||
showIcon?: boolean;
|
||||
style?: React.CSSProperties;
|
||||
|
@ -25,7 +25,7 @@ const easeInOutCubic = (t, b, c, d) => {
|
||||
|
||||
export interface BackTopProps {
|
||||
visibilityHeight?: number;
|
||||
onClick?: React.MouseEventHandler;
|
||||
onClick?: React.MouseEventHandler<any>;
|
||||
target?: () => HTMLElement | Window;
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
|
@ -34,8 +34,8 @@ export interface ButtonProps {
|
||||
icon?: string;
|
||||
shape?: ButtonShape;
|
||||
size?: ButtonSize;
|
||||
onClick?: React.FormEventHandler;
|
||||
onMouseUp?: React.FormEventHandler;
|
||||
onClick?: React.FormEventHandler<any>;
|
||||
onMouseUp?: React.FormEventHandler<any>;
|
||||
loading?: boolean;
|
||||
disabled?: boolean;
|
||||
style?: React.CSSProperties;
|
||||
|
@ -13,7 +13,7 @@ export interface CheckboxProps {
|
||||
/** indeterminate 状态,只负责样式控制 */
|
||||
indeterminate?: boolean;
|
||||
/** 变化时回调函数 */
|
||||
onChange?: React.FormEventHandler;
|
||||
onChange?: React.FormEventHandler<any>;
|
||||
style?: React.CSSProperties;
|
||||
disabled?: boolean;
|
||||
className?: string;
|
||||
|
@ -8,7 +8,7 @@ import splitObject from '../_util/splitObject';
|
||||
|
||||
export interface DropdownButtonProps {
|
||||
type?: 'primary' | 'ghost' | 'dash';
|
||||
onClick?: React.FormEventHandler;
|
||||
onClick?: React.FormEventHandler<any>;
|
||||
trigger?: 'click' | 'hover';
|
||||
overlay: React.ReactNode;
|
||||
visible?: boolean;
|
||||
|
@ -20,7 +20,7 @@ export interface FormProps {
|
||||
inline?: boolean;
|
||||
vertical?: boolean;
|
||||
form?: WrappedFormUtils;
|
||||
onSubmit?: React.FormEventHandler;
|
||||
onSubmit?: React.FormEventHandler<any>;
|
||||
style?: React.CSSProperties;
|
||||
className?: string;
|
||||
prefixCls?: string;
|
||||
|
@ -6,7 +6,7 @@ export interface IconProps {
|
||||
type: string;
|
||||
className?: string;
|
||||
title?: string;
|
||||
onClick?: React.MouseEventHandler;
|
||||
onClick?: React.MouseEventHandler<any>;
|
||||
spin?: boolean;
|
||||
}
|
||||
|
||||
|
@ -45,11 +45,11 @@ export interface InputProps {
|
||||
readOnly?: boolean;
|
||||
addonBefore?: React.ReactNode;
|
||||
addonAfter?: React.ReactNode;
|
||||
onPressEnter?: React.FormEventHandler;
|
||||
onKeyDown?: React.FormEventHandler;
|
||||
onChange?: React.FormEventHandler;
|
||||
onClick?: React.FormEventHandler;
|
||||
onBlur?: React.FormEventHandler;
|
||||
onPressEnter?: React.FormEventHandler<any>;
|
||||
onKeyDown?: React.FormEventHandler<any>;
|
||||
onChange?: React.FormEventHandler<any>;
|
||||
onClick?: React.FormEventHandler<any>;
|
||||
onBlur?: React.FormEventHandler<any>;
|
||||
autosize?: boolean | AutoSizeType;
|
||||
autoComplete?: 'on' | 'off';
|
||||
style?: React.CSSProperties;
|
||||
|
@ -21,7 +21,7 @@ export interface ModalProps {
|
||||
/** 点击确定回调*/
|
||||
onOk?: () => void;
|
||||
/** 点击模态框右上角叉、取消按钮、Props.maskClosable 值为 true 时的遮罩层或键盘按下 Esc 时的回调*/
|
||||
onCancel?: (e: React.MouseEvent) => void;
|
||||
onCancel?: (e: React.MouseEvent<any>) => void;
|
||||
/** 宽度*/
|
||||
width?: string | number;
|
||||
/** 底部内容*/
|
||||
|
@ -19,7 +19,7 @@ function getCheckedValue(children) {
|
||||
|
||||
export interface RadioGroupProps {
|
||||
/** 选项变化时的回调函数*/
|
||||
onChange?: React.FormEventHandler;
|
||||
onChange?: React.FormEventHandler<any>;
|
||||
/** 用于设置当前选中的值*/
|
||||
value?: string | number;
|
||||
/** 默认选中的值*/
|
||||
|
@ -6,7 +6,7 @@ import Checkbox from '../checkbox';
|
||||
import Radio from '../radio';
|
||||
|
||||
export interface FilterDropdownMenuWrapperProps {
|
||||
onClick?: React.MouseEventHandler;
|
||||
onClick?: React.MouseEventHandler<any>;
|
||||
children?: any;
|
||||
className?: string;
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ export interface TransferOperationProps {
|
||||
className?: string;
|
||||
leftArrowText?: string;
|
||||
rightArrowText?: string;
|
||||
moveToLeft?: React.FormEventHandler;
|
||||
moveToRight?: React.FormEventHandler;
|
||||
moveToLeft?: React.FormEventHandler<any>;
|
||||
moveToRight?: React.FormEventHandler<any>;
|
||||
leftActive?: boolean;
|
||||
rightActive?: boolean;
|
||||
}
|
||||
|
@ -8,8 +8,8 @@ function noop() {
|
||||
export interface SearchProps {
|
||||
prefixCls?: string;
|
||||
placeholder?: string;
|
||||
onChange?: (e: React.FormEvent) => void;
|
||||
handleClear?: (e: React.MouseEvent) => void;
|
||||
onChange?: (e: React.FormEvent<any>) => void;
|
||||
handleClear?: (e: React.MouseEvent<any>) => void;
|
||||
value?: any;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ export interface AntTreeNodeEvent {
|
||||
|
||||
export interface AntTreeNodeMouseEvent {
|
||||
node: AntTreeNode;
|
||||
event: React.MouseEventHandler;
|
||||
event: React.MouseEventHandler<any>;
|
||||
}
|
||||
|
||||
export interface TreeProps {
|
||||
|
@ -77,7 +77,9 @@
|
||||
"warning": "~3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"antd-tools": "^0.12.0",
|
||||
"@types/react": "~0.14.41",
|
||||
"@types/react-dom": "~0.14.18",
|
||||
"antd-tools": "^0.13.0",
|
||||
"babel-eslint": "^6.0.2",
|
||||
"babel-jest": "^13.2.2",
|
||||
"babel-plugin-import": "^1.0.0",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"strictNullChecks": false,
|
||||
"moduleResolution": "node",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"jsx": "preserve",
|
||||
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"globalDependencies": {
|
||||
"react": "registry:dt/react#0.14.0+20160720060442",
|
||||
"react-dom": "registry:dt/react-dom#0.14.0+20160412154040"
|
||||
}
|
||||
}
|
70
typings/globals/react-dom/index.d.ts
vendored
70
typings/globals/react-dom/index.d.ts
vendored
@ -1,70 +0,0 @@
|
||||
// Generated by typings
|
||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/b9642fb8ac07f7164dc643ddd1fa99b58ae9be8b/react/react-dom.d.ts
|
||||
declare namespace __React {
|
||||
namespace __DOM {
|
||||
function findDOMNode<E extends Element>(instance: ReactInstance): E;
|
||||
function findDOMNode(instance: ReactInstance): Element;
|
||||
|
||||
function render<P extends DOMAttributes, T extends Element>(
|
||||
element: DOMElement<P, T>,
|
||||
container: Element,
|
||||
callback?: (element: T) => any): T;
|
||||
function render<P>(
|
||||
element: SFCElement<P>,
|
||||
container: Element,
|
||||
callback?: () => any): void;
|
||||
function render<P, T extends Component<P, ComponentState>>(
|
||||
element: CElement<P, T>,
|
||||
container: Element,
|
||||
callback?: (component: T) => any): T;
|
||||
function render<P>(
|
||||
element: ReactElement<P>,
|
||||
container: Element,
|
||||
callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
|
||||
|
||||
function unmountComponentAtNode(container: Element): boolean;
|
||||
|
||||
var version: string;
|
||||
|
||||
function unstable_batchedUpdates<A, B>(callback: (a: A, b: B) => any, a: A, b: B): void;
|
||||
function unstable_batchedUpdates<A>(callback: (a: A) => any, a: A): void;
|
||||
function unstable_batchedUpdates(callback: () => any): void;
|
||||
|
||||
function unstable_renderSubtreeIntoContainer<P extends DOMAttributes, T extends Element>(
|
||||
parentComponent: Component<any, any>,
|
||||
element: DOMElement<P, T>,
|
||||
container: Element,
|
||||
callback?: (element: T) => any): T;
|
||||
function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>(
|
||||
parentComponent: Component<any, any>,
|
||||
element: CElement<P, T>,
|
||||
container: Element,
|
||||
callback?: (component: T) => any): T;
|
||||
function render<P>(
|
||||
parentComponent: Component<any, any>,
|
||||
element: SFCElement<P>,
|
||||
container: Element,
|
||||
callback?: () => any): void;
|
||||
function unstable_renderSubtreeIntoContainer<P>(
|
||||
parentComponent: Component<any, any>,
|
||||
element: ReactElement<P>,
|
||||
container: Element,
|
||||
callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
|
||||
}
|
||||
|
||||
namespace __DOMServer {
|
||||
function renderToString(element: ReactElement<any>): string;
|
||||
function renderToStaticMarkup(element: ReactElement<any>): string;
|
||||
var version: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "react-dom" {
|
||||
import DOM = __React.__DOM;
|
||||
export = DOM;
|
||||
}
|
||||
|
||||
declare module "react-dom/server" {
|
||||
import DOMServer = __React.__DOMServer;
|
||||
export = DOMServer;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"resolution": "main",
|
||||
"tree": {
|
||||
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/b9642fb8ac07f7164dc643ddd1fa99b58ae9be8b/react/react-dom.d.ts",
|
||||
"raw": "registry:dt/react-dom#0.14.0+20160412154040",
|
||||
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/b9642fb8ac07f7164dc643ddd1fa99b58ae9be8b/react/react-dom.d.ts"
|
||||
}
|
||||
}
|
2514
typings/globals/react/index.d.ts
vendored
2514
typings/globals/react/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@ -1,8 +0,0 @@
|
||||
{
|
||||
"resolution": "main",
|
||||
"tree": {
|
||||
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/03cd162da057a9cbf653119982e12233ae2b90a6/react/react.d.ts",
|
||||
"raw": "registry:dt/react#0.14.0+20160720060442",
|
||||
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/03cd162da057a9cbf653119982e12233ae2b90a6/react/react.d.ts"
|
||||
}
|
||||
}
|
3
typings/index.d.ts
vendored
3
typings/index.d.ts
vendored
@ -1,2 +1 @@
|
||||
/// <reference path="globals/react-dom/index.d.ts" />
|
||||
/// <reference path="globals/react/index.d.ts" />
|
||||
/// <reference path="custom-typings.d.ts" />
|
||||
|
Loading…
Reference in New Issue
Block a user