Browse Source

upgrade ts 2.0

pull/3504/head
yiminghe 8 years ago
parent
commit
8afe3965c1
  1. 2
      components/alert/index.tsx
  2. 2
      components/back-top/index.tsx
  3. 4
      components/button/button.tsx
  4. 2
      components/checkbox/index.tsx
  5. 2
      components/dropdown/dropdown-button.tsx
  6. 2
      components/form/Form.tsx
  7. 2
      components/icon/index.tsx
  8. 10
      components/input/Input.tsx
  9. 2
      components/modal/Modal.tsx
  10. 2
      components/radio/group.tsx
  11. 2
      components/table/filterDropdown.tsx
  12. 4
      components/transfer/operation.tsx
  13. 4
      components/transfer/search.tsx
  14. 2
      components/tree/index.tsx
  15. 4
      package.json
  16. 1
      tsconfig.json
  17. 6
      typings.json
  18. 70
      typings/globals/react-dom/index.d.ts
  19. 8
      typings/globals/react-dom/typings.json
  20. 2514
      typings/globals/react/index.d.ts
  21. 8
      typings/globals/react/typings.json
  22. 3
      typings/index.d.ts

2
components/alert/index.tsx

@ -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;

2
components/back-top/index.tsx

@ -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;

4
components/button/button.tsx

@ -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;

2
components/checkbox/index.tsx

@ -13,7 +13,7 @@ export interface CheckboxProps {
/** indeterminate 状态,只负责样式控制 */
indeterminate?: boolean;
/** 变化时回调函数 */
onChange?: React.FormEventHandler;
onChange?: React.FormEventHandler<any>;
style?: React.CSSProperties;
disabled?: boolean;
className?: string;

2
components/dropdown/dropdown-button.tsx

@ -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;

2
components/form/Form.tsx

@ -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;

2
components/icon/index.tsx

@ -6,7 +6,7 @@ export interface IconProps {
type: string;
className?: string;
title?: string;
onClick?: React.MouseEventHandler;
onClick?: React.MouseEventHandler<any>;
spin?: boolean;
}

10
components/input/Input.tsx

@ -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;

2
components/modal/Modal.tsx

@ -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;
/** 底部内容*/

2
components/radio/group.tsx

@ -19,7 +19,7 @@ function getCheckedValue(children) {
export interface RadioGroupProps {
/** 选项变化时的回调函数*/
onChange?: React.FormEventHandler;
onChange?: React.FormEventHandler<any>;
/** 用于设置当前选中的值*/
value?: string | number;
/** 默认选中的值*/

2
components/table/filterDropdown.tsx

@ -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;
}

4
components/transfer/operation.tsx

@ -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;
}

4
components/transfer/search.tsx

@ -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;
}

2
components/tree/index.tsx

@ -27,7 +27,7 @@ export interface AntTreeNodeEvent {
export interface AntTreeNodeMouseEvent {
node: AntTreeNode;
event: React.MouseEventHandler;
event: React.MouseEventHandler<any>;
}
export interface TreeProps {

4
package.json

@ -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
tsconfig.json

@ -1,5 +1,6 @@
{
"compilerOptions": {
"strictNullChecks": false,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"jsx": "preserve",

6
typings.json

@ -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

@ -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;
}

8
typings/globals/react-dom/typings.json

@ -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

File diff suppressed because it is too large

8
typings/globals/react/typings.json

@ -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

@ -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…
Cancel
Save