@usechat/react-native 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -1
- package/dist/index.mjs +13 -2
- package/package.json +1 -1
- package/dist/index.d.mts +0 -662
- package/dist/index.d.ts +0 -662
package/dist/index.js
CHANGED
|
@@ -4588,7 +4588,12 @@ var ChatItem = ({ item, onPress }) => {
|
|
|
4588
4588
|
var ChatItem_default = ChatItem;
|
|
4589
4589
|
|
|
4590
4590
|
// src/components/chat-list/ChatList.tsx
|
|
4591
|
-
var ChatListBase = ({
|
|
4591
|
+
var ChatListBase = ({
|
|
4592
|
+
chats,
|
|
4593
|
+
onChatPress,
|
|
4594
|
+
onRefresh,
|
|
4595
|
+
refreshing = false
|
|
4596
|
+
}) => {
|
|
4592
4597
|
const renderChatItem = ({ item }) => <ChatItem_default item={item} onPress={onChatPress} />;
|
|
4593
4598
|
return <import_react_native21.FlatList
|
|
4594
4599
|
data={chats}
|
|
@@ -4596,6 +4601,12 @@ var ChatListBase = ({ chats, onChatPress }) => {
|
|
|
4596
4601
|
keyExtractor={(item) => item.id}
|
|
4597
4602
|
showsVerticalScrollIndicator={false}
|
|
4598
4603
|
style={{ flex: 1 }}
|
|
4604
|
+
refreshControl={onRefresh ? <import_react_native21.RefreshControl
|
|
4605
|
+
refreshing={refreshing}
|
|
4606
|
+
onRefresh={onRefresh}
|
|
4607
|
+
tintColor="#007AFF"
|
|
4608
|
+
colors={["#007AFF"]}
|
|
4609
|
+
/> : void 0}
|
|
4599
4610
|
/>;
|
|
4600
4611
|
};
|
|
4601
4612
|
var ChatList_default = ChatListBase;
|
package/dist/index.mjs
CHANGED
|
@@ -4341,7 +4341,7 @@ function requireAuthHook(hookFn) {
|
|
|
4341
4341
|
}
|
|
4342
4342
|
|
|
4343
4343
|
// src/components/chat-list/ChatList.tsx
|
|
4344
|
-
import { FlatList as FlatList2 } from "react-native";
|
|
4344
|
+
import { FlatList as FlatList2, RefreshControl } from "react-native";
|
|
4345
4345
|
|
|
4346
4346
|
// src/components/chat-list/ChatItem.tsx
|
|
4347
4347
|
import { View as View17, Text as Text12, TouchableOpacity as TouchableOpacity9 } from "react-native";
|
|
@@ -4498,7 +4498,12 @@ var ChatItem = ({ item, onPress }) => {
|
|
|
4498
4498
|
var ChatItem_default = ChatItem;
|
|
4499
4499
|
|
|
4500
4500
|
// src/components/chat-list/ChatList.tsx
|
|
4501
|
-
var ChatListBase = ({
|
|
4501
|
+
var ChatListBase = ({
|
|
4502
|
+
chats,
|
|
4503
|
+
onChatPress,
|
|
4504
|
+
onRefresh,
|
|
4505
|
+
refreshing = false
|
|
4506
|
+
}) => {
|
|
4502
4507
|
const renderChatItem = ({ item }) => <ChatItem_default item={item} onPress={onChatPress} />;
|
|
4503
4508
|
return <FlatList2
|
|
4504
4509
|
data={chats}
|
|
@@ -4506,6 +4511,12 @@ var ChatListBase = ({ chats, onChatPress }) => {
|
|
|
4506
4511
|
keyExtractor={(item) => item.id}
|
|
4507
4512
|
showsVerticalScrollIndicator={false}
|
|
4508
4513
|
style={{ flex: 1 }}
|
|
4514
|
+
refreshControl={onRefresh ? <RefreshControl
|
|
4515
|
+
refreshing={refreshing}
|
|
4516
|
+
onRefresh={onRefresh}
|
|
4517
|
+
tintColor="#007AFF"
|
|
4518
|
+
colors={["#007AFF"]}
|
|
4519
|
+
/> : void 0}
|
|
4509
4520
|
/>;
|
|
4510
4521
|
};
|
|
4511
4522
|
var ChatList_default = ChatListBase;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usechat/react-native",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Modular React Native Chat UI SDK with keyboard handling, customizable components, and rich features",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Lukasz Ko <hello@usechat.dev>",
|
package/dist/index.d.mts
DELETED
|
@@ -1,662 +0,0 @@
|
|
|
1
|
-
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { NativeSyntheticEvent, TextInputContentSizeChangeEventData, TextInput } from 'react-native';
|
|
4
|
-
|
|
5
|
-
interface Message$1 {
|
|
6
|
-
id: number;
|
|
7
|
-
text: string;
|
|
8
|
-
isMe: boolean;
|
|
9
|
-
timestamp: string;
|
|
10
|
-
status?: 'sent' | 'delivered' | 'read';
|
|
11
|
-
senderName?: string;
|
|
12
|
-
senderId?: string;
|
|
13
|
-
replyTo?: ReplyToMessage$1;
|
|
14
|
-
reactions?: MessageReaction$1[];
|
|
15
|
-
type?: 'text' | 'image';
|
|
16
|
-
attachments?: Attachment[];
|
|
17
|
-
deleted?: boolean;
|
|
18
|
-
imageData?: ImageAttachmentData$1;
|
|
19
|
-
}
|
|
20
|
-
interface ReplyToMessage$1 {
|
|
21
|
-
id: number;
|
|
22
|
-
text: string;
|
|
23
|
-
senderName?: string;
|
|
24
|
-
senderId?: string;
|
|
25
|
-
isMe: boolean;
|
|
26
|
-
timestamp?: string;
|
|
27
|
-
type?: 'text' | 'image';
|
|
28
|
-
imageData?: ImageAttachmentData$1;
|
|
29
|
-
}
|
|
30
|
-
interface MessageReaction$1 {
|
|
31
|
-
emoji: string;
|
|
32
|
-
count: number;
|
|
33
|
-
users: string[];
|
|
34
|
-
}
|
|
35
|
-
interface Attachment {
|
|
36
|
-
id: string;
|
|
37
|
-
type: 'image' | 'document' | 'location' | 'contact' | 'poll' | 'event';
|
|
38
|
-
data: any;
|
|
39
|
-
fileName?: string;
|
|
40
|
-
fileSize?: number;
|
|
41
|
-
mimeType?: string;
|
|
42
|
-
uploadStatus?: 'pending' | 'uploading' | 'completed' | 'failed';
|
|
43
|
-
uploadProgress?: number;
|
|
44
|
-
}
|
|
45
|
-
interface ImageAttachmentData$1 {
|
|
46
|
-
uri: string;
|
|
47
|
-
width: number;
|
|
48
|
-
height: number;
|
|
49
|
-
fileSize?: number;
|
|
50
|
-
fileName: string;
|
|
51
|
-
}
|
|
52
|
-
interface AttachmentResult {
|
|
53
|
-
id?: string;
|
|
54
|
-
type: 'image' | 'document' | 'location' | 'contact' | 'poll' | 'event';
|
|
55
|
-
data: any;
|
|
56
|
-
}
|
|
57
|
-
interface ChatScreenHeaderProps {
|
|
58
|
-
name?: string;
|
|
59
|
-
isOnline?: boolean;
|
|
60
|
-
onBack: () => void;
|
|
61
|
-
onVideoCall?: () => void;
|
|
62
|
-
onVoiceCall?: () => void;
|
|
63
|
-
onInfo?: () => void;
|
|
64
|
-
onSimulateTyping?: () => void;
|
|
65
|
-
}
|
|
66
|
-
interface MessageListProps {
|
|
67
|
-
messages: Message$1[];
|
|
68
|
-
onContentSizeChange?: () => void;
|
|
69
|
-
onMessageLongPress?: (message: Message$1, position?: {
|
|
70
|
-
x: number;
|
|
71
|
-
y: number;
|
|
72
|
-
width: number;
|
|
73
|
-
height: number;
|
|
74
|
-
}) => void;
|
|
75
|
-
onReactionPress?: (message: Message$1) => void;
|
|
76
|
-
isTyping?: boolean;
|
|
77
|
-
typingUserName?: string;
|
|
78
|
-
showScrollToBottom?: boolean;
|
|
79
|
-
isReplyActive?: boolean;
|
|
80
|
-
}
|
|
81
|
-
interface MessageInputProps {
|
|
82
|
-
value: string;
|
|
83
|
-
onChangeText: (text: string) => void;
|
|
84
|
-
onSend: () => void;
|
|
85
|
-
onFocus?: () => void;
|
|
86
|
-
height: number;
|
|
87
|
-
onContentSizeChange: (height: number) => void;
|
|
88
|
-
replyToMessage?: Message$1 | null;
|
|
89
|
-
onCancelReply?: () => void;
|
|
90
|
-
onAttachmentSend?: (attachmentResult: AttachmentResult, text?: string) => void;
|
|
91
|
-
}
|
|
92
|
-
interface MessageWithType$1 extends Message$1 {
|
|
93
|
-
listItemType: 'message';
|
|
94
|
-
}
|
|
95
|
-
interface DateSeparator$1 {
|
|
96
|
-
id: string;
|
|
97
|
-
listItemType: 'date-separator';
|
|
98
|
-
date: string;
|
|
99
|
-
displayDate: string;
|
|
100
|
-
}
|
|
101
|
-
type MessageListItem$1 = MessageWithType$1 | DateSeparator$1;
|
|
102
|
-
interface UseAttachmentsReturn {
|
|
103
|
-
attachments: Attachment[];
|
|
104
|
-
openPicker: (type: 'image' | 'document' | 'location' | 'contact') => Promise<void>;
|
|
105
|
-
addAttachment: (attachment: Attachment) => void;
|
|
106
|
-
removeAttachment: (attachmentId: string) => void;
|
|
107
|
-
clearAttachments: () => void;
|
|
108
|
-
uploadAttachments: () => Promise<Attachment[]>;
|
|
109
|
-
isUploading: boolean;
|
|
110
|
-
uploadProgress: number;
|
|
111
|
-
}
|
|
112
|
-
interface RenderMessageProps {
|
|
113
|
-
message: Message$1;
|
|
114
|
-
onLongPress?: (message: Message$1, position?: {
|
|
115
|
-
x: number;
|
|
116
|
-
y: number;
|
|
117
|
-
width: number;
|
|
118
|
-
height: number;
|
|
119
|
-
}) => void;
|
|
120
|
-
onReactionPress?: (message: Message$1) => void;
|
|
121
|
-
onReactionRemove?: (messageId: number, emoji: string) => void;
|
|
122
|
-
}
|
|
123
|
-
interface RenderInputProps {
|
|
124
|
-
value: string;
|
|
125
|
-
onChangeText: (text: string) => void;
|
|
126
|
-
onSend: () => void;
|
|
127
|
-
onFocus?: () => void;
|
|
128
|
-
height: number;
|
|
129
|
-
onContentSizeChange: (height: number) => void;
|
|
130
|
-
replyToMessage?: Message$1 | null;
|
|
131
|
-
onCancelReply?: () => void;
|
|
132
|
-
attachments: Attachment[];
|
|
133
|
-
onAttachmentAdd: (attachment: Attachment) => void;
|
|
134
|
-
onAttachmentRemove: (attachmentId: string) => void;
|
|
135
|
-
onAttachmentUpload: () => Promise<Attachment[]>;
|
|
136
|
-
}
|
|
137
|
-
interface RenderActionSheetProps {
|
|
138
|
-
visible: boolean;
|
|
139
|
-
onClose: () => void;
|
|
140
|
-
isMyMessage: boolean;
|
|
141
|
-
selectedMessage?: Message$1;
|
|
142
|
-
messagePosition?: {
|
|
143
|
-
x: number;
|
|
144
|
-
y: number;
|
|
145
|
-
width: number;
|
|
146
|
-
height: number;
|
|
147
|
-
};
|
|
148
|
-
onActionPress: (action: string) => void;
|
|
149
|
-
onEmojiReact: (emoji: string) => void;
|
|
150
|
-
}
|
|
151
|
-
interface RenderReactionDetailsProps {
|
|
152
|
-
visible: boolean;
|
|
153
|
-
onClose: () => void;
|
|
154
|
-
reactions: MessageReaction$1[];
|
|
155
|
-
messageText: string;
|
|
156
|
-
onAddReaction: (emoji: string) => void;
|
|
157
|
-
onRemoveReaction: (emoji: string) => void;
|
|
158
|
-
}
|
|
159
|
-
interface AttachmentUploader {
|
|
160
|
-
upload: (file: File | any) => Promise<{
|
|
161
|
-
url: string;
|
|
162
|
-
metadata?: any;
|
|
163
|
-
}>;
|
|
164
|
-
validate?: (file: File | any) => boolean | string;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
interface MessageInputRef {
|
|
168
|
-
focus: () => void;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
interface ChatData {
|
|
172
|
-
id: string;
|
|
173
|
-
name: string;
|
|
174
|
-
message: string;
|
|
175
|
-
time: string;
|
|
176
|
-
avatar: string;
|
|
177
|
-
unreadCount?: number;
|
|
178
|
-
isOnline?: boolean;
|
|
179
|
-
hasAttachment?: boolean;
|
|
180
|
-
}
|
|
181
|
-
interface ChatItemProps {
|
|
182
|
-
item: ChatData;
|
|
183
|
-
onPress: (chat: ChatData) => void;
|
|
184
|
-
}
|
|
185
|
-
interface ChatListProps {
|
|
186
|
-
chats: ChatData[];
|
|
187
|
-
onChatPress: (chat: ChatData) => void;
|
|
188
|
-
}
|
|
189
|
-
interface ChatAvatarProps {
|
|
190
|
-
avatar: string;
|
|
191
|
-
isOnline?: boolean;
|
|
192
|
-
size?: 'small' | 'medium' | 'large';
|
|
193
|
-
}
|
|
194
|
-
interface ReplyToMessage {
|
|
195
|
-
id: number;
|
|
196
|
-
text: string;
|
|
197
|
-
senderName?: string;
|
|
198
|
-
isMe: boolean;
|
|
199
|
-
type?: 'text' | 'image';
|
|
200
|
-
imageData?: ImageAttachmentData;
|
|
201
|
-
}
|
|
202
|
-
interface MessageReaction {
|
|
203
|
-
emoji: string;
|
|
204
|
-
count: number;
|
|
205
|
-
users: string[];
|
|
206
|
-
}
|
|
207
|
-
interface Message {
|
|
208
|
-
id: number;
|
|
209
|
-
text: string;
|
|
210
|
-
isMe: boolean;
|
|
211
|
-
timestamp: string;
|
|
212
|
-
status?: 'sent' | 'delivered' | 'read';
|
|
213
|
-
senderName?: string;
|
|
214
|
-
replyTo?: ReplyToMessage;
|
|
215
|
-
reactions?: MessageReaction[];
|
|
216
|
-
type?: 'text' | 'image';
|
|
217
|
-
imageData?: ImageAttachmentData;
|
|
218
|
-
deleted?: boolean;
|
|
219
|
-
}
|
|
220
|
-
interface DateSeparator {
|
|
221
|
-
id: string;
|
|
222
|
-
listItemType: 'date-separator';
|
|
223
|
-
date: string;
|
|
224
|
-
displayDate: string;
|
|
225
|
-
}
|
|
226
|
-
interface MessageWithType extends Message {
|
|
227
|
-
listItemType: 'message';
|
|
228
|
-
}
|
|
229
|
-
type MessageListItem = MessageWithType | DateSeparator;
|
|
230
|
-
interface AttachmentOption {
|
|
231
|
-
id: string;
|
|
232
|
-
label: string;
|
|
233
|
-
icon: any;
|
|
234
|
-
color: string;
|
|
235
|
-
}
|
|
236
|
-
interface AttachmentMenuProps {
|
|
237
|
-
onOptionSelect: (optionId: string) => void;
|
|
238
|
-
options: AttachmentOption[];
|
|
239
|
-
}
|
|
240
|
-
interface AttachmentMenuRef {
|
|
241
|
-
show: () => void;
|
|
242
|
-
hide: () => void;
|
|
243
|
-
}
|
|
244
|
-
interface ImageAttachmentData {
|
|
245
|
-
uri: string;
|
|
246
|
-
width: number;
|
|
247
|
-
height: number;
|
|
248
|
-
fileSize?: number;
|
|
249
|
-
fileName: string;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
interface MessageInputState<T = string> {
|
|
253
|
-
value: T;
|
|
254
|
-
height: number;
|
|
255
|
-
isFocused: boolean;
|
|
256
|
-
replyToMessage: Message$1 | null;
|
|
257
|
-
attachments: AttachmentResult[];
|
|
258
|
-
}
|
|
259
|
-
interface MessageInputActions<T = string> {
|
|
260
|
-
setValue: (value: T) => void;
|
|
261
|
-
setHeight: (height: number) => void;
|
|
262
|
-
setFocus: (focused: boolean) => void;
|
|
263
|
-
setReplyToMessage: (message: Message$1 | null) => void;
|
|
264
|
-
addAttachment: (attachment: AttachmentResult) => void;
|
|
265
|
-
removeAttachment: (attachmentId: string) => void;
|
|
266
|
-
clearAttachments: () => void;
|
|
267
|
-
sendMessage: () => void;
|
|
268
|
-
cancelReply: () => void;
|
|
269
|
-
focusInput: () => void;
|
|
270
|
-
handleAttachmentSelected: (result: AttachmentResult) => void;
|
|
271
|
-
handleContentSizeChange: (event: NativeSyntheticEvent<TextInputContentSizeChangeEventData>) => void;
|
|
272
|
-
handleFocus: () => void;
|
|
273
|
-
handleBlur: () => void;
|
|
274
|
-
}
|
|
275
|
-
interface MessageInputConfig<T = string> {
|
|
276
|
-
initialValue?: T;
|
|
277
|
-
initialHeight?: number;
|
|
278
|
-
onValueChange?: (value: T) => void;
|
|
279
|
-
onHeightChange?: (height: number) => void;
|
|
280
|
-
onSend?: (value: T, attachments: AttachmentResult[], replyTo?: Message$1 | null) => void;
|
|
281
|
-
onAttachmentSend?: (attachmentResult: AttachmentResult, text?: T) => void;
|
|
282
|
-
onReplyCancel?: () => void;
|
|
283
|
-
onFocus?: () => void;
|
|
284
|
-
onBlur?: () => void;
|
|
285
|
-
maxHeight?: number;
|
|
286
|
-
minHeight?: number;
|
|
287
|
-
maxLength?: number;
|
|
288
|
-
placeholder?: string;
|
|
289
|
-
}
|
|
290
|
-
interface UseMessageInputReturn<T = string> {
|
|
291
|
-
state: MessageInputState<T>;
|
|
292
|
-
actions: MessageInputActions<T>;
|
|
293
|
-
refs: {
|
|
294
|
-
textInputRef: React__default.RefObject<TextInput>;
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
interface UseChatMessagesReturn {
|
|
299
|
-
messages: Message[];
|
|
300
|
-
sendMessage: (text: string, replyTo?: ReplyToMessage) => void;
|
|
301
|
-
sendImageMessage: (imageData: any, text?: string, replyTo?: ReplyToMessage) => void;
|
|
302
|
-
updateMessageStatus: (messageId: number, status: 'sent' | 'delivered' | 'read') => void;
|
|
303
|
-
addReaction: (messageId: number, emoji: string) => void;
|
|
304
|
-
deleteMessage: (messageId: number) => void;
|
|
305
|
-
removeReaction: (messageId: number, emoji: string) => void;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
interface ChatSDKConfig {
|
|
309
|
-
initialMessages?: Message[];
|
|
310
|
-
enableOptimisticUpdates?: boolean;
|
|
311
|
-
}
|
|
312
|
-
interface ChatSDKReturn {
|
|
313
|
-
messages: Message[];
|
|
314
|
-
isTyping: boolean;
|
|
315
|
-
sendMessage: (text: string, replyTo?: Message) => void;
|
|
316
|
-
addReaction: (messageId: number, emoji: string) => void;
|
|
317
|
-
removeReaction: (messageId: number, emoji: string) => void;
|
|
318
|
-
setMessages: (messages: Message[]) => void;
|
|
319
|
-
addMessage: (message: Message) => void;
|
|
320
|
-
updateMessage: (messageId: number, updates: Partial<Message>) => void;
|
|
321
|
-
deleteMessage: (messageId: number) => void;
|
|
322
|
-
setTyping: (isTyping: boolean) => void;
|
|
323
|
-
resetChat: () => void;
|
|
324
|
-
getMessageById: (id: number) => Message | undefined;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
interface UseAttachmentsOptions {
|
|
328
|
-
uploader?: AttachmentUploader;
|
|
329
|
-
maxAttachments?: number;
|
|
330
|
-
maxFileSize?: number;
|
|
331
|
-
allowedTypes?: string[];
|
|
332
|
-
onAttachmentAdd?: (attachment: Attachment) => void;
|
|
333
|
-
onAttachmentRemove?: (attachmentId: string) => void;
|
|
334
|
-
onAttachmentUpload?: (attachments: Attachment[]) => void;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
interface MessageListConfig {
|
|
338
|
-
scrollThreshold?: number;
|
|
339
|
-
autoScrollToBottom?: boolean;
|
|
340
|
-
enableMessageActions?: boolean;
|
|
341
|
-
enableReactionDetails?: boolean;
|
|
342
|
-
initialNumToRender?: number;
|
|
343
|
-
maxToRenderPerBatch?: number;
|
|
344
|
-
windowSize?: number;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
interface ActionState {
|
|
348
|
-
actionSheetVisible: boolean;
|
|
349
|
-
selectedMessage: Message$1 | null;
|
|
350
|
-
messagePosition?: {
|
|
351
|
-
x: number;
|
|
352
|
-
y: number;
|
|
353
|
-
width: number;
|
|
354
|
-
height: number;
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
interface ReactionState {
|
|
359
|
-
isReactionDetailsVisible: boolean;
|
|
360
|
-
selectedReactions: any[];
|
|
361
|
-
selectedMessageText: string;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
interface ThemeColors {
|
|
365
|
-
primary: string;
|
|
366
|
-
secondary: string;
|
|
367
|
-
background: string;
|
|
368
|
-
surface: string;
|
|
369
|
-
surfaceSecondary: string;
|
|
370
|
-
text: string;
|
|
371
|
-
textSecondary: string;
|
|
372
|
-
textMuted: string;
|
|
373
|
-
border: string;
|
|
374
|
-
borderLight: string;
|
|
375
|
-
success: string;
|
|
376
|
-
error: string;
|
|
377
|
-
warning: string;
|
|
378
|
-
unread: string;
|
|
379
|
-
online: string;
|
|
380
|
-
messageBubble: {
|
|
381
|
-
sent: string;
|
|
382
|
-
received: string;
|
|
383
|
-
sentText: string;
|
|
384
|
-
receivedText: string;
|
|
385
|
-
};
|
|
386
|
-
gray: {
|
|
387
|
-
50: string;
|
|
388
|
-
100: string;
|
|
389
|
-
200: string;
|
|
390
|
-
300: string;
|
|
391
|
-
400: string;
|
|
392
|
-
500: string;
|
|
393
|
-
600: string;
|
|
394
|
-
700: string;
|
|
395
|
-
800: string;
|
|
396
|
-
900: string;
|
|
397
|
-
};
|
|
398
|
-
blue: {
|
|
399
|
-
50: string;
|
|
400
|
-
500: string;
|
|
401
|
-
600: string;
|
|
402
|
-
};
|
|
403
|
-
green: {
|
|
404
|
-
500: string;
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
interface ThemeSpacing {
|
|
408
|
-
xs: number;
|
|
409
|
-
sm: number;
|
|
410
|
-
md: number;
|
|
411
|
-
lg: number;
|
|
412
|
-
xl: number;
|
|
413
|
-
xxl: number;
|
|
414
|
-
}
|
|
415
|
-
interface ThemeBorderRadius {
|
|
416
|
-
sm: number;
|
|
417
|
-
md: number;
|
|
418
|
-
lg: number;
|
|
419
|
-
xl: number;
|
|
420
|
-
full: number;
|
|
421
|
-
}
|
|
422
|
-
interface ThemeTypography {
|
|
423
|
-
fontFamily: string;
|
|
424
|
-
fontSize: {
|
|
425
|
-
xs: number;
|
|
426
|
-
sm: number;
|
|
427
|
-
base: number;
|
|
428
|
-
lg: number;
|
|
429
|
-
xl: number;
|
|
430
|
-
xxl: number;
|
|
431
|
-
};
|
|
432
|
-
fontWeight: {
|
|
433
|
-
normal: '400' | 'normal';
|
|
434
|
-
medium: '500' | 'medium';
|
|
435
|
-
semibold: '600' | 'semibold';
|
|
436
|
-
bold: '700' | 'bold';
|
|
437
|
-
};
|
|
438
|
-
lineHeight: {
|
|
439
|
-
tight: number;
|
|
440
|
-
normal: number;
|
|
441
|
-
relaxed: number;
|
|
442
|
-
};
|
|
443
|
-
}
|
|
444
|
-
interface Theme {
|
|
445
|
-
colors: ThemeColors;
|
|
446
|
-
spacing: ThemeSpacing;
|
|
447
|
-
borderRadius: ThemeBorderRadius;
|
|
448
|
-
typography: ThemeTypography;
|
|
449
|
-
}
|
|
450
|
-
interface ThemeProviderProps {
|
|
451
|
-
children: React.ReactNode;
|
|
452
|
-
theme?: Partial<Theme>;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
interface ChatHeaderProps {
|
|
456
|
-
title: string;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
interface ChatListSearchBarProps {
|
|
460
|
-
value: string;
|
|
461
|
-
onChangeText: (text: string) => void;
|
|
462
|
-
onClear: () => void;
|
|
463
|
-
placeholder?: string;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
interface TypingIndicatorProps {
|
|
467
|
-
isVisible: boolean;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
interface ExtendedMessageListProps extends MessageListProps {
|
|
471
|
-
isTyping?: boolean;
|
|
472
|
-
typingUserName?: string;
|
|
473
|
-
onScroll?: (event: any) => void;
|
|
474
|
-
onContentSizeChange?: () => void;
|
|
475
|
-
showScrollToBottom?: boolean;
|
|
476
|
-
isReplyActive?: boolean;
|
|
477
|
-
scrollThreshold?: number;
|
|
478
|
-
autoScrollToBottom?: boolean;
|
|
479
|
-
onScrollToBottom?: () => void;
|
|
480
|
-
onScrollToTop?: () => void;
|
|
481
|
-
onScrollPositionChange?: (isNearBottom: boolean, isNearTop: boolean) => void;
|
|
482
|
-
onActionPress?: (action: string, message: Message$1) => void;
|
|
483
|
-
onReactionAdd?: (messageId: number, emoji: string) => void;
|
|
484
|
-
onReactionRemove?: (messageId: number, emoji: string) => void;
|
|
485
|
-
onMessageDelete?: (messageId: number) => void;
|
|
486
|
-
onReplyMessage?: (message: Message$1) => void;
|
|
487
|
-
onCancelReply?: () => void;
|
|
488
|
-
enableMessageActions?: boolean;
|
|
489
|
-
enableReactionDetails?: boolean;
|
|
490
|
-
}
|
|
491
|
-
interface MessageListRef {
|
|
492
|
-
scrollToEnd: (animated?: boolean) => void;
|
|
493
|
-
scrollToOffset: (offset: number, animated?: boolean) => void;
|
|
494
|
-
scrollToIndex: (index: number, animated?: boolean) => void;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
interface ChatConfig {
|
|
498
|
-
keyboardBehavior?: 'padding' | 'height' | 'position';
|
|
499
|
-
keyboardVerticalOffset?: number;
|
|
500
|
-
enableReactionDetails?: boolean;
|
|
501
|
-
enableMessageActions?: boolean;
|
|
502
|
-
enableScrollToBottom?: boolean;
|
|
503
|
-
enableTypingIndicator?: boolean;
|
|
504
|
-
onMessageSend?: (text: string, replyTo?: Message) => void;
|
|
505
|
-
onReactionAdd?: (messageId: number, emoji: string) => void;
|
|
506
|
-
onReactionRemove?: (messageId: number, emoji: string) => void;
|
|
507
|
-
}
|
|
508
|
-
interface ChatProviderProps {
|
|
509
|
-
children: ReactNode;
|
|
510
|
-
config?: ChatConfig;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
interface ChatInitConfig {
|
|
514
|
-
projectId: string;
|
|
515
|
-
apiUrl?: string;
|
|
516
|
-
debug?: boolean;
|
|
517
|
-
}
|
|
518
|
-
interface ChatInitResponse {
|
|
519
|
-
success: boolean;
|
|
520
|
-
message: string;
|
|
521
|
-
projectId: string;
|
|
522
|
-
activatedAt: string;
|
|
523
|
-
}
|
|
524
|
-
/**
|
|
525
|
-
* Initialize the chat SDK with project verification
|
|
526
|
-
*
|
|
527
|
-
* This function validates the project ID with the API and sets up the SDK for use.
|
|
528
|
-
* All UseChat components and hooks require this to be called first.
|
|
529
|
-
*
|
|
530
|
-
* @param config - Configuration object containing projectId and optional apiUrl
|
|
531
|
-
* @returns Promise that resolves to ChatInitResponse or rejects with ChatInitError
|
|
532
|
-
*/
|
|
533
|
-
declare const initChat: (config: ChatInitConfig) => Promise<ChatInitResponse>;
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
* Simple Authentication System for UseChat SDK
|
|
537
|
-
*
|
|
538
|
-
* This system ensures initChat() is called before using any components or hooks.
|
|
539
|
-
* No loading states - just immediate error throwing for better developer experience.
|
|
540
|
-
*/
|
|
541
|
-
interface AuthState {
|
|
542
|
-
isInitialized: boolean;
|
|
543
|
-
projectId: string | null;
|
|
544
|
-
error: string | null;
|
|
545
|
-
}
|
|
546
|
-
/**
|
|
547
|
-
* Get current authentication state (read-only)
|
|
548
|
-
*/
|
|
549
|
-
declare const getAuthState: () => Readonly<AuthState>;
|
|
550
|
-
/**
|
|
551
|
-
* Get the current project ID (throws if not initialized)
|
|
552
|
-
*/
|
|
553
|
-
declare const getProjectId: () => string;
|
|
554
|
-
/**
|
|
555
|
-
* Check if SDK is initialized (without throwing)
|
|
556
|
-
*/
|
|
557
|
-
declare const isInitialized: () => boolean;
|
|
558
|
-
|
|
559
|
-
interface ChatComponents {
|
|
560
|
-
MessageList?: ComponentType<MessageListProps>;
|
|
561
|
-
MessageInput?: ComponentType<MessageInputProps>;
|
|
562
|
-
MessageActionSheet?: ComponentType<any>;
|
|
563
|
-
ReactionDetailsSheet?: ComponentType<any>;
|
|
564
|
-
ScrollToBottomButton?: ComponentType<any>;
|
|
565
|
-
}
|
|
566
|
-
interface ChatRenderProps {
|
|
567
|
-
renderMessage?: (props: RenderMessageProps) => ReactNode;
|
|
568
|
-
renderInput?: (props: RenderInputProps) => ReactNode;
|
|
569
|
-
renderActionSheet?: (props: RenderActionSheetProps) => ReactNode;
|
|
570
|
-
renderReactionDetails?: (props: RenderReactionDetailsProps) => ReactNode;
|
|
571
|
-
}
|
|
572
|
-
interface ChatProps {
|
|
573
|
-
messages?: Message$1[];
|
|
574
|
-
components?: ChatComponents;
|
|
575
|
-
renderProps?: ChatRenderProps;
|
|
576
|
-
onMessageSend?: (message: Message$1) => void;
|
|
577
|
-
onReactionAdd?: (messageId: number, emoji: string) => void;
|
|
578
|
-
onReactionRemove?: (messageId: number, emoji: string) => void;
|
|
579
|
-
onMessageDelete?: (messageId: number) => void;
|
|
580
|
-
onActionPress?: (action: string, message: Message$1) => void;
|
|
581
|
-
attachmentUploader?: AttachmentUploader;
|
|
582
|
-
maxAttachments?: number;
|
|
583
|
-
maxFileSize?: number;
|
|
584
|
-
allowedFileTypes?: string[];
|
|
585
|
-
enableReactionDetails?: boolean;
|
|
586
|
-
enableMessageActions?: boolean;
|
|
587
|
-
enableScrollToBottom?: boolean;
|
|
588
|
-
enableTypingIndicator?: boolean;
|
|
589
|
-
isTyping?: boolean;
|
|
590
|
-
typingUserName?: string;
|
|
591
|
-
isLoading?: boolean;
|
|
592
|
-
loadingComponent?: ReactNode;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
declare const defaultTheme: Theme;
|
|
596
|
-
|
|
597
|
-
declare const Chat: React$1.ComponentType<ChatProps>;
|
|
598
|
-
declare const ChatProvider: React$1.ComponentType<ChatProviderProps>;
|
|
599
|
-
declare const useChatConfig: () => ChatConfig;
|
|
600
|
-
|
|
601
|
-
declare const MessageList: React$1.ComponentType<ExtendedMessageListProps & React$1.RefAttributes<MessageListRef>>;
|
|
602
|
-
declare const MessageInput: React$1.ComponentType<MessageInputProps & React$1.RefAttributes<MessageInputRef>>;
|
|
603
|
-
|
|
604
|
-
declare const ChatScreenHeader: React$1.ComponentType<ChatScreenHeaderProps>;
|
|
605
|
-
declare const TypingIndicator: React$1.ComponentType<TypingIndicatorProps>;
|
|
606
|
-
|
|
607
|
-
declare const ChatList: React$1.ComponentType<ChatListProps>;
|
|
608
|
-
declare const ChatItem: React$1.ComponentType<ChatItemProps>;
|
|
609
|
-
declare const ChatHeader: React$1.ComponentType<ChatHeaderProps>;
|
|
610
|
-
declare const ChatListSearchBar: React$1.ComponentType<ChatListSearchBarProps>;
|
|
611
|
-
|
|
612
|
-
declare const ChatAvatar: React$1.ComponentType<ChatAvatarProps>;
|
|
613
|
-
declare const AttachmentMenu: React$1.ComponentType<AttachmentMenuProps & React$1.RefAttributes<AttachmentMenuRef>>;
|
|
614
|
-
declare const ThemeProvider: React$1.ComponentType<ThemeProviderProps>;
|
|
615
|
-
|
|
616
|
-
declare const useTheme: () => Theme;
|
|
617
|
-
|
|
618
|
-
declare const useChatSDK: (config?: ChatSDKConfig | undefined) => ChatSDKReturn;
|
|
619
|
-
declare const useChatMessages: (senderName?: string | undefined) => UseChatMessagesReturn;
|
|
620
|
-
declare const useMessageList: (messages: Message$1[], config?: MessageListConfig | undefined) => {
|
|
621
|
-
messageItems: MessageListItem[];
|
|
622
|
-
keyExtractor: (item: MessageListItem$1) => string;
|
|
623
|
-
flatListProps: {
|
|
624
|
-
initialNumToRender: number;
|
|
625
|
-
maxToRenderPerBatch: number;
|
|
626
|
-
windowSize: number;
|
|
627
|
-
inverted: boolean;
|
|
628
|
-
showsVerticalScrollIndicator: boolean;
|
|
629
|
-
keyboardShouldPersistTaps: "handled";
|
|
630
|
-
removeClippedSubviews: boolean;
|
|
631
|
-
scrollEventThrottle: number;
|
|
632
|
-
};
|
|
633
|
-
};
|
|
634
|
-
declare const useMessageActions: (config?: MessageListConfig | undefined) => {
|
|
635
|
-
actionState: ActionState;
|
|
636
|
-
handleMessageLongPress: (message: Message$1, position?: {
|
|
637
|
-
x: number;
|
|
638
|
-
y: number;
|
|
639
|
-
width: number;
|
|
640
|
-
height: number;
|
|
641
|
-
}) => void;
|
|
642
|
-
handleActionSheetClose: () => void;
|
|
643
|
-
handleActionPress: (action: string, callbacks?: {
|
|
644
|
-
onReply?: (message: Message$1) => void;
|
|
645
|
-
onDelete?: (messageId: number) => void;
|
|
646
|
-
onCopy?: (message: Message$1) => void;
|
|
647
|
-
onCustomAction?: (action: string, message: Message$1) => void;
|
|
648
|
-
}) => void;
|
|
649
|
-
};
|
|
650
|
-
declare const useMessageReactions: (config?: MessageListConfig | undefined) => {
|
|
651
|
-
reactionState: ReactionState;
|
|
652
|
-
selectedMessage: Message$1 | null;
|
|
653
|
-
handleReactionPress: (message: Message$1) => void;
|
|
654
|
-
handleReactionDetailsClose: () => void;
|
|
655
|
-
handleAddReaction: (emoji: string, onAdd?: (messageId: number, emoji: string) => void) => void;
|
|
656
|
-
handleRemoveReaction: (emoji: string, onRemove?: (messageId: number, emoji: string) => void) => void;
|
|
657
|
-
handleEmojiReact: (emoji: string, onAdd?: (messageId: number, emoji: string) => void) => void;
|
|
658
|
-
};
|
|
659
|
-
declare const useAttachments: (options?: UseAttachmentsOptions | undefined) => UseAttachmentsReturn;
|
|
660
|
-
declare const useMessageInput: <T = string>(config?: MessageInputConfig<T> | undefined) => UseMessageInputReturn<T>;
|
|
661
|
-
|
|
662
|
-
export { AttachmentMenu, type AttachmentResult, Chat, ChatAvatar, type ChatConfig, ChatHeader, type ChatHeaderProps, type ChatInitConfig, type ChatInitResponse, ChatItem, ChatList, ChatListSearchBar, type ChatListSearchBarProps, type ChatProps, ChatProvider, ChatScreenHeader, type Message$1 as Message, MessageInput, type MessageInputRef, MessageList, type MessageListRef, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeProviderProps, type ThemeSpacing, type ThemeTypography, TypingIndicator, type TypingIndicatorProps, defaultTheme, getAuthState, getProjectId, initChat, isInitialized, useAttachments, useChatConfig, useChatMessages, useChatSDK, useMessageActions, useMessageInput, useMessageList, useMessageReactions, useTheme };
|
package/dist/index.d.ts
DELETED
|
@@ -1,662 +0,0 @@
|
|
|
1
|
-
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { NativeSyntheticEvent, TextInputContentSizeChangeEventData, TextInput } from 'react-native';
|
|
4
|
-
|
|
5
|
-
interface Message$1 {
|
|
6
|
-
id: number;
|
|
7
|
-
text: string;
|
|
8
|
-
isMe: boolean;
|
|
9
|
-
timestamp: string;
|
|
10
|
-
status?: 'sent' | 'delivered' | 'read';
|
|
11
|
-
senderName?: string;
|
|
12
|
-
senderId?: string;
|
|
13
|
-
replyTo?: ReplyToMessage$1;
|
|
14
|
-
reactions?: MessageReaction$1[];
|
|
15
|
-
type?: 'text' | 'image';
|
|
16
|
-
attachments?: Attachment[];
|
|
17
|
-
deleted?: boolean;
|
|
18
|
-
imageData?: ImageAttachmentData$1;
|
|
19
|
-
}
|
|
20
|
-
interface ReplyToMessage$1 {
|
|
21
|
-
id: number;
|
|
22
|
-
text: string;
|
|
23
|
-
senderName?: string;
|
|
24
|
-
senderId?: string;
|
|
25
|
-
isMe: boolean;
|
|
26
|
-
timestamp?: string;
|
|
27
|
-
type?: 'text' | 'image';
|
|
28
|
-
imageData?: ImageAttachmentData$1;
|
|
29
|
-
}
|
|
30
|
-
interface MessageReaction$1 {
|
|
31
|
-
emoji: string;
|
|
32
|
-
count: number;
|
|
33
|
-
users: string[];
|
|
34
|
-
}
|
|
35
|
-
interface Attachment {
|
|
36
|
-
id: string;
|
|
37
|
-
type: 'image' | 'document' | 'location' | 'contact' | 'poll' | 'event';
|
|
38
|
-
data: any;
|
|
39
|
-
fileName?: string;
|
|
40
|
-
fileSize?: number;
|
|
41
|
-
mimeType?: string;
|
|
42
|
-
uploadStatus?: 'pending' | 'uploading' | 'completed' | 'failed';
|
|
43
|
-
uploadProgress?: number;
|
|
44
|
-
}
|
|
45
|
-
interface ImageAttachmentData$1 {
|
|
46
|
-
uri: string;
|
|
47
|
-
width: number;
|
|
48
|
-
height: number;
|
|
49
|
-
fileSize?: number;
|
|
50
|
-
fileName: string;
|
|
51
|
-
}
|
|
52
|
-
interface AttachmentResult {
|
|
53
|
-
id?: string;
|
|
54
|
-
type: 'image' | 'document' | 'location' | 'contact' | 'poll' | 'event';
|
|
55
|
-
data: any;
|
|
56
|
-
}
|
|
57
|
-
interface ChatScreenHeaderProps {
|
|
58
|
-
name?: string;
|
|
59
|
-
isOnline?: boolean;
|
|
60
|
-
onBack: () => void;
|
|
61
|
-
onVideoCall?: () => void;
|
|
62
|
-
onVoiceCall?: () => void;
|
|
63
|
-
onInfo?: () => void;
|
|
64
|
-
onSimulateTyping?: () => void;
|
|
65
|
-
}
|
|
66
|
-
interface MessageListProps {
|
|
67
|
-
messages: Message$1[];
|
|
68
|
-
onContentSizeChange?: () => void;
|
|
69
|
-
onMessageLongPress?: (message: Message$1, position?: {
|
|
70
|
-
x: number;
|
|
71
|
-
y: number;
|
|
72
|
-
width: number;
|
|
73
|
-
height: number;
|
|
74
|
-
}) => void;
|
|
75
|
-
onReactionPress?: (message: Message$1) => void;
|
|
76
|
-
isTyping?: boolean;
|
|
77
|
-
typingUserName?: string;
|
|
78
|
-
showScrollToBottom?: boolean;
|
|
79
|
-
isReplyActive?: boolean;
|
|
80
|
-
}
|
|
81
|
-
interface MessageInputProps {
|
|
82
|
-
value: string;
|
|
83
|
-
onChangeText: (text: string) => void;
|
|
84
|
-
onSend: () => void;
|
|
85
|
-
onFocus?: () => void;
|
|
86
|
-
height: number;
|
|
87
|
-
onContentSizeChange: (height: number) => void;
|
|
88
|
-
replyToMessage?: Message$1 | null;
|
|
89
|
-
onCancelReply?: () => void;
|
|
90
|
-
onAttachmentSend?: (attachmentResult: AttachmentResult, text?: string) => void;
|
|
91
|
-
}
|
|
92
|
-
interface MessageWithType$1 extends Message$1 {
|
|
93
|
-
listItemType: 'message';
|
|
94
|
-
}
|
|
95
|
-
interface DateSeparator$1 {
|
|
96
|
-
id: string;
|
|
97
|
-
listItemType: 'date-separator';
|
|
98
|
-
date: string;
|
|
99
|
-
displayDate: string;
|
|
100
|
-
}
|
|
101
|
-
type MessageListItem$1 = MessageWithType$1 | DateSeparator$1;
|
|
102
|
-
interface UseAttachmentsReturn {
|
|
103
|
-
attachments: Attachment[];
|
|
104
|
-
openPicker: (type: 'image' | 'document' | 'location' | 'contact') => Promise<void>;
|
|
105
|
-
addAttachment: (attachment: Attachment) => void;
|
|
106
|
-
removeAttachment: (attachmentId: string) => void;
|
|
107
|
-
clearAttachments: () => void;
|
|
108
|
-
uploadAttachments: () => Promise<Attachment[]>;
|
|
109
|
-
isUploading: boolean;
|
|
110
|
-
uploadProgress: number;
|
|
111
|
-
}
|
|
112
|
-
interface RenderMessageProps {
|
|
113
|
-
message: Message$1;
|
|
114
|
-
onLongPress?: (message: Message$1, position?: {
|
|
115
|
-
x: number;
|
|
116
|
-
y: number;
|
|
117
|
-
width: number;
|
|
118
|
-
height: number;
|
|
119
|
-
}) => void;
|
|
120
|
-
onReactionPress?: (message: Message$1) => void;
|
|
121
|
-
onReactionRemove?: (messageId: number, emoji: string) => void;
|
|
122
|
-
}
|
|
123
|
-
interface RenderInputProps {
|
|
124
|
-
value: string;
|
|
125
|
-
onChangeText: (text: string) => void;
|
|
126
|
-
onSend: () => void;
|
|
127
|
-
onFocus?: () => void;
|
|
128
|
-
height: number;
|
|
129
|
-
onContentSizeChange: (height: number) => void;
|
|
130
|
-
replyToMessage?: Message$1 | null;
|
|
131
|
-
onCancelReply?: () => void;
|
|
132
|
-
attachments: Attachment[];
|
|
133
|
-
onAttachmentAdd: (attachment: Attachment) => void;
|
|
134
|
-
onAttachmentRemove: (attachmentId: string) => void;
|
|
135
|
-
onAttachmentUpload: () => Promise<Attachment[]>;
|
|
136
|
-
}
|
|
137
|
-
interface RenderActionSheetProps {
|
|
138
|
-
visible: boolean;
|
|
139
|
-
onClose: () => void;
|
|
140
|
-
isMyMessage: boolean;
|
|
141
|
-
selectedMessage?: Message$1;
|
|
142
|
-
messagePosition?: {
|
|
143
|
-
x: number;
|
|
144
|
-
y: number;
|
|
145
|
-
width: number;
|
|
146
|
-
height: number;
|
|
147
|
-
};
|
|
148
|
-
onActionPress: (action: string) => void;
|
|
149
|
-
onEmojiReact: (emoji: string) => void;
|
|
150
|
-
}
|
|
151
|
-
interface RenderReactionDetailsProps {
|
|
152
|
-
visible: boolean;
|
|
153
|
-
onClose: () => void;
|
|
154
|
-
reactions: MessageReaction$1[];
|
|
155
|
-
messageText: string;
|
|
156
|
-
onAddReaction: (emoji: string) => void;
|
|
157
|
-
onRemoveReaction: (emoji: string) => void;
|
|
158
|
-
}
|
|
159
|
-
interface AttachmentUploader {
|
|
160
|
-
upload: (file: File | any) => Promise<{
|
|
161
|
-
url: string;
|
|
162
|
-
metadata?: any;
|
|
163
|
-
}>;
|
|
164
|
-
validate?: (file: File | any) => boolean | string;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
interface MessageInputRef {
|
|
168
|
-
focus: () => void;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
interface ChatData {
|
|
172
|
-
id: string;
|
|
173
|
-
name: string;
|
|
174
|
-
message: string;
|
|
175
|
-
time: string;
|
|
176
|
-
avatar: string;
|
|
177
|
-
unreadCount?: number;
|
|
178
|
-
isOnline?: boolean;
|
|
179
|
-
hasAttachment?: boolean;
|
|
180
|
-
}
|
|
181
|
-
interface ChatItemProps {
|
|
182
|
-
item: ChatData;
|
|
183
|
-
onPress: (chat: ChatData) => void;
|
|
184
|
-
}
|
|
185
|
-
interface ChatListProps {
|
|
186
|
-
chats: ChatData[];
|
|
187
|
-
onChatPress: (chat: ChatData) => void;
|
|
188
|
-
}
|
|
189
|
-
interface ChatAvatarProps {
|
|
190
|
-
avatar: string;
|
|
191
|
-
isOnline?: boolean;
|
|
192
|
-
size?: 'small' | 'medium' | 'large';
|
|
193
|
-
}
|
|
194
|
-
interface ReplyToMessage {
|
|
195
|
-
id: number;
|
|
196
|
-
text: string;
|
|
197
|
-
senderName?: string;
|
|
198
|
-
isMe: boolean;
|
|
199
|
-
type?: 'text' | 'image';
|
|
200
|
-
imageData?: ImageAttachmentData;
|
|
201
|
-
}
|
|
202
|
-
interface MessageReaction {
|
|
203
|
-
emoji: string;
|
|
204
|
-
count: number;
|
|
205
|
-
users: string[];
|
|
206
|
-
}
|
|
207
|
-
interface Message {
|
|
208
|
-
id: number;
|
|
209
|
-
text: string;
|
|
210
|
-
isMe: boolean;
|
|
211
|
-
timestamp: string;
|
|
212
|
-
status?: 'sent' | 'delivered' | 'read';
|
|
213
|
-
senderName?: string;
|
|
214
|
-
replyTo?: ReplyToMessage;
|
|
215
|
-
reactions?: MessageReaction[];
|
|
216
|
-
type?: 'text' | 'image';
|
|
217
|
-
imageData?: ImageAttachmentData;
|
|
218
|
-
deleted?: boolean;
|
|
219
|
-
}
|
|
220
|
-
interface DateSeparator {
|
|
221
|
-
id: string;
|
|
222
|
-
listItemType: 'date-separator';
|
|
223
|
-
date: string;
|
|
224
|
-
displayDate: string;
|
|
225
|
-
}
|
|
226
|
-
interface MessageWithType extends Message {
|
|
227
|
-
listItemType: 'message';
|
|
228
|
-
}
|
|
229
|
-
type MessageListItem = MessageWithType | DateSeparator;
|
|
230
|
-
interface AttachmentOption {
|
|
231
|
-
id: string;
|
|
232
|
-
label: string;
|
|
233
|
-
icon: any;
|
|
234
|
-
color: string;
|
|
235
|
-
}
|
|
236
|
-
interface AttachmentMenuProps {
|
|
237
|
-
onOptionSelect: (optionId: string) => void;
|
|
238
|
-
options: AttachmentOption[];
|
|
239
|
-
}
|
|
240
|
-
interface AttachmentMenuRef {
|
|
241
|
-
show: () => void;
|
|
242
|
-
hide: () => void;
|
|
243
|
-
}
|
|
244
|
-
interface ImageAttachmentData {
|
|
245
|
-
uri: string;
|
|
246
|
-
width: number;
|
|
247
|
-
height: number;
|
|
248
|
-
fileSize?: number;
|
|
249
|
-
fileName: string;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
interface MessageInputState<T = string> {
|
|
253
|
-
value: T;
|
|
254
|
-
height: number;
|
|
255
|
-
isFocused: boolean;
|
|
256
|
-
replyToMessage: Message$1 | null;
|
|
257
|
-
attachments: AttachmentResult[];
|
|
258
|
-
}
|
|
259
|
-
interface MessageInputActions<T = string> {
|
|
260
|
-
setValue: (value: T) => void;
|
|
261
|
-
setHeight: (height: number) => void;
|
|
262
|
-
setFocus: (focused: boolean) => void;
|
|
263
|
-
setReplyToMessage: (message: Message$1 | null) => void;
|
|
264
|
-
addAttachment: (attachment: AttachmentResult) => void;
|
|
265
|
-
removeAttachment: (attachmentId: string) => void;
|
|
266
|
-
clearAttachments: () => void;
|
|
267
|
-
sendMessage: () => void;
|
|
268
|
-
cancelReply: () => void;
|
|
269
|
-
focusInput: () => void;
|
|
270
|
-
handleAttachmentSelected: (result: AttachmentResult) => void;
|
|
271
|
-
handleContentSizeChange: (event: NativeSyntheticEvent<TextInputContentSizeChangeEventData>) => void;
|
|
272
|
-
handleFocus: () => void;
|
|
273
|
-
handleBlur: () => void;
|
|
274
|
-
}
|
|
275
|
-
interface MessageInputConfig<T = string> {
|
|
276
|
-
initialValue?: T;
|
|
277
|
-
initialHeight?: number;
|
|
278
|
-
onValueChange?: (value: T) => void;
|
|
279
|
-
onHeightChange?: (height: number) => void;
|
|
280
|
-
onSend?: (value: T, attachments: AttachmentResult[], replyTo?: Message$1 | null) => void;
|
|
281
|
-
onAttachmentSend?: (attachmentResult: AttachmentResult, text?: T) => void;
|
|
282
|
-
onReplyCancel?: () => void;
|
|
283
|
-
onFocus?: () => void;
|
|
284
|
-
onBlur?: () => void;
|
|
285
|
-
maxHeight?: number;
|
|
286
|
-
minHeight?: number;
|
|
287
|
-
maxLength?: number;
|
|
288
|
-
placeholder?: string;
|
|
289
|
-
}
|
|
290
|
-
interface UseMessageInputReturn<T = string> {
|
|
291
|
-
state: MessageInputState<T>;
|
|
292
|
-
actions: MessageInputActions<T>;
|
|
293
|
-
refs: {
|
|
294
|
-
textInputRef: React__default.RefObject<TextInput>;
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
interface UseChatMessagesReturn {
|
|
299
|
-
messages: Message[];
|
|
300
|
-
sendMessage: (text: string, replyTo?: ReplyToMessage) => void;
|
|
301
|
-
sendImageMessage: (imageData: any, text?: string, replyTo?: ReplyToMessage) => void;
|
|
302
|
-
updateMessageStatus: (messageId: number, status: 'sent' | 'delivered' | 'read') => void;
|
|
303
|
-
addReaction: (messageId: number, emoji: string) => void;
|
|
304
|
-
deleteMessage: (messageId: number) => void;
|
|
305
|
-
removeReaction: (messageId: number, emoji: string) => void;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
interface ChatSDKConfig {
|
|
309
|
-
initialMessages?: Message[];
|
|
310
|
-
enableOptimisticUpdates?: boolean;
|
|
311
|
-
}
|
|
312
|
-
interface ChatSDKReturn {
|
|
313
|
-
messages: Message[];
|
|
314
|
-
isTyping: boolean;
|
|
315
|
-
sendMessage: (text: string, replyTo?: Message) => void;
|
|
316
|
-
addReaction: (messageId: number, emoji: string) => void;
|
|
317
|
-
removeReaction: (messageId: number, emoji: string) => void;
|
|
318
|
-
setMessages: (messages: Message[]) => void;
|
|
319
|
-
addMessage: (message: Message) => void;
|
|
320
|
-
updateMessage: (messageId: number, updates: Partial<Message>) => void;
|
|
321
|
-
deleteMessage: (messageId: number) => void;
|
|
322
|
-
setTyping: (isTyping: boolean) => void;
|
|
323
|
-
resetChat: () => void;
|
|
324
|
-
getMessageById: (id: number) => Message | undefined;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
interface UseAttachmentsOptions {
|
|
328
|
-
uploader?: AttachmentUploader;
|
|
329
|
-
maxAttachments?: number;
|
|
330
|
-
maxFileSize?: number;
|
|
331
|
-
allowedTypes?: string[];
|
|
332
|
-
onAttachmentAdd?: (attachment: Attachment) => void;
|
|
333
|
-
onAttachmentRemove?: (attachmentId: string) => void;
|
|
334
|
-
onAttachmentUpload?: (attachments: Attachment[]) => void;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
interface MessageListConfig {
|
|
338
|
-
scrollThreshold?: number;
|
|
339
|
-
autoScrollToBottom?: boolean;
|
|
340
|
-
enableMessageActions?: boolean;
|
|
341
|
-
enableReactionDetails?: boolean;
|
|
342
|
-
initialNumToRender?: number;
|
|
343
|
-
maxToRenderPerBatch?: number;
|
|
344
|
-
windowSize?: number;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
interface ActionState {
|
|
348
|
-
actionSheetVisible: boolean;
|
|
349
|
-
selectedMessage: Message$1 | null;
|
|
350
|
-
messagePosition?: {
|
|
351
|
-
x: number;
|
|
352
|
-
y: number;
|
|
353
|
-
width: number;
|
|
354
|
-
height: number;
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
interface ReactionState {
|
|
359
|
-
isReactionDetailsVisible: boolean;
|
|
360
|
-
selectedReactions: any[];
|
|
361
|
-
selectedMessageText: string;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
interface ThemeColors {
|
|
365
|
-
primary: string;
|
|
366
|
-
secondary: string;
|
|
367
|
-
background: string;
|
|
368
|
-
surface: string;
|
|
369
|
-
surfaceSecondary: string;
|
|
370
|
-
text: string;
|
|
371
|
-
textSecondary: string;
|
|
372
|
-
textMuted: string;
|
|
373
|
-
border: string;
|
|
374
|
-
borderLight: string;
|
|
375
|
-
success: string;
|
|
376
|
-
error: string;
|
|
377
|
-
warning: string;
|
|
378
|
-
unread: string;
|
|
379
|
-
online: string;
|
|
380
|
-
messageBubble: {
|
|
381
|
-
sent: string;
|
|
382
|
-
received: string;
|
|
383
|
-
sentText: string;
|
|
384
|
-
receivedText: string;
|
|
385
|
-
};
|
|
386
|
-
gray: {
|
|
387
|
-
50: string;
|
|
388
|
-
100: string;
|
|
389
|
-
200: string;
|
|
390
|
-
300: string;
|
|
391
|
-
400: string;
|
|
392
|
-
500: string;
|
|
393
|
-
600: string;
|
|
394
|
-
700: string;
|
|
395
|
-
800: string;
|
|
396
|
-
900: string;
|
|
397
|
-
};
|
|
398
|
-
blue: {
|
|
399
|
-
50: string;
|
|
400
|
-
500: string;
|
|
401
|
-
600: string;
|
|
402
|
-
};
|
|
403
|
-
green: {
|
|
404
|
-
500: string;
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
interface ThemeSpacing {
|
|
408
|
-
xs: number;
|
|
409
|
-
sm: number;
|
|
410
|
-
md: number;
|
|
411
|
-
lg: number;
|
|
412
|
-
xl: number;
|
|
413
|
-
xxl: number;
|
|
414
|
-
}
|
|
415
|
-
interface ThemeBorderRadius {
|
|
416
|
-
sm: number;
|
|
417
|
-
md: number;
|
|
418
|
-
lg: number;
|
|
419
|
-
xl: number;
|
|
420
|
-
full: number;
|
|
421
|
-
}
|
|
422
|
-
interface ThemeTypography {
|
|
423
|
-
fontFamily: string;
|
|
424
|
-
fontSize: {
|
|
425
|
-
xs: number;
|
|
426
|
-
sm: number;
|
|
427
|
-
base: number;
|
|
428
|
-
lg: number;
|
|
429
|
-
xl: number;
|
|
430
|
-
xxl: number;
|
|
431
|
-
};
|
|
432
|
-
fontWeight: {
|
|
433
|
-
normal: '400' | 'normal';
|
|
434
|
-
medium: '500' | 'medium';
|
|
435
|
-
semibold: '600' | 'semibold';
|
|
436
|
-
bold: '700' | 'bold';
|
|
437
|
-
};
|
|
438
|
-
lineHeight: {
|
|
439
|
-
tight: number;
|
|
440
|
-
normal: number;
|
|
441
|
-
relaxed: number;
|
|
442
|
-
};
|
|
443
|
-
}
|
|
444
|
-
interface Theme {
|
|
445
|
-
colors: ThemeColors;
|
|
446
|
-
spacing: ThemeSpacing;
|
|
447
|
-
borderRadius: ThemeBorderRadius;
|
|
448
|
-
typography: ThemeTypography;
|
|
449
|
-
}
|
|
450
|
-
interface ThemeProviderProps {
|
|
451
|
-
children: React.ReactNode;
|
|
452
|
-
theme?: Partial<Theme>;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
interface ChatHeaderProps {
|
|
456
|
-
title: string;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
interface ChatListSearchBarProps {
|
|
460
|
-
value: string;
|
|
461
|
-
onChangeText: (text: string) => void;
|
|
462
|
-
onClear: () => void;
|
|
463
|
-
placeholder?: string;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
interface TypingIndicatorProps {
|
|
467
|
-
isVisible: boolean;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
interface ExtendedMessageListProps extends MessageListProps {
|
|
471
|
-
isTyping?: boolean;
|
|
472
|
-
typingUserName?: string;
|
|
473
|
-
onScroll?: (event: any) => void;
|
|
474
|
-
onContentSizeChange?: () => void;
|
|
475
|
-
showScrollToBottom?: boolean;
|
|
476
|
-
isReplyActive?: boolean;
|
|
477
|
-
scrollThreshold?: number;
|
|
478
|
-
autoScrollToBottom?: boolean;
|
|
479
|
-
onScrollToBottom?: () => void;
|
|
480
|
-
onScrollToTop?: () => void;
|
|
481
|
-
onScrollPositionChange?: (isNearBottom: boolean, isNearTop: boolean) => void;
|
|
482
|
-
onActionPress?: (action: string, message: Message$1) => void;
|
|
483
|
-
onReactionAdd?: (messageId: number, emoji: string) => void;
|
|
484
|
-
onReactionRemove?: (messageId: number, emoji: string) => void;
|
|
485
|
-
onMessageDelete?: (messageId: number) => void;
|
|
486
|
-
onReplyMessage?: (message: Message$1) => void;
|
|
487
|
-
onCancelReply?: () => void;
|
|
488
|
-
enableMessageActions?: boolean;
|
|
489
|
-
enableReactionDetails?: boolean;
|
|
490
|
-
}
|
|
491
|
-
interface MessageListRef {
|
|
492
|
-
scrollToEnd: (animated?: boolean) => void;
|
|
493
|
-
scrollToOffset: (offset: number, animated?: boolean) => void;
|
|
494
|
-
scrollToIndex: (index: number, animated?: boolean) => void;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
interface ChatConfig {
|
|
498
|
-
keyboardBehavior?: 'padding' | 'height' | 'position';
|
|
499
|
-
keyboardVerticalOffset?: number;
|
|
500
|
-
enableReactionDetails?: boolean;
|
|
501
|
-
enableMessageActions?: boolean;
|
|
502
|
-
enableScrollToBottom?: boolean;
|
|
503
|
-
enableTypingIndicator?: boolean;
|
|
504
|
-
onMessageSend?: (text: string, replyTo?: Message) => void;
|
|
505
|
-
onReactionAdd?: (messageId: number, emoji: string) => void;
|
|
506
|
-
onReactionRemove?: (messageId: number, emoji: string) => void;
|
|
507
|
-
}
|
|
508
|
-
interface ChatProviderProps {
|
|
509
|
-
children: ReactNode;
|
|
510
|
-
config?: ChatConfig;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
interface ChatInitConfig {
|
|
514
|
-
projectId: string;
|
|
515
|
-
apiUrl?: string;
|
|
516
|
-
debug?: boolean;
|
|
517
|
-
}
|
|
518
|
-
interface ChatInitResponse {
|
|
519
|
-
success: boolean;
|
|
520
|
-
message: string;
|
|
521
|
-
projectId: string;
|
|
522
|
-
activatedAt: string;
|
|
523
|
-
}
|
|
524
|
-
/**
|
|
525
|
-
* Initialize the chat SDK with project verification
|
|
526
|
-
*
|
|
527
|
-
* This function validates the project ID with the API and sets up the SDK for use.
|
|
528
|
-
* All UseChat components and hooks require this to be called first.
|
|
529
|
-
*
|
|
530
|
-
* @param config - Configuration object containing projectId and optional apiUrl
|
|
531
|
-
* @returns Promise that resolves to ChatInitResponse or rejects with ChatInitError
|
|
532
|
-
*/
|
|
533
|
-
declare const initChat: (config: ChatInitConfig) => Promise<ChatInitResponse>;
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
* Simple Authentication System for UseChat SDK
|
|
537
|
-
*
|
|
538
|
-
* This system ensures initChat() is called before using any components or hooks.
|
|
539
|
-
* No loading states - just immediate error throwing for better developer experience.
|
|
540
|
-
*/
|
|
541
|
-
interface AuthState {
|
|
542
|
-
isInitialized: boolean;
|
|
543
|
-
projectId: string | null;
|
|
544
|
-
error: string | null;
|
|
545
|
-
}
|
|
546
|
-
/**
|
|
547
|
-
* Get current authentication state (read-only)
|
|
548
|
-
*/
|
|
549
|
-
declare const getAuthState: () => Readonly<AuthState>;
|
|
550
|
-
/**
|
|
551
|
-
* Get the current project ID (throws if not initialized)
|
|
552
|
-
*/
|
|
553
|
-
declare const getProjectId: () => string;
|
|
554
|
-
/**
|
|
555
|
-
* Check if SDK is initialized (without throwing)
|
|
556
|
-
*/
|
|
557
|
-
declare const isInitialized: () => boolean;
|
|
558
|
-
|
|
559
|
-
interface ChatComponents {
|
|
560
|
-
MessageList?: ComponentType<MessageListProps>;
|
|
561
|
-
MessageInput?: ComponentType<MessageInputProps>;
|
|
562
|
-
MessageActionSheet?: ComponentType<any>;
|
|
563
|
-
ReactionDetailsSheet?: ComponentType<any>;
|
|
564
|
-
ScrollToBottomButton?: ComponentType<any>;
|
|
565
|
-
}
|
|
566
|
-
interface ChatRenderProps {
|
|
567
|
-
renderMessage?: (props: RenderMessageProps) => ReactNode;
|
|
568
|
-
renderInput?: (props: RenderInputProps) => ReactNode;
|
|
569
|
-
renderActionSheet?: (props: RenderActionSheetProps) => ReactNode;
|
|
570
|
-
renderReactionDetails?: (props: RenderReactionDetailsProps) => ReactNode;
|
|
571
|
-
}
|
|
572
|
-
interface ChatProps {
|
|
573
|
-
messages?: Message$1[];
|
|
574
|
-
components?: ChatComponents;
|
|
575
|
-
renderProps?: ChatRenderProps;
|
|
576
|
-
onMessageSend?: (message: Message$1) => void;
|
|
577
|
-
onReactionAdd?: (messageId: number, emoji: string) => void;
|
|
578
|
-
onReactionRemove?: (messageId: number, emoji: string) => void;
|
|
579
|
-
onMessageDelete?: (messageId: number) => void;
|
|
580
|
-
onActionPress?: (action: string, message: Message$1) => void;
|
|
581
|
-
attachmentUploader?: AttachmentUploader;
|
|
582
|
-
maxAttachments?: number;
|
|
583
|
-
maxFileSize?: number;
|
|
584
|
-
allowedFileTypes?: string[];
|
|
585
|
-
enableReactionDetails?: boolean;
|
|
586
|
-
enableMessageActions?: boolean;
|
|
587
|
-
enableScrollToBottom?: boolean;
|
|
588
|
-
enableTypingIndicator?: boolean;
|
|
589
|
-
isTyping?: boolean;
|
|
590
|
-
typingUserName?: string;
|
|
591
|
-
isLoading?: boolean;
|
|
592
|
-
loadingComponent?: ReactNode;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
declare const defaultTheme: Theme;
|
|
596
|
-
|
|
597
|
-
declare const Chat: React$1.ComponentType<ChatProps>;
|
|
598
|
-
declare const ChatProvider: React$1.ComponentType<ChatProviderProps>;
|
|
599
|
-
declare const useChatConfig: () => ChatConfig;
|
|
600
|
-
|
|
601
|
-
declare const MessageList: React$1.ComponentType<ExtendedMessageListProps & React$1.RefAttributes<MessageListRef>>;
|
|
602
|
-
declare const MessageInput: React$1.ComponentType<MessageInputProps & React$1.RefAttributes<MessageInputRef>>;
|
|
603
|
-
|
|
604
|
-
declare const ChatScreenHeader: React$1.ComponentType<ChatScreenHeaderProps>;
|
|
605
|
-
declare const TypingIndicator: React$1.ComponentType<TypingIndicatorProps>;
|
|
606
|
-
|
|
607
|
-
declare const ChatList: React$1.ComponentType<ChatListProps>;
|
|
608
|
-
declare const ChatItem: React$1.ComponentType<ChatItemProps>;
|
|
609
|
-
declare const ChatHeader: React$1.ComponentType<ChatHeaderProps>;
|
|
610
|
-
declare const ChatListSearchBar: React$1.ComponentType<ChatListSearchBarProps>;
|
|
611
|
-
|
|
612
|
-
declare const ChatAvatar: React$1.ComponentType<ChatAvatarProps>;
|
|
613
|
-
declare const AttachmentMenu: React$1.ComponentType<AttachmentMenuProps & React$1.RefAttributes<AttachmentMenuRef>>;
|
|
614
|
-
declare const ThemeProvider: React$1.ComponentType<ThemeProviderProps>;
|
|
615
|
-
|
|
616
|
-
declare const useTheme: () => Theme;
|
|
617
|
-
|
|
618
|
-
declare const useChatSDK: (config?: ChatSDKConfig | undefined) => ChatSDKReturn;
|
|
619
|
-
declare const useChatMessages: (senderName?: string | undefined) => UseChatMessagesReturn;
|
|
620
|
-
declare const useMessageList: (messages: Message$1[], config?: MessageListConfig | undefined) => {
|
|
621
|
-
messageItems: MessageListItem[];
|
|
622
|
-
keyExtractor: (item: MessageListItem$1) => string;
|
|
623
|
-
flatListProps: {
|
|
624
|
-
initialNumToRender: number;
|
|
625
|
-
maxToRenderPerBatch: number;
|
|
626
|
-
windowSize: number;
|
|
627
|
-
inverted: boolean;
|
|
628
|
-
showsVerticalScrollIndicator: boolean;
|
|
629
|
-
keyboardShouldPersistTaps: "handled";
|
|
630
|
-
removeClippedSubviews: boolean;
|
|
631
|
-
scrollEventThrottle: number;
|
|
632
|
-
};
|
|
633
|
-
};
|
|
634
|
-
declare const useMessageActions: (config?: MessageListConfig | undefined) => {
|
|
635
|
-
actionState: ActionState;
|
|
636
|
-
handleMessageLongPress: (message: Message$1, position?: {
|
|
637
|
-
x: number;
|
|
638
|
-
y: number;
|
|
639
|
-
width: number;
|
|
640
|
-
height: number;
|
|
641
|
-
}) => void;
|
|
642
|
-
handleActionSheetClose: () => void;
|
|
643
|
-
handleActionPress: (action: string, callbacks?: {
|
|
644
|
-
onReply?: (message: Message$1) => void;
|
|
645
|
-
onDelete?: (messageId: number) => void;
|
|
646
|
-
onCopy?: (message: Message$1) => void;
|
|
647
|
-
onCustomAction?: (action: string, message: Message$1) => void;
|
|
648
|
-
}) => void;
|
|
649
|
-
};
|
|
650
|
-
declare const useMessageReactions: (config?: MessageListConfig | undefined) => {
|
|
651
|
-
reactionState: ReactionState;
|
|
652
|
-
selectedMessage: Message$1 | null;
|
|
653
|
-
handleReactionPress: (message: Message$1) => void;
|
|
654
|
-
handleReactionDetailsClose: () => void;
|
|
655
|
-
handleAddReaction: (emoji: string, onAdd?: (messageId: number, emoji: string) => void) => void;
|
|
656
|
-
handleRemoveReaction: (emoji: string, onRemove?: (messageId: number, emoji: string) => void) => void;
|
|
657
|
-
handleEmojiReact: (emoji: string, onAdd?: (messageId: number, emoji: string) => void) => void;
|
|
658
|
-
};
|
|
659
|
-
declare const useAttachments: (options?: UseAttachmentsOptions | undefined) => UseAttachmentsReturn;
|
|
660
|
-
declare const useMessageInput: <T = string>(config?: MessageInputConfig<T> | undefined) => UseMessageInputReturn<T>;
|
|
661
|
-
|
|
662
|
-
export { AttachmentMenu, type AttachmentResult, Chat, ChatAvatar, type ChatConfig, ChatHeader, type ChatHeaderProps, type ChatInitConfig, type ChatInitResponse, ChatItem, ChatList, ChatListSearchBar, type ChatListSearchBarProps, type ChatProps, ChatProvider, ChatScreenHeader, type Message$1 as Message, MessageInput, type MessageInputRef, MessageList, type MessageListRef, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeProviderProps, type ThemeSpacing, type ThemeTypography, TypingIndicator, type TypingIndicatorProps, defaultTheme, getAuthState, getProjectId, initChat, isInitialized, useAttachments, useChatConfig, useChatMessages, useChatSDK, useMessageActions, useMessageInput, useMessageList, useMessageReactions, useTheme };
|