UNPKG

2.25 kBTypeScriptView Raw
1import { StyleProp, ViewStyle } from 'react-native';
2import { LightboxProps } from 'react-native-lightbox-v2';
3export { ActionsProps } from './Actions';
4export { AvatarProps } from './Avatar';
5export { BubbleProps, RenderMessageImageProps, RenderMessageVideoProps, RenderMessageAudioProps, RenderMessageTextProps } from './Bubble';
6export { ComposerProps } from './Composer';
7export { DayProps } from './Day';
8export { GiftedAvatarProps } from './GiftedAvatar';
9export { InputToolbarProps } from './InputToolbar';
10export { LoadEarlierProps } from './LoadEarlier';
11export { MessageProps } from './Message';
12export { MessageContainerProps } from './MessageContainer';
13export { MessageImageProps } from './MessageImage';
14export { MessageTextProps } from './MessageText';
15export { QuickRepliesProps } from './QuickReplies';
16export { SendProps } from './Send';
17export { SystemMessageProps } from './SystemMessage';
18export { TimeProps } from './Time';
19export type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
20export interface LeftRightStyle<T> {
21 left?: StyleProp<T>;
22 right?: StyleProp<T>;
23}
24type renderFunction = (x: unknown) => JSX.Element;
25export interface User {
26 _id: string | number;
27 name?: string;
28 avatar?: string | number | renderFunction;
29}
30export interface Reply {
31 title: string;
32 value: string;
33 messageId?: number | string;
34}
35export interface QuickReplies {
36 type: 'radio' | 'checkbox';
37 values: Reply[];
38 keepIt?: boolean;
39}
40export interface IMessage {
41 _id: string | number;
42 text: string;
43 createdAt: Date | number;
44 user: User;
45 image?: string;
46 video?: string;
47 audio?: string;
48 system?: boolean;
49 sent?: boolean;
50 received?: boolean;
51 pending?: boolean;
52 quickReplies?: QuickReplies;
53}
54export type IChatMessage = IMessage;
55export interface MessageVideoProps<TMessage extends IMessage> {
56 currentMessage: TMessage;
57 containerStyle?: StyleProp<ViewStyle>;
58 videoStyle?: StyleProp<ViewStyle>;
59 videoProps?: object;
60 lightboxProps?: LightboxProps;
61}
62export interface MessageAudioProps<TMessage extends IMessage> {
63 currentMessage: TMessage;
64 containerStyle?: StyleProp<ViewStyle>;
65 audioStyle?: StyleProp<ViewStyle>;
66 audioProps?: object;
67}