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 */
|
/** Additional content of Alert */
|
||||||
description?: React.ReactNode;
|
description?: React.ReactNode;
|
||||||
/** Callback when close Alert */
|
/** Callback when close Alert */
|
||||||
onClose?: React.MouseEventHandler;
|
onClose?: React.MouseEventHandler<any>;
|
||||||
/** Whether to show icon */
|
/** Whether to show icon */
|
||||||
showIcon?: boolean;
|
showIcon?: boolean;
|
||||||
style?: React.CSSProperties;
|
style?: React.CSSProperties;
|
||||||
|
@ -25,7 +25,7 @@ const easeInOutCubic = (t, b, c, d) => {
|
|||||||
|
|
||||||
export interface BackTopProps {
|
export interface BackTopProps {
|
||||||
visibilityHeight?: number;
|
visibilityHeight?: number;
|
||||||
onClick?: React.MouseEventHandler;
|
onClick?: React.MouseEventHandler<any>;
|
||||||
target?: () => HTMLElement | Window;
|
target?: () => HTMLElement | Window;
|
||||||
prefixCls?: string;
|
prefixCls?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
@ -34,8 +34,8 @@ export interface ButtonProps {
|
|||||||
icon?: string;
|
icon?: string;
|
||||||
shape?: ButtonShape;
|
shape?: ButtonShape;
|
||||||
size?: ButtonSize;
|
size?: ButtonSize;
|
||||||
onClick?: React.FormEventHandler;
|
onClick?: React.FormEventHandler<any>;
|
||||||
onMouseUp?: React.FormEventHandler;
|
onMouseUp?: React.FormEventHandler<any>;
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
style?: React.CSSProperties;
|
style?: React.CSSProperties;
|
||||||
|
@ -13,7 +13,7 @@ export interface CheckboxProps {
|
|||||||
/** indeterminate 状态,只负责样式控制 */
|
/** indeterminate 状态,只负责样式控制 */
|
||||||
indeterminate?: boolean;
|
indeterminate?: boolean;
|
||||||
/** 变化时回调函数 */
|
/** 变化时回调函数 */
|
||||||
onChange?: React.FormEventHandler;
|
onChange?: React.FormEventHandler<any>;
|
||||||
style?: React.CSSProperties;
|
style?: React.CSSProperties;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
@ -8,7 +8,7 @@ import splitObject from '../_util/splitObject';
|
|||||||
|
|
||||||
export interface DropdownButtonProps {
|
export interface DropdownButtonProps {
|
||||||
type?: 'primary' | 'ghost' | 'dash';
|
type?: 'primary' | 'ghost' | 'dash';
|
||||||
onClick?: React.FormEventHandler;
|
onClick?: React.FormEventHandler<any>;
|
||||||
trigger?: 'click' | 'hover';
|
trigger?: 'click' | 'hover';
|
||||||
overlay: React.ReactNode;
|
overlay: React.ReactNode;
|
||||||
visible?: boolean;
|
visible?: boolean;
|
||||||
|
@ -20,7 +20,7 @@ export interface FormProps {
|
|||||||
inline?: boolean;
|
inline?: boolean;
|
||||||
vertical?: boolean;
|
vertical?: boolean;
|
||||||
form?: WrappedFormUtils;
|
form?: WrappedFormUtils;
|
||||||
onSubmit?: React.FormEventHandler;
|
onSubmit?: React.FormEventHandler<any>;
|
||||||
style?: React.CSSProperties;
|
style?: React.CSSProperties;
|
||||||
className?: string;
|
className?: string;
|
||||||
prefixCls?: string;
|
prefixCls?: string;
|
||||||
|
@ -6,7 +6,7 @@ export interface IconProps {
|
|||||||
type: string;
|
type: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
onClick?: React.MouseEventHandler;
|
onClick?: React.MouseEventHandler<any>;
|
||||||
spin?: boolean;
|
spin?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,11 +45,11 @@ export interface InputProps {
|
|||||||
readOnly?: boolean;
|
readOnly?: boolean;
|
||||||
addonBefore?: React.ReactNode;
|
addonBefore?: React.ReactNode;
|
||||||
addonAfter?: React.ReactNode;
|
addonAfter?: React.ReactNode;
|
||||||
onPressEnter?: React.FormEventHandler;
|
onPressEnter?: React.FormEventHandler<any>;
|
||||||
onKeyDown?: React.FormEventHandler;
|
onKeyDown?: React.FormEventHandler<any>;
|
||||||
onChange?: React.FormEventHandler;
|
onChange?: React.FormEventHandler<any>;
|
||||||
onClick?: React.FormEventHandler;
|
onClick?: React.FormEventHandler<any>;
|
||||||
onBlur?: React.FormEventHandler;
|
onBlur?: React.FormEventHandler<any>;
|
||||||
autosize?: boolean | AutoSizeType;
|
autosize?: boolean | AutoSizeType;
|
||||||
autoComplete?: 'on' | 'off';
|
autoComplete?: 'on' | 'off';
|
||||||
style?: React.CSSProperties;
|
style?: React.CSSProperties;
|
||||||
|
@ -21,7 +21,7 @@ export interface ModalProps {
|
|||||||
/** 点击确定回调*/
|
/** 点击确定回调*/
|
||||||
onOk?: () => void;
|
onOk?: () => void;
|
||||||
/** 点击模态框右上角叉、取消按钮、Props.maskClosable 值为 true 时的遮罩层或键盘按下 Esc 时的回调*/
|
/** 点击模态框右上角叉、取消按钮、Props.maskClosable 值为 true 时的遮罩层或键盘按下 Esc 时的回调*/
|
||||||
onCancel?: (e: React.MouseEvent) => void;
|
onCancel?: (e: React.MouseEvent<any>) => void;
|
||||||
/** 宽度*/
|
/** 宽度*/
|
||||||
width?: string | number;
|
width?: string | number;
|
||||||
/** 底部内容*/
|
/** 底部内容*/
|
||||||
|
@ -19,7 +19,7 @@ function getCheckedValue(children) {
|
|||||||
|
|
||||||
export interface RadioGroupProps {
|
export interface RadioGroupProps {
|
||||||
/** 选项变化时的回调函数*/
|
/** 选项变化时的回调函数*/
|
||||||
onChange?: React.FormEventHandler;
|
onChange?: React.FormEventHandler<any>;
|
||||||
/** 用于设置当前选中的值*/
|
/** 用于设置当前选中的值*/
|
||||||
value?: string | number;
|
value?: string | number;
|
||||||
/** 默认选中的值*/
|
/** 默认选中的值*/
|
||||||
|
@ -6,7 +6,7 @@ import Checkbox from '../checkbox';
|
|||||||
import Radio from '../radio';
|
import Radio from '../radio';
|
||||||
|
|
||||||
export interface FilterDropdownMenuWrapperProps {
|
export interface FilterDropdownMenuWrapperProps {
|
||||||
onClick?: React.MouseEventHandler;
|
onClick?: React.MouseEventHandler<any>;
|
||||||
children?: any;
|
children?: any;
|
||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
@ -9,8 +9,8 @@ export interface TransferOperationProps {
|
|||||||
className?: string;
|
className?: string;
|
||||||
leftArrowText?: string;
|
leftArrowText?: string;
|
||||||
rightArrowText?: string;
|
rightArrowText?: string;
|
||||||
moveToLeft?: React.FormEventHandler;
|
moveToLeft?: React.FormEventHandler<any>;
|
||||||
moveToRight?: React.FormEventHandler;
|
moveToRight?: React.FormEventHandler<any>;
|
||||||
leftActive?: boolean;
|
leftActive?: boolean;
|
||||||
rightActive?: boolean;
|
rightActive?: boolean;
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,8 @@ function noop() {
|
|||||||
export interface SearchProps {
|
export interface SearchProps {
|
||||||
prefixCls?: string;
|
prefixCls?: string;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
onChange?: (e: React.FormEvent) => void;
|
onChange?: (e: React.FormEvent<any>) => void;
|
||||||
handleClear?: (e: React.MouseEvent) => void;
|
handleClear?: (e: React.MouseEvent<any>) => void;
|
||||||
value?: any;
|
value?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ export interface AntTreeNodeEvent {
|
|||||||
|
|
||||||
export interface AntTreeNodeMouseEvent {
|
export interface AntTreeNodeMouseEvent {
|
||||||
node: AntTreeNode;
|
node: AntTreeNode;
|
||||||
event: React.MouseEventHandler;
|
event: React.MouseEventHandler<any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TreeProps {
|
export interface TreeProps {
|
||||||
|
@ -77,7 +77,9 @@
|
|||||||
"warning": "~3.0.0"
|
"warning": "~3.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"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-eslint": "^6.0.2",
|
||||||
"babel-jest": "^13.2.2",
|
"babel-jest": "^13.2.2",
|
||||||
"babel-plugin-import": "^1.0.0",
|
"babel-plugin-import": "^1.0.0",
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"strictNullChecks": false,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"jsx": "preserve",
|
"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="custom-typings.d.ts" />
|
||||||
/// <reference path="globals/react/index.d.ts" />
|
|
||||||
|
Loading…
Reference in New Issue
Block a user