@bcc-code/vue-bcc-chat-ui 7.3.3 → 7.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -15,11 +15,6 @@ import { User } from '@cometchat/chat-sdk-javascript';
15
15
  import { WritableComputedRef } from 'vue';
16
16
 
17
17
  declare const __VLS_base: DefineComponent<__VLS_Props, {
18
- applyComposerFormat: typeof applyComposerFormat;
19
- applyComposerLink: typeof applyComposerLink;
20
- cancelComposerLink: typeof cancelComposerLink;
21
- getComposerSelection: typeof getComposerSelection;
22
- requestComposerLink: typeof requestComposerLink;
23
18
  initiateDirectMessage: typeof initiateDirectMessage_2;
24
19
  scrollToMessage: typeof scrollToMessage_2;
25
20
  groupMembers: ComputedRef<{
@@ -32,56 +27,37 @@ declare const __VLS_base: DefineComponent<__VLS_Props, {
32
27
  }[]>;
33
28
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
34
29
  chatNotAMember: (chatUid: string) => any;
35
- composerSelectionChange: (selection: ChatComposerSelectionState | null) => any;
36
- composerLinkRequest: (selection: ChatComposerSelectionState) => any;
37
30
  chatMembersFetched: (members: ParticipantInfo[]) => any;
38
31
  chatEmpty: () => any;
39
32
  linkClicked: (event: MouseEvent, url: string) => any;
40
33
  }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
41
34
  onChatNotAMember?: ((chatUid: string) => any) | undefined;
42
- onComposerSelectionChange?: ((selection: ChatComposerSelectionState | null) => any) | undefined;
43
- onComposerLinkRequest?: ((selection: ChatComposerSelectionState) => any) | undefined;
44
35
  onChatMembersFetched?: ((members: ParticipantInfo[]) => any) | undefined;
45
36
  onChatEmpty?: (() => any) | undefined;
46
37
  onLinkClicked?: ((event: MouseEvent, url: string) => any) | undefined;
47
38
  }>, {
48
39
  chatUid: string;
40
+ showHeader: boolean;
49
41
  hideGroupActions: boolean;
50
42
  client: ChatClient | null;
51
43
  isReadOnly: boolean;
52
44
  initialScheduledMessagesOpen: boolean;
53
45
  hideDeletedMessages: boolean;
54
- displayNoMessagesText: boolean;
55
- showMessageHeader: boolean;
56
- composerFormattingMode: ComposerFormattingMode;
57
46
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
58
47
 
59
48
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
60
49
 
61
50
  declare type __VLS_Props = {
62
51
  client?: ChatClient | null;
63
- conversation?: ChatConversationItem | null;
64
- messages?: ChatMessageItem[];
65
- threadMessages?: ChatMessageItem[];
66
- loadingMessages?: boolean;
67
- loadingThreadMessages?: boolean;
68
52
  isReadOnly?: boolean;
69
- sendOptions?: MessageSendOptions;
70
- showDefaultEmptyState?: boolean;
71
53
  initialScheduledMessagesOpen?: boolean;
72
54
  chatUid?: string;
73
- senderDisplayName?: string;
74
55
  hideDeletedMessages?: boolean;
75
56
  hideGroupActions?: boolean;
76
- chatMessageGetter?: ChatMessagesGetter;
77
- displayNoMessagesText?: boolean;
78
- language?: Language;
79
57
  showHeader?: boolean;
80
- showMessageHeader?: boolean;
81
58
  containerClass?: string;
82
59
  actionMessageClass?: string;
83
60
  actionMessageRowClass?: string;
84
- composerFormattingMode?: ComposerFormattingMode;
85
61
  };
86
62
 
87
63
  declare type __VLS_Slots = {} & {
@@ -89,9 +65,9 @@ declare type __VLS_Slots = {} & {
89
65
  } & {
90
66
  'message-header'?: (props: typeof __VLS_23) => any;
91
67
  } & {
92
- 'no-messages'?: (props: typeof __VLS_102) => any;
68
+ 'no-messages'?: (props: typeof __VLS_96) => any;
93
69
  } & {
94
- 'not-a-member'?: (props: typeof __VLS_105) => any;
70
+ 'not-a-member'?: (props: typeof __VLS_99) => any;
95
71
  };
96
72
 
97
73
  declare type __VLS_WithSlots<T, S> = T & {
@@ -100,24 +76,12 @@ declare type __VLS_WithSlots<T, S> = T & {
100
76
  };
101
77
  };
102
78
 
103
- declare function applyComposerFormat(command: ComposerFormatCommand, target?: ChatComposerTarget): boolean;
104
-
105
- declare function applyComposerLink(url: string, target?: ChatComposerTarget): boolean;
106
-
107
79
  export declare interface AttachmentUploadInput {
108
80
  file: File;
109
81
  caption?: string;
110
82
  }
111
83
 
112
- export declare interface BccChatComposerFormattingHandle {
113
- applyComposerFormat(command: ComposerFormatCommand, target?: ChatComposerTarget): boolean;
114
- requestComposerLink(target?: ChatComposerTarget): boolean;
115
- applyComposerLink(url: string, target?: ChatComposerTarget): boolean;
116
- cancelComposerLink(target?: ChatComposerTarget): void;
117
- getComposerSelection(target?: ChatComposerTarget): ChatComposerSelectionState | null;
118
- }
119
-
120
- export declare interface BccChatExpose extends BccChatComposerFormattingHandle {
84
+ export declare interface BccChatExpose {
121
85
  scrollToMessage(messageId: string): Promise<void>;
122
86
  initiateDirectMessage(userUid: string): Promise<ChatConversationItem>;
123
87
  readonly groupMembers: ParticipantInfo[];
@@ -135,11 +99,23 @@ export declare interface CachedParticipantSettings {
135
99
  lastUpdated: number;
136
100
  }
137
101
 
138
- declare function cancelComposerLink(target?: ChatComposerTarget): void;
102
+ /** Why the last call session ended for the current user. */
103
+ export declare type CallEndReason = "ended" | "left" | "timed-out" | "failed";
104
+
105
+ /** Settings for the call UI rendered into the container passed to `chat.calls`. */
106
+ export declare interface CallSessionOptions {
107
+ /** Hide the recording control. Defaults to `false`. */
108
+ hideRecordingButton?: boolean;
109
+ /** Hide the in-call chat panel toggle. Defaults to `false`. */
110
+ hideChatButton?: boolean;
111
+ /** How long a participant can be alone in the call before being asked whether to stay, in milliseconds. */
112
+ idleTimeoutBeforePromptMs?: number;
113
+ /** How long the stay prompt waits for an answer before the participant is removed, in milliseconds. */
114
+ idleTimeoutAfterPromptMs?: number;
115
+ }
139
116
 
140
117
  declare const chat: {
141
118
  install: typeof install;
142
- setGetChatMessagesCallback: typeof setGetChatMessagesCallback;
143
119
  initialized: Ref<boolean, boolean>;
144
120
  connected: ComputedRef<boolean>;
145
121
  connecting: ComputedRef<boolean>;
@@ -259,7 +235,6 @@ declare const chat: {
259
235
  toggleMuteAll: typeof toggleMuteAll;
260
236
  toMarkdownHtml: typeof toMarkdownHtml;
261
237
  retrieveCcToken: typeof retrieveCcToken;
262
- getChatMessages: Ref<ChatMessagesGetter | undefined, ChatMessagesGetter | undefined>;
263
238
  scrollToMessageId: Ref<string | undefined, string | undefined>;
264
239
  scrollToMessage: typeof scrollToMessage;
265
240
  pinnedMessages: ComputedRef<ChatMessageItem[]>;
@@ -298,11 +273,15 @@ declare const chat: {
298
273
  incomingCall: ComputedRef< Call | null>;
299
274
  incomingCalls: ComputedRef<Map<string, Call>>;
300
275
  outgoingCall: ComputedRef< Call | null>;
301
- start: (receiverId: string, container: HTMLElement, callType?: "audio" | "video", receiverType?: "user" | "group") => Promise< Call>;
302
- accept: (container: HTMLElement, sessionId?: string) => Promise<void>;
276
+ lastEndReason: ComputedRef<CallEndReason | null>;
277
+ start: (receiverId: string, container: HTMLElement, callType?: "audio" | "video", receiverType?: "user" | "group", options?: CallSessionOptions) => Promise< Call>;
278
+ /** Joins the chat's ongoing call, starting one if there is none. Leaving does not end it for the others. */
279
+ join: (chatUid: string, container: HTMLElement, callType?: "audio" | "video", options?: CallSessionOptions) => Promise<void>;
280
+ accept: (container: HTMLElement, sessionId?: string, options?: CallSessionOptions) => Promise<void>;
303
281
  reject: (sessionId?: string) => Promise<void>;
304
282
  end: () => Promise<void>;
305
- joinActive: (container: HTMLElement) => Promise<void>;
283
+ leave: () => void | undefined;
284
+ joinActive: (container: HTMLElement, options?: CallSessionOptions) => Promise<void>;
306
285
  };
307
286
  };
308
287
  export { chat }
@@ -370,6 +349,8 @@ export declare interface ChatClient {
370
349
  forwardMessage: (message: ChatMessageItem, target: ForwardMessageTarget) => Promise<void>;
371
350
  fetchScheduledMessages: (originalChatUid?: string) => Promise<void>;
372
351
  loadOlderMessages: () => Promise<boolean>;
352
+ /** Drops older loaded messages once the user is back at the newest ones. */
353
+ trimOlderMessages?: () => void;
373
354
  loadOlderThreadMessages: () => Promise<boolean>;
374
355
  ensureMessageLoaded: (messageId: string) => Promise<boolean>;
375
356
  scheduleMessage: (input: ScheduleMessageInput, options?: MessageSendOptions) => Promise<void>;
@@ -399,25 +380,22 @@ export declare interface ChatClient {
399
380
  uid: string;
400
381
  displayName: string;
401
382
  }>) => void;
402
- initiateCall: (receiverId: string, container: HTMLElement, callType?: "video" | "audio", receiverType?: "user" | "group") => Promise<InstanceType<typeof CometChat_2.Call>>;
403
- acceptIncomingCall: (container: HTMLElement, sessionId?: string) => Promise<void>;
383
+ initiateCall: (receiverId: string, container: HTMLElement, callType?: "video" | "audio", receiverType?: "user" | "group", options?: CallSessionOptions) => Promise<InstanceType<typeof CometChat_2.Call>>;
384
+ joinChatCall: (chatUid: string, container: HTMLElement, callType?: "video" | "audio", options?: CallSessionOptions) => Promise<void>;
385
+ acceptIncomingCall: (container: HTMLElement, sessionId?: string, options?: CallSessionOptions) => Promise<void>;
404
386
  rejectIncomingCall: (sessionId?: string) => Promise<void>;
405
387
  endActiveCall: () => Promise<void>;
406
- joinOutgoingCallSession: (container: HTMLElement) => Promise<void>;
388
+ leaveActiveCall: () => void;
389
+ joinOutgoingCallSession: (container: HTMLElement, options?: CallSessionOptions) => Promise<void>;
407
390
  incomingCall: Ref<InstanceType<typeof CometChat_2.Call> | null>;
408
391
  incomingCalls: Ref<Map<string, InstanceType<typeof CometChat_2.Call>>>;
409
392
  outgoingCall: Ref<InstanceType<typeof CometChat_2.Call> | null>;
410
393
  activeCallSessionId: Ref<string | null>;
411
394
  activeCallType: Ref<"audio" | "video">;
412
395
  callState: Ref<"idle" | "outgoing" | "incoming" | "connecting" | "in-call">;
396
+ lastCallEndReason: Ref<CallEndReason | null>;
413
397
  }
414
398
 
415
- export declare interface ChatComposerSelectionState extends ComposerSelectionState {
416
- target: ChatComposerTarget;
417
- }
418
-
419
- export declare type ChatComposerTarget = "main" | "thread";
420
-
421
399
  export declare interface ChatConversationItem {
422
400
  id: string;
423
401
  targetId: string;
@@ -534,23 +512,6 @@ export declare interface ChatMessageReceiptSummary {
534
512
  readByMeAt?: Date;
535
513
  }
536
514
 
537
- export declare type ChatMessagesGetter = (guid: string, query: string) => Promise<ChatMessagesGetterResult>;
538
-
539
- export declare interface ChatMessagesGetterPagination {
540
- total_pages?: number;
541
- current_page?: number;
542
- [key: string]: unknown;
543
- }
544
-
545
- export declare interface ChatMessagesGetterResult<TMessage = Record<string, unknown>> {
546
- data: TMessage[];
547
- meta?: {
548
- pagination?: ChatMessagesGetterPagination;
549
- [key: string]: unknown;
550
- };
551
- [key: string]: unknown;
552
- }
553
-
554
515
  export declare interface ChatPollData {
555
516
  id?: string;
556
517
  question: string;
@@ -604,23 +565,9 @@ declare function clearChatCount(chatUid: string): Promise<void>;
604
565
 
605
566
  export declare type ComposerFormatCommand = "bold" | "italic" | "underline";
606
567
 
607
- export declare type ComposerFormattingMode = "default" | "external";
608
-
609
- export declare interface ComposerSelectionRect {
610
- x: number;
611
- y: number;
612
- top: number;
613
- right: number;
614
- bottom: number;
615
- left: number;
616
- width: number;
617
- height: number;
618
- }
619
-
620
568
  export declare interface ComposerSelectionState {
621
569
  text: string;
622
570
  href?: string;
623
- rect: ComposerSelectionRect;
624
571
  }
625
572
 
626
573
  declare function connect(connectionName?: string): Promise<void>;
@@ -665,8 +612,6 @@ declare function getChatMembersInfo(chatUid: string): Promise<ParticipantInfo[]>
665
612
 
666
613
  declare function getChatOnlineCount(chatUid: string): Promise<number>;
667
614
 
668
- declare function getComposerSelection(target?: ChatComposerTarget): ChatComposerSelectionState | null;
669
-
670
615
  declare function getCurrentEnvironment(): ChatEnvironmentConfig;
671
616
 
672
617
  declare function getGroup(groupUid: string, throwErrors?: boolean): Promise<Group | null | undefined>;
@@ -804,8 +749,6 @@ export declare type PresenceStatus = "online" | "offline";
804
749
 
805
750
  declare function proxyImage(imageUrl: string): string;
806
751
 
807
- declare function requestComposerLink(target?: ChatComposerTarget): boolean;
808
-
809
752
  export declare interface RescheduleMessageInput {
810
753
  messageId: number;
811
754
  muid: string;
@@ -841,8 +784,6 @@ declare function setAccessToken(token: string): Promise<void>;
841
784
 
842
785
  declare function setEnvironment(environment: Environment): void;
843
786
 
844
- declare function setGetChatMessagesCallback(chatMessageGetter: ChatMessagesGetter | undefined): void;
845
-
846
787
  declare function setLanguage(language: Language): void;
847
788
 
848
789
  declare function setMuteAll(mute: boolean): Promise<boolean>;