deps: upgrade TypeScript to 2.6, close #8018

pull/8125/head
Benjy Cui 7 years ago
parent dbe451a199
commit 51785aa6eb

@ -1,7 +1,11 @@
import React from 'react'; import React from 'react';
import { findDOMNode } from 'react-dom'; import { findDOMNode } from 'react-dom';
export default class InputElement extends React.Component<any, any> { export interface InputElementProps {
children: React.ReactElement<any>;
}
export default class InputElement extends React.Component<InputElementProps, any> {
private ele: HTMLInputElement; private ele: HTMLInputElement;
focus = () => { focus = () => {
@ -12,7 +16,7 @@ export default class InputElement extends React.Component<any, any> {
} }
saveRef = (ele: HTMLInputElement) => { saveRef = (ele: HTMLInputElement) => {
this.ele = ele; this.ele = ele;
const childRef = this.props.children.ref; const { ref: childRef } = this.props.children as any;
if (typeof childRef === 'function') { if (typeof childRef === 'function') {
childRef(ele); childRef(ele);
} }

@ -29,9 +29,13 @@ export interface TextAreaProps extends AbstractInputProps {
onPressEnter?: React.FormEventHandler<any>; onPressEnter?: React.FormEventHandler<any>;
} }
export interface TextAreaState {
textareaStyles?: React.CSSProperties;
}
export type HTMLTextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>; export type HTMLTextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
export default class TextArea extends React.Component<TextAreaProps & HTMLTextareaProps, any> { export default class TextArea extends React.Component<TextAreaProps & HTMLTextareaProps, TextAreaState> {
static defaultProps = { static defaultProps = {
prefixCls: 'ant-input', prefixCls: 'ant-input',
}; };
@ -39,7 +43,7 @@ export default class TextArea extends React.Component<TextAreaProps & HTMLTextar
nextFrameActionId: number; nextFrameActionId: number;
state = { state = {
textareaStyles: null, textareaStyles: {},
}; };
private textAreaRef: HTMLTextAreaElement; private textAreaRef: HTMLTextAreaElement;

@ -152,7 +152,7 @@
"rimraf": "^2.5.4", "rimraf": "^2.5.4",
"stylelint": "^8.0.0", "stylelint": "^8.0.0",
"stylelint-config-standard": "^17.0.0", "stylelint-config-standard": "^17.0.0",
"typescript": "~2.5.3", "typescript": "~2.6.1",
"unified": "^6.1.5", "unified": "^6.1.5",
"values.js": "^1.0.3", "values.js": "^1.0.3",
"xhr2": "^0.1.3" "xhr2": "^0.1.3"

Loading…
Cancel
Save