This repository has been 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
/
Message.d.ts
65 lines (65 loc) · 2.73 KB
/
Message.d.ts
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
59
60
61
62
63
64
65
import PropTypes from 'prop-types';
import React from 'react';
import { ViewStyle } from 'react-native';
import Avatar from './Avatar';
import Bubble from './Bubble';
import SystemMessage from './SystemMessage';
import Day from './Day';
import { IMessage, User, LeftRightStyle } from './types';
export interface MessageProps<TMessage extends IMessage> {
key: any;
showUserAvatar?: boolean;
position: 'left' | 'right';
currentMessage?: TMessage;
nextMessage?: TMessage;
previousMessage?: TMessage;
user: User;
inverted?: boolean;
containerStyle?: LeftRightStyle<ViewStyle>;
renderBubble?(props: Bubble['props']): React.ReactNode;
renderDay?(props: Day['props']): React.ReactNode;
renderSystemMessage?(props: SystemMessage['props']): React.ReactNode;
renderAvatar?(props: Avatar['props']): React.ReactNode;
shouldUpdateMessage?(props: MessageProps<IMessage>, nextProps: MessageProps<IMessage>): boolean;
}
export default class Message<TMessage extends IMessage = IMessage> extends React.Component<MessageProps<TMessage>> {
static defaultProps: {
renderAvatar: undefined;
renderBubble: null;
renderDay: null;
renderSystemMessage: null;
position: string;
currentMessage: {};
nextMessage: {};
previousMessage: {};
user: {};
containerStyle: {};
showUserAvatar: boolean;
inverted: boolean;
shouldUpdateMessage: undefined;
};
static propTypes: {
renderAvatar: PropTypes.Requireable<(...args: any[]) => any>;
showUserAvatar: PropTypes.Requireable<boolean>;
renderBubble: PropTypes.Requireable<(...args: any[]) => any>;
renderDay: PropTypes.Requireable<(...args: any[]) => any>;
renderSystemMessage: PropTypes.Requireable<(...args: any[]) => any>;
position: PropTypes.Requireable<string>;
currentMessage: PropTypes.Requireable<object>;
nextMessage: PropTypes.Requireable<object>;
previousMessage: PropTypes.Requireable<object>;
user: PropTypes.Requireable<object>;
inverted: PropTypes.Requireable<boolean>;
containerStyle: PropTypes.Requireable<PropTypes.InferProps<{
left: PropTypes.Validator<import("react-native").StyleProp<ViewStyle>> | undefined;
right: PropTypes.Validator<import("react-native").StyleProp<ViewStyle>> | undefined;
}>>;
shouldUpdateMessage: PropTypes.Requireable<(...args: any[]) => any>;
};
shouldComponentUpdate(nextProps: MessageProps<TMessage>): boolean;
renderDay(): {} | null | undefined;
renderBubble(): {} | null | undefined;
renderSystemMessage(): {} | null | undefined;
renderAvatar(): JSX.Element | null;
render(): JSX.Element | null;
}