1 | import PropTypes from 'prop-types';
|
2 | import React from 'react';
|
3 | import { TextInputProps } from 'react-native';
|
4 | export interface ComposerProps {
|
5 | composerHeight?: number;
|
6 | text?: string;
|
7 | placeholder?: string;
|
8 | placeholderTextColor?: string;
|
9 | textInputProps?: Partial<TextInputProps>;
|
10 | textInputStyle?: TextInputProps['style'];
|
11 | textInputAutoFocus?: boolean;
|
12 | keyboardAppearance?: TextInputProps['keyboardAppearance'];
|
13 | multiline?: boolean;
|
14 | disableComposer?: boolean;
|
15 | onTextChanged?(text: string): void;
|
16 | onInputSizeChanged?(contentSize: {
|
17 | width: number;
|
18 | height: number;
|
19 | }): void;
|
20 | }
|
21 | export default class Composer extends React.Component<ComposerProps> {
|
22 | static defaultProps: {
|
23 | composerHeight: number | undefined;
|
24 | text: string;
|
25 | placeholderTextColor: string;
|
26 | placeholder: string;
|
27 | textInputProps: null;
|
28 | multiline: boolean;
|
29 | disableComposer: boolean;
|
30 | textInputStyle: {};
|
31 | textInputAutoFocus: boolean;
|
32 | keyboardAppearance: string;
|
33 | onTextChanged: () => void;
|
34 | onInputSizeChanged: () => void;
|
35 | };
|
36 | static propTypes: {
|
37 | composerHeight: PropTypes.Requireable<number>;
|
38 | text: PropTypes.Requireable<string>;
|
39 | placeholder: PropTypes.Requireable<string>;
|
40 | placeholderTextColor: PropTypes.Requireable<string>;
|
41 | textInputProps: PropTypes.Requireable<object>;
|
42 | onTextChanged: PropTypes.Requireable<(...args: any[]) => any>;
|
43 | onInputSizeChanged: PropTypes.Requireable<(...args: any[]) => any>;
|
44 | multiline: PropTypes.Requireable<boolean>;
|
45 | disableComposer: PropTypes.Requireable<boolean>;
|
46 | textInputStyle: PropTypes.Requireable<number | boolean | object>;
|
47 | textInputAutoFocus: PropTypes.Requireable<boolean>;
|
48 | keyboardAppearance: PropTypes.Requireable<string>;
|
49 | };
|
50 | contentSize?: {
|
51 | width: number;
|
52 | height: number;
|
53 | };
|
54 | onContentSizeChange: (e: any) => void;
|
55 | onChangeText: (text: string) => void;
|
56 | render(): JSX.Element;
|
57 | }
|