vue-parley 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +276 -0
- package/dist/chat.css +3223 -0
- package/dist/chunks/Call-CTIujxDi.cjs +818 -0
- package/dist/chunks/Call-CTIujxDi.cjs.map +1 -0
- package/dist/chunks/Call-Dwuyd-Ut.mjs +818 -0
- package/dist/chunks/Call-Dwuyd-Ut.mjs.map +1 -0
- package/dist/chunks/index-D50Yn7q4.cjs +7031 -0
- package/dist/chunks/index-D50Yn7q4.cjs.map +1 -0
- package/dist/chunks/index-JU_JZkSC.mjs +7010 -0
- package/dist/chunks/index-JU_JZkSC.mjs.map +1 -0
- package/dist/chunks/session-B3KIrj3_.mjs +711 -0
- package/dist/chunks/session-B3KIrj3_.mjs.map +1 -0
- package/dist/chunks/session-BOfkV8PJ.cjs +711 -0
- package/dist/chunks/session-BOfkV8PJ.cjs.map +1 -0
- package/dist/fakes.cjs +335 -0
- package/dist/fakes.cjs.map +1 -0
- package/dist/fakes.mjs +335 -0
- package/dist/fakes.mjs.map +1 -0
- package/dist/index.cjs +24 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.mjs +24 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/app/components/ChatPage.vue.d.ts +60 -0
- package/dist/types/app/components/ChatPage.vue.d.ts.map +1 -0
- package/dist/types/app/components/call/Call.vue.d.ts +8 -0
- package/dist/types/app/components/call/Call.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatBubble.vue.d.ts +64 -0
- package/dist/types/app/components/chat/ChatBubble.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatInput.vue.d.ts +60 -0
- package/dist/types/app/components/chat/ChatInput.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatMessages.vue.d.ts +45 -0
- package/dist/types/app/components/chat/ChatMessages.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatPageBar.vue.d.ts +50 -0
- package/dist/types/app/components/chat/ChatPageBar.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatProfileOverview.vue.d.ts +11 -0
- package/dist/types/app/components/chat/ChatProfileOverview.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatView.vue.d.ts +244 -0
- package/dist/types/app/components/chat/ChatView.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleDivider.vue.d.ts +7 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleDivider.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleImages.vue.d.ts +13 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleImages.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleMeta.vue.d.ts +11 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleMeta.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleOptions.vue.d.ts +16 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleOptions.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleRequest.vue.d.ts +8 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleRequest.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleSelectionMark.vue.d.ts +7 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleSelectionMark.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleStatus.vue.d.ts +7 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleStatus.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleVideo.vue.d.ts +25 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleVideo.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/FileDisplay.vue.d.ts +13 -0
- package/dist/types/app/components/chat/chat-bubbles/FileDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/ImageGroupDisplay.vue.d.ts +14 -0
- package/dist/types/app/components/chat/chat-bubbles/ImageGroupDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/ReplyPreview.vue.d.ts +10 -0
- package/dist/types/app/components/chat/chat-bubbles/ReplyPreview.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/UploadProgressOverlay.vue.d.ts +10 -0
- package/dist/types/app/components/chat/chat-bubbles/UploadProgressOverlay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/VoiceDisplay.vue.d.ts +12 -0
- package/dist/types/app/components/chat/chat-bubbles/VoiceDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/AttachementFileDisplay.vue.d.ts +12 -0
- package/dist/types/app/components/chat/chat-input/AttachementFileDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/InputActionBar.vue.d.ts +13 -0
- package/dist/types/app/components/chat/chat-input/InputActionBar.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/InputAttachement.vue.d.ts +18 -0
- package/dist/types/app/components/chat/chat-input/InputAttachement.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/PermissionPopup.vue.d.ts +8 -0
- package/dist/types/app/components/chat/chat-input/PermissionPopup.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/RecordButton.vue.d.ts +27 -0
- package/dist/types/app/components/chat/chat-input/RecordButton.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/RecordingStatus.vue.d.ts +12 -0
- package/dist/types/app/components/chat/chat-input/RecordingStatus.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/VideoRecordDisplay.vue.d.ts +26 -0
- package/dist/types/app/components/chat/chat-input/VideoRecordDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ChatContactDisplay.vue.d.ts +8 -0
- package/dist/types/app/components/chat/contact/ChatContactDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ChatList.vue.d.ts +5 -0
- package/dist/types/app/components/chat/contact/ChatList.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ChatListSearch.vue.d.ts +16 -0
- package/dist/types/app/components/chat/contact/ChatListSearch.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ContactAvatar.vue.d.ts +10 -0
- package/dist/types/app/components/chat/contact/ContactAvatar.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ContactSkeleton.vue.d.ts +3 -0
- package/dist/types/app/components/chat/contact/ContactSkeleton.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/messages/FloatingDateHeader.vue.d.ts +9 -0
- package/dist/types/app/components/chat/messages/FloatingDateHeader.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/messages/MessagesSkeleton.vue.d.ts +8 -0
- package/dist/types/app/components/chat/messages/MessagesSkeleton.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/messages/ScrollToBottomButton.vue.d.ts +11 -0
- package/dist/types/app/components/chat/messages/ScrollToBottomButton.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/profile/FileDisplay.vue.d.ts +9 -0
- package/dist/types/app/components/chat/profile/FileDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/ConfirmModal.vue.d.ts +21 -0
- package/dist/types/app/components/general/ConfirmModal.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/FileFormatDisplay.vue.d.ts +16 -0
- package/dist/types/app/components/general/FileFormatDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/IconButton.vue.d.ts +13 -0
- package/dist/types/app/components/general/IconButton.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/LoadingStatus.vue.d.ts +16 -0
- package/dist/types/app/components/general/LoadingStatus.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/MediaImage.vue.d.ts +30 -0
- package/dist/types/app/components/general/MediaImage.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/NoDataDisplay.vue.d.ts +7 -0
- package/dist/types/app/components/general/NoDataDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/ResponsiveDialog.vue.d.ts +28 -0
- package/dist/types/app/components/general/ResponsiveDialog.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/SafeEmojiText.vue.d.ts +10 -0
- package/dist/types/app/components/general/SafeEmojiText.vue.d.ts.map +1 -0
- package/dist/types/app/components/global/BEmojiPicker.vue.d.ts +8 -0
- package/dist/types/app/components/global/BEmojiPicker.vue.d.ts.map +1 -0
- package/dist/types/app/components/global/BIcon.vue.d.ts +11 -0
- package/dist/types/app/components/global/BIcon.vue.d.ts.map +1 -0
- package/dist/types/app/components/global/BVirtualVerticalList.vue.d.ts +30 -0
- package/dist/types/app/components/global/BVirtualVerticalList.vue.d.ts.map +1 -0
- package/dist/types/app/composables/call/media.d.ts +204 -0
- package/dist/types/app/composables/call/media.d.ts.map +1 -0
- package/dist/types/app/composables/call/peer.d.ts +39 -0
- package/dist/types/app/composables/call/peer.d.ts.map +1 -0
- package/dist/types/app/composables/call/peers.d.ts +54 -0
- package/dist/types/app/composables/call/peers.d.ts.map +1 -0
- package/dist/types/app/composables/call/session.d.ts +284 -0
- package/dist/types/app/composables/call/session.d.ts.map +1 -0
- package/dist/types/app/composables/call/signaling.d.ts +36 -0
- package/dist/types/app/composables/call/signaling.d.ts.map +1 -0
- package/dist/types/app/composables/call/useCallUi.d.ts +27 -0
- package/dist/types/app/composables/call/useCallUi.d.ts.map +1 -0
- package/dist/types/app/composables/chat/useChatRecording.d.ts +75 -0
- package/dist/types/app/composables/chat/useChatRecording.d.ts.map +1 -0
- package/dist/types/app/composables/chat/useInputDraft.d.ts +14 -0
- package/dist/types/app/composables/chat/useInputDraft.d.ts.map +1 -0
- package/dist/types/app/composables/useAppPermissions.d.ts +25 -0
- package/dist/types/app/composables/useAppPermissions.d.ts.map +1 -0
- package/dist/types/app/composables/useAppToast.d.ts +13 -0
- package/dist/types/app/composables/useAppToast.d.ts.map +1 -0
- package/dist/types/app/composables/useAttachmentPicker.d.ts +18 -0
- package/dist/types/app/composables/useAttachmentPicker.d.ts.map +1 -0
- package/dist/types/app/composables/useCall.d.ts +91 -0
- package/dist/types/app/composables/useCall.d.ts.map +1 -0
- package/dist/types/app/composables/useChatMessageList.d.ts +18 -0
- package/dist/types/app/composables/useChatMessageList.d.ts.map +1 -0
- package/dist/types/app/composables/useDate.d.ts +7 -0
- package/dist/types/app/composables/useDate.d.ts.map +1 -0
- package/dist/types/app/composables/useDevice.d.ts +32 -0
- package/dist/types/app/composables/useDevice.d.ts.map +1 -0
- package/dist/types/app/composables/useFlippedVirtualScroll.d.ts +22 -0
- package/dist/types/app/composables/useFlippedVirtualScroll.d.ts.map +1 -0
- package/dist/types/app/composables/useHostI18n.d.ts +15 -0
- package/dist/types/app/composables/useHostI18n.d.ts.map +1 -0
- package/dist/types/app/composables/useLocalI18n.d.ts +5 -0
- package/dist/types/app/composables/useLocalI18n.d.ts.map +1 -0
- package/dist/types/app/composables/useLongPress.d.ts +6 -0
- package/dist/types/app/composables/useLongPress.d.ts.map +1 -0
- package/dist/types/app/composables/useRichTextEditor.d.ts +12 -0
- package/dist/types/app/composables/useRichTextEditor.d.ts.map +1 -0
- package/dist/types/app/directives/loading.d.ts +6 -0
- package/dist/types/app/directives/loading.d.ts.map +1 -0
- package/dist/types/app/index.d.ts +31 -0
- package/dist/types/app/index.d.ts.map +1 -0
- package/dist/types/app/plugin.d.ts +28 -0
- package/dist/types/app/plugin.d.ts.map +1 -0
- package/dist/types/app/provider/callProvider.d.ts +7 -0
- package/dist/types/app/provider/callProvider.d.ts.map +1 -0
- package/dist/types/app/stores/callStore.d.ts +1626 -0
- package/dist/types/app/stores/callStore.d.ts.map +1 -0
- package/dist/types/app/stores/chatStore.d.ts +126 -0
- package/dist/types/app/stores/chatStore.d.ts.map +1 -0
- package/dist/types/app/stores/mediaStore.d.ts +18 -0
- package/dist/types/app/stores/mediaStore.d.ts.map +1 -0
- package/dist/types/app/stores/messageStores.d.ts +2460 -0
- package/dist/types/app/stores/messageStores.d.ts.map +1 -0
- package/dist/types/app/stores/profileStore.d.ts +102 -0
- package/dist/types/app/stores/profileStore.d.ts.map +1 -0
- package/dist/types/app/types/components/chat-input.d.ts +4 -0
- package/dist/types/app/types/components/chat-input.d.ts.map +1 -0
- package/dist/types/app/types/components/menu-options.d.ts +7 -0
- package/dist/types/app/types/components/menu-options.d.ts.map +1 -0
- package/dist/types/app/types/components/modal.d.ts +17 -0
- package/dist/types/app/types/components/modal.d.ts.map +1 -0
- package/dist/types/app/types/index.d.ts +257 -0
- package/dist/types/app/types/index.d.ts.map +1 -0
- package/dist/types/app/utils/emojiParser.d.ts +5 -0
- package/dist/types/app/utils/emojiParser.d.ts.map +1 -0
- package/dist/types/app/utils/format.d.ts +4 -0
- package/dist/types/app/utils/format.d.ts.map +1 -0
- package/dist/types/fakes/backend.d.ts +25 -0
- package/dist/types/fakes/backend.d.ts.map +1 -0
- package/dist/types/fakes/call.d.ts +7 -0
- package/dist/types/fakes/call.d.ts.map +1 -0
- package/dist/types/fakes/data.d.ts +13 -0
- package/dist/types/fakes/data.d.ts.map +1 -0
- package/dist/types/fakes/index.d.ts +7 -0
- package/dist/types/fakes/index.d.ts.map +1 -0
- package/dist/types/fakes.d.ts +2 -0
- package/dist/types/i18n/locales/index.d.ts +3557 -0
- package/dist/types/i18n/locales/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +98 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { TrackTypes } from './signaling';
|
|
2
|
+
export interface MediaOptions {
|
|
3
|
+
/** Shows an error; `key` is a `chat.call.errors.*` translation key. */
|
|
4
|
+
notify: (key: string) => void;
|
|
5
|
+
isMobile: () => boolean;
|
|
6
|
+
}
|
|
7
|
+
/** This participant's camera, microphone and screen share. */
|
|
8
|
+
export declare function useCallMedia({ notify, isMobile }: MediaOptions): {
|
|
9
|
+
localStream: globalThis.Ref<{
|
|
10
|
+
readonly active: boolean;
|
|
11
|
+
readonly id: string;
|
|
12
|
+
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
13
|
+
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
14
|
+
addTrack: (track: MediaStreamTrack) => void;
|
|
15
|
+
clone: () => MediaStream;
|
|
16
|
+
getAudioTracks: () => MediaStreamTrack[];
|
|
17
|
+
getTrackById: (trackId: string) => MediaStreamTrack | null;
|
|
18
|
+
getTracks: () => MediaStreamTrack[];
|
|
19
|
+
getVideoTracks: () => MediaStreamTrack[];
|
|
20
|
+
removeTrack: (track: MediaStreamTrack) => void;
|
|
21
|
+
addEventListener: {
|
|
22
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
23
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
24
|
+
};
|
|
25
|
+
removeEventListener: {
|
|
26
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
27
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
28
|
+
};
|
|
29
|
+
dispatchEvent: (event: Event) => boolean;
|
|
30
|
+
} | null, MediaStream | {
|
|
31
|
+
readonly active: boolean;
|
|
32
|
+
readonly id: string;
|
|
33
|
+
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
34
|
+
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
35
|
+
addTrack: (track: MediaStreamTrack) => void;
|
|
36
|
+
clone: () => MediaStream;
|
|
37
|
+
getAudioTracks: () => MediaStreamTrack[];
|
|
38
|
+
getTrackById: (trackId: string) => MediaStreamTrack | null;
|
|
39
|
+
getTracks: () => MediaStreamTrack[];
|
|
40
|
+
getVideoTracks: () => MediaStreamTrack[];
|
|
41
|
+
removeTrack: (track: MediaStreamTrack) => void;
|
|
42
|
+
addEventListener: {
|
|
43
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
44
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
45
|
+
};
|
|
46
|
+
removeEventListener: {
|
|
47
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
48
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
49
|
+
};
|
|
50
|
+
dispatchEvent: (event: Event) => boolean;
|
|
51
|
+
} | null>;
|
|
52
|
+
screenStream: globalThis.Ref<{
|
|
53
|
+
readonly active: boolean;
|
|
54
|
+
readonly id: string;
|
|
55
|
+
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
56
|
+
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
57
|
+
addTrack: (track: MediaStreamTrack) => void;
|
|
58
|
+
clone: () => MediaStream;
|
|
59
|
+
getAudioTracks: () => MediaStreamTrack[];
|
|
60
|
+
getTrackById: (trackId: string) => MediaStreamTrack | null;
|
|
61
|
+
getTracks: () => MediaStreamTrack[];
|
|
62
|
+
getVideoTracks: () => MediaStreamTrack[];
|
|
63
|
+
removeTrack: (track: MediaStreamTrack) => void;
|
|
64
|
+
addEventListener: {
|
|
65
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
66
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
67
|
+
};
|
|
68
|
+
removeEventListener: {
|
|
69
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
70
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
71
|
+
};
|
|
72
|
+
dispatchEvent: (event: Event) => boolean;
|
|
73
|
+
} | null, MediaStream | {
|
|
74
|
+
readonly active: boolean;
|
|
75
|
+
readonly id: string;
|
|
76
|
+
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
77
|
+
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
78
|
+
addTrack: (track: MediaStreamTrack) => void;
|
|
79
|
+
clone: () => MediaStream;
|
|
80
|
+
getAudioTracks: () => MediaStreamTrack[];
|
|
81
|
+
getTrackById: (trackId: string) => MediaStreamTrack | null;
|
|
82
|
+
getTracks: () => MediaStreamTrack[];
|
|
83
|
+
getVideoTracks: () => MediaStreamTrack[];
|
|
84
|
+
removeTrack: (track: MediaStreamTrack) => void;
|
|
85
|
+
addEventListener: {
|
|
86
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
87
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
88
|
+
};
|
|
89
|
+
removeEventListener: {
|
|
90
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
91
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
92
|
+
};
|
|
93
|
+
dispatchEvent: (event: Event) => boolean;
|
|
94
|
+
} | null>;
|
|
95
|
+
trackTypes: globalThis.Ref<{
|
|
96
|
+
id: string;
|
|
97
|
+
type: import('../..').TrackType;
|
|
98
|
+
}[], TrackTypes | {
|
|
99
|
+
id: string;
|
|
100
|
+
type: import('../..').TrackType;
|
|
101
|
+
}[]>;
|
|
102
|
+
videoTrack: globalThis.Ref<{
|
|
103
|
+
contentHint: string;
|
|
104
|
+
enabled: boolean;
|
|
105
|
+
readonly id: string;
|
|
106
|
+
readonly kind: string;
|
|
107
|
+
readonly label: string;
|
|
108
|
+
readonly muted: boolean;
|
|
109
|
+
onended: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
110
|
+
onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
111
|
+
onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
112
|
+
readonly readyState: MediaStreamTrackState;
|
|
113
|
+
applyConstraints: (constraints?: MediaTrackConstraints) => Promise<void>;
|
|
114
|
+
clone: () => MediaStreamTrack;
|
|
115
|
+
getCapabilities: () => MediaTrackCapabilities;
|
|
116
|
+
getConstraints: () => MediaTrackConstraints;
|
|
117
|
+
getSettings: () => MediaTrackSettings;
|
|
118
|
+
stop: () => void;
|
|
119
|
+
addEventListener: {
|
|
120
|
+
<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
121
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
122
|
+
};
|
|
123
|
+
removeEventListener: {
|
|
124
|
+
<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
125
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
126
|
+
};
|
|
127
|
+
dispatchEvent: (event: Event) => boolean;
|
|
128
|
+
} | null, MediaStreamTrack | {
|
|
129
|
+
contentHint: string;
|
|
130
|
+
enabled: boolean;
|
|
131
|
+
readonly id: string;
|
|
132
|
+
readonly kind: string;
|
|
133
|
+
readonly label: string;
|
|
134
|
+
readonly muted: boolean;
|
|
135
|
+
onended: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
136
|
+
onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
137
|
+
onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
138
|
+
readonly readyState: MediaStreamTrackState;
|
|
139
|
+
applyConstraints: (constraints?: MediaTrackConstraints) => Promise<void>;
|
|
140
|
+
clone: () => MediaStreamTrack;
|
|
141
|
+
getCapabilities: () => MediaTrackCapabilities;
|
|
142
|
+
getConstraints: () => MediaTrackConstraints;
|
|
143
|
+
getSettings: () => MediaTrackSettings;
|
|
144
|
+
stop: () => void;
|
|
145
|
+
addEventListener: {
|
|
146
|
+
<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
147
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
148
|
+
};
|
|
149
|
+
removeEventListener: {
|
|
150
|
+
<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
151
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
152
|
+
};
|
|
153
|
+
dispatchEvent: (event: Event) => boolean;
|
|
154
|
+
} | null>;
|
|
155
|
+
cameras: globalThis.Ref<{
|
|
156
|
+
readonly deviceId: string;
|
|
157
|
+
readonly groupId: string;
|
|
158
|
+
readonly kind: MediaDeviceKind;
|
|
159
|
+
readonly label: string;
|
|
160
|
+
toJSON: () => any;
|
|
161
|
+
}[], MediaDeviceInfo[] | {
|
|
162
|
+
readonly deviceId: string;
|
|
163
|
+
readonly groupId: string;
|
|
164
|
+
readonly kind: MediaDeviceKind;
|
|
165
|
+
readonly label: string;
|
|
166
|
+
toJSON: () => any;
|
|
167
|
+
}[]>;
|
|
168
|
+
isAudioOn: globalThis.Ref<boolean, boolean>;
|
|
169
|
+
isVideoOn: globalThis.Ref<boolean, boolean>;
|
|
170
|
+
isScreenSharing: globalThis.Ref<boolean, boolean>;
|
|
171
|
+
isFlashlightOn: globalThis.Ref<boolean, boolean>;
|
|
172
|
+
isFlashlightSupported: globalThis.ComputedRef<boolean>;
|
|
173
|
+
checkPermissions: () => Promise<void>;
|
|
174
|
+
start: () => Promise<void>;
|
|
175
|
+
toggleAudio: () => void;
|
|
176
|
+
toggleVideo: () => void;
|
|
177
|
+
switchCamera: (deviceId: string) => Promise<MediaStreamTrack | null>;
|
|
178
|
+
startScreenShare: (onEnded: () => void) => Promise<MediaStream | null>;
|
|
179
|
+
stopScreenShare: () => {
|
|
180
|
+
readonly active: boolean;
|
|
181
|
+
readonly id: string;
|
|
182
|
+
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
183
|
+
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
184
|
+
addTrack: (track: MediaStreamTrack) => void;
|
|
185
|
+
clone: () => MediaStream;
|
|
186
|
+
getAudioTracks: () => MediaStreamTrack[];
|
|
187
|
+
getTrackById: (trackId: string) => MediaStreamTrack | null;
|
|
188
|
+
getTracks: () => MediaStreamTrack[];
|
|
189
|
+
getVideoTracks: () => MediaStreamTrack[];
|
|
190
|
+
removeTrack: (track: MediaStreamTrack) => void;
|
|
191
|
+
addEventListener: {
|
|
192
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
193
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
194
|
+
};
|
|
195
|
+
removeEventListener: {
|
|
196
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
197
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
198
|
+
};
|
|
199
|
+
dispatchEvent: (event: Event) => boolean;
|
|
200
|
+
} | null;
|
|
201
|
+
toggleFlashlight: () => Promise<void>;
|
|
202
|
+
stopAll: () => void;
|
|
203
|
+
};
|
|
204
|
+
//# sourceMappingURL=media.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../../../app/composables/call/media.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,uEAAuE;IACvE,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,QAAQ,EAAE,MAAM,OAAO,CAAC;CACzB;AAgBD,8DAA8D;AAC9D,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA4GvB,MAAM;gCAwBH,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;EAyGpD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SignalData } from '../../types';
|
|
2
|
+
export interface PeerEvents {
|
|
3
|
+
/** A message for the other side, to send over signalling. */
|
|
4
|
+
onSignal(signal: SignalData): void;
|
|
5
|
+
/** A new remote stream (once per stream, with its tracks already added). */
|
|
6
|
+
onStream(stream: MediaStream): void;
|
|
7
|
+
/** The connection is gone, from either side. Fires once. */
|
|
8
|
+
onClose(): void;
|
|
9
|
+
onError(error: Error): void;
|
|
10
|
+
}
|
|
11
|
+
export interface PeerOptions extends PeerEvents {
|
|
12
|
+
/** Whether this side makes the offers. Exactly one side of a pair must be the initiator. */
|
|
13
|
+
initiator: boolean;
|
|
14
|
+
stream: MediaStream;
|
|
15
|
+
config: RTCConfiguration;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* One WebRTC connection to one remote participant, on the plain browser API.
|
|
19
|
+
*
|
|
20
|
+
* It speaks simple-peer's wire protocol (with `trickle: false`), so it interoperates with clients
|
|
21
|
+
* still running the previous, simple-peer based build:
|
|
22
|
+
* - full offers/answers with the ICE candidates inside the SDP;
|
|
23
|
+
* - only the initiator makes offers; the other side asks with `{ type: "renegotiate" }` and, for
|
|
24
|
+
* tracks the offer had no room for, `{ type: "transceiverRequest" }`, so offers never collide;
|
|
25
|
+
* - a data channel whose closing tells either side that the other one left.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createPeer(opts: PeerOptions): {
|
|
28
|
+
/** Applies a message from the other side. */
|
|
29
|
+
signal(data: SignalData): void;
|
|
30
|
+
addTrack(track: MediaStreamTrack, stream: MediaStream): void;
|
|
31
|
+
removeTrack(track: MediaStreamTrack): void;
|
|
32
|
+
/** Swaps the outgoing video track in place (no renegotiation), or adds it if none is sent. */
|
|
33
|
+
replaceVideoTrack(track: MediaStreamTrack, stream: MediaStream): void;
|
|
34
|
+
/** Whether we currently send this track. */
|
|
35
|
+
isSending(track: MediaStreamTrack): boolean;
|
|
36
|
+
destroy: () => void;
|
|
37
|
+
};
|
|
38
|
+
export type PeerConnection = ReturnType<typeof createPeer>;
|
|
39
|
+
//# sourceMappingURL=peer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peer.d.ts","sourceRoot":"","sources":["../../../../../app/composables/call/peer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAK1C,MAAM,WAAW,UAAU;IACzB,6DAA6D;IAC7D,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IACnC,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IACpC,4DAA4D;IAC5D,OAAO,IAAI,IAAI,CAAC;IAChB,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,4FAA4F;IAC5F,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAUD;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW;IAqJxC,6CAA6C;iBAChC,UAAU;oBAwBP,gBAAgB,UAAU,WAAW;uBAMlC,gBAAgB;IAQnC,8FAA8F;6BACrE,gBAAgB,UAAU,WAAW;IAO9D,4CAA4C;qBAC3B,gBAAgB;;EAMpC;AAED,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { SignalData } from '../../types';
|
|
3
|
+
import { Signaling, TrackTypes } from './signaling';
|
|
4
|
+
export interface RemoteStream {
|
|
5
|
+
name: string;
|
|
6
|
+
stream: MediaStream;
|
|
7
|
+
}
|
|
8
|
+
export interface PeerOptions {
|
|
9
|
+
selfId: string;
|
|
10
|
+
signaling: Signaling;
|
|
11
|
+
localStream: Ref<MediaStream | null>;
|
|
12
|
+
screenStream: Ref<MediaStream | null>;
|
|
13
|
+
/** ICE servers and policy for each new connection, or null when none are usable yet. */
|
|
14
|
+
rtcConfig: () => RTCConfiguration | null;
|
|
15
|
+
log: (...args: unknown[]) => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* One connection per remote participant, plus the streams they send us.
|
|
19
|
+
*
|
|
20
|
+
* Who makes the offer is decided by comparing ids, so both sides agree without a round trip.
|
|
21
|
+
* A peer can't be created before our own media exists; such requests wait until it does.
|
|
22
|
+
*/
|
|
23
|
+
export declare function usePeers(opts: PeerOptions): {
|
|
24
|
+
peers: Ref<Record<string, {
|
|
25
|
+
signal(data: SignalData): void;
|
|
26
|
+
addTrack(track: MediaStreamTrack, stream: MediaStream): void;
|
|
27
|
+
removeTrack(track: MediaStreamTrack): void;
|
|
28
|
+
replaceVideoTrack(track: MediaStreamTrack, stream: MediaStream): void;
|
|
29
|
+
isSending(track: MediaStreamTrack): boolean;
|
|
30
|
+
destroy: () => void;
|
|
31
|
+
}>, Record<string, {
|
|
32
|
+
signal(data: SignalData): void;
|
|
33
|
+
addTrack(track: MediaStreamTrack, stream: MediaStream): void;
|
|
34
|
+
removeTrack(track: MediaStreamTrack): void;
|
|
35
|
+
replaceVideoTrack(track: MediaStreamTrack, stream: MediaStream): void;
|
|
36
|
+
isSending(track: MediaStreamTrack): boolean;
|
|
37
|
+
destroy: () => void;
|
|
38
|
+
}>>;
|
|
39
|
+
remoteVideos: Ref<Record<string, RemoteStream>, Record<string, RemoteStream>>;
|
|
40
|
+
remoteScreens: Ref<Record<string, RemoteStream>, Record<string, RemoteStream>>;
|
|
41
|
+
remoteStreamTypes: Ref<Record<string, TrackTypes>, Record<string, TrackTypes>>;
|
|
42
|
+
isInitiator: (remoteId: string) => boolean;
|
|
43
|
+
has: (remoteId: string) => boolean;
|
|
44
|
+
add: (remoteId: string, name: string) => void;
|
|
45
|
+
remove: (remoteId: string) => void;
|
|
46
|
+
signal: (remoteId: string, name: string, data: SignalData & {
|
|
47
|
+
sdp: string;
|
|
48
|
+
}) => void;
|
|
49
|
+
addTrackToAll: (track: MediaStreamTrack, stream: MediaStream) => void;
|
|
50
|
+
removeTrackFromAll: (track: MediaStreamTrack) => void;
|
|
51
|
+
replaceVideoTrack: (track: MediaStreamTrack, stream: MediaStream) => void;
|
|
52
|
+
destroyAll: () => void;
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=peers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peers.d.ts","sourceRoot":"","sources":["../../../../../app/composables/call/peers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACrC,YAAY,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACtC,wFAAwF;IACxF,SAAS,EAAE,MAAM,gBAAgB,GAAG,IAAI,CAAC;IACzC,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW;;;;;;;;;;;;;;;;;;;4BAcT,MAAM;oBACd,MAAM;oBAqCN,MAAM,QAAQ,MAAM;uBAnCjB,MAAM;uBAyFN,MAAM,QAAQ,MAAM,QAAQ,UAAU,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE;2BAepD,gBAAgB,UAAU,WAAW;gCAIhC,gBAAgB;+BAKjB,gBAAgB,UAAU,WAAW;;EAqCxE"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { CallHandlers } from '../../types';
|
|
2
|
+
export interface CallSessionOptions {
|
|
3
|
+
handlers: CallHandlers;
|
|
4
|
+
channel: string;
|
|
5
|
+
self: {
|
|
6
|
+
id: string;
|
|
7
|
+
name: () => string;
|
|
8
|
+
avatar: () => Blob | undefined;
|
|
9
|
+
};
|
|
10
|
+
/** Shows an error; `key` is a translation key. */
|
|
11
|
+
notify: (key: string) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* One call, from joining to hanging up: signalling, peer connections and local media. It lives in
|
|
15
|
+
* the call store, not in a component, so the call carries on while no call view is mounted.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createCallSession(opts: CallSessionOptions): {
|
|
18
|
+
channel: string;
|
|
19
|
+
start: () => Promise<void>;
|
|
20
|
+
end: () => void;
|
|
21
|
+
toggleScreenShare: () => Promise<void>;
|
|
22
|
+
switchCamera: (deviceId: string) => Promise<{
|
|
23
|
+
readonly active: boolean;
|
|
24
|
+
readonly id: string;
|
|
25
|
+
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
26
|
+
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
27
|
+
addTrack: (track: MediaStreamTrack) => void;
|
|
28
|
+
clone: () => MediaStream;
|
|
29
|
+
getAudioTracks: () => MediaStreamTrack[];
|
|
30
|
+
getTrackById: (trackId: string) => MediaStreamTrack | null;
|
|
31
|
+
getTracks: () => MediaStreamTrack[];
|
|
32
|
+
getVideoTracks: () => MediaStreamTrack[];
|
|
33
|
+
removeTrack: (track: MediaStreamTrack) => void;
|
|
34
|
+
addEventListener: {
|
|
35
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
36
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
37
|
+
};
|
|
38
|
+
removeEventListener: {
|
|
39
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
40
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
41
|
+
};
|
|
42
|
+
dispatchEvent: (event: Event) => boolean;
|
|
43
|
+
} | null>;
|
|
44
|
+
signaling: {
|
|
45
|
+
listen: (on: import('./signaling').SignalingHandlers) => Promise<void>;
|
|
46
|
+
stop: () => void;
|
|
47
|
+
join: () => Promise<void>;
|
|
48
|
+
trackTypes: (types: import('./signaling').TrackTypes) => Promise<void>;
|
|
49
|
+
signal: (to: string, signal: import('../../types').SignalData) => Promise<void>;
|
|
50
|
+
ring: (channel: string, avatar?: string) => Promise<void>;
|
|
51
|
+
hangup: (channel: string) => Promise<void>;
|
|
52
|
+
};
|
|
53
|
+
media: {
|
|
54
|
+
localStream: globalThis.Ref<{
|
|
55
|
+
readonly active: boolean;
|
|
56
|
+
readonly id: string;
|
|
57
|
+
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
58
|
+
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
59
|
+
addTrack: (track: MediaStreamTrack) => void;
|
|
60
|
+
clone: () => MediaStream;
|
|
61
|
+
getAudioTracks: () => MediaStreamTrack[];
|
|
62
|
+
getTrackById: (trackId: string) => MediaStreamTrack | null;
|
|
63
|
+
getTracks: () => MediaStreamTrack[];
|
|
64
|
+
getVideoTracks: () => MediaStreamTrack[];
|
|
65
|
+
removeTrack: (track: MediaStreamTrack) => void;
|
|
66
|
+
addEventListener: {
|
|
67
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
68
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
69
|
+
};
|
|
70
|
+
removeEventListener: {
|
|
71
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
72
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
73
|
+
};
|
|
74
|
+
dispatchEvent: (event: Event) => boolean;
|
|
75
|
+
} | null, MediaStream | {
|
|
76
|
+
readonly active: boolean;
|
|
77
|
+
readonly id: string;
|
|
78
|
+
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
79
|
+
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
80
|
+
addTrack: (track: MediaStreamTrack) => void;
|
|
81
|
+
clone: () => MediaStream;
|
|
82
|
+
getAudioTracks: () => MediaStreamTrack[];
|
|
83
|
+
getTrackById: (trackId: string) => MediaStreamTrack | null;
|
|
84
|
+
getTracks: () => MediaStreamTrack[];
|
|
85
|
+
getVideoTracks: () => MediaStreamTrack[];
|
|
86
|
+
removeTrack: (track: MediaStreamTrack) => void;
|
|
87
|
+
addEventListener: {
|
|
88
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
89
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
90
|
+
};
|
|
91
|
+
removeEventListener: {
|
|
92
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
93
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
94
|
+
};
|
|
95
|
+
dispatchEvent: (event: Event) => boolean;
|
|
96
|
+
} | null>;
|
|
97
|
+
screenStream: globalThis.Ref<{
|
|
98
|
+
readonly active: boolean;
|
|
99
|
+
readonly id: string;
|
|
100
|
+
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
101
|
+
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
102
|
+
addTrack: (track: MediaStreamTrack) => void;
|
|
103
|
+
clone: () => MediaStream;
|
|
104
|
+
getAudioTracks: () => MediaStreamTrack[];
|
|
105
|
+
getTrackById: (trackId: string) => MediaStreamTrack | null;
|
|
106
|
+
getTracks: () => MediaStreamTrack[];
|
|
107
|
+
getVideoTracks: () => MediaStreamTrack[];
|
|
108
|
+
removeTrack: (track: MediaStreamTrack) => void;
|
|
109
|
+
addEventListener: {
|
|
110
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
111
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
112
|
+
};
|
|
113
|
+
removeEventListener: {
|
|
114
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
115
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
116
|
+
};
|
|
117
|
+
dispatchEvent: (event: Event) => boolean;
|
|
118
|
+
} | null, MediaStream | {
|
|
119
|
+
readonly active: boolean;
|
|
120
|
+
readonly id: string;
|
|
121
|
+
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
122
|
+
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
123
|
+
addTrack: (track: MediaStreamTrack) => void;
|
|
124
|
+
clone: () => MediaStream;
|
|
125
|
+
getAudioTracks: () => MediaStreamTrack[];
|
|
126
|
+
getTrackById: (trackId: string) => MediaStreamTrack | null;
|
|
127
|
+
getTracks: () => MediaStreamTrack[];
|
|
128
|
+
getVideoTracks: () => MediaStreamTrack[];
|
|
129
|
+
removeTrack: (track: MediaStreamTrack) => void;
|
|
130
|
+
addEventListener: {
|
|
131
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
132
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
133
|
+
};
|
|
134
|
+
removeEventListener: {
|
|
135
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
136
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
137
|
+
};
|
|
138
|
+
dispatchEvent: (event: Event) => boolean;
|
|
139
|
+
} | null>;
|
|
140
|
+
trackTypes: globalThis.Ref<{
|
|
141
|
+
id: string;
|
|
142
|
+
type: import('../../types').TrackType;
|
|
143
|
+
}[], import('./signaling').TrackTypes | {
|
|
144
|
+
id: string;
|
|
145
|
+
type: import('../../types').TrackType;
|
|
146
|
+
}[]>;
|
|
147
|
+
videoTrack: globalThis.Ref<{
|
|
148
|
+
contentHint: string;
|
|
149
|
+
enabled: boolean;
|
|
150
|
+
readonly id: string;
|
|
151
|
+
readonly kind: string;
|
|
152
|
+
readonly label: string;
|
|
153
|
+
readonly muted: boolean;
|
|
154
|
+
onended: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
155
|
+
onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
156
|
+
onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
157
|
+
readonly readyState: MediaStreamTrackState;
|
|
158
|
+
applyConstraints: (constraints?: MediaTrackConstraints) => Promise<void>;
|
|
159
|
+
clone: () => MediaStreamTrack;
|
|
160
|
+
getCapabilities: () => MediaTrackCapabilities;
|
|
161
|
+
getConstraints: () => MediaTrackConstraints;
|
|
162
|
+
getSettings: () => MediaTrackSettings;
|
|
163
|
+
stop: () => void;
|
|
164
|
+
addEventListener: {
|
|
165
|
+
<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
166
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
167
|
+
};
|
|
168
|
+
removeEventListener: {
|
|
169
|
+
<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
170
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
171
|
+
};
|
|
172
|
+
dispatchEvent: (event: Event) => boolean;
|
|
173
|
+
} | null, MediaStreamTrack | {
|
|
174
|
+
contentHint: string;
|
|
175
|
+
enabled: boolean;
|
|
176
|
+
readonly id: string;
|
|
177
|
+
readonly kind: string;
|
|
178
|
+
readonly label: string;
|
|
179
|
+
readonly muted: boolean;
|
|
180
|
+
onended: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
181
|
+
onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
182
|
+
onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
183
|
+
readonly readyState: MediaStreamTrackState;
|
|
184
|
+
applyConstraints: (constraints?: MediaTrackConstraints) => Promise<void>;
|
|
185
|
+
clone: () => MediaStreamTrack;
|
|
186
|
+
getCapabilities: () => MediaTrackCapabilities;
|
|
187
|
+
getConstraints: () => MediaTrackConstraints;
|
|
188
|
+
getSettings: () => MediaTrackSettings;
|
|
189
|
+
stop: () => void;
|
|
190
|
+
addEventListener: {
|
|
191
|
+
<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
192
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
193
|
+
};
|
|
194
|
+
removeEventListener: {
|
|
195
|
+
<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
196
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
197
|
+
};
|
|
198
|
+
dispatchEvent: (event: Event) => boolean;
|
|
199
|
+
} | null>;
|
|
200
|
+
cameras: globalThis.Ref<{
|
|
201
|
+
readonly deviceId: string;
|
|
202
|
+
readonly groupId: string;
|
|
203
|
+
readonly kind: MediaDeviceKind;
|
|
204
|
+
readonly label: string;
|
|
205
|
+
toJSON: () => any;
|
|
206
|
+
}[], MediaDeviceInfo[] | {
|
|
207
|
+
readonly deviceId: string;
|
|
208
|
+
readonly groupId: string;
|
|
209
|
+
readonly kind: MediaDeviceKind;
|
|
210
|
+
readonly label: string;
|
|
211
|
+
toJSON: () => any;
|
|
212
|
+
}[]>;
|
|
213
|
+
isAudioOn: globalThis.Ref<boolean, boolean>;
|
|
214
|
+
isVideoOn: globalThis.Ref<boolean, boolean>;
|
|
215
|
+
isScreenSharing: globalThis.Ref<boolean, boolean>;
|
|
216
|
+
isFlashlightOn: globalThis.Ref<boolean, boolean>;
|
|
217
|
+
isFlashlightSupported: globalThis.ComputedRef<boolean>;
|
|
218
|
+
checkPermissions: () => Promise<void>;
|
|
219
|
+
start: () => Promise<void>;
|
|
220
|
+
toggleAudio: () => void;
|
|
221
|
+
toggleVideo: () => void;
|
|
222
|
+
switchCamera: (deviceId: string) => Promise<MediaStreamTrack | null>;
|
|
223
|
+
startScreenShare: (onEnded: () => void) => Promise<MediaStream | null>;
|
|
224
|
+
stopScreenShare: () => {
|
|
225
|
+
readonly active: boolean;
|
|
226
|
+
readonly id: string;
|
|
227
|
+
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
228
|
+
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
|
|
229
|
+
addTrack: (track: MediaStreamTrack) => void;
|
|
230
|
+
clone: () => MediaStream;
|
|
231
|
+
getAudioTracks: () => MediaStreamTrack[];
|
|
232
|
+
getTrackById: (trackId: string) => MediaStreamTrack | null;
|
|
233
|
+
getTracks: () => MediaStreamTrack[];
|
|
234
|
+
getVideoTracks: () => MediaStreamTrack[];
|
|
235
|
+
removeTrack: (track: MediaStreamTrack) => void;
|
|
236
|
+
addEventListener: {
|
|
237
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
238
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
239
|
+
};
|
|
240
|
+
removeEventListener: {
|
|
241
|
+
<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
242
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
243
|
+
};
|
|
244
|
+
dispatchEvent: (event: Event) => boolean;
|
|
245
|
+
} | null;
|
|
246
|
+
toggleFlashlight: () => Promise<void>;
|
|
247
|
+
stopAll: () => void;
|
|
248
|
+
};
|
|
249
|
+
peers: {
|
|
250
|
+
peers: globalThis.Ref<Record<string, {
|
|
251
|
+
signal(data: import('../../types').SignalData): void;
|
|
252
|
+
addTrack(track: MediaStreamTrack, stream: MediaStream): void;
|
|
253
|
+
removeTrack(track: MediaStreamTrack): void;
|
|
254
|
+
replaceVideoTrack(track: MediaStreamTrack, stream: MediaStream): void;
|
|
255
|
+
isSending(track: MediaStreamTrack): boolean;
|
|
256
|
+
destroy: () => void;
|
|
257
|
+
}>, Record<string, {
|
|
258
|
+
signal(data: import('../../types').SignalData): void;
|
|
259
|
+
addTrack(track: MediaStreamTrack, stream: MediaStream): void;
|
|
260
|
+
removeTrack(track: MediaStreamTrack): void;
|
|
261
|
+
replaceVideoTrack(track: MediaStreamTrack, stream: MediaStream): void;
|
|
262
|
+
isSending(track: MediaStreamTrack): boolean;
|
|
263
|
+
destroy: () => void;
|
|
264
|
+
}>>;
|
|
265
|
+
remoteVideos: globalThis.Ref<Record<string, import('./peers').RemoteStream>, Record<string, import('./peers').RemoteStream>>;
|
|
266
|
+
remoteScreens: globalThis.Ref<Record<string, import('./peers').RemoteStream>, Record<string, import('./peers').RemoteStream>>;
|
|
267
|
+
remoteStreamTypes: globalThis.Ref<Record<string, import('./signaling').TrackTypes>, Record<string, import('./signaling').TrackTypes>>;
|
|
268
|
+
isInitiator: (remoteId: string) => boolean;
|
|
269
|
+
has: (remoteId: string) => boolean;
|
|
270
|
+
add: (remoteId: string, name: string) => void;
|
|
271
|
+
remove: (remoteId: string) => void;
|
|
272
|
+
signal: (remoteId: string, name: string, data: import('../../types').SignalData & {
|
|
273
|
+
sdp: string;
|
|
274
|
+
}) => void;
|
|
275
|
+
addTrackToAll: (track: MediaStreamTrack, stream: MediaStream) => void;
|
|
276
|
+
removeTrackFromAll: (track: MediaStreamTrack) => void;
|
|
277
|
+
replaceVideoTrack: (track: MediaStreamTrack, stream: MediaStream) => void;
|
|
278
|
+
destroyAll: () => void;
|
|
279
|
+
};
|
|
280
|
+
participantCount: globalThis.ComputedRef<number>;
|
|
281
|
+
tileCount: globalThis.ComputedRef<number>;
|
|
282
|
+
};
|
|
283
|
+
export type CallSession = ReturnType<typeof createCallSession>;
|
|
284
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../app/composables/call/session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAK5C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,IAAI,GAAG,SAAS,CAAA;KAAE,CAAC;IACzE,kDAAkD;IAClD,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AASD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB;;;;;6BA0GlB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0B7C;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CallHandlers, SignalData, TrackType } from '../../types';
|
|
2
|
+
export type TrackTypes = {
|
|
3
|
+
id: string;
|
|
4
|
+
type: TrackType;
|
|
5
|
+
}[];
|
|
6
|
+
export interface SignalingHandlers {
|
|
7
|
+
/** An SDP offer/answer or ICE candidate addressed to us. */
|
|
8
|
+
onSignal(from: string, name: string, signal: SignalData & {
|
|
9
|
+
sdp: string;
|
|
10
|
+
}): void;
|
|
11
|
+
/** Someone entered the call. */
|
|
12
|
+
onJoin(from: string, name: string): void;
|
|
13
|
+
/** Someone described which of their streams are camera, screen, … */
|
|
14
|
+
onTrackTypes(from: string, types: TrackTypes): void;
|
|
15
|
+
/** Someone left the call. */
|
|
16
|
+
onHangup(from: string): void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The call's messages over the host's pub/sub (`CallHandlers`), typed. Knows nothing about
|
|
20
|
+
* WebRTC: it only turns calls into messages and messages into callbacks.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createSignaling(handlers: Pick<CallHandlers, "publisher" | "subscriber" | "unSubscriber">, self: {
|
|
23
|
+
id: string;
|
|
24
|
+
name: () => string;
|
|
25
|
+
}): {
|
|
26
|
+
listen: (on: SignalingHandlers) => Promise<void>;
|
|
27
|
+
stop: () => void;
|
|
28
|
+
join: () => Promise<void>;
|
|
29
|
+
trackTypes: (types: TrackTypes) => Promise<void>;
|
|
30
|
+
signal: (to: string, signal: SignalData) => Promise<void>;
|
|
31
|
+
/** Rings the other side of `channel`. */
|
|
32
|
+
ring: (channel: string, avatar?: string) => Promise<void>;
|
|
33
|
+
hangup: (channel: string) => Promise<void>;
|
|
34
|
+
};
|
|
35
|
+
export type Signaling = ReturnType<typeof createSignaling>;
|
|
36
|
+
//# sourceMappingURL=signaling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signaling.d.ts","sourceRoot":"","sources":["../../../../../app/composables/call/signaling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACV,SAAS,EACV,MAAM,SAAS,CAAC;AAGjB,MAAM,MAAM,UAAU,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,EAAE,CAAC;AAE3D,MAAM,WAAW,iBAAiB;IAChC,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjF,gCAAgC;IAChC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,qEAAqE;IACrE,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACpD,6BAA6B;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,GAAG,YAAY,GAAG,cAAc,CAAC,EACzE,IAAI,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,MAAM,CAAA;CAAE;iBAOd,iBAAiB;;;wBAoCrB,UAAU;iBAKjB,MAAM,UAAU,UAAU;IAUvC,yCAAyC;oBACzB,MAAM,WAAW,MAAM;sBAKrB,MAAM;EAM3B;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC"}
|