@adatechnology/conversations-ui 0.0.0

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.
Files changed (65) hide show
  1. package/dist/channel/index.d.ts +2 -0
  2. package/dist/channel/index.js +0 -0
  3. package/dist/chunk-ZDURDZTM.js +199 -0
  4. package/dist/flows/index.d.ts +246 -0
  5. package/dist/flows/index.js +1110 -0
  6. package/dist/index.d.ts +542 -0
  7. package/dist/index.js +2077 -0
  8. package/dist/styles.css +11 -0
  9. package/dist/styles.d.ts +2 -0
  10. package/package.json +52 -0
  11. package/src/AudioPlayer.tsx +103 -0
  12. package/src/Avatar.tsx +63 -0
  13. package/src/ConversationListItem.tsx +147 -0
  14. package/src/ConversationLocalesProvider.tsx +76 -0
  15. package/src/DateDivider.tsx +32 -0
  16. package/src/EmojiPicker.tsx +77 -0
  17. package/src/FileIcon.tsx +33 -0
  18. package/src/Lightbox.tsx +17 -0
  19. package/src/MediaRenderer.tsx +158 -0
  20. package/src/MessageBubble.tsx +129 -0
  21. package/src/MessageComposer.tsx +211 -0
  22. package/src/MessageTail.tsx +18 -0
  23. package/src/MessageText.tsx +42 -0
  24. package/src/MessageTimestamp.tsx +22 -0
  25. package/src/SimpleEmojiPicker.tsx +72 -0
  26. package/src/StatusTicks.tsx +39 -0
  27. package/src/Toast.tsx +140 -0
  28. package/src/Wallpaper.tsx +13 -0
  29. package/src/WhatsAppMessageEditor.tsx +142 -0
  30. package/src/channel/index.ts +1 -0
  31. package/src/conversations/index.ts +1 -0
  32. package/src/flows/FlowGroupFrame.tsx +21 -0
  33. package/src/flows/FlowGroupHeader.tsx +31 -0
  34. package/src/flows/FlowMapCanvas.tsx +76 -0
  35. package/src/flows/FlowMapNode.tsx +39 -0
  36. package/src/flows/FlowNodeCard.tsx +150 -0
  37. package/src/flows/FlowNodePanel.tsx +356 -0
  38. package/src/flows/FlowPalette.tsx +137 -0
  39. package/src/flows/FlowPortalNode.tsx +30 -0
  40. package/src/flows/FlowWhatsAppPreview.tsx +67 -0
  41. package/src/flows/flowGraph.ts +391 -0
  42. package/src/flows/index.ts +55 -0
  43. package/src/flows/labels.ts +187 -0
  44. package/src/hooks/useAsyncResource.ts +38 -0
  45. package/src/hooks/useConversationContext.ts +23 -0
  46. package/src/hooks/useConversationDocuments.ts +33 -0
  47. package/src/hooks/useConversationList.ts +32 -0
  48. package/src/hooks/useConversationMessages.ts +64 -0
  49. package/src/hooks/useConversationRealtime.ts +50 -0
  50. package/src/index.ts +87 -0
  51. package/src/lib/format.ts +32 -0
  52. package/src/lib/phone.ts +26 -0
  53. package/src/lib/whatsapp-formatting.tsx +215 -0
  54. package/src/providers/ConversationsProvider.tsx +29 -0
  55. package/src/providers/types.ts +54 -0
  56. package/src/settings/TopicsForm.tsx +109 -0
  57. package/src/settings/WelcomeFarewellForm.tsx +118 -0
  58. package/src/settings/WhatsAppCreateTemplateForm.tsx +309 -0
  59. package/src/settings/WhatsAppTemplateSettingsForm.tsx +264 -0
  60. package/src/styles.css +21 -0
  61. package/src/theme.ts +30 -0
  62. package/src/types.ts +44 -0
  63. package/src/useDarkMode.ts +48 -0
  64. package/src/useWaitingNotifications.ts +64 -0
  65. package/tsconfig.json +15 -0
