UNPKG

1.93 kBTypeScriptView Raw
1// Type definitions for react-textarea-autosize 4.3.0
2// Project: https://github.com/andreypopp/react-textarea-autosize
3// Definitions by: Alexey Svetliakov <https://github.com/asvetliakov>,
4// Jerry Zou <https://github.com/zry656565>
5// Rahul Sagore <https://github.com/Rahul-Sagore>
6// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7// TypeScript Version: 2.8
8
9declare module "react-textarea-autosize" {
10 import * as React from "react";
11
12 /**
13 * <TextareaAutosize/> properties
14 */
15 export interface TextareaAutosizeProps extends React.HTMLProps<HTMLTextAreaElement> {
16 /**
17 * Current textarea value
18 */
19 value?: string;
20 /**
21 * Callback on value change
22 * @param event
23 */
24 onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
25 /**
26 * Callback on height change
27 * @param height
28 */
29 onHeightChange?: (height: number) => void;
30 /**
31 * Try to cache DOM measurements performed by component so that we don't
32 * touch DOM when it's not needed.
33 *
34 * This optimization doesn't work if we dynamically style `<textarea />`
35 * component.
36 * @default false
37 */
38 useCacheForDOMMeasurements?: boolean;
39 /**
40 * Minimal number of rows to show.
41 */
42 rows?: number;
43 /**
44 * Alias for `rows`.
45 */
46 minRows?: number;
47 /**
48 * Maximum number of rows to show.
49 */
50 maxRows?: number;
51 /**
52 * Allows an owner to retrieve the DOM node.
53 */
54 inputRef?: ((node: HTMLTextAreaElement) => void) | React.RefObject<HTMLTextAreaElement>;
55 }
56
57 /**
58 * <TextareaAutosize/>
59 */
60 export default class TextareaAutosize extends React.Component<TextareaAutosizeProps> { }
61
62}
63
\No newline at end of file