UNPKG

1 kBTypeScriptView Raw
1import type { TextAreaProps as RcTextAreaProps } from 'rc-textarea';
2import type { ResizableTextAreaRef } from 'rc-textarea/lib/ResizableTextArea';
3import * as React from 'react';
4import type { SizeType } from '../config-provider/SizeContext';
5import type { InputStatus } from '../_util/statusUtils';
6import type { InputFocusOptions } from './Input';
7interface ShowCountProps {
8 formatter: (args: {
9 value: string;
10 count: number;
11 maxLength?: number;
12 }) => string;
13}
14export interface TextAreaProps extends RcTextAreaProps {
15 allowClear?: boolean;
16 bordered?: boolean;
17 showCount?: boolean | ShowCountProps;
18 size?: SizeType;
19 disabled?: boolean;
20 status?: InputStatus;
21}
22export interface TextAreaRef {
23 focus: (options?: InputFocusOptions) => void;
24 blur: () => void;
25 resizableTextArea?: ResizableTextAreaRef;
26}
27declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<TextAreaRef>>;
28export default TextArea;