Skip to content

Instantly share code, notes, and snippets.

@WunGCQ
Created August 2, 2017 09:18
Show Gist options
  • Save WunGCQ/4c7779aa196fdabf74f41ead22009ad3 to your computer and use it in GitHub Desktop.
Save WunGCQ/4c7779aa196fdabf74f41ead22009ad3 to your computer and use it in GitHub Desktop.
fix antd/lib/input/Textarea.d.ts (version 2.12.3)
/// <reference types="react" />
import React from 'react';
import { AbstractInputProps } from './Input';
export interface AutoSizeType {
minRows?: number;
maxRows?: number;
}
export interface TextAreaProps extends AbstractInputProps {
autosize?: boolean | AutoSizeType;
onPressEnter?: React.FormEventHandler<any>;
}
interface TextareaHTMLAttributes<T> extends React.HTMLAttributes<T> {
autoComplete?: string;
autoFocus?: boolean;
cols?: number;
dirName?: string;
disabled?: boolean;
form?: string;
maxLength?: number;
minLength?: number;
name?: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
rows?: number;
value?: string | string[] | number;
wrap?: string;
onChange?: React.ChangeEventHandler<T>;
}
export declare type HTMLTextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;
export default class TextArea extends React.Component<TextAreaProps & HTMLTextareaProps, any> {
static defaultProps: {
prefixCls: string;
};
nextFrameActionId: number;
textAreaRef: HTMLTextAreaElement;
state: {
textareaStyles: null;
};
componentDidMount(): void;
componentWillReceiveProps(nextProps: any): void;
focus(): void;
blur(): void;
resizeTextarea: () => void;
getTextAreaClassName(): any;
handleTextareaChange: (e: any) => void;
handleKeyDown: (e: any) => void;
saveTextAreaRef: (textArea: any) => void;
render(): JSX.Element;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment