@talkjs/react-components 0.0.29 → 0.0.31

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/theming.d.ts DELETED
@@ -1,1316 +0,0 @@
1
- import { AudioBlock } from '@talkjs/core';
2
- import { ConversationSnapshot } from '@talkjs/core';
3
- import { EditMessageParams } from '@talkjs/core';
4
- import { EditTextMessageParams } from '@talkjs/core';
5
- import { FileBlock } from '@talkjs/core';
6
- import { FileToken } from '@talkjs/core';
7
- import { GenericFileBlock } from '@talkjs/core';
8
- import { ImageBlock } from '@talkjs/core';
9
- import { LocationBlock } from '@talkjs/core';
10
- import { MessageSnapshot } from '@talkjs/core';
11
- import { ParticipantSnapshot } from '@talkjs/core';
12
- import * as React from 'react';
13
- import { ReferencedMessageSnapshot } from '@talkjs/core';
14
- import { SendMessageParams } from '@talkjs/core';
15
- import { SendTextMessageParams } from '@talkjs/core';
16
- import { TalkSession } from '@talkjs/core';
17
- import { TextBlock } from '@talkjs/core';
18
- import { TypingSnapshot } from '@talkjs/core';
19
- import { UserSnapshot } from '@talkjs/core';
20
- import { VideoBlock } from '@talkjs/core';
21
- import { VoiceBlock } from '@talkjs/core';
22
-
23
- /**
24
- * Holds information about your TalkJS app.
25
- *
26
- * @public
27
- */
28
- export declare interface App {
29
- /**
30
- * Your app's unique TalkJS ID. You can find it on the Settings page of the
31
- * {@link https://talkjs.com/dashboard | TalkJS dashboard.}
32
- */
33
- id: string;
34
- /**
35
- * The name of your app.
36
- */
37
- name: string;
38
- /**
39
- * The default locale.
40
- *
41
- * @remarks
42
- * This can be configured from your TalkJS dashboard.
43
- */
44
- defaultLocale: string;
45
- /**
46
- * Custom data set for this app.
47
- *
48
- * @remarks
49
- * This can be configured from your TalkJS dashboard.
50
- */
51
- custom: Record<string, string>;
52
- }
53
-
54
- export { AudioBlock }
55
-
56
- /**
57
- * @public
58
- */
59
- export declare interface AudioBlockProps {
60
- /**
61
- * A collection of objects which are passed to all Chatbox theme components.
62
- */
63
- common: CommonChatboxProps;
64
- /**
65
- * The message that this content block belongs to.
66
- */
67
- message: MessageSnapshot;
68
- /**
69
- * The audio block to display.
70
- */
71
- block: AudioBlock;
72
- /**
73
- * The URL used to download the file.
74
- *
75
- * @remarks
76
- * This URL is not the same as `block.url`. When the current user sends a file
77
- * message, the `block.url` will hold a temporary `blob:` URL until that file
78
- * is uploaded to TalkJS. The user can immediately see their file present in
79
- * the chat, which makes for a smoother user experience.
80
- *
81
- * The `downloadUrl` is the URL of the file once it is uploaded to TalkJS. As
82
- * such, this property will be `undefined` until the upload is completed,
83
- * while `block.url` will always be defined and should be used for preview
84
- * purposes.
85
- */
86
- downloadUrl?: string;
87
- }
88
-
89
- /**
90
- * Audio player based on wavesurfer.
91
- *
92
- * @remarks
93
- * Wavesurfer is designed to make SoundCloud-style sound wave players. It has no
94
- * UI elements other than the actual sound waves, but it does abstract away all
95
- * the audio playing browser internals very nicely.
96
- *
97
- * Also, it has some additional settings that let us turn the sound wave display
98
- * into a series of nice rounded bars. Less signal, but also less distraction. I
99
- * kinda like it!
100
- */
101
- export declare function AudioPlayer({ src, onError, filename, className, }: AudioPlayerProps): JSX.Element;
102
-
103
- /**
104
- * @public
105
- */
106
- export declare interface AudioPlayerProps {
107
- /**
108
- * Source of the audio that's being played.
109
- */
110
- src: string;
111
- /**
112
- * Name of the audio file that's being played.
113
- */
114
- filename: string;
115
- /**
116
- * Callback that runs when an error is encountered during playback.
117
- */
118
- onError?: () => void;
119
- /**
120
- * @hidden
121
- */
122
- className?: string;
123
- }
124
-
125
- /**
126
- * @public
127
- */
128
- export declare interface AvatarProps {
129
- /**
130
- * A collection of objects which are passed to all Chatbox/ConversationList
131
- * theme components.
132
- *
133
- * @remarks
134
- * Because this particular theme component can show up in both a `<Chatbox>`
135
- * and a `<ConversationList>`, this prop has a union type.
136
- */
137
- common: CommonChatboxProps | CommonConversationListProps;
138
- /**
139
- * The URL of the image that's to be displayed.
140
- */
141
- photoUrl: string;
142
- }
143
-
144
- /**
145
- * A collection of actions available on the Chatbox UI.
146
- *
147
- * @public
148
- */
149
- export declare interface Chatbox {
150
- /**
151
- * Deletes the message with the given ID.
152
- *
153
- * @param messageId
154
- */
155
- deleteMessage(messageId: string): Promise<void>;
156
- /**
157
- * Enable/disable editing of a given message.
158
- *
159
- * @param messageId When `null` is provided, editing mode will be disabled
160
- */
161
- setEditing(messageId: string | null): void;
162
- /**
163
- * Edit the message with the given ID.
164
- *
165
- * @param messageId
166
- * @param params
167
- */
168
- editMessage(messageId: string, params: EditTextMessageParams | EditMessageParams): Promise<void>;
169
- /**
170
- * Send a text message to the current conversation.
171
- *
172
- * @param params
173
- */
174
- sendMessage(params: SendTextMessageParams | SendMessageParams): Promise<void>;
175
- /**
176
- * Send a file message to the current conversation.
177
- *
178
- * @param message
179
- */
180
- sendFileMessage(params: {
181
- fileToken: FileToken;
182
- custom?: Record<string, string>;
183
- }): Promise<void>;
184
- /**
185
- * Send a location message to the current conversation.
186
- *
187
- * @param message
188
- */
189
- sendLocationMessage(message: {
190
- location: Coordinates;
191
- custom?: Record<string, string>;
192
- }): Promise<void>;
193
- /**
194
- * Set/unset the message that's currently being replied to.
195
- *
196
- * @param messageId When `null` is provided, the "replying to" message is cleared
197
- */
198
- setReferencedMessage(messageId: string | null): void;
199
- }
200
-
201
- /**
202
- * @public
203
- */
204
- export declare interface ChatHeaderProps {
205
- /**
206
- * A collection of objects which are passed to all Chatbox theme components.
207
- */
208
- common: CommonChatboxProps;
209
- /**
210
- * A record of user IDs and their connection status.
211
- */
212
- isUserConnected: {
213
- [userId: string]: boolean;
214
- };
215
- /**
216
- * The current user's permissions.
217
- */
218
- permissions: UserPermissions;
219
- }
220
-
221
- /**
222
- * A collection of props that's shared by every themed component used in the Chatbox UI.
223
- *
224
- * @public
225
- */
226
- export declare interface CommonChatboxProps {
227
- /**
228
- * Holds information about your TalkJS app.
229
- */
230
- app: App;
231
- /**
232
- * The user that mounted this chatbox.
233
- */
234
- currentUser: UserSnapshot;
235
- /**
236
- * A translation object which holds localized strings for internationalization
237
- * purposes.
238
- */
239
- t: Translation;
240
- /**
241
- * The chatbox instance itself.
242
- */
243
- chatbox: Chatbox;
244
- /**
245
- * Arbitrary custom data passed down to the theme.
246
- *
247
- * @remarks
248
- * The data that you pass to {@link ChatboxProps.themeCustom} will show up
249
- * here so that you can use it from within theme components.
250
- */
251
- themeCustom?: any;
252
- /**
253
- * Describes the capabilities of the current device.
254
- */
255
- device: DeviceFeatures;
256
- /**
257
- * The theme object that the chatbox's is currently using.
258
- */
259
- theme: Theme;
260
- /**
261
- * The conversation displayed in the chatbox.
262
- */
263
- conversation: ConversationSnapshot;
264
- /**
265
- * A list of participants that are part of the conversation that's currently
266
- * being shown.
267
- */
268
- participants: ParticipantSnapshot[];
269
- /**
270
- * Tells you which participants are currently typing
271
- */
272
- typing: TypingSnapshot;
273
- /**
274
- * The underlying TalkJS session object that handles sending and receiving chat data.
275
- */
276
- session: TalkSession;
277
- }
278
-
279
- /**
280
- * A collection of props that's shared by every themed component used in the ConversationList UI.
281
- *
282
- * @public
283
- */
284
- export declare interface CommonConversationListProps {
285
- /**
286
- * Holds information about your TalkJS app.
287
- */
288
- app: App;
289
- /**
290
- * The user that mounted this chatbox.
291
- */
292
- currentUser: UserSnapshot;
293
- /**
294
- * A translation object which holds localized strings for internationalization
295
- * purposes.
296
- */
297
- t: Translation;
298
- /**
299
- * Arbitrary custom data passed down to the theme.
300
- *
301
- * @remarks
302
- * The data that you pass to {@link ConversationListProps.themeCustom} will show up
303
- * here so that you can use it from within theme components.
304
- */
305
- themeCustom?: any;
306
- /**
307
- * Describes the capabilities of the current device.
308
- */
309
- device: DeviceFeatures;
310
- /**
311
- * The theme object that the chatbox's is currently using.
312
- */
313
- theme: Theme;
314
- /**
315
- * The conversation list instance itself.
316
- */
317
- conversationList: ConversationList;
318
- /**
319
- * The underlying TalkJS session object that handles sending and receiving chat data.
320
- */
321
- session: TalkSession;
322
- }
323
-
324
- /**
325
- * @public
326
- */
327
- export declare interface CompactMessageContentProps {
328
- /**
329
- * A collection of objects which are passed to all Chatbox/ConversationList
330
- * theme components.
331
- *
332
- * @remarks
333
- * Because this particular theme component can show up in both a `<Chatbox>`
334
- * and a `<ConversationList>`, this prop has a union type.
335
- */
336
- common: CommonChatboxProps | CommonConversationListProps;
337
- /**
338
- * The message that's being displayed.
339
- */
340
- message: MessageSnapshot | ReferencedMessageSnapshot;
341
- }
342
-
343
- /**
344
- * @public
345
- */
346
- export declare interface ConversationImageProps {
347
- /**
348
- * A collection of objects which are passed to all Chatbox/ConversationList
349
- * theme components.
350
- *
351
- * @remarks
352
- * Because this particular theme component can show up in both a `<Chatbox>`
353
- * and a `<ConversationList>`, this prop has a union type.
354
- */
355
- common: CommonChatboxProps | CommonConversationListProps;
356
- /**
357
- * The conversation that's being displayed.
358
- */
359
- conversation: ConversationSnapshot;
360
- /**
361
- * A list of participants that are a part of the conversation.
362
- */
363
- participants: ParticipantSnapshot[];
364
- }
365
-
366
- /**
367
- * A collection of actions available on the ConversationList UI.
368
- *
369
- * @public
370
- */
371
- export declare interface ConversationList {
372
- /**
373
- * Programatically select a conversation.
374
- *
375
- * @param conversationId
376
- *
377
- * @remarks
378
- * Note that this **will not** trigger the
379
- * {@linkcode ConversationListProps.onSelectConversation} callback.
380
- */
381
- selectConversation(conversationId: string): void;
382
- }
383
-
384
- export declare interface ConversationListItemProps {
385
- /**
386
- * A collection of objects which are passed to all ConversationList theme components.
387
- */
388
- common: CommonConversationListProps;
389
- /**
390
- * The conversation that's being displayed.
391
- */
392
- conversation: ConversationSnapshot;
393
- /**
394
- * The list of participants that are part of the given conversation.
395
- */
396
- participants: ParticipantSnapshot[];
397
- /**
398
- * If `true`, this conversation is the currently selected one in the
399
- * conversation list.
400
- */
401
- isSelected: boolean;
402
- }
403
-
404
- export { ConversationSnapshot }
405
-
406
- /**
407
- * @public
408
- */
409
- export declare interface Coordinates {
410
- latitude: number;
411
- longitude: number;
412
- }
413
-
414
- /**
415
- * Describes the capabilities of the current device.
416
- *
417
- * @public
418
- */
419
- export declare interface DeviceFeatures {
420
- /**
421
- * True if the browser supports IndexedDB, which the emoji picker depends on.
422
- */
423
- supportsEmojiPicker: boolean;
424
- /**
425
- * True if the user agents reports the current device as a mobile/tablet.
426
- */
427
- isMobile: boolean;
428
- }
429
-
430
- export declare function Editor({ placeholder, disabled, className, characterLimit, spellcheck, }: EditorProps): JSX.Element;
431
-
432
- export declare interface EditorController {
433
- isTyping: boolean;
434
- atTextLimit: boolean;
435
- isEmpty: boolean;
436
- characterCount: number;
437
- showEmojiPicker: boolean;
438
- send(): void;
439
- shareLocation(): void;
440
- attachFile(): void;
441
- toggleEmojiPicker(): void;
442
- }
443
-
444
- /**
445
- * @public
446
- */
447
- export declare interface EditorProps {
448
- /**
449
- * The maximum allowed character length.
450
- *
451
- * @remarks
452
- * The default is `10000`
453
- */
454
- characterLimit?: number;
455
- /**
456
- * Determines if the Editor can be interacted with or not.
457
- */
458
- disabled?: boolean;
459
- /**
460
- * Placeholder text when the input is empty to encourage the user to write.
461
- *
462
- * @remarks
463
- * The default is `"Say something..."`
464
- */
465
- placeholder?: string;
466
- /**
467
- * If true, spell-checking is enabled.
468
- *
469
- * @remarks
470
- * The default is `false`
471
- */
472
- spellcheck?: boolean;
473
- /**
474
- * @hidden
475
- */
476
- className?: string;
477
- }
478
-
479
- export declare function EmojiPicker(props: EmojiPickerProps): JSX.Element;
480
-
481
- /**
482
- * @public
483
- */
484
- export declare interface EmojiPickerProps {
485
- /**
486
- * Display the emoji picker in light mode or dark mode.
487
- */
488
- colorScheme: "light" | "dark";
489
- }
490
-
491
- /**
492
- * Shows a bar with emoji suggestions when the user types eg `:bla`. Shown if `query` is non-empty.
493
- *
494
- * Uses the IndexedDB-backed emoji database from "emoji-picker-element".
495
- */
496
- export declare function EmojiSuggestBar(props: EmojiSuggestBarProps): JSX.Element;
497
-
498
- /**
499
- * @public
500
- */
501
- export declare interface EmojiSuggestBarProps {
502
- }
503
-
504
- export { FileBlock }
505
-
506
- /**
507
- * @public
508
- */
509
- export declare interface FileBlockProps {
510
- /**
511
- * A collection of objects which are passed to all Chatbox theme components.
512
- */
513
- common: CommonChatboxProps;
514
- /**
515
- * The message that this content block belongs to.
516
- */
517
- message: MessageSnapshot;
518
- /**
519
- * The generic file block to display.
520
- */
521
- block: GenericFileBlock;
522
- /**
523
- * The URL used to download the file.
524
- *
525
- * @remarks
526
- * This URL is not the same as `block.url`. When the current user sends a file
527
- * message, the `block.url` will hold a temporary `blob:` URL until that file
528
- * is uploaded to TalkJS. The user can immediately see their file present in
529
- * the chat, which makes for a smoother user experience.
530
- *
531
- * The `downloadUrl` is the URL of the file once it is uploaded to TalkJS. As
532
- * such, this property will be `undefined` until the upload is completed,
533
- * while `block.url` will always be defined and should be used for preview
534
- * purposes.
535
- */
536
- downloadUrl?: string;
537
- }
538
-
539
- /**
540
- * Displays the given number of seconds in a human-friendly MM:SS or HH:MM:SS
541
- * format; whichever's shorter.
542
- *
543
- * @public
544
- */
545
- export declare function formatDuration(seconds: number): string;
546
-
547
- /**
548
- * Returns a human-readable filesize count.
549
- *
550
- * @public
551
- */
552
- export declare function formatFilesize(bytes: number): string;
553
-
554
- export { GenericFileBlock }
555
-
556
- /**
557
- * Given a coordinate, returns an `imageUrl` used to display a Google Maps
558
- * preview image and a `linkUrl` which points to the given location on Google
559
- * Maps.
560
- *
561
- * @public
562
- */
563
- export declare function getGoogleMapsUrls({ latitude, longitude }: Coordinates): {
564
- imageUrl: string;
565
- linkUrl: string;
566
- };
567
-
568
- /**
569
- * Returns the given user's `photoUrl` if available. If not, returns a `data:`
570
- * URL of a fallback SVG which shows the user's initials.
571
- *
572
- * @public
573
- */
574
- export declare function getPhotoUrlWithFallback(user: UserSnapshot): string;
575
-
576
- /**
577
- * Generates a random color in hex format.
578
- *
579
- * @public
580
- */
581
- export declare function getRandomColor(id: string): string;
582
-
583
- /**
584
- * @public
585
- */
586
- export declare interface GroupChatImageProps {
587
- /**
588
- * A collection of objects which are passed to all Chatbox/ConversationList
589
- * theme components.
590
- *
591
- * @remarks
592
- * Because this particular theme component can show up in both a `<Chatbox>`
593
- * and a `<ConversationList>`, this prop has a union type.
594
- */
595
- common: CommonChatboxProps | CommonConversationListProps;
596
- /**
597
- * A list of participants that are a part of the conversation.
598
- */
599
- participants: ParticipantSnapshot[];
600
- }
601
-
602
- /**
603
- * Parses a JSX-like React string into a React element tree.
604
- *
605
- * @remarks
606
- * Uses the {@link https://github.com/developit/htm | `htm`} library under the
607
- * hood.
608
- *
609
- * @public
610
- *
611
- * @privateRemarks
612
- * Adapted from:
613
- * https://github.com/developit/htm/issues/175#issuecomment-773755560
614
- */
615
- export declare function html(strings: TemplateStringsArray, ...args: any[]): React.ReactElement;
616
-
617
- /**
618
- * @public
619
- */
620
- export declare interface IconProps {
621
- /**
622
- * A collection of objects which are passed to all Chatbox/ConversationList
623
- * theme components.
624
- *
625
- * @remarks
626
- * Because this particular theme component can show up in both a `<Chatbox>`
627
- * and a `<ConversationList>`, this prop has a union type.
628
- */
629
- common: CommonChatboxProps | CommonConversationListProps;
630
- /**
631
- * The name of the icon to display.
632
- */
633
- type: "attach" | "chevronLeft" | "left" | "chevronRight" | "right" | "chevronUp" | "up" | "chevronDown" | "down" | "close" | "emoji" | "locationPin" | "more" | "plus" | "search" | "send" | "spinner" | "play" | "pause" | "updown" | "addEmoji" | "microphone" | "mic" | "stop" | "download" | "location" | "email" | "movie" | "image" | "attachment" | "horizontalDots" | "verticalDots" | "reply" | "back";
634
- /**
635
- * @hidden
636
- */
637
- className?: string;
638
- }
639
-
640
- export { ImageBlock }
641
-
642
- /**
643
- * @public
644
- */
645
- export declare interface ImageBlockProps {
646
- /**
647
- * A collection of objects which are passed to all Chatbox theme components.
648
- */
649
- common: CommonChatboxProps;
650
- /**
651
- * The message that this content block belongs to.
652
- */
653
- message: MessageSnapshot;
654
- /**
655
- * The image block to display.
656
- */
657
- block: ImageBlock;
658
- /**
659
- * The URL used to download the file.
660
- *
661
- * @remarks
662
- * This URL is not the same as `block.url`. When the current user sends a file
663
- * message, the `block.url` will hold a temporary `blob:` URL until that file
664
- * is uploaded to TalkJS. The user can immediately see their file present in
665
- * the chat, which makes for a smoother user experience.
666
- *
667
- * The `downloadUrl` is the URL of the file once it is uploaded to TalkJS. As
668
- * such, this property will be `undefined` until the upload is completed,
669
- * while `block.url` will always be defined and should be used for preview
670
- * purposes.
671
- */
672
- downloadUrl?: string;
673
- }
674
-
675
- export { LocationBlock }
676
-
677
- /**
678
- * @public
679
- */
680
- export declare interface LocationBlockProps {
681
- /**
682
- * A collection of objects which are passed to all Chatbox theme components.
683
- */
684
- common: CommonChatboxProps;
685
- /**
686
- * The message that this content block belongs to.
687
- */
688
- message: MessageSnapshot;
689
- /**
690
- * The location block to display.
691
- */
692
- block: LocationBlock;
693
- }
694
-
695
- export declare function MentionSuggestList(props: MentionSuggestListProps): JSX.Element | null;
696
-
697
- export declare interface MentionSuggestList {
698
- keydown(key: string): boolean;
699
- }
700
-
701
- /**
702
- * @public
703
- */
704
- export declare interface MentionSuggestListProps {
705
- }
706
-
707
- export declare function MenuItem(props: MenuItemProps): JSX.Element;
708
-
709
- /**
710
- * @public
711
- */
712
- export declare interface MenuItemProps extends React.HTMLAttributes<HTMLDivElement> {
713
- /**
714
- * When a callback is passed, it will be called when the menu item is selected.
715
- */
716
- onSelect?: () => void;
717
- }
718
-
719
- /**
720
- * @public
721
- */
722
- export declare interface MessageActionMenuProps {
723
- /**
724
- * A collection of objects which are passed to all Chatbox theme components.
725
- */
726
- common: CommonChatboxProps;
727
- /**
728
- * The message that's attached to the action menu.
729
- */
730
- message: MessageSnapshot;
731
- /**
732
- * The current user's permissions relating to the given message.
733
- */
734
- permissions: MessagePermissions;
735
- }
736
-
737
- export declare function MessageContent(props: MessageContentProps): JSX.Element;
738
-
739
- /**
740
- * @public
741
- */
742
- export declare interface MessageContentProps {
743
- /**
744
- * A collection of objects which are passed to all Chatbox theme components.
745
- */
746
- common: CommonChatboxProps;
747
- /**
748
- * The message whose contents are being displayed
749
- */
750
- message: MessageSnapshot;
751
- /**
752
- * The current status of the given message.
753
- */
754
- messageStatus: MessageStatus;
755
- /**
756
- * @hidden
757
- */
758
- className?: string;
759
- }
760
-
761
- /**
762
- * @public
763
- */
764
- export declare interface MessageDividerProps {
765
- /**
766
- * A collection of objects which are passed to all Chatbox theme components.
767
- */
768
- common: CommonChatboxProps;
769
- /**
770
- * If true, this divider separates unread messages from read ones.
771
- */
772
- isReadMarker: boolean;
773
- /**
774
- * If true, this divider separates messages sent on two different dates.
775
- */
776
- isDayMarker: boolean;
777
- /**
778
- * The date timestamp when {@link MessageDividerProps.isDayMarker} is `true`. Holds the number of
779
- * milliseconds passed since the Unix Epoch.
780
- */
781
- timestamp?: number;
782
- }
783
-
784
- /**
785
- * @public
786
- */
787
- export declare interface MessageFieldProps {
788
- /**
789
- * A collection of objects which are passed to all Chatbox theme components.
790
- */
791
- common: CommonChatboxProps;
792
- /**
793
- * The message that's currently being replied to, if any.
794
- */
795
- referencedMessage: MessageSnapshot | undefined;
796
- /**
797
- * The current user's permissions.
798
- */
799
- permissions: UserPermissions;
800
- /**
801
- * An object holding the state of the message field.
802
- */
803
- editor: EditorController;
804
- /**
805
- * When a message is being edited its ID will be stored here.
806
- */
807
- editMessageId: string | undefined;
808
- }
809
-
810
- /**
811
- * @public
812
- */
813
- export declare interface MessageListFooterProps {
814
- /**
815
- * A collection of objects which are passed to all Chatbox theme components.
816
- */
817
- common: CommonChatboxProps;
818
- }
819
-
820
- /**
821
- * A set of permissions the current user has for a given message.
822
- *
823
- * @remarks
824
- * The values of these permissions come from the user's {@link https://talkjs.com/docs/Concepts/Roles/ | role}.
825
- *
826
- * @public
827
- */
828
- export declare interface MessagePermissions extends UserPermissions {
829
- /**
830
- * True if the user has the ability to delete the given message.
831
- */
832
- canDeleteMessage: boolean;
833
- /**
834
- * True if the user has the ability to reply to the given message.
835
- */
836
- canReplyToMessage: boolean;
837
- /**
838
- * True if the user has the ability to edit the given message.
839
- */
840
- canEditMessage: boolean;
841
- /**
842
- * True if the user has the ability to add an {@link https://talkjs.com/docs/Features/Messages/Emojis/#emoji-reactions | emoji reaction} to the given message.
843
- */
844
- canAddReaction: boolean;
845
- }
846
-
847
- /**
848
- * @public
849
- */
850
- export declare interface MessageProps {
851
- /**
852
- * A collection of objects which are passed to all Chatbox theme components.
853
- */
854
- common: CommonChatboxProps;
855
- /**
856
- * The message that's being displayed.
857
- */
858
- message: MessageSnapshot;
859
- /**
860
- * The current status of the message.
861
- */
862
- messageStatus: MessageStatus;
863
- /**
864
- * The current user's permissions relating to the given message.
865
- */
866
- permissions: MessagePermissions;
867
- }
868
-
869
- export { MessageSnapshot }
870
-
871
- /**
872
- * The current status of the message.
873
- *
874
- * @remarks
875
- * This type can have one of these values:
876
- *
877
- * - `"sending"` - Message is still being sent to the server. a loading spinner is typically shown in chat UIs.
878
- *
879
- * - `"sent"` - Message has arrived on the server. Typically represented using a single checkmark in chat UIs.
880
- *
881
- * - `"everyoneRead"` - Everyone in the conversation has read this message. Typically represented using two checkmarks in chat UIs.
882
- *
883
- * @public
884
- */
885
- export declare type MessageStatus = "sending" | "sent" | "everyoneRead";
886
-
887
- export { ParticipantSnapshot }
888
-
889
- /**
890
- * PopoverButton component that renders a popover triggered by a button.
891
- *
892
- * Usage:
893
- * <PopoverButton
894
- * popoverComponent={YourMenuComponent}
895
- * popoverProps={{ prop1: value1, prop2: value2 }}
896
- * aria-label="..."
897
- * >
898
- * <Icon type="horizontalDots" />
899
- * </MenuButton>
900
- *
901
- * All props except for menuComponent and popoverProps are passed to the button element.
902
- *
903
- * the popoverComponent will also receive a closePopover prop. It's a function you can call to close the popover.
904
- */
905
- export declare function PopoverButton<T extends object>(props: PopoverButtonProps<T>): JSX.Element;
906
-
907
- /**
908
- * @public
909
- */
910
- export declare interface PopoverButtonProps<T extends object> extends React.HTMLAttributes<HTMLButtonElement> {
911
- /**
912
- * Whether to display a menu or a popover when the button is clicked.
913
- *
914
- * @remarks
915
- * Default value is `"popover"`.
916
- */
917
- type?: "menu" | "popover";
918
- /**
919
- * The popover component to render in response to the button click.
920
- */
921
- popoverComponent: React.ComponentType<T>;
922
- /**
923
- * Props passed to the popover component.
924
- */
925
- popoverProps: T;
926
- /**
927
- * Children nodes rendered inside the button.
928
- */
929
- children: React.ReactNode;
930
- }
931
-
932
- export declare function ReactionPicker({ messageId, colorScheme, }: ReactionPickerProps): JSX.Element;
933
-
934
- /**
935
- * @public
936
- */
937
- export declare interface ReactionPickerProps {
938
- /**
939
- * The ID of the message that's being reacted to.
940
- */
941
- messageId: string;
942
- /**
943
- * Display the emoji reaction picker in light mode or dark mode.
944
- */
945
- colorScheme: "light" | "dark";
946
- }
947
-
948
- /**
949
- * @public
950
- */
951
- export declare interface ReferencedMessageProps {
952
- /**
953
- * A collection of objects which are passed to all Chatbox theme components.
954
- */
955
- common: CommonChatboxProps;
956
- /**
957
- * The message that's being referenced.
958
- */
959
- referencedMessage: ReferencedMessageSnapshot;
960
- }
961
-
962
- export { ReferencedMessageSnapshot }
963
-
964
- /**
965
- * @public
966
- */
967
- export declare interface ReplyBarProps {
968
- /**
969
- * A collection of objects which are passed to all Chatbox theme components.
970
- */
971
- common: CommonChatboxProps;
972
- /**
973
- * The message that's being replied to.
974
- */
975
- referencedMessage: MessageSnapshot;
976
- }
977
-
978
- export { TalkSession }
979
-
980
- declare function Text_2({ block, nonInteractive, message, className, }: TextProps): React.ReactElement;
981
- export { Text_2 as Text }
982
-
983
- export { TextBlock }
984
-
985
- /**
986
- * @public
987
- */
988
- export declare interface TextBlockProps {
989
- /**
990
- * A collection of objects which are passed to all Chatbox theme components.
991
- */
992
- common: CommonChatboxProps;
993
- /**
994
- * The message that this content block belongs to.
995
- */
996
- message: MessageSnapshot;
997
- /**
998
- * The text block to display.
999
- */
1000
- block: TextBlock;
1001
- }
1002
-
1003
- /**
1004
- * @public
1005
- */
1006
- export declare interface TextProps {
1007
- /**
1008
- * The block of formatted text to display.
1009
- */
1010
- block: TextBlock;
1011
- /**
1012
- * If true, links and action buttons/links won't be rendered.
1013
- *
1014
- * @remarks
1015
- * The default is `false`
1016
- */
1017
- nonInteractive?: boolean;
1018
- /**
1019
- * @hidden
1020
- */
1021
- className?: string;
1022
- /**
1023
- * The message that this text block belongs to.
1024
- */
1025
- message: MessageSnapshot | ReferencedMessageSnapshot;
1026
- }
1027
-
1028
- /**
1029
- * A theme can be used to customize the appearance & behavior of your TalkJS
1030
- * Chatbox and/or ConversationList.
1031
- *
1032
- * @remarks
1033
- * The implementation of TalkJS's default theme is open-source and
1034
- * {@link https://github.com/talkjs/theme-default | available on Github. }
1035
- *
1036
- * @public
1037
- */
1038
- export declare interface Theme {
1039
- Avatar: React.ComponentType<AvatarProps>;
1040
- ConversationImage: React.ComponentType<ConversationImageProps>;
1041
- GroupChatImage: React.ComponentType<GroupChatImageProps>;
1042
- ReferencedMessage: React.ComponentType<ReferencedMessageProps>;
1043
- ReplyBar: React.ComponentType<ReplyBarProps>;
1044
- TimeAgo: React.ComponentType<TimeAgoProps>;
1045
- MessageActionMenu: React.ComponentType<MessageActionMenuProps>;
1046
- CompactMessageContent: React.ComponentType<CompactMessageContentProps>;
1047
- ChatHeader: React.ComponentType<ChatHeaderProps>;
1048
- Message: React.ComponentType<MessageProps>;
1049
- MessageField: React.ComponentType<MessageFieldProps>;
1050
- Icon: React.ComponentType<IconProps>;
1051
- MessageDivider: React.ComponentType<MessageDividerProps>;
1052
- MessageListFooter: React.ComponentType<MessageListFooterProps>;
1053
- TextBlock: React.ComponentType<TextBlockProps>;
1054
- FileBlock: React.ComponentType<FileBlockProps>;
1055
- LocationBlock: React.ComponentType<LocationBlockProps>;
1056
- ImageBlock: React.ComponentType<ImageBlockProps>;
1057
- AudioBlock: React.ComponentType<AudioBlockProps>;
1058
- VoiceBlock: React.ComponentType<VoiceBlockProps>;
1059
- VideoBlock: React.ComponentType<VideoBlockProps>;
1060
- ConversationListItem: React.ComponentType<ConversationListItemProps>;
1061
- }
1062
-
1063
- /**
1064
- * An object describing a human-readable tim
1065
- *
1066
- * @public
1067
- */
1068
- export declare interface TimeAgo {
1069
- /**
1070
- * An amount of milliseconds after which the values in {@link TimeAgo.long} and {@link TimeAgo.short} _may_ have changed.
1071
- * If undefined, the values will not change within any meaningful period.
1072
- */
1073
- changeTimeout?: number | undefined;
1074
- /**
1075
- * A precise time description containing the exact date and time.
1076
- */
1077
- long: string;
1078
- /**
1079
- * A short human-friendly time description, such as "2 minutes ago"
1080
- */
1081
- short: string;
1082
- }
1083
-
1084
- /**
1085
- * @public
1086
- */
1087
- export declare interface TimeAgoProps {
1088
- /**
1089
- * A collection of objects which are passed to all Chatbox theme components.
1090
- */
1091
- common: CommonChatboxProps;
1092
- /**
1093
- * The timestamp of when the message was sent. Holds the number of milliseconds passed since the Unix Epoch.
1094
- */
1095
- timestamp: number;
1096
- }
1097
-
1098
- /**
1099
- * Translation object
1100
- *
1101
- * @public
1102
- */
1103
- export declare interface Translation extends TranslationStrings {
1104
- locale: string;
1105
- }
1106
-
1107
- declare interface TranslationStrings {
1108
- YESTERDAY: string;
1109
- TODAY: string;
1110
- DAYS: string;
1111
- HOURS: string;
1112
- MINUTES: string;
1113
- JUST_NOW: string;
1114
- LOCATION: string;
1115
- CANCEL: string;
1116
- INBOX: string;
1117
- DESKTOP_NOTIFICATIONS: string;
1118
- DESKTOP_NOTIFICATIONS_ERROR: string;
1119
- DESKTOP_NOTIFICATIONS_DEMO_TITLE: (appName: string) => string;
1120
- DESKTOP_NOTIFICATIONS_DEMO_BODY: string;
1121
- SEND_BUTTON_TEXT: string;
1122
- ENTRYBOX_TEXT_LIMIT: string;
1123
- ENTRYBOX_PLACEHOLDER: string;
1124
- ENTRYBOX_PLACEHOLDER_CHAT_CLOSED: string;
1125
- ENTRYBOX_PLACEHOLDER_CHAT_READONLY: string;
1126
- MESSAGELIST_LOADING_OLDER: string;
1127
- MESSAGELIST_SHOW_OLDER: string;
1128
- MESSAGELIST_NEW_MARKER: string;
1129
- MESSAGE_SENT_VIA_EMAIL: string;
1130
- YOU_MARKER: string;
1131
- UPLOAD_IN_PROGRESS: string;
1132
- UPLOAD_SEND_FILE: string;
1133
- UPLOAD_SHARE_LOCATION: string;
1134
- UPLOAD_ERROR: string;
1135
- SHARE_LOCATION_ERROR: string;
1136
- LOADING: string;
1137
- HUB_EMPTY: string;
1138
- HUB_SHOW_EARLIER: string;
1139
- INBOX_NO_CHATS_TITLE: string;
1140
- INBOX_NO_CHATS_BODY: string;
1141
- ENABLE_TRANSLATION: string;
1142
- DISABLE_TRANSLATION: string;
1143
- SEARCH_PLACEHOLDER_TEXT: string;
1144
- SEARCH_SEARCHING: string;
1145
- SEARCH_NO_RESULTS: string;
1146
- SEARCH_NO_MORE_RESULTS: string;
1147
- CHAT_NOT_FOUND: string;
1148
- DELETE_MESSAGE: string;
1149
- DELETION_EXPLANATION: string;
1150
- EDIT_MESSAGE: string;
1151
- SAVE: string;
1152
- EDITED_INDICATOR: string;
1153
- REPLY_TO_MESSAGE: string;
1154
- REPLY_TO_ARIA_LABEL: (senderName: string, content: string) => string;
1155
- REPLY_MODE_LEAVE_ARIA_LABEL: string;
1156
- ADD_REACTION: string;
1157
- AUTH_EXPIRED_OVERLAY_TITLE: string;
1158
- AUTH_EXPIRED_OVERLAY_DESCRIPTION: string;
1159
- VOICE_MESSAGE: string;
1160
- LEAVE_CONVERSATION: string;
1161
- MARK_CONVERSATION_AS_UNREAD: string;
1162
- STATUS_INDICATOR_ONLINE: string;
1163
- STATUS_INDICATOR_OFFLINE: string;
1164
- CONTACT_INFORMATION_HIDDEN: string;
1165
- }
1166
-
1167
- export { TypingSnapshot }
1168
-
1169
- /**
1170
- * Returns "Yesterday", "Last Monday", "Tuesday, March 31" or "Monday, March 31
1171
- * 2014", depending on which is most appropriate.
1172
- *
1173
- * @param timestamp The timestamp of the event in milliseconds since Unix epoch.
1174
- * @param t Relevant translation object to get localized output
1175
- *
1176
- * @public
1177
- */
1178
- export declare function userFriendlyDate(timestamp: number, t: Translation): string;
1179
-
1180
- /**
1181
- * A set of permissions for the current user.
1182
- *
1183
- * @remarks
1184
- * The values of these permissions come from the user's {@link https://talkjs.com/docs/Concepts/Roles/ | role}.
1185
- *
1186
- * @public
1187
- */
1188
- export declare interface UserPermissions {
1189
- /**
1190
- * True if typing indicators are enabled.
1191
- */
1192
- showTypingIndicator: boolean;
1193
- /**
1194
- * True if {@link https://talkjs.com/docs/Features/Messages/File_Sharing/ | file sharing} is enabled.
1195
- */
1196
- canShareFile: boolean;
1197
- /**
1198
- * True if location sharing is enabled.
1199
- */
1200
- canShareLocation: boolean;
1201
- /**
1202
- * True if {@link https://talkjs.com/docs/Features/Messages/Mentions/ | mentions} are enabled.
1203
- */
1204
- canMention: boolean;
1205
- /**
1206
- * True if
1207
- * {@link https://talkjs.com/docs/Features/Conversations/Status_Indicator/ | online status indicators }
1208
- * are enabled.
1209
- */
1210
- showOnlineStatus: boolean;
1211
- /**
1212
- * True if {@link https://talkjs.com/docs/Features/Messages/Voice_Messages/ | voice messages} are enabled.
1213
- */
1214
- canSendVoiceMessage: boolean;
1215
- /**
1216
- * True if the user has the permission to leave a given conversation.
1217
- */
1218
- canLeaveConversation: boolean;
1219
- /**
1220
- * True if the user has the permission to mark the given conversation as unread.
1221
- */
1222
- canMarkConversationAsUnread: boolean;
1223
- }
1224
-
1225
- export { UserSnapshot }
1226
-
1227
- /**
1228
- *
1229
- * This hooks triggers only when a human-readable timestamp needs to be updated.
1230
- * For example, you could use it to display that a messages was updated X
1231
- * minutes or Y hours ago.
1232
- *
1233
- * @public
1234
- */
1235
- export declare function useTimeAgo(timestamp: number, t: Translation): TimeAgo;
1236
-
1237
- export { VideoBlock }
1238
-
1239
- /**
1240
- * @public
1241
- */
1242
- export declare interface VideoBlockProps {
1243
- /**
1244
- * A collection of objects which are passed to all Chatbox theme components.
1245
- */
1246
- common: CommonChatboxProps;
1247
- /**
1248
- * The message that this content block belongs to.
1249
- */
1250
- message: MessageSnapshot;
1251
- /**
1252
- * The video block to display.
1253
- */
1254
- block: VideoBlock;
1255
- /**
1256
- * The URL used to download the file.
1257
- *
1258
- * @remarks
1259
- * This URL is not the same as `block.url`. When the current user sends a file
1260
- * message, the `block.url` will hold a temporary `blob:` URL until that file
1261
- * is uploaded to TalkJS. The user can immediately see their file present in
1262
- * the chat, which makes for a smoother user experience.
1263
- *
1264
- * The `downloadUrl` is the URL of the file once it is uploaded to TalkJS. As
1265
- * such, this property will be `undefined` until the upload is completed,
1266
- * while `block.url` will always be defined and should be used for preview
1267
- * purposes.
1268
- */
1269
- downloadUrl?: string;
1270
- }
1271
-
1272
- export { VoiceBlock }
1273
-
1274
- /**
1275
- * @public
1276
- */
1277
- export declare interface VoiceBlockProps {
1278
- /**
1279
- * A collection of objects which are passed to all Chatbox theme components.
1280
- */
1281
- common: CommonChatboxProps;
1282
- /**
1283
- * The message that this content block belongs to.
1284
- */
1285
- message: MessageSnapshot;
1286
- /**
1287
- * The voice block to display.
1288
- */
1289
- block: VoiceBlock;
1290
- /**
1291
- * The URL used to download the file.
1292
- *
1293
- * @remarks
1294
- * This URL is not the same as `block.url`. When the current user sends a file
1295
- * message, the `block.url` will hold a temporary `blob:` URL until that file
1296
- * is uploaded to TalkJS. The user can immediately see their file present in
1297
- * the chat, which makes for a smoother user experience.
1298
- *
1299
- * The `downloadUrl` is the URL of the file once it is uploaded to TalkJS. As
1300
- * such, this property will be `undefined` until the upload is completed,
1301
- * while `block.url` will always be defined and should be used for preview
1302
- * purposes.
1303
- */
1304
- downloadUrl?: string;
1305
- }
1306
-
1307
- export { }
1308
-
1309
-
1310
- declare global {
1311
- interface HTMLElementTagNameMap {
1312
- "t-chatbox": ChatboxHTMLElement;
1313
- "t-conversation-list": ConversationListHTMLElement;
1314
- }
1315
- }
1316
-