@@ -0,0 +1,542 @@
1
+ import * as react from 'react';
2
+ import react__default, { ReactNode, FormEvent } from 'react';
3
+
4
+ interface ConversationsUIConfig {
5
+ apiBaseUrl: string;
6
+ theme?: ConversationsTheme;
7
+ features?: ConversationsFeatures;
8
+ }
9
+ interface ConversationsTheme {
10
+ primaryColor?: string;
11
+ backgroundColor?: string;
12
+ bubbleSent?: string;
13
+ bubbleReceived?: string;
14
+ textPrimary?: string;
15
+ textSecondary?: string;
16
+ }
17
+ interface ConversationsFeatures {
18
+ audio?: boolean;
19
+ documents?: boolean;
20
+ emoji?: boolean;
21
+ darkMode?: boolean;
22
+ }
23
+ interface MessagePayload {
24
+ id: string;
25
+ type: 'text' | 'image' | 'video' | 'audio' | 'document' | 'sticker' | 'template';
26
+ content?: string;
27
+ caption?: string;
28
+ mediaUrl?: string;
29
+ base64?: string;
30
+ uploadId?: string;
31
+ mediaId?: string;
32
+ mimeType?: string;
33
+ filename?: string;
34
+ sizeBytes?: number;
35
+ direction: 'inbound' | 'outbound';
36
+ sender: 'bot' | 'customer' | 'agent';
37
+ timestamp: string;
38
+ status?: 'sent' | 'delivered' | 'read' | 'failed';
39
+ readAt?: string;
40
+ agentName?: string | null;
41
+ templateName?: string;
42
+ isFirstInGroup?: boolean;
43
+ isLastInGroup?: boolean;
44
+ }
45
+
46
+ type ResolveMediaUrl = (message: MessagePayload) => Promise<string | null>;
47
+ interface MediaRendererProps {
48
+ message: MessagePayload;
49
+ onLightbox: (src: string) => void;
50
+ onResolveUrl?: ResolveMediaUrl;
51
+ }
52
+ declare function MediaRenderer({ message, onLightbox, onResolveUrl }: MediaRendererProps): react.JSX.Element | null;
53
+
54
+ interface MessageBubbleProps {
55
+ message: MessagePayload;
56
+ isMine: boolean;
57
+ senderName?: string | null;
58
+ isFirstInGroup?: boolean;
59
+ isSelecting?: boolean;
60
+ isSelected?: boolean;
61
+ onToggleSelect?: () => void;
62
+ onResolveMediaUrl?: ResolveMediaUrl;
63
+ }
64
+ declare function MessageBubble({ message, isMine, senderName, isFirstInGroup, isSelecting, isSelected, onToggleSelect, onResolveMediaUrl, }: MessageBubbleProps): react.JSX.Element;
65
+
66
+ interface ConversationWallpaperProps {
67
+ children?: ReactNode;
68
+ className?: string;
69
+ }
70
+ declare function ConversationWallpaper({ children, className }: ConversationWallpaperProps): react.JSX.Element;
71
+
72
+ interface ConversationLocales {
73
+ bubble: {
74
+ customer: string;
75
+ bot: string;
76
+ agent: string;
77
+ document: string;
78
+ media: string;
79
+ templateLabel: string;
80
+ readAt: string;
81
+ windowExpired: string;
82
+ viewImage: string;
83
+ listenAudio: string;
84
+ viewVideo: string;
85
+ };
86
+ selection: {
87
+ select: string;
88
+ };
89
+ dateDivider: {
90
+ today: string;
91
+ yesterday: string;
92
+ };
93
+ }
94
+ type PartialLocales = {
95
+ [K in keyof ConversationLocales]?: Partial<ConversationLocales[K]>;
96
+ };
97
+ interface ConversationLocalesProviderProps {
98
+ children: react__default.ReactNode;
99
+ locales?: PartialLocales;
100
+ }
101
+ declare function ConversationLocalesProvider({ children, locales }: ConversationLocalesProviderProps): react__default.JSX.Element;
102
+ declare function useConversationLocales(): ConversationLocales;
103
+
104
+ interface AudioPlayerProps {
105
+ src: string;
106
+ isMine?: boolean;
107
+ }
108
+ declare function AudioPlayer({ src, isMine }: AudioPlayerProps): react.JSX.Element;
109
+
110
+ interface EmojiPickerProps {
111
+ onSelect: (emoji: string) => void;
112
+ className?: string;
113
+ }
114
+ declare const EmojiPicker: ({ onSelect, className }: EmojiPickerProps) => react.JSX.Element;
115
+
116
+ interface MessageComposerProps {
117
+ onSend: (text: string) => void;
118
+ onAttach?: (file: File) => void;
119
+ value?: string;
120
+ onChange?: (value: string) => void;
121
+ features?: ConversationsFeatures;
122
+ placeholder?: string;
123
+ maxLength?: number;
124
+ disabled?: boolean;
125
+ acceptedFileTypes?: string;
126
+ }
127
+ declare const MessageComposer: ({ onSend, onAttach, value: externalValue, onChange: externalOnChange, features, placeholder, maxLength, disabled, acceptedFileTypes, }: MessageComposerProps) => react.JSX.Element;
128
+
129
+ interface WhatsAppMessageEditorProps {
130
+ value: string;
131
+ onChange: (value: string) => void;
132
+ placeholder?: string;
133
+ placeholders?: readonly string[];
134
+ rows?: number;
135
+ previewLabel?: string;
136
+ emptyPreviewText?: string;
137
+ }
138
+ declare function WhatsAppMessageEditor({ value, onChange, placeholder, placeholders, rows, previewLabel, emptyPreviewText, }: WhatsAppMessageEditorProps): react.JSX.Element;
139
+
140
+ interface SimpleEmojiPickerProps {
141
+ onSelect: (emoji: string) => void;
142
+ label?: string;
143
+ pickerWidth?: string;
144
+ pickerMaxHeight?: string;
145
+ }
146
+ declare function SimpleEmojiPicker({ onSelect, label, pickerWidth, pickerMaxHeight }: SimpleEmojiPickerProps): react.JSX.Element;
147
+
148
+ interface DateDividerProps {
149
+ iso: string;
150
+ }
151
+ declare function DateDivider({ iso }: DateDividerProps): react.JSX.Element;
152
+
153
+ interface AvatarProps {
154
+ name?: string | null;
155
+ avatarUrl?: string;
156
+ size?: 'sm' | 'md' | 'lg';
157
+ className?: string;
158
+ }
159
+ declare function Avatar({ name, avatarUrl, size, className }: AvatarProps): react.JSX.Element;
160
+
161
+ interface ConversationsApi {
162
+ fetchMessages(conversationId: string, params?: {
163
+ limit?: number;
164
+ before?: string;
165
+ }): Promise<MessagePayload[]>;
166
+ fetchConversations(params?: {
167
+ page?: number;
168
+ limit?: number;
169
+ waitingHuman?: boolean;
170
+ search?: string;
171
+ }): Promise<ConversationSummary[]>;
172
+ sendMessage(conversationId: string, text: string): Promise<MessagePayload>;
173
+ sendMedia(conversationId: string, data: {
174
+ base64: string;
175
+ mimeType: string;
176
+ filename: string;
177
+ caption?: string;
178
+ }): Promise<MessagePayload>;
179
+ sendTemplate(conversationId: string, data: {
180
+ templateName: string;
181
+ languageCode?: string;
182
+ bodyParams?: string[];
183
+ }): Promise<void>;
184
+ markRead(conversationId: string): Promise<void>;
185
+ getContext(conversationId: string): Promise<Record<string, unknown>>;
186
+ getDocuments(conversationId: string, params?: {
187
+ search?: string;
188
+ page?: number;
189
+ }): Promise<ConversationDocument[]>;
190
+ getDocumentUrl(uploadId: string): Promise<string>;
191
+ getMediaProxyUrl(mediaId: string): Promise<{
192
+ mimeType: string;
193
+ data: string;
194
+ }>;
195
+ }
196
+ interface SSEProvider {
197
+ connectConversationStream(conversationId: string): EventSource;
198
+ connectGlobalStream(): EventSource;
199
+ }
200
+ interface ConversationSummary {
201
+ id: string;
202
+ whatsappNumber: string;
203
+ clientName?: string;
204
+ lastContent?: string;
205
+ lastDirection?: 'inbound' | 'outbound';
206
+ lastAt: string;
207
+ lastInboundAt: string | null;
208
+ mode: 'bot' | 'human';
209
+ assignedUserId: string | null;
210
+ waitingHuman: boolean;
211
+ unread: number;
212
+ currentState: string;
213
+ }
214
+ interface ConversationDocument {
215
+ id: string;
216
+ filename: string;
217
+ mimeType: string;
218
+ sizeBytes: number;
219
+ source: string;
220
+ linkedAt: string;
221
+ }
222
+
223
+ interface ConversationListItemProps {
224
+ conversation: ConversationSummary;
225
+ active?: boolean;
226
+ selected?: boolean;
227
+ onClick?: () => void;
228
+ onSelect?: (id: string) => void;
229
+ }
230
+ declare const ConversationListItem: ({ conversation, active, selected, onClick, onSelect, }: ConversationListItemProps) => react.JSX.Element;
231
+
232
+ type ToastType = 'success' | 'error' | 'info';
233
+ interface ToastContextValue {
234
+ show: (type: ToastType, message: string) => void;
235
+ }
236
+ declare const toast: {
237
+ show(type: ToastType, message: string): void;
238
+ };
239
+ declare function ToastProvider({ children }: {
240
+ children: ReactNode;
241
+ }): react.JSX.Element;
242
+ declare function useToast(): ToastContextValue;
243
+
244
+ interface StatusTicksProps {
245
+ status: string;
246
+ title?: string;
247
+ }
248
+ declare function StatusTicks({ status, title }: StatusTicksProps): react.JSX.Element;
249
+
250
+ interface LightboxProps {
251
+ imageUrl: string;
252
+ caption?: string;
253
+ onClose: () => void;
254
+ }
255
+ declare function Lightbox({ imageUrl, caption, onClose }: LightboxProps): react.JSX.Element;
256
+
257
+ interface FileIconProps {
258
+ filename?: string;
259
+ mimeType?: string;
260
+ size?: number;
261
+ className?: string;
262
+ }
263
+ declare function FileIcon({ filename, mimeType, size, className }: FileIconProps): react.JSX.Element;
264
+
265
+ interface MessageTextProps {
266
+ message: MessagePayload;
267
+ }
268
+ declare function MessageText({ message }: MessageTextProps): react.JSX.Element;
269
+
270
+ interface MessageTimestampProps {
271
+ timestamp: string;
272
+ status?: string;
273
+ isOutbound: boolean;
274
+ }
275
+ declare function MessageTimestamp({ timestamp, status, isOutbound }: MessageTimestampProps): react.JSX.Element;
276
+
277
+ interface MessageTailProps {
278
+ isOutbound: boolean;
279
+ }
280
+ declare function MessageTail({ isOutbound }: MessageTailProps): react.JSX.Element;
281
+
282
+ declare function useDarkMode(): {
283
+ isDark: boolean;
284
+ toggle: () => void;
285
+ };
286
+
287
+ interface UseWaitingNotificationsResult {
288
+ unreadCount: number;
289
+ conversations: ConversationSummary[];
290
+ }
291
+ declare function useWaitingNotifications(): UseWaitingNotificationsResult;
292
+
293
+ interface ConversationsContextValue {
294
+ api: ConversationsApi;
295
+ sse: SSEProvider;
296
+ }
297
+ declare function ConversationsProvider({ api, sse, children, }: {
298
+ api: ConversationsApi;
299
+ sse: SSEProvider;
300
+ children: ReactNode;
301
+ }): react.JSX.Element;
302
+ declare function useConversations(): ConversationsContextValue | null;
303
+
304
+ interface WhatsAppTemplateSummary {
305
+ name: string;
306
+ language: string;
307
+ displayName: string;
308
+ shortId: string;
309
+ status: string;
310
+ bodyText: string | null;
311
+ variableCount: number;
312
+ }
313
+ interface WhatsAppTemplateVariableSuggestion {
314
+ token: string;
315
+ label: string;
316
+ }
317
+ interface WhatsAppTemplateSettingsFormLabels {
318
+ sectionTitle: string;
319
+ sectionDescription: string;
320
+ templateLabel: string;
321
+ refreshList: string;
322
+ errorLoading: string;
323
+ currentNameSaved: string;
324
+ selectPlaceholder: string;
325
+ variablesLabel: string;
326
+ addVariable: string;
327
+ removeVariable: string;
328
+ variablesAvailableTitle: string;
329
+ variablesAvailableHint: string;
330
+ variablesMappingHint: string;
331
+ noVariables: string;
332
+ save: string;
333
+ saving: string;
334
+ saveSuccess: string;
335
+ }
336
+ interface WhatsAppTemplateSettingsFormProps {
337
+ templates: WhatsAppTemplateSummary[];
338
+ loadingTemplates?: boolean;
339
+ templatesError?: boolean;
340
+ onRefreshTemplates?: () => void;
341
+ selectedTemplateName: string;
342
+ onSelectTemplate: (name: string, template: WhatsAppTemplateSummary | undefined) => void;
343
+ variables: string[];
344
+ onVariablesChange: (variables: string[]) => void;
345
+ availableVariables?: WhatsAppTemplateVariableSuggestion[];
346
+ saving?: boolean;
347
+ saveSuccess?: boolean;
348
+ onSave: (event: FormEvent) => void;
349
+ labels?: Partial<WhatsAppTemplateSettingsFormLabels>;
350
+ }
351
+ declare function WhatsAppTemplateSettingsForm({ templates, loadingTemplates, templatesError, onRefreshTemplates, selectedTemplateName, onSelectTemplate, variables, onVariablesChange, availableVariables, saving, saveSuccess, onSave, labels: labelsOverride, }: WhatsAppTemplateSettingsFormProps): react.JSX.Element;
352
+
353
+ type WhatsAppTemplateHeaderType = 'NONE' | 'TEXT';
354
+ interface WhatsAppCreateTemplateState {
355
+ name: string;
356
+ category: string;
357
+ language: string;
358
+ headerType: WhatsAppTemplateHeaderType;
359
+ headerText: string;
360
+ bodyText: string;
361
+ footerText: string;
362
+ }
363
+ interface WhatsAppCreateTemplateResult {
364
+ ok: boolean;
365
+ message: string;
366
+ status?: string;
367
+ }
368
+ interface WhatsAppCreateTemplateFormLabels {
369
+ sectionTitle: string;
370
+ sectionDescription: string;
371
+ nameLabel: string;
372
+ nameHint: string;
373
+ categoryLabel: string;
374
+ languageLabel: string;
375
+ headerLabel: string;
376
+ headerHint: string;
377
+ headerNone: string;
378
+ headerText: string;
379
+ headerPlaceholder: string;
380
+ bodyLabel: string;
381
+ bodyHint: string;
382
+ bodyPlaceholder: string;
383
+ detectedVariables: string;
384
+ variableLabel: (index: number) => string;
385
+ configureHintPrefix: string;
386
+ configureHintLink: string;
387
+ configureHintSuffix: string;
388
+ footerLabel: string;
389
+ footerHint: string;
390
+ footerPlaceholder: string;
391
+ previewLabel: string;
392
+ previewOnline: string;
393
+ previewDescription: string;
394
+ previewHeaderFallback: string;
395
+ previewBodyPlaceholder: string;
396
+ sendForApproval: string;
397
+ sending: string;
398
+ successStatus: (status: string) => string;
399
+ }
400
+ interface WhatsAppCreateTemplateFormProps {
401
+ value: WhatsAppCreateTemplateState;
402
+ onChange: (value: WhatsAppCreateTemplateState) => void;
403
+ onSubmit: (event: FormEvent) => void;
404
+ submitting?: boolean;
405
+ result?: WhatsAppCreateTemplateResult | null;
406
+ previewCompanyName?: string;
407
+ labels?: Partial<WhatsAppCreateTemplateFormLabels>;
408
+ variableExamples?: readonly string[];
409
+ }
410
+ declare function WhatsAppCreateTemplateForm({ value, onChange, onSubmit, submitting, result, previewCompanyName, labels: labelsOverride, variableExamples, }: WhatsAppCreateTemplateFormProps): react.JSX.Element;
411
+
412
+ interface WelcomeFarewellFormLabels {
413
+ sectionTitle: string;
414
+ welcomeMessage: string;
415
+ welcomeMessagePlaceholder: string;
416
+ welcomeMessageHint: string;
417
+ farewellMessage: string;
418
+ farewellMessagePlaceholder: string;
419
+ farewellMessageHint: string;
420
+ save: string;
421
+ saving: string;
422
+ saveSuccess: string;
423
+ }
424
+ interface WelcomeFarewellFormProps {
425
+ welcomeMessage: string;
426
+ onWelcomeMessageChange: (value: string) => void;
427
+ farewellMessage: string;
428
+ onFarewellMessageChange: (value: string) => void;
429
+ onSave: (event: FormEvent) => void;
430
+ saving?: boolean;
431
+ saveSuccess?: boolean;
432
+ welcomePlaceholders?: readonly string[];
433
+ farewellPlaceholders?: readonly string[];
434
+ labels?: Partial<WelcomeFarewellFormLabels>;
435
+ }
436
+ declare function WelcomeFarewellForm({ welcomeMessage, onWelcomeMessageChange, farewellMessage, onFarewellMessageChange, onSave, saving, saveSuccess, welcomePlaceholders, farewellPlaceholders, labels: labelsOverride, }: WelcomeFarewellFormProps): react.JSX.Element;
437
+
438
+ interface TopicItem {
439
+ key: string;
440
+ label: string;
441
+ enabled: boolean;
442
+ message: string;
443
+ }
444
+ interface TopicsFormLabels {
445
+ sectionTitle: string;
446
+ sectionDescription: string;
447
+ messagePlaceholder: string;
448
+ saveButton: string;
449
+ saveSuccess: string;
450
+ }
451
+ interface TopicsFormProps {
452
+ topics: TopicItem[];
453
+ onToggle: (key: string) => void;
454
+ onMessageChange: (key: string, message: string) => void;
455
+ onSave: (event: FormEvent) => void;
456
+ saving?: boolean;
457
+ saveSuccess?: boolean;
458
+ labels?: Partial<TopicsFormLabels>;
459
+ }
460
+ declare function TopicsForm({ topics, onToggle, onMessageChange, onSave, saving, saveSuccess, labels: labelsOverride, }: TopicsFormProps): react.JSX.Element;
461
+
462
+ interface UseConversationMessagesResult {
463
+ messages: MessagePayload[];
464
+ loading: boolean;
465
+ error: Error | undefined;
466
+ refetch: () => Promise<void>;
467
+ sendMessage: (text: string) => Promise<MessagePayload>;
468
+ sendMedia: (data: {
469
+ base64: string;
470
+ mimeType: string;
471
+ filename: string;
472
+ caption?: string;
473
+ }) => Promise<MessagePayload>;
474
+ sendTemplate: (data: {
475
+ templateName: string;
476
+ languageCode?: string;
477
+ bodyParams?: string[];
478
+ }) => Promise<void>;
479
+ markRead: () => Promise<void>;
480
+ }
481
+ declare function useConversationMessages(conversationId: string, params?: {
482
+ limit?: number;
483
+ before?: string;
484
+ }): UseConversationMessagesResult;
485
+
486
+ interface UseConversationListParams {
487
+ page?: number;
488
+ limit?: number;
489
+ waitingHuman?: boolean;
490
+ search?: string;
491
+ }
492
+ interface UseConversationListResult {
493
+ conversations: ConversationSummary[];
494
+ loading: boolean;
495
+ error: Error | undefined;
496
+ refetch: () => Promise<void>;
497
+ }
498
+ declare function useConversationList(params?: UseConversationListParams): UseConversationListResult;
499
+
500
+ interface UseConversationContextResult {
501
+ context: Record<string, unknown> | undefined;
502
+ loading: boolean;
503
+ error: Error | undefined;
504
+ refetch: () => Promise<void>;
505
+ }
506
+ declare function useConversationContext(conversationId: string): UseConversationContextResult;
507
+
508
+ interface UseConversationDocumentsParams {
509
+ search?: string;
510
+ page?: number;
511
+ }
512
+ interface UseConversationDocumentsResult {
513
+ documents: ConversationDocument[];
514
+ loading: boolean;
515
+ error: Error | undefined;
516
+ refetch: () => Promise<void>;
517
+ }
518
+ declare function useConversationDocuments(conversationId: string, params?: UseConversationDocumentsParams): UseConversationDocumentsResult;
519
+
520
+ type ConversationRealtimeHandler = (event: MessageEvent) => void;
521
+ declare function useConversationRealtime(conversationId: string | undefined, onEvent: ConversationRealtimeHandler): void;
522
+ declare function useGlobalRealtime(onEvent: ConversationRealtimeHandler): void;
523
+
524
+ declare function parseWhatsAppFormatting(text: string): ReactNode[];
525
+ declare function waToHTML(text: string): string;
526
+ declare function htmlToWA(html: string): string;
527
+ declare function waToHTMLInline(text: string): string;
528
+
529
+ declare function formatPhone(number: string): string;
530
+ declare function phoneInitials(number: string): string;
531
+
532
+ declare function formatTimestamp(timestamp: string): string;
533
+ declare function formatFileSize(bytes: number): string;
534
+
535
+ interface AsyncResourceState<T> {
536
+ data: T | undefined;
537
+ loading: boolean;
538
+ error: Error | undefined;
539
+ refetch: () => Promise<void>;
540
+ }
541
+
542
+ export { type AsyncResourceState, AudioPlayer, type AudioPlayerProps, Avatar, type AvatarProps, type ConversationDocument, ConversationListItem, type ConversationListItemProps, type ConversationLocales, ConversationLocalesProvider, type ConversationLocalesProviderProps, type ConversationRealtimeHandler, type ConversationSummary, ConversationWallpaper, type ConversationWallpaperProps, type ConversationsApi, type ConversationsFeatures, ConversationsProvider, type ConversationsTheme, type ConversationsUIConfig, DateDivider, type DateDividerProps, EmojiPicker, type EmojiPickerProps, FileIcon, type FileIconProps, Lightbox, type LightboxProps, MediaRenderer, type MediaRendererProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, type MessagePayload, MessageTail, MessageText, type MessageTextProps, MessageTimestamp, type ResolveMediaUrl, type SSEProvider, SimpleEmojiPicker, type SimpleEmojiPickerProps, StatusTicks, type StatusTicksProps, ToastProvider, type TopicItem, TopicsForm, type TopicsFormLabels, type TopicsFormProps, type UseConversationContextResult, type UseConversationDocumentsParams, type UseConversationDocumentsResult, type UseConversationListParams, type UseConversationListResult, type UseConversationMessagesResult, WelcomeFarewellForm, type WelcomeFarewellFormLabels, type WelcomeFarewellFormProps, WhatsAppCreateTemplateForm, type WhatsAppCreateTemplateFormLabels, type WhatsAppCreateTemplateFormProps, type WhatsAppCreateTemplateResult, type WhatsAppCreateTemplateState, WhatsAppMessageEditor, type WhatsAppMessageEditorProps, type WhatsAppTemplateHeaderType, WhatsAppTemplateSettingsForm, type WhatsAppTemplateSettingsFormLabels, type WhatsAppTemplateSettingsFormProps, type WhatsAppTemplateSummary, type WhatsAppTemplateVariableSuggestion, formatFileSize, formatPhone, formatTimestamp, htmlToWA, parseWhatsAppFormatting, phoneInitials, toast, useConversationContext, useConversationDocuments, useConversationList, useConversationLocales, useConversationMessages, useConversationRealtime, useConversations, useDarkMode, useGlobalRealtime, useToast, useWaitingNotifications, waToHTML, waToHTMLInline };