-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Expand file tree
/
Copy pathtypes.ts
More file actions
104 lines (96 loc) · 3.46 KB
/
types.ts
File metadata and controls
104 lines (96 loc) · 3.46 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import React, { ComponentProps } from 'react'
import {
StyleProp,
ViewStyle,
TextStyle,
Pressable,
} from 'react-native'
import { MessageReplyProps } from '../components/MessageReply'
import { MessageImageProps } from '../MessageImage'
import { MessageTextProps } from '../MessageText'
import {
User,
IMessage,
LeftRightStyle,
Reply,
ReplyMessage,
Omit,
MessageVideoProps,
MessageAudioProps,
} from '../Models'
import { QuickRepliesProps } from '../QuickReplies'
import { MessageReplyStyleProps } from '../Reply'
import { TimeProps } from '../Time'
export type RenderMessageImageProps<TMessage extends IMessage> = Omit<
BubbleProps<TMessage>,
'containerStyle' | 'wrapperStyle'
> &
MessageImageProps<TMessage>
export type RenderMessageVideoProps<TMessage extends IMessage> = Omit<
BubbleProps<TMessage>,
'containerStyle' | 'wrapperStyle'
> &
MessageVideoProps<TMessage>
export type RenderMessageAudioProps<TMessage extends IMessage> = Omit<
BubbleProps<TMessage>,
'containerStyle' | 'wrapperStyle'
> &
MessageAudioProps<TMessage>
export type RenderMessageTextProps<TMessage extends IMessage> = Omit<
BubbleProps<TMessage>,
'containerStyle' | 'wrapperStyle'
> &
MessageTextProps<TMessage>
/** Props for message reply functionality in bubble */
export interface BubbleReplyProps<TMessage extends IMessage> extends MessageReplyStyleProps {
/** Custom render for message reply; rendered on top of message content */
renderMessageReply?: (props: MessageReplyProps<TMessage>) => React.ReactNode
/** Callback when message reply is pressed */
onPress?: (replyMessage: ReplyMessage) => void
}
export interface BubbleProps<TMessage extends IMessage> {
user?: User
touchableProps?: ComponentProps<typeof Pressable>
isUsernameVisible?: boolean
isCustomViewBottom?: boolean
isInverted?: boolean
position: 'left' | 'right'
currentMessage: TMessage
nextMessage?: TMessage
previousMessage?: TMessage
containerStyle?: LeftRightStyle<ViewStyle>
wrapperStyle?: LeftRightStyle<ViewStyle>
textStyle?: LeftRightStyle<TextStyle>
bottomContainerStyle?: LeftRightStyle<ViewStyle>
tickStyle?: StyleProp<TextStyle>
containerToNextStyle?: LeftRightStyle<ViewStyle>
containerToPreviousStyle?: LeftRightStyle<ViewStyle>
usernameStyle?: TextStyle
quickReplyStyle?: StyleProp<ViewStyle>
quickReplyTextStyle?: StyleProp<TextStyle>
quickReplyContainerStyle?: StyleProp<ViewStyle>
messageTextProps?: Partial<MessageTextProps<TMessage>>
onPressMessage?: (context?: unknown, message?: unknown) => void
onLongPressMessage?: (context?: unknown, message?: unknown) => void
onQuickReply?: (replies: Reply[]) => void
renderMessageImage?: (
props: RenderMessageImageProps<TMessage>
) => React.ReactNode
renderMessageVideo?: (
props: RenderMessageVideoProps<TMessage>
) => React.ReactNode
renderMessageAudio?: (
props: RenderMessageAudioProps<TMessage>
) => React.ReactNode
renderMessageText?: (props: RenderMessageTextProps<TMessage>) => React.ReactNode
renderCustomView?: (bubbleProps: BubbleProps<TMessage>) => React.ReactNode
renderTime?: (timeProps: TimeProps<TMessage>) => React.ReactNode
renderTicks?: (currentMessage: TMessage) => React.ReactNode
renderUsername?: (user?: TMessage['user']) => React.ReactNode
renderQuickReplySend?: () => React.ReactNode
renderQuickReplies?: (
quickReplies: QuickRepliesProps<TMessage>
) => React.ReactNode
/** Message reply configuration */
messageReply?: BubbleReplyProps<TMessage>
}