UNPKG

2.18 kBTypeScriptView Raw
1import PropTypes from 'prop-types';
2import React from 'react';
3import { TextProps, StyleProp, ViewStyle, TextStyle } from 'react-native';
4import { LeftRightStyle, IMessage } from './Models';
5export interface MessageTextProps<TMessage extends IMessage> {
6 position?: 'left' | 'right';
7 optionTitles?: string[];
8 currentMessage: TMessage;
9 containerStyle?: LeftRightStyle<ViewStyle>;
10 textStyle?: LeftRightStyle<TextStyle>;
11 linkStyle?: LeftRightStyle<TextStyle>;
12 textProps?: TextProps;
13 customTextStyle?: StyleProp<TextStyle>;
14 parsePatterns?: (linkStyle: TextStyle) => [];
15}
16export declare function MessageText<TMessage extends IMessage = IMessage>({ currentMessage, optionTitles, position, containerStyle, textStyle, linkStyle: linkStyleProp, customTextStyle, parsePatterns, textProps, }: MessageTextProps<TMessage>): React.JSX.Element;
17export declare namespace MessageText {
18 var propTypes: {
19 position: PropTypes.Requireable<string>;
20 optionTitles: PropTypes.Requireable<(string | null | undefined)[]>;
21 currentMessage: PropTypes.Requireable<object>;
22 containerStyle: PropTypes.Requireable<PropTypes.InferProps<{
23 left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
24 right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
25 }>>;
26 textStyle: PropTypes.Requireable<PropTypes.InferProps<{
27 left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
28 right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
29 }>>;
30 linkStyle: PropTypes.Requireable<PropTypes.InferProps<{
31 left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
32 right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
33 }>>;
34 parsePatterns: PropTypes.Requireable<(...args: any[]) => any>;
35 textProps: PropTypes.Requireable<object>;
36 customTextStyle: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
37 };
38}