@phonghq/go-chat 1.0.17 → 1.0.19

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.
@@ -102,7 +102,7 @@ const responsiveRender = computed(() => {
102
102
  });
103
103
  const list = computed(() => chatListRef.value?.listConversations ?? []);
104
104
  const unreadCount = computed(() => list.value?.reduce((total, cur) => total + (cur?.unread_count ?? 0), 0) ?? 0);
105
- const userRemote = computed(() => callingRef.value?.userRemoter ?? null);
105
+ const callStatus = computed(() => callingRef.value?.callStatus ?? null);
106
106
  const responsiveObserver = ref('tablet');
107
107
  const appChatRef = ref();
108
108
  const callingRef = ref(null);
@@ -148,7 +148,14 @@ initPage({ props: props, response: props.response });
148
148
  let __VLS_exposed;
149
149
  defineExpose({
150
150
  unreadCount,
151
- callInstance: callingRef.value,
151
+ callStatus,
152
+ getUserRemote: () => {
153
+ return callingRef.value?.userRemoter ?? null;
154
+ },
155
+ startCall: async () => {
156
+ await callingRef.value?.answer();
157
+ },
158
+ endCall: () => callingRef.value?.endCall()
152
159
  });
153
160
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
154
161
  const __VLS_defaults = {
@@ -10,7 +10,10 @@ export type GoChatProps = {
10
10
  };
11
11
  export interface GoChatInstance {
12
12
  unreadCount: ComputedRef<number>;
13
- callInstance: CallInstance | null;
13
+ getUserRemote: () => (IResUser | null);
14
+ callStatus: ComputedRef<PLIVO_CALL_STATUS | null>;
15
+ startCall: (() => Promise<void>) | undefined;
16
+ endCall: (() => void) | undefined;
14
17
  }
15
18
  export interface CallInstance {
16
19
  userRemoter: Ref<IResUser | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phonghq/go-chat",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist"