@ermis-network/ermis-chat-react 1.0.9 → 2.0.1

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 (113) hide show
  1. package/README.md +144 -0
  2. package/dist/index.cjs +8320 -3427
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.css +1277 -291
  5. package/dist/index.css.map +1 -1
  6. package/dist/index.d.mts +1131 -99
  7. package/dist/index.d.ts +1131 -99
  8. package/dist/index.mjs +8168 -3319
  9. package/dist/index.mjs.map +1 -1
  10. package/package.json +9 -4
  11. package/src/channelTypeUtils.ts +1 -1
  12. package/src/components/Avatar.tsx +2 -1
  13. package/src/components/Channel.tsx +6 -5
  14. package/src/components/ChannelActions.tsx +67 -3
  15. package/src/components/ChannelHeader.tsx +27 -37
  16. package/src/components/ChannelInfo/AddMemberModal.tsx +12 -2
  17. package/src/components/ChannelInfo/ChannelInfo.tsx +410 -187
  18. package/src/components/ChannelInfo/ChannelInfoTabs.tsx +59 -297
  19. package/src/components/ChannelInfo/ChannelSettingsPanel.tsx +30 -174
  20. package/src/components/ChannelInfo/EditChannelModal.tsx +6 -3
  21. package/src/components/ChannelInfo/MediaGridItem.tsx +215 -68
  22. package/src/components/ChannelInfo/MemberListItem.tsx +2 -3
  23. package/src/components/ChannelInfo/MessageSearchPanel.tsx +27 -126
  24. package/src/components/ChannelInfo/States.tsx +1 -1
  25. package/src/components/ChannelInfo/index.ts +3 -0
  26. package/src/components/ChannelInfo/useChannelInfoTabs.tsx +427 -0
  27. package/src/components/ChannelInfo/useChannelSettings.ts +212 -0
  28. package/src/components/ChannelInfo/useMessageSearch.tsx +141 -0
  29. package/src/components/ChannelList.tsx +247 -301
  30. package/src/components/CreateChannelModal.tsx +290 -93
  31. package/src/components/Dropdown.tsx +1 -16
  32. package/src/components/EditPreview.tsx +1 -0
  33. package/src/components/ErmisCallProvider.tsx +72 -17
  34. package/src/components/ErmisCallUI.tsx +43 -20
  35. package/src/components/FilesPreview.tsx +8 -12
  36. package/src/components/FlatTopicGroupItem.tsx +243 -0
  37. package/src/components/ForwardMessageModal.tsx +43 -81
  38. package/src/components/MediaLightbox.tsx +454 -292
  39. package/src/components/MentionSuggestions.tsx +47 -35
  40. package/src/components/MessageActionsBox.tsx +6 -1
  41. package/src/components/MessageInput.tsx +165 -17
  42. package/src/components/MessageInputDefaults.tsx +127 -1
  43. package/src/components/MessageItem.tsx +155 -43
  44. package/src/components/MessageQuickReactions.tsx +153 -23
  45. package/src/components/MessageReactions.tsx +49 -3
  46. package/src/components/MessageRenderers.tsx +1114 -445
  47. package/src/components/Panel.tsx +1 -14
  48. package/src/components/PinnedMessages.tsx +55 -15
  49. package/src/components/PreviewOverlay.tsx +24 -0
  50. package/src/components/QuotedMessagePreview.tsx +99 -8
  51. package/src/components/ReadReceipts.tsx +2 -1
  52. package/src/components/RecoveryPin/RecoveryPin.tsx +279 -0
  53. package/src/components/RecoveryPin/index.ts +19 -0
  54. package/src/components/TopicList.tsx +236 -0
  55. package/src/components/TopicModal.tsx +4 -1
  56. package/src/components/TypingIndicator.tsx +17 -8
  57. package/src/components/UserPicker.tsx +94 -16
  58. package/src/components/VirtualMessageList.tsx +419 -113
  59. package/src/context/ChatComponentsContext.tsx +14 -0
  60. package/src/context/ChatProvider.tsx +44 -14
  61. package/src/context/ErmisCallContext.tsx +4 -0
  62. package/src/hooks/useChannelCapabilities.ts +7 -4
  63. package/src/hooks/useChannelData.ts +10 -3
  64. package/src/hooks/useChannelListUpdates.ts +94 -21
  65. package/src/hooks/useChannelMessages.ts +391 -42
  66. package/src/hooks/useChannelRowUpdates.ts +36 -5
  67. package/src/hooks/useChatUser.ts +39 -0
  68. package/src/hooks/useContactChannels.ts +45 -0
  69. package/src/hooks/useContactCount.ts +50 -0
  70. package/src/hooks/useDownloadHandler.ts +36 -0
  71. package/src/hooks/useDragAndDrop.ts +79 -0
  72. package/src/hooks/useE2eeAttachmentRenderer.ts +204 -0
  73. package/src/hooks/useE2eeFileUpload.ts +38 -0
  74. package/src/hooks/useFileUpload.ts +25 -5
  75. package/src/hooks/useForwardMessage.ts +309 -0
  76. package/src/hooks/useInviteChannels.ts +88 -0
  77. package/src/hooks/useInviteCount.ts +104 -0
  78. package/src/hooks/useLoadMessages.ts +16 -4
  79. package/src/hooks/useMentions.ts +60 -7
  80. package/src/hooks/useMessageActions.ts +19 -10
  81. package/src/hooks/useMessageSend.ts +64 -12
  82. package/src/hooks/usePendingE2eeSends.ts +29 -0
  83. package/src/hooks/usePendingState.ts +21 -4
  84. package/src/hooks/usePreviewState.ts +69 -0
  85. package/src/hooks/useRecoveryPin.ts +287 -0
  86. package/src/hooks/useScrollToMessage.ts +29 -4
  87. package/src/hooks/useStickerPicker.ts +62 -0
  88. package/src/hooks/useTopicGroupUpdates.ts +235 -0
  89. package/src/index.ts +79 -6
  90. package/src/messageTypeUtils.ts +27 -1
  91. package/src/styles/_base.css +0 -1
  92. package/src/styles/_call-ui.css +59 -2
  93. package/src/styles/_channel-info.css +50 -4
  94. package/src/styles/_channel-list.css +131 -68
  95. package/src/styles/_create-channel-modal.css +10 -0
  96. package/src/styles/_forward-modal.css +16 -1
  97. package/src/styles/_media-lightbox.css +67 -2
  98. package/src/styles/_mentions.css +1 -1
  99. package/src/styles/_message-actions.css +3 -4
  100. package/src/styles/_message-bubble.css +631 -112
  101. package/src/styles/_message-input.css +139 -0
  102. package/src/styles/_message-list.css +91 -18
  103. package/src/styles/_message-quick-reactions.css +105 -32
  104. package/src/styles/_message-reactions.css +22 -32
  105. package/src/styles/_modal.css +2 -1
  106. package/src/styles/_preview-overlay.css +38 -0
  107. package/src/styles/_recovery-pin.css +97 -0
  108. package/src/styles/_tokens.css +22 -20
  109. package/src/styles/_typing-indicator.css +26 -10
  110. package/src/styles/index.css +2 -0
  111. package/src/types.ts +477 -15
  112. package/src/utils/avatarColors.ts +48 -0
  113. package/src/utils.ts +219 -16
package/dist/index.d.ts CHANGED
@@ -1,8 +1,21 @@
1
- import React$1 from 'react';
2
- import { Channel as Channel$1, Attachment, FormatMessageResponse, ChannelFilters, ChannelSort, ChannelQueryOptions, ErmisChat, UserCallInfo, MessageLabel, ErmisCallNode, CallStatus } from '@ermis-network/ermis-chat-sdk';
1
+ import * as React$1 from 'react';
2
+ import React__default from 'react';
3
+ import * as _ermis_network_ermis_chat_sdk from '@ermis-network/ermis-chat-sdk';
4
+ import { Channel as Channel$1, E2eeAttachmentManifest, Attachment, FormatMessageResponse, ChannelFilters, ChannelSort, ChannelQueryOptions, SystemMessageTranslations, SignalMessageTranslations, ErmisChat, UserCallInfo, E2eeRecoveryPolicy, MessageLabel, ExtendableGenerics, DefaultGenerics, UserResponse, E2eeAttachmentTransferProgress, PendingE2eeSendRecord, RestoreProgressRecord, RepairMode, RepairResult, EncryptedChannelRepairMode, EncryptedChannelRepairResult, ErmisCallNode, CallStatus } from '@ermis-network/ermis-chat-sdk';
3
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
6
  import { VListHandle } from 'virtua';
5
7
 
8
+ type ChatComponentsContextValue = {
9
+ ModalComponent?: React__default.ComponentType<ModalProps>;
10
+ DropdownComponent?: React__default.ComponentType<DropdownProps>;
11
+ PanelComponent?: React__default.ComponentType<PanelProps>;
12
+ ForwardMessageModalComponent?: React__default.ComponentType<ForwardMessageModalProps>;
13
+ ChannelListErrorIndicator?: React__default.ComponentType<{
14
+ text?: string;
15
+ onRetry?: () => void;
16
+ }>;
17
+ };
18
+
6
19
  type Theme = 'dark' | 'light';
7
20
  type ReadStateEntry = {
8
21
  last_read: Date | string;
@@ -42,10 +55,25 @@ type ChatContextValue = {
42
55
  setJumpToMessageId: (id: string | null) => void;
43
56
  /** Indicates whether the direct call feature is enabled */
44
57
  enableCall?: boolean;
58
+ /** Save a draft message (innerHTML and files) for a specific channel */
59
+ setDraft: (cid: string, draft: {
60
+ html: string;
61
+ files: any[];
62
+ }) => void;
63
+ /** Retrieve the saved draft for a specific channel */
64
+ getDraft: (cid: string) => {
65
+ html: string;
66
+ files: any[];
67
+ } | undefined;
68
+ /** Clear all saved drafts (e.g. on logout) */
69
+ clearAllDrafts: () => void;
45
70
  };
71
+
46
72
  type ChatProviderProps = {
47
73
  client: ErmisChat;
48
74
  children: React.ReactNode;
75
+ /** Global UI primitive components registry */
76
+ components?: ChatComponentsContextValue;
49
77
  /** Initial theme, defaults to 'dark' */
50
78
  initialTheme?: Theme;
51
79
  /** Enable direct call feature (Audio/Video). If enabled, configures internal CallProvider */
@@ -167,6 +195,9 @@ type ErmisCallRingingProps = {
167
195
  endCallLabel: string;
168
196
  audioCallBadgeLabel: string;
169
197
  videoCallBadgeLabel: string;
198
+ isAccepting?: boolean;
199
+ isRejecting?: boolean;
200
+ isEnding?: boolean;
170
201
  };
171
202
  /** Props for the Connected Audio state view */
172
203
  type ErmisCallConnectedAudioProps = {
@@ -210,6 +241,7 @@ type ErmisCallControlsBarProps = {
210
241
  selectedVideoDeviceId: string;
211
242
  switchAudioDevice: (id: string) => Promise<void>;
212
243
  switchVideoDevice: (id: string) => Promise<void>;
244
+ isEnding?: boolean;
213
245
  };
214
246
  type AvatarProps = {
215
247
  /** Image URL */
@@ -296,8 +328,10 @@ type ChannelActionLabels = {
296
328
  closeTopic?: string;
297
329
  reopenTopic?: string;
298
330
  createTopic?: string;
331
+ deleteTopic?: string;
299
332
  deleteChannel?: string;
300
333
  leaveChannel?: string;
334
+ truncateChannel?: string;
301
335
  };
302
336
  type ChannelActionIcons = {
303
337
  PinIcon?: React.ReactNode;
@@ -308,8 +342,10 @@ type ChannelActionIcons = {
308
342
  CloseTopicIcon?: React.ReactNode;
309
343
  ReopenTopicIcon?: React.ReactNode;
310
344
  CreateTopicIcon?: React.ReactNode;
345
+ DeleteTopicIcon?: React.ReactNode;
311
346
  DeleteChannelIcon?: React.ReactNode;
312
347
  LeaveChannelIcon?: React.ReactNode;
348
+ TruncateChannelIcon?: React.ReactNode;
313
349
  };
314
350
  type ChannelActionsProps = {
315
351
  channel: Channel$1;
@@ -321,7 +357,7 @@ type ChannelItemProps = {
321
357
  isActive: boolean;
322
358
  hasUnread: boolean;
323
359
  unreadCount: number;
324
- lastMessageText: string;
360
+ lastMessageText: React.ReactNode;
325
361
  lastMessageUser: string;
326
362
  lastMessageTimestamp?: Date | string | null;
327
363
  onSelect: (channel: Channel$1) => void;
@@ -344,6 +380,10 @@ type ChannelItemProps = {
344
380
  onEditTopic?: (channel: Channel$1) => void;
345
381
  /** Handler when Close/Reopen Topic action is triggered */
346
382
  onToggleCloseTopic?: (channel: Channel$1, isClosed: boolean) => void;
383
+ /** Handler when Delete Topic action is triggered */
384
+ onDeleteTopic?: (channel: Channel$1) => void;
385
+ /** Handler when Truncate Channel action is triggered */
386
+ onTruncateChannel?: (channel: Channel$1) => void;
347
387
  /** Array of action IDs to hide from the actions dropdown */
348
388
  hiddenActions?: string[];
349
389
  /** Custom labels for default channel actions */
@@ -353,6 +393,62 @@ type ChannelItemProps = {
353
393
  /** Whether the other user in this direct channel is online (friend channels only) */
354
394
  isOnline?: boolean;
355
395
  };
396
+ type TopicPillProps = {
397
+ /** The topic channel to display as a pill */
398
+ topic: Channel$1;
399
+ /** Size of the topic avatar in pixels (default: 16) */
400
+ avatarSize?: number;
401
+ };
402
+ type TopicListProps = {
403
+ /** Parent channel that has topics enabled */
404
+ channel: Channel$1;
405
+ /** Custom channel item component for each topic row */
406
+ ChannelItemComponent?: React.ComponentType<ChannelItemProps>;
407
+ /** Custom avatar for the general (parent) topic */
408
+ GeneralAvatarComponent?: React.ComponentType<AvatarProps>;
409
+ /** Custom avatar for sub-topic items */
410
+ TopicAvatarComponent?: React.ComponentType<AvatarProps>;
411
+ /** Custom avatar component (fallback) */
412
+ AvatarComponent?: React.ComponentType<AvatarProps>;
413
+ /** Label for the general topic (default: 'general') */
414
+ generalTopicLabel?: string;
415
+ /** Pinned icon component */
416
+ PinnedIconComponent?: React.ComponentType;
417
+ /** Custom channel actions component */
418
+ ChannelActionsComponent?: React.ComponentType<ChannelActionsProps>;
419
+ /** Called when a topic is selected */
420
+ onSelectTopic?: (topic: Channel$1) => void;
421
+ /** Handler for Edit Topic action */
422
+ onEditTopic?: (channel: Channel$1) => void;
423
+ /** Handler for Close/Reopen Topic action */
424
+ onToggleCloseTopic?: (channel: Channel$1, isClosed: boolean) => void;
425
+ /** Handler for Delete Topic action */
426
+ onDeleteTopic?: (channel: Channel$1) => void;
427
+ /** Actions to hide */
428
+ hiddenActions?: string[];
429
+ /** Custom action labels */
430
+ actionLabels?: ChannelActionLabels;
431
+ /** Custom action icons */
432
+ actionIcons?: ChannelActionIcons;
433
+ /** Icon for closed topics */
434
+ closedTopicIcon?: React.ReactNode;
435
+ /** Badge label for pending members */
436
+ pendingBadgeLabel?: string;
437
+ /** Badge label for blocked members */
438
+ blockedBadgeLabel?: string;
439
+ /** Auto-scroll the topic list to the top when the current user sends a message (default: true) */
440
+ scrollToTopOnOwnMessage?: boolean;
441
+ deletedMessageLabel?: React.ReactNode;
442
+ stickerMessageLabel?: React.ReactNode;
443
+ photoMessageLabel?: React.ReactNode;
444
+ videoMessageLabel?: React.ReactNode;
445
+ voiceRecordingMessageLabel?: React.ReactNode;
446
+ fileMessageLabel?: React.ReactNode;
447
+ encryptedMessageLabel?: React.ReactNode;
448
+ encryptedMessageUnavailableLabel?: React.ReactNode;
449
+ systemMessageTranslations?: SystemMessageTranslations;
450
+ signalMessageTranslations?: SignalMessageTranslations;
451
+ };
356
452
  type ChannelListProps = {
357
453
  filters?: ChannelFilters;
358
454
  sort?: ChannelSort;
@@ -360,6 +456,8 @@ type ChannelListProps = {
360
456
  renderChannel?: (channel: Channel$1, isActive: boolean) => React.ReactNode;
361
457
  onChannelSelect?: (channel: Channel$1) => void;
362
458
  className?: string;
459
+ /** Whether to show pending invites visually in the main list (default: true) */
460
+ showPendingInvites?: boolean;
363
461
  /** Array of action IDs to hide from the actions dropdown */
364
462
  hiddenActions?: string[];
365
463
  LoadingIndicator?: React.ComponentType<{
@@ -379,18 +477,37 @@ type ChannelListProps = {
379
477
  pendingBadgeLabel?: string;
380
478
  /** Label for the loading indicator */
381
479
  loadingLabel?: string;
382
- /** Label for the empty state indicator */
480
+ /** Component to display when there is an error loading channels */
481
+ ErrorIndicator?: React.ComponentType<{
482
+ text?: string;
483
+ onRetry?: () => void;
484
+ }>;
485
+ /** Label to display in the error indicator */
486
+ errorLabel?: string;
487
+ /** Label to display in the empty state indicator */
383
488
  emptyStateLabel?: string;
384
489
  /** Label for the blocked channel badge hover */
385
490
  blockedBadgeLabel?: string;
386
- /** Custom component for rendering topic group */
387
- ChannelTopicGroupComponent?: React.ComponentType<any>;
388
- /** Custom avatar component for general topic */
389
- GeneralTopicAvatarComponent?: React.ComponentType<any>;
390
- /** Custom avatar component for other topics */
391
- TopicAvatarComponent?: React.ComponentType<any>;
392
- /** Name for the general topic (default: "general") */
393
- generalTopicLabel?: string;
491
+ /** Label for deleted messages in the preview strip (default: 'This message was deleted') */
492
+ deletedMessageLabel?: React.ReactNode;
493
+ /** Label for sticker messages in the preview strip (default: 'Sticker') */
494
+ stickerMessageLabel?: React.ReactNode;
495
+ /** Label for photo messages in the preview strip (default: '📷 Photo') */
496
+ photoMessageLabel?: React.ReactNode;
497
+ /** Label for video messages in the preview strip (default: '🎬 Video') */
498
+ videoMessageLabel?: React.ReactNode;
499
+ /** Label for voice message in the preview strip (default: '🎤 Voice message') */
500
+ voiceRecordingMessageLabel?: React.ReactNode;
501
+ /** Label for file messages in the preview strip (default: '📎 File') */
502
+ fileMessageLabel?: React.ReactNode;
503
+ /** Label for encrypted messages in the preview strip (default: 'Encrypted message') */
504
+ encryptedMessageLabel?: React.ReactNode;
505
+ /** Label for encrypted messages that failed in the preview strip (default: 'Encrypted message unavailable') */
506
+ encryptedMessageUnavailableLabel?: React.ReactNode;
507
+ /** Custom translation templates for system messages in the preview strip */
508
+ systemMessageTranslations?: SystemMessageTranslations;
509
+ /** Custom translation templates for signal (call) messages in the preview strip */
510
+ signalMessageTranslations?: SignalMessageTranslations;
394
511
  /** Handler when Add Topic button is clicked on a team channel */
395
512
  onAddTopic?: (channel: Channel$1) => void;
396
513
  /** Optional custom emoji picker for TopicModal */
@@ -403,12 +520,32 @@ type ChannelListProps = {
403
520
  onEditTopic?: (channel: Channel$1) => void;
404
521
  /** Handler when Close/Reopen Topic action is triggered */
405
522
  onToggleCloseTopic?: (channel: Channel$1, isClosed: boolean) => void;
523
+ /** Handler when Delete Topic action is triggered */
524
+ onDeleteTopic?: (channel: Channel$1) => void;
525
+ /** Handler when Truncate action is triggered */
526
+ onTruncateChannel?: (channel: Channel$1) => void;
406
527
  /** Custom labels for default channel actions */
407
528
  actionLabels?: ChannelActionLabels;
408
529
  /** Custom icons for default channel actions */
409
530
  actionIcons?: ChannelActionIcons;
410
531
  /** Show online/offline indicator dots on channel item avatars for friend channels (default: true) */
411
532
  showOnlineStatus?: boolean;
533
+ /** Handler when a topic-enabled channel is clicked — enables drill-down mode */
534
+ onTopicDrillDown?: (channel: Channel$1) => void;
535
+ /** Max number of topic pills shown in the preview strip (default: 3) */
536
+ maxVisibleTopics?: number;
537
+ /** Label for the overflow indicator when topics exceed maxVisibleTopics (default: '...') */
538
+ moreTopicsLabel?: string;
539
+ /** Label for the general topic pill (default: 'general') */
540
+ generalTopicLabel?: string;
541
+ /** Custom component for rendering each topic pill in the preview strip */
542
+ TopicPillComponent?: React.ComponentType<TopicPillProps>;
543
+ /** Custom component to replace the entire flat topic group item */
544
+ FlatTopicGroupItemComponent?: React.ComponentType<any>;
545
+ /** Auto-scroll the channel list to the top when the current user sends a message (default: true) */
546
+ scrollToTopOnOwnMessage?: boolean;
547
+ /** Whether to show topic pills on team channels (default: false) */
548
+ showTopicPills?: boolean;
412
549
  };
413
550
  type AttachmentProps = {
414
551
  attachment: Attachment;
@@ -418,6 +555,15 @@ type AttachmentProps = {
418
555
  type MessageRendererProps = {
419
556
  message: FormatMessageResponse;
420
557
  isOwnMessage: boolean;
558
+ systemMessageTranslations?: SystemMessageTranslations;
559
+ signalMessageTranslations?: SignalMessageTranslations;
560
+ onMentionClick?: (userId: string) => void;
561
+ /** I18n Label for encrypted messages (default: 'Encrypted message') */
562
+ encryptedMessageLabel?: string;
563
+ /** I18n Label for encrypted messages that failed to decrypt (default: 'Encrypted message could not be decrypted') */
564
+ encryptedMessageFailedLabel?: string;
565
+ /** I18n Label for encrypted messages being decrypted (default: 'Decrypting encrypted message...') */
566
+ encryptedMessageDecryptingLabel?: string;
421
567
  };
422
568
  type MessageBubbleProps = {
423
569
  message: FormatMessageResponse;
@@ -432,9 +578,16 @@ type JumpToLatestProps = {
432
578
  };
433
579
  type MediaLightboxItem = {
434
580
  type: 'image' | 'video';
435
- src: string;
581
+ src?: string;
436
582
  alt?: string;
437
583
  posterSrc?: string;
584
+ loading?: boolean;
585
+ progressLabel?: string;
586
+ download?: () => Promise<void> | void;
587
+ onPlaybackError?: (context?: {
588
+ currentTime?: number;
589
+ }) => Promise<void> | void;
590
+ onDispose?: () => Promise<void> | void;
438
591
  };
439
592
  type MediaLightboxProps = {
440
593
  items: MediaLightboxItem[];
@@ -445,6 +598,12 @@ type MediaLightboxProps = {
445
598
  type MessageListProps = {
446
599
  /** Fully custom render for each message */
447
600
  renderMessage?: (message: FormatMessageResponse, isOwnMessage: boolean) => React.ReactNode;
601
+ /** Handler when a mention is clicked */
602
+ onMentionClick?: (userId: string) => void;
603
+ /** Handler when a sender's username is clicked in the message list */
604
+ onUserNameClick?: (userId: string) => void;
605
+ /** Handler when clicking to add a custom reaction */
606
+ onAddReactionClick?: (e: React.MouseEvent, messageId: string) => void;
448
607
  /** Additional CSS class name */
449
608
  className?: string;
450
609
  /** Custom empty state component */
@@ -459,6 +618,8 @@ type MessageListProps = {
459
618
  loadMoreLimit?: number;
460
619
  /** Custom date separator component */
461
620
  DateSeparatorComponent?: React.ComponentType<DateSeparatorProps>;
621
+ /** Locale string for date separator labels (e.g. 'vi', 'en-US'). Falls back to browser default. */
622
+ dateLocale?: string;
462
623
  /** Custom message item component (replaces the entire row) */
463
624
  MessageItemComponent?: React.ComponentType<MessageItemProps>;
464
625
  /** Custom system message item component */
@@ -518,6 +679,41 @@ type MessageListProps = {
518
679
  }>;
519
680
  /** I18n Label for pending invitee notification */
520
681
  pendingInviteeLabel?: string | ((inviteeName?: string) => string);
682
+ /** I18n Label for pinned messages header */
683
+ pinnedMessagesLabel?: string | ((count: number) => string);
684
+ /** I18n Label for seeing all pinned messages */
685
+ seeAllLabel?: string;
686
+ /** I18n Label for collapsing pinned messages */
687
+ collapseLabel?: string;
688
+ /** I18n Label for unpinning a message */
689
+ unpinLabel?: string;
690
+ /** I18n Label for sticker message preview */
691
+ stickerLabel?: string;
692
+ /** I18n Label for typing indicator */
693
+ typingIndicatorLabel?: (users: Array<{
694
+ id: string;
695
+ name?: string;
696
+ }>) => string;
697
+ /** I18n Label for deleted display messages (display_type === 'deleted') */
698
+ deletedMessageLabel?: string;
699
+ /** I18n Label for attachment-only previews */
700
+ attachmentLabel?: string;
701
+ /** I18n Label for messages whose contents are unavailable */
702
+ unavailableMessageLabel?: string;
703
+ /** I18n Label for encrypted messages (default: 'Encrypted message') */
704
+ encryptedMessageLabel?: string;
705
+ /** I18n Label for encrypted messages that failed to decrypt (default: 'Encrypted message could not be decrypted') */
706
+ encryptedMessageFailedLabel?: string;
707
+ /** I18n Label for encrypted messages being decrypted (default: 'Decrypting encrypted message...') */
708
+ encryptedMessageDecryptingLabel?: string;
709
+ /** I18n Label for encrypted messages unavailable in sidebar preview (default: 'Encrypted message unavailable') */
710
+ encryptedMessageUnavailableLabel?: string;
711
+ /** Custom translation templates for system messages */
712
+ systemMessageTranslations?: SystemMessageTranslations;
713
+ /** Custom translation templates for signal (call) messages */
714
+ signalMessageTranslations?: SignalMessageTranslations;
715
+ /** Whether to include hidden (deleted) messages in the initial channel query. Defaults to true. */
716
+ includeHiddenMessages?: boolean;
521
717
  };
522
718
  type ReactionUser = {
523
719
  id: string;
@@ -541,6 +737,8 @@ type MessageReactionsProps = {
541
737
  onClickReaction?: (type: string) => void;
542
738
  /** Whether interactions are disabled */
543
739
  disabled?: boolean;
740
+ /** Whether the message is from the current user */
741
+ isOwnMessage?: boolean;
544
742
  };
545
743
  type ReadReceiptUser = {
546
744
  id: string;
@@ -598,11 +796,38 @@ type MessageItemProps = {
598
796
  forwardedLabel?: string;
599
797
  /** I18n Label for edited state */
600
798
  editedLabel?: string;
799
+ /** I18n Label for deleted display messages (display_type === 'deleted') */
800
+ deletedMessageLabel?: React.ReactNode;
801
+ /** I18n Label for attachment-only previews */
802
+ attachmentLabel?: string;
803
+ /** I18n Label for messages whose contents are unavailable */
804
+ unavailableMessageLabel?: string;
805
+ /** I18n Label for sticker message previews */
806
+ stickerLabel?: string;
807
+ /** I18n Label for encrypted messages (default: 'Encrypted message') */
808
+ encryptedMessageLabel?: string;
809
+ /** I18n Label for encrypted messages that failed to decrypt (default: 'Encrypted message could not be decrypted') */
810
+ encryptedMessageFailedLabel?: string;
811
+ /** I18n Label for encrypted messages being decrypted (default: 'Decrypting encrypted message...') */
812
+ encryptedMessageDecryptingLabel?: string;
813
+ /** Custom translation templates for system messages */
814
+ systemMessageTranslations?: SystemMessageTranslations;
815
+ /** Custom translation templates for signal (call) messages */
816
+ signalMessageTranslations?: SignalMessageTranslations;
817
+ /** Handler when a mention is clicked */
818
+ onMentionClick?: (userId: string) => void;
819
+ /** Handler when a sender's username is clicked in the message list */
820
+ onUserNameClick?: (userId: string) => void;
821
+ /** Handler when clicking to add a custom reaction */
822
+ onAddReactionClick?: (e: React.MouseEvent, messageId: string) => void;
823
+ /** When true, the avatar column is not rendered (handled by group wrapper) */
824
+ hideAvatar?: boolean;
601
825
  };
602
826
  type SystemMessageItemProps = {
603
827
  message: FormatMessageResponse;
604
828
  isOwnMessage: boolean;
605
829
  SystemRenderer: React.ComponentType<MessageRendererProps>;
830
+ systemMessageTranslations?: SystemMessageTranslations;
606
831
  };
607
832
  type SendButtonProps = {
608
833
  disabled: boolean;
@@ -612,6 +837,10 @@ type AttachButtonProps = {
612
837
  disabled: boolean;
613
838
  onClick: () => void;
614
839
  };
840
+ type VoiceRecordButtonProps = {
841
+ disabled: boolean;
842
+ onRecordComplete: (file: File) => void;
843
+ };
615
844
  /** Props passed to a consumer-provided emoji picker component */
616
845
  type EmojiPickerProps = {
617
846
  /** Called when user selects an emoji — insert the emoji string into the input */
@@ -619,6 +848,17 @@ type EmojiPickerProps = {
619
848
  /** Called when the picker should close (e.g. click outside) */
620
849
  onClose: () => void;
621
850
  };
851
+ /** Props for the preview overlay when a user has not joined a public channel */
852
+ type PreviewOverlayProps = {
853
+ /** Title shown in the preview overlay */
854
+ title?: string;
855
+ /** Label for the join button */
856
+ buttonLabel?: string;
857
+ /** Action when the join button is clicked */
858
+ onJoin?: () => void;
859
+ /** Custom class name */
860
+ className?: string;
861
+ };
622
862
  /** Props passed to the emoji button component */
623
863
  type EmojiButtonProps = {
624
864
  /** Whether the picker is currently open */
@@ -637,6 +877,8 @@ type MessageInputProps = {
637
877
  SendButton?: React.ComponentType<SendButtonProps>;
638
878
  /** Custom attach button component */
639
879
  AttachButton?: React.ComponentType<AttachButtonProps>;
880
+ /** Custom voice record button component */
881
+ VoiceRecordButtonComponent?: React.ComponentType<VoiceRecordButtonProps>;
640
882
  /** Custom file preview component */
641
883
  FilesPreviewComponent?: React.ComponentType<FilesPreviewProps>;
642
884
  /** Custom mention suggestions component */
@@ -675,6 +917,38 @@ type MessageInputProps = {
675
917
  slowModeLabel?: (cooldown: number) => React.ReactNode;
676
918
  /** I18n Label for closed topic */
677
919
  closedTopicLabel?: string;
920
+ /** I18n Label for replying state */
921
+ replyingToLabel?: string;
922
+ /** I18n Label for editing state */
923
+ editingMessageLabel?: string;
924
+ /** I18n Label for Drag and Drop overlay */
925
+ dragAndDropLabel?: string;
926
+ /** Custom component for Drag and Drop overlay */
927
+ DragAndDropOverlayComponent?: React.ComponentType<{
928
+ dragAndDropLabel: string;
929
+ }>;
930
+ /** Custom component for the Preview Overlay (shown instead of input in unjoined public channels) */
931
+ PreviewOverlayComponent?: React.ComponentType<PreviewOverlayProps>;
932
+ /** I18n Title for Preview Overlay */
933
+ previewOverlayTitle?: string;
934
+ /** I18n Label for Join Button in Preview Overlay */
935
+ joinChannelLabel?: string;
936
+ /** Disable stickers entirely */
937
+ disableStickers?: boolean;
938
+ /** URL for the sticker picker iframe (default: https://sticker.ermis.network) */
939
+ stickerIframeUrl?: string;
940
+ /** Custom sticker picker component */
941
+ StickerPickerComponent?: React.ComponentType<{
942
+ stickerIframeUrl: string;
943
+ onClose: () => void;
944
+ }>;
945
+ /** Custom sticker button component */
946
+ StickerButtonComponent?: React.ComponentType<{
947
+ active: boolean;
948
+ onClick: () => void;
949
+ }>;
950
+ /** I18n Label for maximum characters exceeded error */
951
+ maxCharsLabel?: string;
678
952
  };
679
953
  type ReplyPreviewProps = {
680
954
  message: FormatMessageResponse;
@@ -722,6 +996,10 @@ type PinnedMessageItemProps = {
722
996
  onClickMessage?: (messageId: string) => void;
723
997
  onUnpin?: (messageId: string) => void;
724
998
  AvatarComponent: React.ComponentType<AvatarProps>;
999
+ unpinLabel?: string;
1000
+ stickerLabel?: string;
1001
+ attachmentLabel?: string;
1002
+ unavailableMessageLabel?: string;
725
1003
  };
726
1004
  type PinnedMessagesProps = {
727
1005
  /** Additional CSS class name */
@@ -734,6 +1012,14 @@ type PinnedMessagesProps = {
734
1012
  onClickMessage?: (messageId: string) => void;
735
1013
  /** Max messages to show in collapsed state (default: 1) */
736
1014
  maxCollapsed?: number;
1015
+ /** I18n Labels */
1016
+ pinnedMessagesLabel?: string | ((count: number) => string);
1017
+ seeAllLabel?: string;
1018
+ collapseLabel?: string;
1019
+ unpinLabel?: string;
1020
+ stickerLabel?: string;
1021
+ attachmentLabel?: string;
1022
+ unavailableMessageLabel?: string;
737
1023
  };
738
1024
  type QuotedMessagePreviewProps = {
739
1025
  /** The quoted (replied-to) message object */
@@ -744,11 +1030,28 @@ type QuotedMessagePreviewProps = {
744
1030
  id?: string;
745
1031
  name?: string;
746
1032
  };
1033
+ attachments?: Attachment[];
1034
+ content_type?: string;
1035
+ mls_ciphertext?: unknown;
1036
+ e2ee_status?: string;
1037
+ sticker_url?: string;
1038
+ type?: string;
1039
+ display_type?: string;
1040
+ mentioned_users?: string[];
1041
+ mentioned_all?: boolean;
747
1042
  };
748
1043
  /** Whether the parent message is from the current user */
749
1044
  isOwnMessage: boolean;
750
1045
  /** Callback when the quote box is clicked */
751
1046
  onClick: (messageId: string) => void;
1047
+ /** I18n Label for attachment-only quoted messages */
1048
+ attachmentLabel?: string;
1049
+ /** I18n Label for quoted messages whose contents are unavailable */
1050
+ unavailableMessageLabel?: string;
1051
+ /** I18n Label for sticker quoted messages */
1052
+ stickerLabel?: string;
1053
+ /** I18n Label for deleted messages */
1054
+ deletedMessageLabel?: string;
752
1055
  };
753
1056
  type MentionSuggestionsProps = {
754
1057
  members: MentionMember[];
@@ -799,6 +1102,10 @@ type FilePreviewItem = {
799
1102
  previewUrl?: string;
800
1103
  /** Upload status */
801
1104
  status: 'pending' | 'uploading' | 'done' | 'error';
1105
+ /** E2EE upload phase when the file is handled by MLS attachment flow */
1106
+ e2eePhase?: 'generating_preview' | 'encrypting' | 'uploading' | 'completing' | 'sending' | 'retrying' | 'failed';
1107
+ /** Upload progress percentage (0-100) */
1108
+ progress?: number;
802
1109
  /** Error message if upload failed */
803
1110
  error?: string;
804
1111
  /** URL returned after successful upload */
@@ -824,6 +1131,36 @@ interface ModalProps {
824
1131
  hideCloseButton?: boolean;
825
1132
  closeOnOutsideClick?: boolean;
826
1133
  }
1134
+ interface DropdownProps {
1135
+ /** Whether the dropdown is open */
1136
+ isOpen: boolean;
1137
+ /** Rect from getBoundingClientRect() of the anchor element */
1138
+ anchorRect: DOMRect | null;
1139
+ /** Callback when dropdown requests to close (e.g., click outside, scroll, Escape) */
1140
+ onClose: () => void;
1141
+ /** Dropdown menu content */
1142
+ children: React.ReactNode;
1143
+ /** Horizontal alignment relative to the anchor. Default: 'left' */
1144
+ align?: 'left' | 'right';
1145
+ /** Optional custom CSS class for the container */
1146
+ className?: string;
1147
+ /** Optional custom CSS style for the container */
1148
+ style?: React.CSSProperties;
1149
+ }
1150
+ type PanelProps = {
1151
+ /** Whether the panel is visible */
1152
+ isOpen: boolean;
1153
+ /** Called when user clicks the back button */
1154
+ onClose: () => void;
1155
+ /** Panel title shown in the header */
1156
+ title?: string;
1157
+ /** Panel body content */
1158
+ children: React.ReactNode;
1159
+ /** Optional header content (replaces default title + back button) */
1160
+ headerContent?: React.ReactNode;
1161
+ /** Additional CSS class name */
1162
+ className?: string;
1163
+ };
827
1164
  /** Attachment item from the channel attachment query API */
828
1165
  type AttachmentItem = {
829
1166
  id: string;
@@ -844,8 +1181,16 @@ type AttachmentItem = {
844
1181
  og_scrape_url?: string;
845
1182
  image_url?: string;
846
1183
  text?: string;
1184
+ e2ee_manifest?: E2eeAttachmentManifest;
1185
+ e2ee_manifest_missing?: boolean;
847
1186
  };
848
1187
  type MediaTab = 'members' | 'media' | 'links' | 'files';
1188
+ type ChannelInfoTabHeaderProps = {
1189
+ activeTab: MediaTab;
1190
+ onTabChange: (tab: MediaTab) => void;
1191
+ availableTabs: MediaTab[];
1192
+ tabCounts: Record<MediaTab, number>;
1193
+ };
849
1194
  type ChannelInfoMemberItemProps = {
850
1195
  member: ChannelInfoMember;
851
1196
  AvatarComponent: React.ComponentType<AvatarProps>;
@@ -859,6 +1204,8 @@ type ChannelInfoMemberItemProps = {
859
1204
  canPromote?: boolean;
860
1205
  onDemote?: (id: string) => void;
861
1206
  canDemote?: boolean;
1207
+ /** Custom labels for member roles (owner, moder, member, pending) */
1208
+ roleLabels?: Record<string, string>;
862
1209
  };
863
1210
  type ChannelInfoMediaItemProps = {
864
1211
  item: AttachmentItem;
@@ -895,29 +1242,55 @@ type ChannelInfoCoverProps = {
895
1242
  isTopic?: boolean;
896
1243
  /** Whether the channel is a team channel */
897
1244
  isTeamChannel?: boolean;
1245
+ /** Whether this channel or inherited parent topic is E2EE enabled */
1246
+ isE2ee?: boolean;
1247
+ /** Current encryption epoch, if available */
1248
+ encryptionEpoch?: number;
898
1249
  };
899
1250
  type ChannelInfoActionsProps = {
1251
+ channel?: Channel$1;
900
1252
  onSearchClick?: () => void;
901
1253
  onSettingsClick?: () => void;
902
1254
  onLeaveChannel?: () => void;
903
1255
  onDeleteChannel?: () => void;
1256
+ onTruncateChannel?: () => void;
904
1257
  onBlockUser?: () => void;
905
1258
  onUnblockUser?: () => void;
1259
+ onPin?: () => void;
1260
+ onUnpin?: () => void;
906
1261
  isTeamChannel?: boolean;
907
1262
  isTopic?: boolean;
908
1263
  isClosedTopic?: boolean;
909
1264
  isBlocked?: boolean;
1265
+ isPinned?: boolean;
910
1266
  currentUserRole?: string;
911
1267
  searchLabel?: string;
912
1268
  settingsLabel?: string;
913
1269
  deleteLabel?: string;
1270
+ truncateLabel?: string;
914
1271
  leaveLabel?: string;
915
1272
  blockLabel?: string;
916
1273
  unblockLabel?: string;
1274
+ pinLabel?: string;
1275
+ unpinLabel?: string;
917
1276
  onCloseTopic?: () => void;
918
1277
  onReopenTopic?: () => void;
919
1278
  closeTopicLabel?: string;
920
1279
  reopenTopicLabel?: string;
1280
+ onDeleteTopic?: () => void;
1281
+ deleteTopicLabel?: string;
1282
+ onCreateTopic?: () => void;
1283
+ createTopicLabel?: string;
1284
+ topicsEnabled?: boolean;
1285
+ isE2ee?: boolean;
1286
+ encryptionInitialized?: boolean;
1287
+ encryptionEpoch?: number;
1288
+ onRotateKey?: () => void;
1289
+ rotateKeyLabel?: string;
1290
+ rotateKeyDisabled?: boolean;
1291
+ onEnableE2ee?: () => void;
1292
+ enableE2eeLabel?: string;
1293
+ enableE2eeDisabled?: boolean;
921
1294
  };
922
1295
  type ChannelInfoMember = {
923
1296
  id: string;
@@ -929,6 +1302,7 @@ type ChannelInfoMember = {
929
1302
  type EditChannelData = {
930
1303
  name?: string;
931
1304
  image?: string;
1305
+ banner?: string;
932
1306
  description?: string;
933
1307
  public?: boolean;
934
1308
  };
@@ -1031,6 +1405,7 @@ type ChannelInfoTabsProps = {
1031
1405
  onUnbanMember?: (id: string) => void;
1032
1406
  onPromoteMember?: (id: string) => void;
1033
1407
  onDemoteMember?: (id: string) => void;
1408
+ isPreviewMode?: boolean;
1034
1409
  /** Label for the 'Add Member' button in the Members tab (default: 'Add Member') */
1035
1410
  addMemberButtonLabel?: string;
1036
1411
  /** Custom component for the 'Add Member' button */
@@ -1041,7 +1416,16 @@ type ChannelInfoTabsProps = {
1041
1416
  LinkItemComponent?: React.ComponentType<ChannelInfoLinkItemProps>;
1042
1417
  FileItemComponent?: React.ComponentType<ChannelInfoFileItemProps>;
1043
1418
  EmptyStateComponent?: React.ComponentType<ChannelInfoEmptyStateProps>;
1044
- LoadingComponent?: React.ComponentType;
1419
+ LoadingComponent?: React.ComponentType<{
1420
+ tab?: string;
1421
+ }>;
1422
+ /** Custom component for the tab header buttons */
1423
+ TabHeaderComponent?: React.ComponentType<ChannelInfoTabHeaderProps>;
1424
+ /** Whether the tabs panel is currently visible — controls data fetching (default: true) */
1425
+ isVisible?: boolean;
1426
+ roleLabels?: Record<string, string>;
1427
+ /** Ref or Element of the parent scrollable container — used for virtualization sync (default: undefined) */
1428
+ scrollContainerRef?: React.RefObject<HTMLDivElement | null> | HTMLDivElement | null;
1045
1429
  };
1046
1430
  type ChannelInfoProps = {
1047
1431
  /** Optional channel override. Defaults to activeChannel from context */
@@ -1054,6 +1438,8 @@ type ChannelInfoProps = {
1054
1438
  onClose?: () => void;
1055
1439
  /** Custom Title String for the banner */
1056
1440
  title?: string;
1441
+ /** Whether the panel is visible — controls data fetching timing (default: true) */
1442
+ isVisible?: boolean;
1057
1443
  /** Custom components to replace internal sections */
1058
1444
  HeaderComponent?: React.ComponentType<ChannelInfoHeaderProps>;
1059
1445
  CoverComponent?: React.ComponentType<ChannelInfoCoverProps>;
@@ -1063,13 +1449,19 @@ type ChannelInfoProps = {
1063
1449
  AddMemberModalComponent?: React.ComponentType<AddMemberModalProps>;
1064
1450
  /** Custom component replacing the entire EditChannelModal */
1065
1451
  EditChannelModalComponent?: React.ComponentType<EditChannelModalProps>;
1452
+ /** Custom component replacing the entire EditTopicModal */
1453
+ EditTopicModalComponent?: React.ComponentType<TopicModalProps>;
1066
1454
  /** Custom sub-component overrides (passed through to TabsComponent) */
1067
1455
  MemberItemComponent?: React.ComponentType<ChannelInfoMemberItemProps>;
1068
1456
  MediaItemComponent?: React.ComponentType<ChannelInfoMediaItemProps>;
1069
1457
  LinkItemComponent?: React.ComponentType<ChannelInfoLinkItemProps>;
1070
1458
  FileItemComponent?: React.ComponentType<ChannelInfoFileItemProps>;
1071
1459
  EmptyStateComponent?: React.ComponentType<ChannelInfoEmptyStateProps>;
1072
- LoadingComponent?: React.ComponentType;
1460
+ LoadingComponent?: React.ComponentType<{
1461
+ tab?: string;
1462
+ }>;
1463
+ /** Custom component for the tab header buttons (passed through to TabsComponent) */
1464
+ TabHeaderComponent?: React.ComponentType<ChannelInfoTabHeaderProps>;
1073
1465
  /** Add Member customization (passed through to AddMemberModal) */
1074
1466
  addMemberModalTitle?: string;
1075
1467
  addMemberSearchPlaceholder?: string;
@@ -1099,14 +1491,26 @@ type ChannelInfoProps = {
1099
1491
  editChannelMaxImageSize?: number;
1100
1492
  editChannelMaxImageSizeError?: string;
1101
1493
  /** Action Labels */
1494
+ /** Custom component for the search panel */
1495
+ MessageSearchPanelComponent?: React.ComponentType<MessageSearchPanelProps>;
1496
+ /** Custom component for the channel settings panel */
1497
+ ChannelSettingsPanelComponent?: React.ComponentType<ChannelSettingsPanelProps>;
1102
1498
  actionsSearchLabel?: string;
1103
1499
  actionsSettingsLabel?: string;
1104
1500
  actionsDeleteLabel?: string;
1501
+ actionsTruncateLabel?: string;
1105
1502
  actionsLeaveLabel?: string;
1503
+ actionsPinLabel?: string;
1504
+ actionsUnpinLabel?: string;
1505
+ actionsPinTopicLabel?: string;
1506
+ actionsUnpinTopicLabel?: string;
1106
1507
  /** Action callbacks */
1107
1508
  onSearchClick?: () => void;
1108
1509
  onLeaveChannel?: () => void;
1109
1510
  onDeleteChannel?: () => void;
1511
+ onTruncateChannel?: (channel: Channel$1) => void;
1512
+ onPinChannel?: () => void;
1513
+ onUnpinChannel?: () => void;
1110
1514
  onAddMemberClick?: () => void;
1111
1515
  onRemoveMember?: (id: string) => void;
1112
1516
  onBanMember?: (id: string) => void;
@@ -1121,10 +1525,63 @@ type ChannelInfoProps = {
1121
1525
  actionsUnblockLabel?: string;
1122
1526
  actionsCloseTopicLabel?: string;
1123
1527
  actionsReopenTopicLabel?: string;
1528
+ actionsDeleteTopicLabel?: string;
1529
+ actionsCreateTopicLabel?: string;
1530
+ onDeleteTopic?: (channel: Channel$1) => void;
1531
+ onCreateTopic?: (channel: Channel$1) => void;
1124
1532
  /** Settings Panel Topics Labels */
1125
1533
  settingsWorkspaceTopicsTitle?: string;
1126
1534
  settingsTopicsFeatureName?: string;
1127
1535
  settingsTopicsFeatureDescription?: string;
1536
+ /** Custom labels for member roles (owner, moder, member, pending) */
1537
+ roleLabels?: Record<string, string>;
1538
+ };
1539
+ type SearchResultMessage = {
1540
+ id: string;
1541
+ text?: string;
1542
+ user_id?: string;
1543
+ user?: {
1544
+ id?: string;
1545
+ name?: string;
1546
+ avatar?: string;
1547
+ image?: string;
1548
+ avatar_url?: string;
1549
+ };
1550
+ created_at?: string;
1551
+ [key: string]: any;
1552
+ };
1553
+ type MessageSearchPanelProps = {
1554
+ isOpen: boolean;
1555
+ onClose: () => void;
1556
+ channel: Channel$1;
1557
+ /** Custom avatar component */
1558
+ AvatarComponent?: React.ComponentType<AvatarProps>;
1559
+ /** Title for the panel */
1560
+ title?: string;
1561
+ /** Search input placeholder */
1562
+ placeholder?: string;
1563
+ /** Text shown when loading */
1564
+ loadingText?: string;
1565
+ /** Text shown when no more messages or no results */
1566
+ emptyText?: string;
1567
+ /** Debounce wait time in ms (default: 500) */
1568
+ debounceMs?: number;
1569
+ };
1570
+ type ChannelSettingsPanelProps = {
1571
+ isOpen: boolean;
1572
+ onClose: () => void;
1573
+ channel: Channel$1;
1574
+ /** Title for the settings panel */
1575
+ title?: string;
1576
+ /** Custom slow mode options */
1577
+ slowModeOptions?: {
1578
+ label: string;
1579
+ value: number;
1580
+ }[];
1581
+ /** I18n labels for Topics settings */
1582
+ workspaceTopicsTitle?: string;
1583
+ topicsFeatureName?: string;
1584
+ topicsFeatureDescription?: string;
1128
1585
  };
1129
1586
  /** Individual user item in UserPicker */
1130
1587
  type UserPickerUser = {
@@ -1182,14 +1639,78 @@ type UserPickerProps = {
1182
1639
  emptyText?: string;
1183
1640
  loadingMoreText?: string;
1184
1641
  selectedEmptyLabel?: string;
1642
+ friendsOnly?: boolean;
1643
+ };
1644
+ type CreateChannelTabsProps = {
1645
+ activeTab: 'messaging' | 'team';
1646
+ onTabChange: (tab: 'messaging' | 'team') => void;
1647
+ disabled?: boolean;
1648
+ directTabLabel?: string;
1649
+ groupTabLabel?: string;
1650
+ };
1651
+ type CreateChannelFooterProps = {
1652
+ tab: 'messaging' | 'team';
1653
+ step: 1 | 2;
1654
+ onCancel: () => void;
1655
+ onNext: () => void;
1656
+ onBack: () => void;
1657
+ onCreate: () => void;
1658
+ isCreating: boolean;
1659
+ isValid: boolean;
1660
+ hasExistingDirectChannel?: boolean;
1661
+ cancelButtonLabel?: string;
1662
+ createButtonLabel?: string;
1663
+ creatingButtonLabel?: string;
1664
+ messageButtonLabel?: string;
1665
+ nextButtonLabel?: string;
1666
+ backButtonLabel?: string;
1667
+ e2eeEnabled?: boolean;
1668
+ };
1669
+ type CreateChannelGroupFieldsProps = {
1670
+ name: string;
1671
+ onNameChange: (name: string) => void;
1672
+ description: string;
1673
+ onDescriptionChange: (desc: string) => void;
1674
+ isPublic: boolean;
1675
+ onPublicChange: (isPublic: boolean) => void;
1676
+ disabled?: boolean;
1677
+ groupNameLabel?: string;
1678
+ groupNamePlaceholder?: string;
1679
+ groupDescriptionLabel?: string;
1680
+ groupDescriptionPlaceholder?: string;
1681
+ groupPublicLabel?: string;
1682
+ e2eeEnabled?: boolean;
1683
+ onE2eeChange?: (enabled: boolean) => void;
1684
+ e2eeLabel?: string;
1685
+ e2eeDescription?: string;
1686
+ e2eeDisabled?: boolean;
1687
+ };
1688
+ type CreateChannelE2eeToggleProps = {
1689
+ enabled: boolean;
1690
+ onChange: (enabled: boolean) => void;
1691
+ disabled?: boolean;
1692
+ label?: string;
1693
+ description?: string;
1185
1694
  };
1186
1695
  type CreateChannelModalProps = {
1187
1696
  isOpen: boolean;
1188
1697
  onClose: () => void;
1189
1698
  onSuccess?: (channel: any) => void;
1699
+ /** Recovery coverage policy for newly created E2EE channels. Defaults to member_assisted. */
1700
+ e2eeRecoveryPolicy?: E2eeRecoveryPolicy;
1190
1701
  /** Override visual components */
1191
1702
  AvatarComponent?: React.ComponentType<AvatarProps>;
1192
1703
  UserItemComponent?: React.ComponentType<UserPickerItemProps>;
1704
+ TabsComponent?: React.ComponentType<CreateChannelTabsProps>;
1705
+ FooterComponent?: React.ComponentType<CreateChannelFooterProps>;
1706
+ GroupFieldsComponent?: React.ComponentType<CreateChannelGroupFieldsProps>;
1707
+ SearchInputComponent?: React.ComponentType<{
1708
+ value: string;
1709
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
1710
+ placeholder: string;
1711
+ }>;
1712
+ SelectedBoxComponent?: React.ComponentType<UserPickerSelectedBoxProps>;
1713
+ E2eeToggleComponent?: React.ComponentType<CreateChannelE2eeToggleProps>;
1193
1714
  /** i18n labels */
1194
1715
  title?: string;
1195
1716
  directTabLabel?: string;
@@ -1205,6 +1726,12 @@ type CreateChannelModalProps = {
1205
1726
  createButtonLabel?: string;
1206
1727
  creatingButtonLabel?: string;
1207
1728
  messageButtonLabel?: string;
1729
+ nextButtonLabel?: string;
1730
+ backButtonLabel?: string;
1731
+ emptyStateLabel?: string;
1732
+ e2eeLabel?: string;
1733
+ e2eeDescription?: string;
1734
+ e2eeUnavailableLabel?: string;
1208
1735
  /** File upload configuration for group channel images */
1209
1736
  imageAccept?: string;
1210
1737
  maxImageSize?: number;
@@ -1235,10 +1762,41 @@ type TopicModalProps = {
1235
1762
  savingButtonLabel?: string;
1236
1763
  };
1237
1764
 
1238
- declare const ChatProvider: React$1.FC<ChatProviderProps>;
1765
+ declare const ChatProvider: React__default.FC<ChatProviderProps>;
1239
1766
 
1240
1767
  declare const useChatClient: () => ChatContextValue;
1241
1768
 
1769
+ declare const useChatUser: <ErmisChatGenerics extends ExtendableGenerics = DefaultGenerics>() => {
1770
+ user: UserResponse<ErmisChatGenerics> | undefined;
1771
+ };
1772
+
1773
+ /**
1774
+ * A hook that retrieves all pending invite channels from the SDK's local cache
1775
+ * without triggering an extra API network query.
1776
+ *
1777
+ * Re-renders automatically when related events (e.g., invites, accepts, deletes) arrive.
1778
+ */
1779
+ declare function useInviteChannels(): Channel$1[];
1780
+
1781
+ /**
1782
+ * A hook that retrieves all friend (contact) channels from the SDK's local cache
1783
+ * without triggering an extra API network query.
1784
+ *
1785
+ * A contact is defined as a direct (1-1) channel where both members
1786
+ * hold the 'owner' channel_role.
1787
+ *
1788
+ * Re-renders automatically when related events arrive.
1789
+ */
1790
+ declare function useContactChannels(): Channel$1[];
1791
+
1792
+ declare const useInviteCount: () => {
1793
+ inviteCount: number;
1794
+ };
1795
+
1796
+ declare const useContactCount: () => {
1797
+ contactCount: number;
1798
+ };
1799
+
1242
1800
  declare const useChannel: () => UseChannelReturn;
1243
1801
 
1244
1802
  /**
@@ -1252,7 +1810,7 @@ declare const useChannel: () => UseChannelReturn;
1252
1810
  * `channel.state.unreadCount` before our listener fires, so we only
1253
1811
  * need to re-order / flush the React state.
1254
1812
  */
1255
- declare function useChannelListUpdates(channels: Channel$1[], setChannels: React.Dispatch<React.SetStateAction<Channel$1[]>>): void;
1813
+ declare function useChannelListUpdates(channels: Channel$1[], setChannels: React.Dispatch<React.SetStateAction<Channel$1[]>>, onOwnMessageNew?: () => void): void;
1256
1814
 
1257
1815
  /**
1258
1816
  * Custom hook to abstract real-time row-level updates for a single channel.
@@ -1332,26 +1890,272 @@ declare function useOnlineUsers(channels: Channel$1[]): Set<string>;
1332
1890
  */
1333
1891
  declare function usePendingState(channel: Channel$1 | null | undefined, currentUserId?: string): {
1334
1892
  isPending: boolean;
1893
+ inviteUpdateCount: number;
1894
+ };
1895
+
1896
+ /**
1897
+ * Hook that tracks whether the current user is previewing a public channel
1898
+ * without being a member.
1899
+ */
1900
+ declare function usePreviewState(channel: Channel$1 | null | undefined, currentUserId?: string): {
1901
+ isPreviewMode: boolean;
1902
+ };
1903
+
1904
+ /** Preview data for the most recent message across the topic group */
1905
+ type LatestMessagePreview = {
1906
+ text: React__default.ReactNode;
1907
+ user: string;
1908
+ timestamp?: string | Date;
1909
+ /** Topic name if the message came from a sub-topic, null if from general/parent */
1910
+ sourceName: string | null;
1911
+ };
1912
+ type TopicGroupUpdatesOptions = {
1913
+ deletedMessageLabel?: React__default.ReactNode;
1914
+ stickerMessageLabel?: React__default.ReactNode;
1915
+ photoMessageLabel?: React__default.ReactNode;
1916
+ videoMessageLabel?: React__default.ReactNode;
1917
+ voiceRecordingMessageLabel?: React__default.ReactNode;
1918
+ fileMessageLabel?: React__default.ReactNode;
1919
+ encryptedMessageLabel?: React__default.ReactNode;
1920
+ encryptedMessageUnavailableLabel?: React__default.ReactNode;
1921
+ systemMessageTranslations?: SystemMessageTranslations;
1922
+ signalMessageTranslations?: SignalMessageTranslations;
1923
+ };
1924
+ /**
1925
+ * Hook encapsulating realtime logic for a topic-enabled channel group.
1926
+ *
1927
+ * Subscribes to message and pin events on the parent channel AND all its
1928
+ * topics to compute:
1929
+ * - sorted topics list (pinned first, then by last activity)
1930
+ * - aggregated unread count across parent + all topics
1931
+ * - boolean flag indicating if any unread exists
1932
+ * - latest message preview across parent + all topics
1933
+ */
1934
+ declare function useTopicGroupUpdates(channel: Channel$1, currentUserId?: string, options?: TopicGroupUpdatesOptions): {
1935
+ topics: Channel$1[];
1936
+ aggregatedUnreadCount: number;
1937
+ hasUnread: boolean;
1938
+ updateCount: number;
1939
+ latestMessagePreview: LatestMessagePreview | null;
1940
+ };
1941
+
1942
+ declare function useDragAndDrop(onFilesDrop: (files: FileList) => void, disabled?: boolean): {
1943
+ isDragging: boolean;
1944
+ };
1945
+
1946
+ type UseMessageSendOptions = {
1947
+ activeChannel: Channel$1 | null;
1948
+ editableRef: React.RefObject<HTMLDivElement | null>;
1949
+ files: FilePreviewItem[];
1950
+ setFiles: React.Dispatch<React.SetStateAction<FilePreviewItem[]>>;
1951
+ hasContent: boolean;
1952
+ setHasContent: (value: boolean) => void;
1953
+ isTeamChannel: boolean;
1954
+ buildPayload: () => {
1955
+ text: string;
1956
+ mentioned_all: boolean;
1957
+ mentioned_users: string[];
1958
+ };
1959
+ reset: () => void;
1960
+ syncMessages: () => void;
1961
+ onSend?: (text: string) => void;
1962
+ onBeforeSend?: (text: string, attachments: FilePreviewItem[]) => boolean | Promise<boolean>;
1963
+ /** Message being replied to */
1964
+ quotedMessage?: FormatMessageResponse | null;
1965
+ /** Clear quoted message after send */
1966
+ clearQuotedMessage?: () => void;
1967
+ /** Message being edited */
1968
+ editingMessage?: FormatMessageResponse | null;
1969
+ /** Clear edited message after send */
1970
+ clearEditingMessage?: () => void;
1971
+ };
1972
+ declare function useMessageSend({ activeChannel, editableRef, files, setFiles, hasContent, setHasContent, isTeamChannel, buildPayload, reset, syncMessages, onSend, onBeforeSend, quotedMessage, clearQuotedMessage, editingMessage, clearEditingMessage, }: UseMessageSendOptions): {
1973
+ sending: boolean;
1974
+ handleSend: () => Promise<void>;
1975
+ };
1976
+
1977
+ type UseFileUploadOptions = {
1978
+ activeChannel: Channel$1 | null;
1979
+ editableRef: React.RefObject<HTMLDivElement | null>;
1980
+ setHasContent: (value: boolean) => void;
1981
+ };
1982
+ declare function useFileUpload({ activeChannel, editableRef, setHasContent }: UseFileUploadOptions): {
1983
+ files: FilePreviewItem[];
1984
+ setFiles: React$1.Dispatch<React$1.SetStateAction<FilePreviewItem[]>>;
1985
+ fileInputRef: React$1.RefObject<HTMLInputElement>;
1986
+ handleFilesSelected: (selectedFiles: FileList | null) => void;
1987
+ handleRemoveFile: (id: string) => void;
1988
+ handleAttachClick: () => void;
1989
+ cleanupFiles: () => void;
1990
+ };
1991
+
1992
+ type E2eeFileUploadProgress = {
1993
+ fileIndex: number;
1994
+ phase: 'generating_preview' | 'encrypting' | 'uploading' | 'completing';
1995
+ loaded: number;
1996
+ total: number;
1997
+ percentage: number;
1998
+ };
1999
+ declare function useE2eeFileUpload(channel: Channel$1 | null): {
2000
+ upload: (files: Blob[]) => Promise<{
2001
+ attachments: E2eeAttachmentManifest[];
2002
+ e2ee_attachment_ids: string[];
2003
+ }>;
2004
+ progress: E2eeFileUploadProgress | null;
2005
+ uploading: boolean;
2006
+ error: string | undefined;
2007
+ };
2008
+
2009
+ type E2eeAttachmentRenderState = {
2010
+ url?: string;
2011
+ blob?: Blob;
2012
+ loading: boolean;
2013
+ error?: string;
2014
+ progress?: E2eeAttachmentTransferProgress;
2015
+ load: () => Promise<string | undefined>;
2016
+ download: (filename?: string) => Promise<void>;
2017
+ streamUrl?: string;
2018
+ streamLoading: boolean;
2019
+ loadStream: () => Promise<string | undefined>;
2020
+ disposeStream: () => Promise<void>;
2021
+ revoke: () => void;
2022
+ };
2023
+ declare function useE2eeAttachmentRenderer(channel: Channel$1 | null, manifest?: E2eeAttachmentManifest, kind?: 'original' | 'preview'): E2eeAttachmentRenderState;
2024
+
2025
+ declare function usePendingE2eeSends(statuses?: string[]): {
2026
+ records: PendingE2eeSendRecord[];
2027
+ loading: boolean;
2028
+ refresh: () => Promise<void>;
2029
+ };
2030
+
2031
+ type UseEmojiPickerOptions = {
2032
+ editableRef: React.RefObject<HTMLDivElement | null>;
2033
+ setHasContent: (value: boolean) => void;
2034
+ };
2035
+ declare function useEmojiPicker({ editableRef, setHasContent }: UseEmojiPickerOptions): {
2036
+ emojiPickerOpen: boolean;
2037
+ handleEmojiSelect: (emoji: string) => void;
2038
+ handleEmojiClose: () => void;
2039
+ toggleEmojiPicker: () => void;
2040
+ };
2041
+
2042
+ type UseStickerPickerOptions = {
2043
+ activeChannel?: Channel$1 | null;
2044
+ stickerIframeUrl?: string;
2045
+ };
2046
+ declare function useStickerPicker({ activeChannel, stickerIframeUrl, }: UseStickerPickerOptions): {
2047
+ stickerPickerOpen: boolean;
2048
+ toggleStickerPicker: () => void;
2049
+ closeStickerPicker: () => void;
2050
+ handleStickerSend: (stickerUrl: string) => Promise<void>;
2051
+ };
2052
+
2053
+ declare const useChannelCapabilities: () => {
2054
+ isGroupChannel: boolean;
2055
+ isOwner: boolean;
2056
+ isModerator: boolean;
2057
+ isOwnerOrModerator: boolean;
2058
+ hasCapability: (cap: string) => boolean;
2059
+ role: any;
2060
+ capabilities: string[];
2061
+ };
2062
+
2063
+ declare const useChannelMembers: (channel: Channel$1 | null | undefined) => {
2064
+ members: Record<string, unknown>[];
2065
+ memberUpdateCount: number;
2066
+ };
2067
+ declare const useChannelProfile: (channel: Channel$1 | null | undefined) => {
2068
+ channelName: string;
2069
+ channelImage: string | undefined;
2070
+ channelDescription: string | undefined;
2071
+ isPinned: boolean;
1335
2072
  };
1336
2073
 
1337
2074
  /**
1338
2075
  * Avatar component with image or initial fallback.
1339
2076
  */
1340
- declare const Avatar: React$1.FC<AvatarProps>;
2077
+ declare const Avatar: React__default.FC<AvatarProps>;
1341
2078
 
1342
2079
  declare function computeDefaultActions(channel: Channel$1, currentUserId?: string, options?: {
1343
2080
  onAddTopic?: (channel: Channel$1) => void;
1344
2081
  onEditTopic?: (channel: Channel$1) => void;
1345
2082
  onToggleCloseTopic?: (channel: Channel$1, isClosed: boolean) => void;
2083
+ onDeleteTopic?: (channel: Channel$1) => void;
2084
+ onTruncateChannel?: (channel: Channel$1) => void;
1346
2085
  isBlocked?: boolean;
1347
2086
  actionLabels?: ChannelActionLabels;
1348
2087
  actionIcons?: ChannelActionIcons;
1349
2088
  }): ChannelAction[];
1350
- declare const DefaultChannelActions: React$1.FC<ChannelActionsProps>;
2089
+ declare const DefaultChannelActions: React__default.FC<ChannelActionsProps>;
1351
2090
 
1352
- declare const ChannelItem: React$1.FC<ChannelItemProps>;
1353
- declare const ChannelTopicGroup: React$1.MemoExoticComponent<({ channel, activeChannel, handleSelect, renderChannel, ChannelItemComponent, AvatarComponent, GeneralTopicAvatarComponent, TopicAvatarComponent, currentUserId, pendingBadgeLabel, blockedBadgeLabel, generalTopicLabel, closedTopicIcon, PinnedIconComponent, ChannelActionsComponent, onAddTopic, onEditTopic, onToggleCloseTopic, hiddenActions, actionLabels, actionIcons, }: any) => react_jsx_runtime.JSX.Element>;
1354
- declare const ChannelList: React$1.FC<ChannelListProps>;
2091
+ declare const ChannelItem: React__default.FC<ChannelItemProps>;
2092
+ declare const DefaultPinnedIcon: React__default.MemoExoticComponent<() => react_jsx_runtime.JSX.Element>;
2093
+ type ChannelRowProps = {
2094
+ channel: Channel$1;
2095
+ isActive: boolean;
2096
+ handleSelect: (c: Channel$1) => void;
2097
+ renderChannel?: (c: Channel$1, active: boolean) => React__default.ReactNode;
2098
+ ChannelItemComponent: React__default.ComponentType<ChannelItemProps>;
2099
+ AvatarComponent: React__default.ComponentType<any>;
2100
+ currentUserId?: string;
2101
+ pendingBadgeLabel?: string;
2102
+ blockedBadgeLabel?: string;
2103
+ closedTopicIcon?: React__default.ReactNode;
2104
+ PinnedIconComponent?: React__default.ComponentType;
2105
+ ChannelActionsComponent?: React__default.ComponentType<ChannelActionsProps>;
2106
+ onAddTopic?: (channel: Channel$1) => void;
2107
+ onEditTopic?: (channel: Channel$1) => void;
2108
+ onToggleCloseTopic?: (channel: Channel$1, isClosed: boolean) => void;
2109
+ onDeleteTopic?: (channel: Channel$1) => void;
2110
+ onTruncateChannel?: (channel: Channel$1) => void;
2111
+ hiddenActions?: string[];
2112
+ actionLabels?: ChannelActionLabels;
2113
+ actionIcons?: ChannelActionIcons;
2114
+ isOnline?: boolean;
2115
+ deletedMessageLabel?: React__default.ReactNode;
2116
+ stickerMessageLabel?: React__default.ReactNode;
2117
+ photoMessageLabel?: React__default.ReactNode;
2118
+ videoMessageLabel?: React__default.ReactNode;
2119
+ voiceRecordingMessageLabel?: React__default.ReactNode;
2120
+ fileMessageLabel?: React__default.ReactNode;
2121
+ encryptedMessageLabel?: React__default.ReactNode;
2122
+ encryptedMessageUnavailableLabel?: React__default.ReactNode;
2123
+ systemMessageTranslations?: SystemMessageTranslations;
2124
+ signalMessageTranslations?: SignalMessageTranslations;
2125
+ };
2126
+ declare const ChannelRow: React__default.FC<ChannelRowProps>;
2127
+ declare const ChannelList: React__default.FC<ChannelListProps>;
2128
+
2129
+ type FlatTopicGroupItemProps = {
2130
+ channel: Channel$1;
2131
+ isActive: boolean;
2132
+ onDrillDown?: (channel: Channel$1) => void;
2133
+ AvatarComponent: React__default.ComponentType<AvatarProps>;
2134
+ maxVisibleTopics?: number;
2135
+ moreTopicsLabel?: string;
2136
+ /** Label for the general pill (default: 'general') */
2137
+ generalTopicLabel?: string;
2138
+ TopicPillComponent?: React__default.ComponentType<TopicPillProps>;
2139
+ PinnedIconComponent?: React__default.ComponentType;
2140
+ ChannelActionsComponent?: React__default.ComponentType<ChannelActionsProps>;
2141
+ onAddTopic?: (channel: Channel$1) => void;
2142
+ onTruncateChannel?: (channel: Channel$1) => void;
2143
+ hiddenActions?: string[];
2144
+ actionLabels?: ChannelActionLabels;
2145
+ actionIcons?: ChannelActionIcons;
2146
+ deletedMessageLabel?: React__default.ReactNode;
2147
+ stickerMessageLabel?: React__default.ReactNode;
2148
+ photoMessageLabel?: React__default.ReactNode;
2149
+ videoMessageLabel?: React__default.ReactNode;
2150
+ voiceRecordingMessageLabel?: React__default.ReactNode;
2151
+ fileMessageLabel?: React__default.ReactNode;
2152
+ systemMessageTranslations?: SystemMessageTranslations;
2153
+ signalMessageTranslations?: SignalMessageTranslations;
2154
+ showTopicPills?: boolean;
2155
+ };
2156
+ declare const FlatTopicGroupItem: React__default.FC<FlatTopicGroupItemProps>;
2157
+
2158
+ declare const TopicList: React__default.FC<TopicListProps>;
1355
2159
 
1356
2160
  /**
1357
2161
  * Channel wrapper component.
@@ -1361,7 +2165,7 @@ declare const ChannelList: React$1.FC<ChannelListProps>;
1361
2165
  * Receives `{ channel, name, image }` as props.
1362
2166
  * - `EmptyStateIndicator` — custom component when no channel is selected.
1363
2167
  */
1364
- declare const Channel: React$1.FC<ChannelProps>;
2168
+ declare const Channel: React__default.FC<ChannelProps>;
1365
2169
 
1366
2170
  /**
1367
2171
  * ChannelHeader displays the active channel's avatar and name.
@@ -1377,40 +2181,25 @@ declare const Channel: React$1.FC<ChannelProps>;
1377
2181
  *
1378
2182
  * For a fully custom header, use `Channel`'s `HeaderComponent` prop instead.
1379
2183
  */
1380
- declare const ChannelHeader: React$1.FC<ChannelHeaderProps>;
2184
+ declare const ChannelHeader: React__default.FC<ChannelHeaderProps>;
1381
2185
 
1382
- declare const VirtualMessageList: React$1.FC<MessageListProps>;
2186
+ declare const VirtualMessageList: React__default.FC<MessageListProps>;
1383
2187
 
1384
- declare const PinnedMessages: React$1.FC<PinnedMessagesProps>;
2188
+ declare const PinnedMessages: React__default.FC<PinnedMessagesProps>;
1385
2189
 
1386
- declare const MessageItem: React$1.FC<MessageItemProps>;
1387
- declare const SystemMessageItem: React$1.FC<SystemMessageItemProps>;
2190
+ declare const MessageItem: React__default.FC<MessageItemProps>;
2191
+ declare const SystemMessageItem: React__default.FC<SystemMessageItemProps>;
1388
2192
 
1389
- declare const MessageActionsBox: React$1.FC<MessageActionsBoxProps>;
2193
+ declare const MessageActionsBox: React__default.FC<MessageActionsBoxProps>;
1390
2194
 
1391
2195
  /** Dispatch a global event to close all open dropdowns */
1392
2196
  declare const closeAllDropdowns: () => void;
1393
- interface DropdownProps {
1394
- /** Whether the dropdown is open */
1395
- isOpen: boolean;
1396
- /** Rect from getBoundingClientRect() of the anchor element */
1397
- anchorRect: DOMRect | null;
1398
- /** Callback when dropdown requests to close (e.g., click outside, scroll, Escape) */
1399
- onClose: () => void;
1400
- /** Dropdown menu content */
1401
- children: React$1.ReactNode;
1402
- /** Horizontal alignment relative to the anchor. Default: 'left' */
1403
- align?: 'left' | 'right';
1404
- /** Optional custom CSS class for the container */
1405
- className?: string;
1406
- /** Optional custom CSS style for the container */
1407
- style?: React$1.CSSProperties;
1408
- }
1409
- declare const Dropdown: React$1.FC<DropdownProps>;
1410
2197
 
1411
- declare const MessageReactions: React$1.FC<MessageReactionsProps>;
2198
+ declare const Dropdown: React__default.FC<DropdownProps>;
1412
2199
 
1413
- declare const MessageQuickReactions: React$1.FC<{
2200
+ declare const MessageReactions: React__default.FC<MessageReactionsProps>;
2201
+
2202
+ declare const MessageQuickReactions: React__default.FC<{
1414
2203
  message: FormatMessageResponse;
1415
2204
  isOwnMessage: boolean;
1416
2205
  disabled?: boolean;
@@ -1432,11 +2221,17 @@ type MessageActionList = {
1432
2221
  hasCapPin: boolean;
1433
2222
  hasCapReply: boolean;
1434
2223
  hasCapQuote: boolean;
2224
+ hasCapReact: boolean;
1435
2225
  };
1436
2226
  declare const useMessageActions: (message: FormatMessageResponse, isOwnMessage: boolean) => MessageActionList;
1437
2227
 
1438
2228
  /**
1439
- * Format a Date or date-string to a short time string (HH:MM).
2229
+ * Remove Vietnamese diacritics (accents) from a string.
2230
+ */
2231
+ declare function removeAccents(str: string): string;
2232
+ /**
2233
+ * Format a Date or date-string to a short time string (HH:MM, 24-hour).
2234
+ * Matches Telegram's compact time display.
1440
2235
  */
1441
2236
  declare function formatTime(date: Date | string | undefined): string;
1442
2237
  /**
@@ -1445,8 +2240,10 @@ declare function formatTime(date: Date | string | undefined): string;
1445
2240
  declare function getDateKey(date: Date | string | undefined): string;
1446
2241
  /**
1447
2242
  * Format a date into a human-friendly label (Today / Yesterday / full date).
2243
+ * When `locale` is provided, "Today" / "Yesterday" are localised via
2244
+ * `Intl.RelativeTimeFormat` and the full date uses that locale for formatting.
1448
2245
  */
1449
- declare function formatDateLabel(date: Date | string | undefined): string;
2246
+ declare function formatDateLabel(date: Date | string | undefined, locale?: string): string;
1450
2247
  /**
1451
2248
  * Get the user id from a message, checking multiple possible sources.
1452
2249
  */
@@ -1456,9 +2253,58 @@ declare function getMessageUserId(message: FormatMessageResponse): string;
1456
2253
  * Returns the formatted string.
1457
2254
  */
1458
2255
  declare function replaceMentionsForPreview(text: string, message: FormatMessageResponse | {
1459
- mentioned_users?: string[];
2256
+ mentioned_users?: any[];
1460
2257
  mentioned_all?: boolean;
1461
2258
  }, userMap: Record<string, string>, renderWrapper?: (userId: string, name: string) => string): string;
2259
+ /**
2260
+ * Common helper to build a dictionary of User ID -> Display Name
2261
+ * from the channel state, used for rendering Mentions and System logs.
2262
+ */
2263
+ declare function buildUserMap(channelState: any, extraUsers?: Record<string, any>): Record<string, string>;
2264
+ /**
2265
+ * Format a date string into a relative label:
2266
+ * "Today", "Yesterday", "Xd ago", or "Mon DD" / "Mon DD, YYYY".
2267
+ */
2268
+ declare function formatRelativeDate(dateStr: string): string;
2269
+ /**
2270
+ * Get a human-readable preview string for the last message,
2271
+ * handling regular, system, and signal message types.
2272
+ */
2273
+ declare function getLastMessagePreview(channel: Channel$1, myUserId?: string, options?: {
2274
+ deletedMessageLabel?: React__default.ReactNode;
2275
+ stickerMessageLabel?: React__default.ReactNode;
2276
+ photoMessageLabel?: React__default.ReactNode;
2277
+ videoMessageLabel?: React__default.ReactNode;
2278
+ voiceRecordingMessageLabel?: React__default.ReactNode;
2279
+ fileMessageLabel?: React__default.ReactNode;
2280
+ encryptedMessageLabel?: React__default.ReactNode;
2281
+ encryptedMessageUnavailableLabel?: React__default.ReactNode;
2282
+ systemMessageTranslations?: SystemMessageTranslations;
2283
+ signalMessageTranslations?: SignalMessageTranslations;
2284
+ }): {
2285
+ text: React__default.ReactNode;
2286
+ user: string;
2287
+ timestamp?: string | Date;
2288
+ };
2289
+ /**
2290
+ * Count the number of words in a string.
2291
+ * A word is defined as a non-empty sequence of characters separated by whitespace.
2292
+ */
2293
+ declare function countWords(str: string): number;
2294
+
2295
+ /**
2296
+ * Hash-based avatar color palette.
2297
+ *
2298
+ * Each user/channel is assigned a deterministic gradient based on
2299
+ * the hash of their name. This provides visual variety in the
2300
+ * channel list and improves readability over a single brand-color
2301
+ * fallback.
2302
+ */
2303
+ /**
2304
+ * Returns a CSS `linear-gradient(...)` string for a given name.
2305
+ * The same name always produces the same gradient (deterministic).
2306
+ */
2307
+ declare function getAvatarGradient(name?: string): string;
1462
2308
 
1463
2309
  /** Channel supports group features: roles, capabilities, settings, topics, edit, delete */
1464
2310
  declare function isGroupChannel(channel: Channel$1 | null | undefined): boolean;
@@ -1532,46 +2378,66 @@ declare function isVoiceRecordingAttachment(attachment: any): boolean;
1532
2378
  declare function isLinkPreviewAttachment(attachment: any): boolean;
1533
2379
  declare function isImage(attachment: any): boolean;
1534
2380
  declare function isVideo(attachment: any): boolean;
2381
+ declare const MESSAGE_DISPLAY_TYPES: {
2382
+ readonly NORMAL: "normal";
2383
+ readonly DELETED: "deleted";
2384
+ };
2385
+ type MessageDisplayType = (typeof MESSAGE_DISPLAY_TYPES)[keyof typeof MESSAGE_DISPLAY_TYPES] | string;
2386
+ /** Check if a message was deleted for current user (display_type === 'deleted') */
2387
+ declare function isDeletedDisplayMessage(message: any): boolean;
1535
2388
 
1536
- declare const MessageAttachment: React$1.FC<AttachmentProps>;
1537
- declare const AttachmentList: React$1.FC<{
1538
- attachments?: Attachment[];
2389
+ declare const MessageAttachment: React__default.FC<AttachmentProps>;
2390
+ declare const AttachmentList: React__default.FC<{
2391
+ attachments?: Array<Attachment | E2eeAttachmentManifest>;
2392
+ e2eeGrantReady?: boolean;
1539
2393
  }>;
1540
2394
  /** Regular message: text with @mentions + attachments */
1541
- declare const RegularMessage: React$1.FC<MessageRendererProps>;
2395
+ declare const RegularMessage: React__default.FC<MessageRendererProps>;
1542
2396
  /** System message: centered info text, parsed from raw format */
1543
- declare const SystemMessage: React$1.FC<MessageRendererProps>;
2397
+ declare const SystemMessage: React__default.FC<MessageRendererProps>;
1544
2398
  /** Signal message: call events */
1545
- declare const SignalMessage: React$1.FC<MessageRendererProps>;
2399
+ declare const SignalMessage: React__default.FC<MessageRendererProps>;
1546
2400
  /** Poll message */
1547
- declare const PollMessage: React$1.FC<MessageRendererProps>;
2401
+ declare const PollMessage: React__default.FC<MessageRendererProps>;
1548
2402
  /** Sticker message */
1549
- declare const StickerMessage: React$1.FC<MessageRendererProps>;
2403
+ declare const StickerMessage: React__default.FC<MessageRendererProps>;
1550
2404
  /** Error message */
1551
- declare const ErrorMessage: React$1.FC<MessageRendererProps>;
2405
+ declare const ErrorMessage: React__default.FC<MessageRendererProps>;
1552
2406
  /**
1553
2407
  * Map from MessageLabel → component.
1554
2408
  * Consumer can override individual renderers via the `messageRenderers` prop.
1555
2409
  */
1556
- declare const defaultMessageRenderers: Record<MessageLabel, React$1.ComponentType<MessageRendererProps>>;
2410
+ declare const defaultMessageRenderers: Record<MessageLabel, React__default.ComponentType<MessageRendererProps>>;
1557
2411
 
1558
2412
  /**
1559
2413
  * MediaLightbox – full-screen overlay for viewing images & videos.
1560
2414
  * Supports prev/next navigation, keyboard controls, and image zoom.
1561
2415
  * Renders via React portal into document.body.
1562
2416
  */
1563
- declare const MediaLightbox: React$1.FC<MediaLightboxProps>;
2417
+ declare const MediaLightbox: React__default.FC<MediaLightboxProps>;
1564
2418
 
1565
- declare const MessageInput: React$1.FC<MessageInputProps>;
2419
+ declare const MessageInput: React__default.FC<MessageInputProps>;
1566
2420
 
1567
2421
  /**
1568
2422
  * FilesPreview — renders selected files with thumbnails and remove buttons.
1569
2423
  * Shown above the text input area in MessageInput.
1570
2424
  */
1571
- declare const FilesPreview: React$1.FC<FilesPreviewProps>;
2425
+ declare const FilesPreview: React__default.FC<FilesPreviewProps>;
2426
+
2427
+ declare const MentionSuggestions: React__default.FC<MentionSuggestionsProps>;
2428
+
2429
+ declare const EditPreview: React__default.FC<{
2430
+ message: FormatMessageResponse;
2431
+ onDismiss: () => void;
2432
+ editingMessageLabel?: string;
2433
+ }>;
1572
2434
 
1573
- declare const MentionSuggestions: React$1.FC<MentionSuggestionsProps>;
2435
+ declare const PreviewOverlay: React__default.FC<PreviewOverlayProps>;
1574
2436
 
2437
+ /**
2438
+ * Returns the raw HTML string for a mention span, useful for initializing contenteditable divs.
2439
+ */
2440
+ declare function getMentionHtml(userId: string, displayName: string): string;
1575
2441
  declare function useMentions({ members, currentUserId, editableRef, }: UseMentionsOptions): UseMentionsReturn;
1576
2442
 
1577
2443
  type UseScrollToMessageOptions = {
@@ -1599,6 +2465,8 @@ type UseLoadMessagesOptions = {
1599
2465
  messagesRef: React.MutableRefObject<FormatMessageResponse[]>;
1600
2466
  /** Shared guard ref — skip scroll-triggered loads during jump transitions */
1601
2467
  jumpingRef: React.MutableRefObject<boolean>;
2468
+ /** Blocks scroll-triggered pagination while auto-following appended messages. */
2469
+ scrollLoadLockRef?: React.MutableRefObject<boolean>;
1602
2470
  loadMoreLimit?: number;
1603
2471
  };
1604
2472
  type UseLoadMessagesReturn = {
@@ -1617,31 +2485,107 @@ type UseLoadMessagesReturn = {
1617
2485
  handleScroll: (offset: number) => void;
1618
2486
  isAtBottomRef: React.MutableRefObject<boolean>;
1619
2487
  };
1620
- declare function useLoadMessages({ vlistRef, messagesRef, jumpingRef, loadMoreLimit, }: UseLoadMessagesOptions): UseLoadMessagesReturn;
2488
+ declare function useLoadMessages({ vlistRef, messagesRef, jumpingRef, scrollLoadLockRef, loadMoreLimit, }: UseLoadMessagesOptions): UseLoadMessagesReturn;
1621
2489
 
1622
2490
  type UseChannelMessagesOptions = {
1623
2491
  scrollToBottom: (smooth: boolean) => void;
2492
+ /** Reads the live virtual-list metrics to decide whether the viewport is near the bottom. */
2493
+ isNearBottom?: () => boolean;
2494
+ /** Temporarily blocks scroll-triggered pagination while auto-following new messages. */
2495
+ holdScrollLoadLock?: (duration?: number) => void;
1624
2496
  /** Shared guard ref — blocks scroll-triggered loads during channel switch */
1625
2497
  jumpingRef: React.MutableRefObject<boolean>;
1626
2498
  isAtBottomRef: React.MutableRefObject<boolean>;
1627
2499
  /** Called to reset load-more state when channel switches */
1628
2500
  onChannelSwitch?: () => void;
2501
+ /** Whether to include hidden (deleted) messages in the initial channel query */
2502
+ includeHiddenMessages?: boolean;
2503
+ /** Ref to the message list container for smooth opacity transitions */
2504
+ containerRef?: React.RefObject<HTMLDivElement>;
1629
2505
  };
2506
+ declare const markChannelAsFullyQueried: (cid: string) => Set<string>;
1630
2507
  /**
1631
2508
  * Subscribes to channel message events and handles:
1632
2509
  * - message.new → sync + scroll to bottom
1633
2510
  * - message.updated / message.deleted → sync only
1634
2511
  * - Channel switch → reset state + scroll to bottom
1635
2512
  */
1636
- declare function useChannelMessages({ scrollToBottom, jumpingRef, isAtBottomRef, onChannelSwitch, }: UseChannelMessagesOptions): void;
2513
+ declare function useChannelMessages({ scrollToBottom, isNearBottom, holdScrollLoadLock, jumpingRef, isAtBottomRef, onChannelSwitch, includeHiddenMessages, containerRef, }: UseChannelMessagesOptions): void;
1637
2514
 
1638
- declare const QuotedMessagePreview: React$1.FC<QuotedMessagePreviewProps>;
2515
+ declare function useForwardMessage(message: FormatMessageResponse, onDismiss: () => void): {
2516
+ search: string;
2517
+ setSearch: React$1.Dispatch<React$1.SetStateAction<string>>;
2518
+ selectedChannels: Set<string>;
2519
+ toggleChannel: (channel: Channel$1) => void;
2520
+ sending: boolean;
2521
+ results: {
2522
+ success: string[];
2523
+ failed: string[];
2524
+ } | null;
2525
+ setResults: React$1.Dispatch<React$1.SetStateAction<{
2526
+ success: string[];
2527
+ failed: string[];
2528
+ } | null>>;
2529
+ filteredChannels: Channel$1<_ermis_network_ermis_chat_sdk.DefaultGenerics>[];
2530
+ handleSend: () => Promise<void>;
2531
+ };
1639
2532
 
1640
- declare const ReplyPreview: React$1.FC<ReplyPreviewProps>;
2533
+ type RecoveryPinStatus = 'idle' | 'working' | 'ready' | 'locked' | 'error';
2534
+ type RecoveryStatusInfo = {
2535
+ hasVault: boolean;
2536
+ unlocked: boolean;
2537
+ hasIncompleteRestore: boolean;
2538
+ incompleteChannels: string[];
2539
+ channelsWithPermanentGaps: string[];
2540
+ restoreProgressWithIssues: RestoreProgressRecord[];
2541
+ e2eeBootstrapRunning?: boolean;
2542
+ e2eeBootstrapCompleted?: number;
2543
+ e2eeBootstrapTotal?: number;
2544
+ };
2545
+ type RecoveryRestoredMessage = {
2546
+ epoch: number;
2547
+ messageId?: string;
2548
+ plaintext?: unknown;
2549
+ source?: 'archive';
2550
+ createdAt?: string;
2551
+ gap?: boolean;
2552
+ reason?: string;
2553
+ };
2554
+ type UseRecoveryPinReturn = {
2555
+ status: RecoveryPinStatus;
2556
+ error: Error | null;
2557
+ hasRecoveryKey: boolean;
2558
+ recoveryStatus: RecoveryStatusInfo | null;
2559
+ setupRecoveryPin: (pin: string) => Promise<void>;
2560
+ unlockRecoveryVault: (pin: string) => Promise<void>;
2561
+ changeRecoveryPin: (oldPin: string, newPin: string) => Promise<void>;
2562
+ changeUnlockedRecoveryPin: (newPin: string) => Promise<void>;
2563
+ repairRecoveryChannel: (channelType: string, channelId: string, options?: {
2564
+ mode?: RepairMode;
2565
+ }) => Promise<RepairResult>;
2566
+ repairEncryptedChannel: (channelType: string, channelId: string, options?: {
2567
+ mode?: EncryptedChannelRepairMode;
2568
+ }) => Promise<EncryptedChannelRepairResult>;
2569
+ enqueueRestore: (channelType: string, channelId: string, priority?: 'active' | 'background', options?: {
2570
+ fromEpoch?: number;
2571
+ toEpoch?: number;
2572
+ }) => void;
2573
+ loadRestoreProgress: (channelType: string, channelId: string) => Promise<RestoreProgressRecord | null>;
2574
+ restoreHistoricalMessages: (channelType: string, channelId: string, options?: {
2575
+ fromEpoch?: number;
2576
+ toEpoch?: number;
2577
+ }) => Promise<RecoveryRestoredMessage[]>;
2578
+ refresh: () => void;
2579
+ };
2580
+ declare const useRecoveryPin: () => UseRecoveryPinReturn;
1641
2581
 
1642
- declare const ForwardMessageModal: React$1.FC<ForwardMessageModalProps>;
2582
+ declare const QuotedMessagePreview: React__default.FC<QuotedMessagePreviewProps>;
1643
2583
 
1644
- declare const TopicModal: React$1.FC<TopicModalProps>;
2584
+ declare const ReplyPreview: React__default.FC<ReplyPreviewProps>;
2585
+
2586
+ declare const ForwardMessageModal: React__default.FC<ForwardMessageModalProps>;
2587
+
2588
+ declare const TopicModal: React__default.FC<TopicModalProps>;
1645
2589
 
1646
2590
  type TypingUser = {
1647
2591
  id: string;
@@ -1659,48 +2603,132 @@ declare function useTypingIndicator(): {
1659
2603
  };
1660
2604
 
1661
2605
  type TypingIndicatorProps = {
1662
- /** Custom render function for the typing text */
1663
- renderText?: (users: TypingUser[]) => React$1.ReactNode;
2606
+ /** Custom render function for the typing text (I18n) */
2607
+ typingIndicatorLabel?: (users: TypingUser[]) => string;
2608
+ /** Custom render function for the typing text (JSX) */
2609
+ renderText?: (users: TypingUser[]) => React__default.ReactNode;
1664
2610
  };
1665
2611
  /**
1666
2612
  * Displays a "X is typing..." indicator below the message list.
1667
2613
  * Automatically subscribes to typing events via the useTypingIndicator hook.
1668
2614
  */
1669
- declare const TypingIndicator: React$1.FC<TypingIndicatorProps>;
2615
+ declare const TypingIndicator: React__default.FC<TypingIndicatorProps>;
1670
2616
 
1671
- declare const DefaultChannelInfoHeader: React$1.FC<ChannelInfoHeaderProps>;
1672
- declare const DefaultChannelInfoCover: React$1.FC<ChannelInfoCoverProps>;
1673
- declare const DefaultChannelInfoActions: React$1.FC<ChannelInfoActionsProps>;
1674
- declare const ChannelInfo: React$1.FC<ChannelInfoProps>;
2617
+ declare const DefaultChannelInfoHeader: React__default.FC<ChannelInfoHeaderProps>;
2618
+ declare const DefaultChannelInfoCover: React__default.FC<ChannelInfoCoverProps>;
2619
+ declare const DefaultChannelInfoActions: React__default.FC<ChannelInfoActionsProps>;
2620
+ declare const ChannelInfo: React__default.FC<ChannelInfoProps>;
1675
2621
 
1676
- declare const DefaultChannelInfoTabs: React$1.FC<ChannelInfoTabsProps>;
2622
+ declare const DefaultChannelInfoTabs: React__default.FC<ChannelInfoTabsProps>;
1677
2623
 
1678
- declare const Modal: React$1.FC<ModalProps>;
2624
+ declare const HighlightedText: React__default.FC<{
2625
+ text: string;
2626
+ term: string;
2627
+ }>;
2628
+ declare const MessageSearchPanel: React__default.FC<MessageSearchPanelProps>;
1679
2629
 
1680
- type PanelProps = {
1681
- /** Whether the panel is visible */
2630
+ type UseMessageSearchProps = {
2631
+ channel: Channel$1;
1682
2632
  isOpen: boolean;
1683
- /** Called when user clicks the back button */
1684
- onClose: () => void;
1685
- /** Panel title shown in the header */
1686
- title?: string;
1687
- /** Panel body content */
1688
- children: React$1.ReactNode;
1689
- /** Optional header content (replaces default title + back button) */
1690
- headerContent?: React$1.ReactNode;
1691
- /** Additional CSS class name */
1692
- className?: string;
2633
+ debounceMs?: number;
2634
+ };
2635
+ declare const useMessageSearch: ({ channel, isOpen, debounceMs }: UseMessageSearchProps) => {
2636
+ query: string;
2637
+ setQuery: React$1.Dispatch<React$1.SetStateAction<string>>;
2638
+ results: SearchResultMessage[];
2639
+ loading: boolean;
2640
+ hasMore: boolean;
2641
+ loadingMore: boolean;
2642
+ handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
2643
+ handleScroll: (e: React.UIEvent<HTMLElement>) => void;
2644
+ resetSearch: () => void;
2645
+ userMaps: {
2646
+ original: Record<string, string>;
2647
+ lower: Record<string, string>;
2648
+ };
2649
+ };
2650
+
2651
+ declare const ChannelSettingsPanel: React__default.FC<ChannelSettingsPanelProps>;
2652
+
2653
+ interface UseChannelSettingsOptions {
2654
+ channel: Channel$1 | undefined;
2655
+ isOpen?: boolean;
2656
+ onClose?: () => void;
2657
+ currentUserRole?: string;
2658
+ }
2659
+ declare const useChannelSettings: ({ channel, isOpen, onClose, currentUserRole }: UseChannelSettingsOptions) => {
2660
+ slowMode: number;
2661
+ setSlowMode: React$1.Dispatch<React$1.SetStateAction<number>>;
2662
+ topicsEnabled: boolean;
2663
+ setTopicsEnabled: React$1.Dispatch<React$1.SetStateAction<boolean>>;
2664
+ capabilities: Record<string, boolean>;
2665
+ toggleCapability: (key: string) => void;
2666
+ keywords: string[];
2667
+ newKeyword: string;
2668
+ setNewKeyword: React$1.Dispatch<React$1.SetStateAction<string>>;
2669
+ handleAddNewKeyword: () => void;
2670
+ handleRemoveKeyword: (kw: string) => void;
2671
+ isSaving: boolean;
2672
+ error: string | null;
2673
+ isDirty: boolean;
2674
+ isOwner: boolean;
2675
+ handleSave: () => Promise<void>;
1693
2676
  };
2677
+
2678
+ declare const Modal: React__default.FC<ModalProps>;
2679
+
1694
2680
  /**
1695
2681
  * Reusable sliding panel component.
1696
2682
  * Slides in from the right to overlay itself on whatever container it's placed in.
1697
2683
  * Use it like a Modal but inside a sidebar — call `isOpen` to show/hide.
1698
2684
  */
1699
- declare const Panel: React$1.FC<PanelProps>;
2685
+ declare const Panel: React__default.FC<PanelProps>;
1700
2686
 
1701
- declare const UserPicker: React$1.FC<UserPickerProps>;
2687
+ declare const UserPicker: React__default.FC<UserPickerProps>;
1702
2688
 
1703
- declare const CreateChannelModal: React$1.FC<CreateChannelModalProps>;
2689
+ declare const CreateChannelModal: React__default.FC<CreateChannelModalProps>;
2690
+
2691
+ type RecoveryPinSetupProps = {
2692
+ onComplete?: () => void;
2693
+ minDigits?: number;
2694
+ };
2695
+ type RecoveryPinRestoreProps = {
2696
+ onComplete?: () => void;
2697
+ };
2698
+ type RecoveryPinChangeProps = {
2699
+ onComplete?: () => void;
2700
+ minDigits?: number;
2701
+ };
2702
+ type RecoveryStatusProps = {
2703
+ status?: RecoveryPinStatus;
2704
+ hasRecoveryKey?: boolean;
2705
+ className?: string;
2706
+ };
2707
+ type RecoveryGapProps = {
2708
+ epoch?: number;
2709
+ reason: string;
2710
+ className?: string;
2711
+ };
2712
+ type RecoveryGateProps = {
2713
+ onSkip?: () => void;
2714
+ className?: string;
2715
+ };
2716
+ type RecoveryRestoreProgressProps = {
2717
+ restoredEpochs: number;
2718
+ totalEpochs: number;
2719
+ gaps?: Array<{
2720
+ epoch?: number;
2721
+ reason: string;
2722
+ }>;
2723
+ className?: string;
2724
+ };
2725
+ declare const RecoveryPinSetup: React__default.FC<RecoveryPinSetupProps>;
2726
+ declare const RecoveryPinRestore: React__default.FC<RecoveryPinRestoreProps>;
2727
+ declare const RecoveryPinChange: React__default.FC<RecoveryPinChangeProps>;
2728
+ declare const RecoveryStatus: React__default.FC<RecoveryStatusProps>;
2729
+ declare const RecoveryGap: React__default.FC<RecoveryGapProps>;
2730
+ declare const RecoveryGate: React__default.FC<RecoveryGateProps>;
2731
+ declare const RecoveryRestoreProgress: React__default.FC<RecoveryRestoreProgressProps>;
1704
2732
 
1705
2733
  type CallContextValue = {
1706
2734
  callNode: ErmisCallNode | null;
@@ -1733,13 +2761,17 @@ type CallContextValue = {
1733
2761
  isRemoteVideoMuted: boolean;
1734
2762
  upgradeCall: () => Promise<void>;
1735
2763
  callDuration: number;
2764
+ isAccepting: boolean;
2765
+ isRejecting: boolean;
2766
+ isEnding: boolean;
2767
+ resetCall: () => void;
1736
2768
  };
1737
- declare const ErmisCallContext: React$1.Context<CallContextValue | undefined>;
2769
+ declare const ErmisCallContext: React__default.Context<CallContextValue | undefined>;
1738
2770
 
1739
2771
  declare const useCallContext: () => CallContextValue;
1740
2772
 
1741
- declare const ErmisCallProvider: React$1.FC<ErmisCallProviderProps>;
2773
+ declare const ErmisCallProvider: React__default.FC<ErmisCallProviderProps>;
1742
2774
 
1743
- declare const ErmisCallUI: React$1.FC<ErmisCallUIProps>;
2775
+ declare const ErmisCallUI: React__default.FC<ErmisCallUIProps>;
1744
2776
 
1745
- export { ATTACHMENT_TYPES, type AddMemberButtonProps, type AddMemberModalProps, type AddMemberUserItemProps, type AttachButtonProps, type AttachmentItem, AttachmentList, type AttachmentProps, type AttachmentType, Avatar, type AvatarProps, CHANNEL_ROLES, type CallContextValue, Channel, type ChannelAction, type ChannelActionsProps, ChannelHeader, type ChannelHeaderData, type ChannelHeaderProps, ChannelInfo, type ChannelInfoActionsProps, type ChannelInfoCoverProps, type ChannelInfoEmptyStateProps, type ChannelInfoFileItemProps, type ChannelInfoHeaderProps, type ChannelInfoLinkItemProps, type ChannelInfoMediaItemProps, type ChannelInfoMemberItemProps, type ChannelInfoProps, type ChannelInfoTabsProps, ChannelItem, type ChannelItemProps, ChannelList, type ChannelListProps, type ChannelProps, type ChannelRole, ChannelTopicGroup, type ChatContextValue, ChatProvider, type ChatProviderProps, CreateChannelModal, type CreateChannelModalProps, type DateSeparatorProps, DefaultChannelActions, DefaultChannelInfoActions, DefaultChannelInfoCover, DefaultChannelInfoHeader, DefaultChannelInfoTabs, Dropdown, type DropdownProps, type EmojiButtonProps, type EmojiPickerProps, type ErmisCallConnectedAudioProps, type ErmisCallConnectedVideoProps, ErmisCallContext, type ErmisCallControlsBarProps, type ErmisCallErrorProps, ErmisCallProvider, type ErmisCallProviderProps, type ErmisCallRingingProps, ErmisCallUI, type ErmisCallUIProps, ErrorMessage, type FilePreviewItem, FilesPreview, type FilesPreviewProps, type ForwardChannelItemProps, ForwardMessageModal, type ForwardMessageModalProps, type JumpToLatestProps, type LatestReaction, MESSAGE_TYPES, MediaLightbox, type MediaLightboxItem, type MediaLightboxProps, type MediaTab, type MentionMember, type MentionPayload, MentionSuggestions, type MentionSuggestionsProps, MessageActionsBox, type MessageActionsBoxProps, MessageAttachment, type MessageBubbleProps, MessageInput, type MessageInputProps, MessageItem, type MessageItemProps, type MessageListProps, MessageQuickReactions, MessageReactions, type MessageReactionsProps, type MessageRendererProps, type MessageType, Modal, type ModalProps, type OnlineStatus, Panel, type PinnedMessageItemProps, PinnedMessages, type PinnedMessagesProps, PollMessage, QuotedMessagePreview, type QuotedMessagePreviewProps, type ReactionUser, RegularMessage, ReplyPreview, type ReplyPreviewProps, type SendButtonProps, SignalMessage, StickerMessage, SystemMessage, SystemMessageItem, type SystemMessageItemProps, type Theme, TopicModal, TypingIndicator, type TypingIndicatorProps, type TypingUser, type UseChannelMessagesOptions, type UseChannelReturn, type UseLoadMessagesOptions, type UseLoadMessagesReturn, type UseMentionsOptions, type UseMentionsReturn, type UseScrollToMessageOptions, type UseScrollToMessageReturn, UserPicker, type UserPickerItemProps, type UserPickerProps, type UserPickerSelectedBoxProps, type UserPickerUser, VirtualMessageList, canBanTargetMember, canDemoteTargetMember, canManageChannel, canPromoteTargetMember, canRemoveTargetMember, closeAllDropdowns, computeDefaultActions, dedupMessages, defaultMessageRenderers, formatDateLabel, formatTime, getDateKey, getMessageUserId, hasTopicsEnabled, isDirectChannel, isFriendChannel, isGeneralProxy, isGroupChannel, isImage, isImageAttachment, isLinkPreviewAttachment, isOwnerMember, isPendingMember, isPublicGroupChannel, isRegularMessage, isSignalMessage, isSkippedMember, isStickerMessage, isSystemMessage, isTopicChannel, isVideo, isVideoAttachment, isVoiceRecordingAttachment, replaceMentionsForPreview, supportsBlocking, useBannedState, useBlockedState, useCallContext, useChannel, useChannelListUpdates, useChannelMessages, useChannelRowUpdates, useChatClient, useLoadMessages, useMentions, useMessageActions, useOnlineStatus, useOnlineUsers, usePendingState, useScrollToMessage, useTypingIndicator };
2777
+ export { ATTACHMENT_TYPES, type AddMemberButtonProps, type AddMemberModalProps, type AddMemberUserItemProps, type AttachButtonProps, type AttachmentItem, AttachmentList, type AttachmentProps, type AttachmentType, Avatar, type AvatarProps, CHANNEL_ROLES, type CallContextValue, Channel, type ChannelAction, type ChannelActionsProps, ChannelHeader, type ChannelHeaderData, type ChannelHeaderProps, ChannelInfo, type ChannelInfoActionsProps, type ChannelInfoCoverProps, type ChannelInfoEmptyStateProps, type ChannelInfoFileItemProps, type ChannelInfoHeaderProps, type ChannelInfoLinkItemProps, type ChannelInfoMediaItemProps, type ChannelInfoMemberItemProps, type ChannelInfoProps, type ChannelInfoTabHeaderProps, type ChannelInfoTabsProps, ChannelItem, type ChannelItemProps, ChannelList, type ChannelListProps, type ChannelProps, type ChannelRole, ChannelRow, ChannelSettingsPanel, type ChannelSettingsPanelProps, type ChatContextValue, ChatProvider, type ChatProviderProps, CreateChannelModal, type CreateChannelModalProps, type DateSeparatorProps, DefaultChannelActions, DefaultChannelInfoActions, DefaultChannelInfoCover, DefaultChannelInfoHeader, DefaultChannelInfoTabs, DefaultPinnedIcon, Dropdown, type DropdownProps, type EditChannelData, type EditChannelModalProps, EditPreview, type EmojiButtonProps, type EmojiPickerProps, type ErmisCallConnectedAudioProps, type ErmisCallConnectedVideoProps, ErmisCallContext, type ErmisCallControlsBarProps, type ErmisCallErrorProps, ErmisCallProvider, type ErmisCallProviderProps, type ErmisCallRingingProps, ErmisCallUI, type ErmisCallUIProps, ErrorMessage, type FilePreviewItem, FilesPreview, type FilesPreviewProps, FlatTopicGroupItem, type ForwardChannelItemProps, ForwardMessageModal, type ForwardMessageModalProps, HighlightedText, type JumpToLatestProps, type LatestReaction, MESSAGE_DISPLAY_TYPES, MESSAGE_TYPES, MediaLightbox, type MediaLightboxItem, type MediaLightboxProps, type MediaTab, type MentionMember, type MentionPayload, MentionSuggestions, type MentionSuggestionsProps, MessageActionsBox, type MessageActionsBoxProps, MessageAttachment, type MessageBubbleProps, type MessageDisplayType, MessageInput, type MessageInputProps, MessageItem, type MessageItemProps, type MessageListProps, MessageQuickReactions, MessageReactions, type MessageReactionsProps, type MessageRendererProps, MessageSearchPanel, type MessageSearchPanelProps, type MessageType, Modal, type ModalProps, type OnlineStatus, Panel, type PinnedMessageItemProps, PinnedMessages, type PinnedMessagesProps, PollMessage, PreviewOverlay, QuotedMessagePreview, type QuotedMessagePreviewProps, type ReactionUser, RecoveryGap, type RecoveryGapProps, RecoveryGate, type RecoveryGateProps, RecoveryPinChange, type RecoveryPinChangeProps, RecoveryPinRestore, type RecoveryPinRestoreProps, RecoveryPinSetup, type RecoveryPinSetupProps, type RecoveryPinStatus, RecoveryRestoreProgress, type RecoveryRestoreProgressProps, type RecoveryRestoredMessage, RecoveryStatus, type RecoveryStatusInfo, type RecoveryStatusProps, RegularMessage, ReplyPreview, type ReplyPreviewProps, type SendButtonProps, SignalMessage, StickerMessage, SystemMessage, SystemMessageItem, type SystemMessageItemProps, type Theme, TopicList, type TopicListProps, TopicModal, type TopicModalProps, type TopicPillProps, TypingIndicator, type TypingIndicatorProps, type TypingUser, type UseChannelMessagesOptions, type UseChannelReturn, type UseLoadMessagesOptions, type UseLoadMessagesReturn, type UseMentionsOptions, type UseMentionsReturn, type UseRecoveryPinReturn, type UseScrollToMessageOptions, type UseScrollToMessageReturn, type UseStickerPickerOptions, UserPicker, type UserPickerItemProps, type UserPickerProps, type UserPickerSelectedBoxProps, type UserPickerUser, VirtualMessageList, buildUserMap, canBanTargetMember, canDemoteTargetMember, canManageChannel, canPromoteTargetMember, canRemoveTargetMember, closeAllDropdowns, computeDefaultActions, countWords, dedupMessages, defaultMessageRenderers, formatDateLabel, formatRelativeDate, formatTime, getAvatarGradient, getDateKey, getLastMessagePreview, getMentionHtml, getMessageUserId, hasTopicsEnabled, isDeletedDisplayMessage, isDirectChannel, isFriendChannel, isGeneralProxy, isGroupChannel, isImage, isImageAttachment, isLinkPreviewAttachment, isOwnerMember, isPendingMember, isPublicGroupChannel, isRegularMessage, isSignalMessage, isSkippedMember, isStickerMessage, isSystemMessage, isTopicChannel, isVideo, isVideoAttachment, isVoiceRecordingAttachment, markChannelAsFullyQueried, removeAccents, replaceMentionsForPreview, supportsBlocking, useBannedState, useBlockedState, useCallContext, useChannel, useChannelCapabilities, useChannelListUpdates, useChannelMembers, useChannelMessages, useChannelProfile, useChannelRowUpdates, useChannelSettings, useChatClient, useChatUser, useContactChannels, useContactCount, useDragAndDrop, useE2eeAttachmentRenderer, useE2eeFileUpload, useEmojiPicker, useFileUpload, useForwardMessage, useInviteChannels, useInviteCount, useLoadMessages, useMentions, useMessageActions, useMessageSearch, useMessageSend, useOnlineStatus, useOnlineUsers, usePendingE2eeSends, usePendingState, usePreviewState, useRecoveryPin, useScrollToMessage, useStickerPicker, useTopicGroupUpdates, useTypingIndicator };