This repository was archived by the owner on Aug 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMessageText.d.ts
More file actions
58 lines (58 loc) · 2.32 KB
/
MessageText.d.ts
File metadata and controls
58 lines (58 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import PropTypes from 'prop-types';
import React from 'react';
import { TextProps, StyleProp, ViewStyle, TextStyle } from 'react-native';
import { LeftRightStyle, IMessage } from './types';
export interface MessageTextProps<TMessage extends IMessage> {
position: 'left' | 'right';
optionTitles?: string[];
currentMessage?: TMessage;
containerStyle?: LeftRightStyle<ViewStyle>;
textStyle?: LeftRightStyle<TextStyle>;
linkStyle?: LeftRightStyle<TextStyle>;
textProps?: TextProps;
customTextStyle?: StyleProp<TextStyle>;
parsePatterns?(linkStyle: TextStyle): any;
}
export default class MessageText<TMessage extends IMessage = IMessage> extends React.Component<MessageTextProps<TMessage>> {
static contextTypes: {
actionSheet: PropTypes.Requireable<(...args: any[]) => any>;
};
static defaultProps: {
position: string;
optionTitles: string[];
currentMessage: {
text: string;
};
containerStyle: {};
textStyle: {};
linkStyle: {};
customTextStyle: {};
textProps: {};
parsePatterns: () => never[];
};
static propTypes: {
position: PropTypes.Requireable<string>;
optionTitles: PropTypes.Requireable<(string | null)[]>;
currentMessage: PropTypes.Requireable<object>;
containerStyle: PropTypes.Requireable<PropTypes.InferProps<{
left: PropTypes.Validator<StyleProp<ViewStyle>> | undefined;
right: PropTypes.Validator<StyleProp<ViewStyle>> | undefined;
}>>;
textStyle: PropTypes.Requireable<PropTypes.InferProps<{
left: PropTypes.Requireable<number | object>;
right: PropTypes.Requireable<number | object>;
}>>;
linkStyle: PropTypes.Requireable<PropTypes.InferProps<{
left: PropTypes.Requireable<number | object>;
right: PropTypes.Requireable<number | object>;
}>>;
parsePatterns: PropTypes.Requireable<(...args: any[]) => any>;
textProps: PropTypes.Requireable<object>;
customTextStyle: PropTypes.Requireable<number | object>;
};
shouldComponentUpdate(nextProps: MessageTextProps<TMessage>): boolean;
onUrlPress: (url: string) => void;
onPhonePress: (phone: string) => void;
onEmailPress: (email: string) => void;
render(): JSX.Element;
}