1234567891011121314151617181920212223242526272829303132333435363738 |
- import * as React from "react";
- import * as PropTypes from "prop-types";
- export type TextareaProps = React.HTMLProps<HTMLTextAreaElement> & {
- /** Called whenever the textarea resizes */
- onResize?: (e: Event) => void;
- /** Minimum number of visible rows */
- rows?: React.HTMLProps<HTMLTextAreaElement>["rows"];
- /** Maximum number of visible rows */
- maxRows?: number;
- /** Initialize `autosize` asynchronously.
- * Enable it if you are using StyledComponents
- * This is forced to true when `maxRows` is set.
- */
- async?: boolean;
- };
- export type State = {
- lineHeight: number | null;
- };
- export type DefaultProps = {
- rows: number;
- async: boolean;
- };
- export declare class Textarea extends React.Component<TextareaProps, State> {
- textarea: HTMLTextAreaElement | null;
- currentValue: TextareaProps["value"];
- static defaultProps: DefaultProps;
- static propTypes: {
- [key in keyof TextareaProps]: PropTypes.Requireable<any>;
- };
- state: State;
- onResize: (e: Event) => void;
- componentDidUpdate(): void;
- componentDidMount(): void;
- componentWillUnmount(): void;
- onChange: (e: React.SyntheticEvent<HTMLTextAreaElement>) => void;
- updateLineHeight: () => void;
- render(): React.JSX.Element;
- }
|