@signalwire/js 3.29.2 → 4.0.0-beta.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/base-A5AZTrAd.d.cts +23 -0
- package/dist/base-A5AZTrAd.d.cts.map +1 -0
- package/dist/base-aVtoG8Wk.d.mts +23 -0
- package/dist/base-aVtoG8Wk.d.mts.map +1 -0
- package/dist/browser.mjs +16625 -0
- package/dist/browser.mjs.map +1 -0
- package/dist/browser.umd.js +16646 -0
- package/dist/browser.umd.js.map +1 -0
- package/dist/index.cjs +6210 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2690 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +2690 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +6194 -0
- package/dist/index.mjs.map +1 -0
- package/dist/operators/index.cjs +6 -0
- package/dist/operators/index.d.cts +109 -0
- package/dist/operators/index.d.cts.map +1 -0
- package/dist/operators/index.d.mts +109 -0
- package/dist/operators/index.d.mts.map +1 -0
- package/dist/operators/index.mjs +3 -0
- package/dist/operators-BHQMSEzq.mjs +371 -0
- package/dist/operators-BHQMSEzq.mjs.map +1 -0
- package/dist/operators-DT4UB24-.cjs +596 -0
- package/dist/operators-DT4UB24-.cjs.map +1 -0
- package/package.json +73 -37
- package/README.md +0 -40
- package/dist/core/src/BaseClient.d.ts +0 -19
- package/dist/core/src/BaseClient.d.ts.map +0 -1
- package/dist/core/src/BaseComponent.d.ts +0 -101
- package/dist/core/src/BaseComponent.d.ts.map +0 -1
- package/dist/core/src/BaseComponent.test.d.ts +0 -2
- package/dist/core/src/BaseComponent.test.d.ts.map +0 -1
- package/dist/core/src/BaseConsumer.d.ts +0 -18
- package/dist/core/src/BaseConsumer.d.ts.map +0 -1
- package/dist/core/src/BaseConsumer.test.d.ts +0 -2
- package/dist/core/src/BaseConsumer.test.d.ts.map +0 -1
- package/dist/core/src/BaseJWTSession.d.ts +0 -47
- package/dist/core/src/BaseJWTSession.d.ts.map +0 -1
- package/dist/core/src/BaseJWTSession.test.d.ts +0 -2
- package/dist/core/src/BaseJWTSession.test.d.ts.map +0 -1
- package/dist/core/src/BaseSession.d.ts +0 -117
- package/dist/core/src/BaseSession.d.ts.map +0 -1
- package/dist/core/src/BaseSession.test.d.ts +0 -2
- package/dist/core/src/BaseSession.test.d.ts.map +0 -1
- package/dist/core/src/CustomErrors.d.ts +0 -17
- package/dist/core/src/CustomErrors.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/RPCConnect.d.ts +0 -42
- package/dist/core/src/RPCMessages/RPCConnect.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/RPCDisconnect.d.ts +0 -8
- package/dist/core/src/RPCMessages/RPCDisconnect.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/RPCEventAck.d.ts +0 -8
- package/dist/core/src/RPCMessages/RPCEventAck.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/RPCExecute.d.ts +0 -16
- package/dist/core/src/RPCMessages/RPCExecute.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/RPCPing.d.ts +0 -16
- package/dist/core/src/RPCMessages/RPCPing.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/RPCReauthenticate.d.ts +0 -13
- package/dist/core/src/RPCMessages/RPCReauthenticate.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/VertoMessages.d.ts +0 -84
- package/dist/core/src/RPCMessages/VertoMessages.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/helpers.d.ts +0 -31
- package/dist/core/src/RPCMessages/helpers.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/index.d.ts +0 -9
- package/dist/core/src/RPCMessages/index.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/index.test.d.ts +0 -2
- package/dist/core/src/RPCMessages/index.test.d.ts.map +0 -1
- package/dist/core/src/chat/BaseChat.d.ts +0 -23
- package/dist/core/src/chat/BaseChat.d.ts.map +0 -1
- package/dist/core/src/chat/ChatMember.d.ts +0 -15
- package/dist/core/src/chat/ChatMember.d.ts.map +0 -1
- package/dist/core/src/chat/ChatMessage.d.ts +0 -10
- package/dist/core/src/chat/ChatMessage.d.ts.map +0 -1
- package/dist/core/src/chat/applyCommonMethods.d.ts +0 -22
- package/dist/core/src/chat/applyCommonMethods.d.ts.map +0 -1
- package/dist/core/src/chat/index.d.ts +0 -6
- package/dist/core/src/chat/index.d.ts.map +0 -1
- package/dist/core/src/chat/methods.d.ts +0 -31
- package/dist/core/src/chat/methods.d.ts.map +0 -1
- package/dist/core/src/chat/utils/index.d.ts +0 -3
- package/dist/core/src/chat/utils/index.d.ts.map +0 -1
- package/dist/core/src/chat/utils/toInternalChatChannels.d.ts +0 -3
- package/dist/core/src/chat/utils/toInternalChatChannels.d.ts.map +0 -1
- package/dist/core/src/chat/utils/toInternalChatChannels.test.d.ts +0 -2
- package/dist/core/src/chat/utils/toInternalChatChannels.test.d.ts.map +0 -1
- package/dist/core/src/chat/workers/chatWorker.d.ts +0 -4
- package/dist/core/src/chat/workers/chatWorker.d.ts.map +0 -1
- package/dist/core/src/chat/workers/index.d.ts +0 -2
- package/dist/core/src/chat/workers/index.d.ts.map +0 -1
- package/dist/core/src/index.d.ts +0 -45
- package/dist/core/src/index.d.ts.map +0 -1
- package/dist/core/src/index.test.d.ts +0 -1
- package/dist/core/src/index.test.d.ts.map +0 -1
- package/dist/core/src/memberPosition/index.d.ts +0 -2
- package/dist/core/src/memberPosition/index.d.ts.map +0 -1
- package/dist/core/src/memberPosition/workers.d.ts +0 -13
- package/dist/core/src/memberPosition/workers.d.ts.map +0 -1
- package/dist/core/src/memberPosition/workers.test.d.ts +0 -2
- package/dist/core/src/memberPosition/workers.test.d.ts.map +0 -1
- package/dist/core/src/pubSub/BasePubSub.d.ts +0 -43
- package/dist/core/src/pubSub/BasePubSub.d.ts.map +0 -1
- package/dist/core/src/pubSub/PubSubMessage.d.ts +0 -19
- package/dist/core/src/pubSub/PubSubMessage.d.ts.map +0 -1
- package/dist/core/src/pubSub/index.d.ts +0 -3
- package/dist/core/src/pubSub/index.d.ts.map +0 -1
- package/dist/core/src/pubSub/workers/index.d.ts +0 -2
- package/dist/core/src/pubSub/workers/index.d.ts.map +0 -1
- package/dist/core/src/pubSub/workers/pubSubWorker.d.ts +0 -4
- package/dist/core/src/pubSub/workers/pubSubWorker.d.ts.map +0 -1
- package/dist/core/src/redux/actions.d.ts +0 -25
- package/dist/core/src/redux/actions.d.ts.map +0 -1
- package/dist/core/src/redux/connect.d.ts +0 -23
- package/dist/core/src/redux/connect.d.ts.map +0 -1
- package/dist/core/src/redux/connect.test.d.ts +0 -2
- package/dist/core/src/redux/connect.test.d.ts.map +0 -1
- package/dist/core/src/redux/features/component/componentSaga.d.ts +0 -4
- package/dist/core/src/redux/features/component/componentSaga.d.ts.map +0 -1
- package/dist/core/src/redux/features/component/componentSaga.test.d.ts +0 -2
- package/dist/core/src/redux/features/component/componentSaga.test.d.ts.map +0 -1
- package/dist/core/src/redux/features/component/componentSelectors.d.ts +0 -7
- package/dist/core/src/redux/features/component/componentSelectors.d.ts.map +0 -1
- package/dist/core/src/redux/features/component/componentSelectors.test.d.ts +0 -2
- package/dist/core/src/redux/features/component/componentSelectors.test.d.ts.map +0 -1
- package/dist/core/src/redux/features/component/componentSlice.d.ts +0 -2319
- package/dist/core/src/redux/features/component/componentSlice.d.ts.map +0 -1
- package/dist/core/src/redux/features/component/componentSlice.test.d.ts +0 -2
- package/dist/core/src/redux/features/component/componentSlice.test.d.ts.map +0 -1
- package/dist/core/src/redux/features/index.d.ts +0 -3
- package/dist/core/src/redux/features/index.d.ts.map +0 -1
- package/dist/core/src/redux/features/session/sessionSaga.d.ts +0 -11
- package/dist/core/src/redux/features/session/sessionSaga.d.ts.map +0 -1
- package/dist/core/src/redux/features/session/sessionSelectors.d.ts +0 -9
- package/dist/core/src/redux/features/session/sessionSelectors.d.ts.map +0 -1
- package/dist/core/src/redux/features/session/sessionSlice.d.ts +0 -521
- package/dist/core/src/redux/features/session/sessionSlice.d.ts.map +0 -1
- package/dist/core/src/redux/features/session/sessionSlice.test.d.ts +0 -2
- package/dist/core/src/redux/features/session/sessionSlice.test.d.ts.map +0 -1
- package/dist/core/src/redux/index.d.ts +0 -31
- package/dist/core/src/redux/index.d.ts.map +0 -1
- package/dist/core/src/redux/interfaces.d.ts +0 -87
- package/dist/core/src/redux/interfaces.d.ts.map +0 -1
- package/dist/core/src/redux/rootReducer.d.ts +0 -457
- package/dist/core/src/redux/rootReducer.d.ts.map +0 -1
- package/dist/core/src/redux/rootSaga.d.ts +0 -40
- package/dist/core/src/redux/rootSaga.d.ts.map +0 -1
- package/dist/core/src/redux/rootSaga.test.d.ts +0 -2
- package/dist/core/src/redux/rootSaga.test.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/configureStore.d.ts +0 -77
- package/dist/core/src/redux/toolkit/configureStore.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/createAction.d.ts +0 -180
- package/dist/core/src/redux/toolkit/createAction.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/createReducer.d.ts +0 -42
- package/dist/core/src/redux/toolkit/createReducer.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/createSlice.d.ts +0 -142
- package/dist/core/src/redux/toolkit/createSlice.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/devtoolsExtension.d.ts +0 -185
- package/dist/core/src/redux/toolkit/devtoolsExtension.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/getDefaultMiddleware.d.ts +0 -12
- package/dist/core/src/redux/toolkit/getDefaultMiddleware.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/index.d.ts +0 -13
- package/dist/core/src/redux/toolkit/index.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/isPlainObject.d.ts +0 -12
- package/dist/core/src/redux/toolkit/isPlainObject.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/mapBuilders.d.ts +0 -38
- package/dist/core/src/redux/toolkit/mapBuilders.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/tsHelpers.d.ts +0 -51
- package/dist/core/src/redux/toolkit/tsHelpers.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/utils.d.ts +0 -11
- package/dist/core/src/redux/toolkit/utils.d.ts.map +0 -1
- package/dist/core/src/redux/utils/createDestroyableSlice.d.ts +0 -9
- package/dist/core/src/redux/utils/createDestroyableSlice.d.ts.map +0 -1
- package/dist/core/src/redux/utils/createDestroyableSlice.test.d.ts +0 -2
- package/dist/core/src/redux/utils/createDestroyableSlice.test.d.ts.map +0 -1
- package/dist/core/src/redux/utils/sagaHelpers.d.ts +0 -5
- package/dist/core/src/redux/utils/sagaHelpers.d.ts.map +0 -1
- package/dist/core/src/redux/utils/useInstanceMap.d.ts +0 -3
- package/dist/core/src/redux/utils/useInstanceMap.d.ts.map +0 -1
- package/dist/core/src/redux/utils/useSession.d.ts +0 -16
- package/dist/core/src/redux/utils/useSession.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionPlayback.d.ts +0 -40
- package/dist/core/src/rooms/RoomSessionPlayback.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionPlayback.test.d.ts +0 -2
- package/dist/core/src/rooms/RoomSessionPlayback.test.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionRecording.d.ts +0 -30
- package/dist/core/src/rooms/RoomSessionRecording.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionRecording.test.d.ts +0 -2
- package/dist/core/src/rooms/RoomSessionRecording.test.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionStream.d.ts +0 -29
- package/dist/core/src/rooms/RoomSessionStream.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionStream.test.d.ts +0 -2
- package/dist/core/src/rooms/RoomSessionStream.test.d.ts.map +0 -1
- package/dist/core/src/rooms/index.d.ts +0 -11
- package/dist/core/src/rooms/index.d.ts.map +0 -1
- package/dist/core/src/rooms/methods.d.ts +0 -179
- package/dist/core/src/rooms/methods.d.ts.map +0 -1
- package/dist/core/src/rooms/methods.test.d.ts +0 -2
- package/dist/core/src/rooms/methods.test.d.ts.map +0 -1
- package/dist/core/src/setupTests.d.ts +0 -1
- package/dist/core/src/setupTests.d.ts.map +0 -1
- package/dist/core/src/testUtils.d.ts +0 -54
- package/dist/core/src/testUtils.d.ts.map +0 -1
- package/dist/core/src/types/cantina.d.ts +0 -82
- package/dist/core/src/types/cantina.d.ts.map +0 -1
- package/dist/core/src/types/chat.d.ts +0 -270
- package/dist/core/src/types/chat.d.ts.map +0 -1
- package/dist/core/src/types/common.d.ts +0 -34
- package/dist/core/src/types/common.d.ts.map +0 -1
- package/dist/core/src/types/conversation.d.ts +0 -33
- package/dist/core/src/types/conversation.d.ts.map +0 -1
- package/dist/core/src/types/fabric.d.ts +0 -15
- package/dist/core/src/types/fabric.d.ts.map +0 -1
- package/dist/core/src/types/fabricLayout.d.ts +0 -25
- package/dist/core/src/types/fabricLayout.d.ts.map +0 -1
- package/dist/core/src/types/fabricMember.d.ts +0 -148
- package/dist/core/src/types/fabricMember.d.ts.map +0 -1
- package/dist/core/src/types/fabricRoomSession.d.ts +0 -631
- package/dist/core/src/types/fabricRoomSession.d.ts.map +0 -1
- package/dist/core/src/types/index.d.ts +0 -276
- package/dist/core/src/types/index.d.ts.map +0 -1
- package/dist/core/src/types/messaging.d.ts +0 -90
- package/dist/core/src/types/messaging.d.ts.map +0 -1
- package/dist/core/src/types/pubSub.d.ts +0 -123
- package/dist/core/src/types/pubSub.d.ts.map +0 -1
- package/dist/core/src/types/task.d.ts +0 -36
- package/dist/core/src/types/task.d.ts.map +0 -1
- package/dist/core/src/types/utils.d.ts +0 -71
- package/dist/core/src/types/utils.d.ts.map +0 -1
- package/dist/core/src/types/video.d.ts +0 -62
- package/dist/core/src/types/video.d.ts.map +0 -1
- package/dist/core/src/types/videoLayout.d.ts +0 -75
- package/dist/core/src/types/videoLayout.d.ts.map +0 -1
- package/dist/core/src/types/videoMember.d.ts +0 -384
- package/dist/core/src/types/videoMember.d.ts.map +0 -1
- package/dist/core/src/types/videoPlayback.d.ts +0 -123
- package/dist/core/src/types/videoPlayback.d.ts.map +0 -1
- package/dist/core/src/types/videoRecording.d.ts +0 -114
- package/dist/core/src/types/videoRecording.d.ts.map +0 -1
- package/dist/core/src/types/videoRoomDevice.d.ts +0 -23
- package/dist/core/src/types/videoRoomDevice.d.ts.map +0 -1
- package/dist/core/src/types/videoRoomSession.d.ts +0 -921
- package/dist/core/src/types/videoRoomSession.d.ts.map +0 -1
- package/dist/core/src/types/videoStream.d.ts +0 -104
- package/dist/core/src/types/videoStream.d.ts.map +0 -1
- package/dist/core/src/types/voice.d.ts +0 -15
- package/dist/core/src/types/voice.d.ts.map +0 -1
- package/dist/core/src/types/voiceCall.d.ts +0 -253
- package/dist/core/src/types/voiceCall.d.ts.map +0 -1
- package/dist/core/src/types/voiceCollect.d.ts +0 -166
- package/dist/core/src/types/voiceCollect.d.ts.map +0 -1
- package/dist/core/src/types/voiceConnect.d.ts +0 -77
- package/dist/core/src/types/voiceConnect.d.ts.map +0 -1
- package/dist/core/src/types/voiceDetect.d.ts +0 -127
- package/dist/core/src/types/voiceDetect.d.ts.map +0 -1
- package/dist/core/src/types/voicePlayback.d.ts +0 -141
- package/dist/core/src/types/voicePlayback.d.ts.map +0 -1
- package/dist/core/src/types/voicePrompt.d.ts +0 -105
- package/dist/core/src/types/voicePrompt.d.ts.map +0 -1
- package/dist/core/src/types/voiceRecording.d.ts +0 -107
- package/dist/core/src/types/voiceRecording.d.ts.map +0 -1
- package/dist/core/src/types/voiceSendDigits.d.ts +0 -21
- package/dist/core/src/types/voiceSendDigits.d.ts.map +0 -1
- package/dist/core/src/types/voiceTap.d.ts +0 -116
- package/dist/core/src/types/voiceTap.d.ts.map +0 -1
- package/dist/core/src/utils/EventEmitter.d.ts +0 -9
- package/dist/core/src/utils/EventEmitter.d.ts.map +0 -1
- package/dist/core/src/utils/EventEmitter.test.d.ts +0 -2
- package/dist/core/src/utils/EventEmitter.test.d.ts.map +0 -1
- package/dist/core/src/utils/SWCloseEvent.d.ts +0 -18
- package/dist/core/src/utils/SWCloseEvent.d.ts.map +0 -1
- package/dist/core/src/utils/asyncRetry.d.ts +0 -18
- package/dist/core/src/utils/asyncRetry.d.ts.map +0 -1
- package/dist/core/src/utils/asyncRetry.test.d.ts +0 -2
- package/dist/core/src/utils/asyncRetry.test.d.ts.map +0 -1
- package/dist/core/src/utils/common.d.ts +0 -9
- package/dist/core/src/utils/common.d.ts.map +0 -1
- package/dist/core/src/utils/constants.d.ts +0 -44
- package/dist/core/src/utils/constants.d.ts.map +0 -1
- package/dist/core/src/utils/debounce.d.ts +0 -8
- package/dist/core/src/utils/debounce.d.ts.map +0 -1
- package/dist/core/src/utils/eventUtils.d.ts +0 -2
- package/dist/core/src/utils/eventUtils.d.ts.map +0 -1
- package/dist/core/src/utils/extendComponent.d.ts +0 -4
- package/dist/core/src/utils/extendComponent.d.ts.map +0 -1
- package/dist/core/src/utils/extendComponent.test.d.ts +0 -2
- package/dist/core/src/utils/extendComponent.test.d.ts.map +0 -1
- package/dist/core/src/utils/index.d.ts +0 -47
- package/dist/core/src/utils/index.d.ts.map +0 -1
- package/dist/core/src/utils/index.test.d.ts +0 -2
- package/dist/core/src/utils/index.test.d.ts.map +0 -1
- package/dist/core/src/utils/interfaces.d.ts +0 -296
- package/dist/core/src/utils/interfaces.d.ts.map +0 -1
- package/dist/core/src/utils/logger.d.ts +0 -6
- package/dist/core/src/utils/logger.d.ts.map +0 -1
- package/dist/core/src/utils/logger.test.d.ts +0 -2
- package/dist/core/src/utils/logger.test.d.ts.map +0 -1
- package/dist/core/src/utils/parseRPCResponse.d.ts +0 -10
- package/dist/core/src/utils/parseRPCResponse.d.ts.map +0 -1
- package/dist/core/src/utils/parseRPCResponse.test.d.ts +0 -2
- package/dist/core/src/utils/parseRPCResponse.test.d.ts.map +0 -1
- package/dist/core/src/utils/storage/index.d.ts +0 -11
- package/dist/core/src/utils/storage/index.d.ts.map +0 -1
- package/dist/core/src/utils/storage/index.native.d.ts +0 -11
- package/dist/core/src/utils/storage/index.native.d.ts.map +0 -1
- package/dist/core/src/utils/toExternalJSON.d.ts +0 -34
- package/dist/core/src/utils/toExternalJSON.d.ts.map +0 -1
- package/dist/core/src/utils/toExternalJSON.test.d.ts +0 -2
- package/dist/core/src/utils/toExternalJSON.test.d.ts.map +0 -1
- package/dist/core/src/utils/toInternalAction.d.ts +0 -7
- package/dist/core/src/utils/toInternalAction.d.ts.map +0 -1
- package/dist/core/src/utils/toInternalAction.test.d.ts +0 -2
- package/dist/core/src/utils/toInternalAction.test.d.ts.map +0 -1
- package/dist/core/src/utils/toInternalEventName.d.ts +0 -8
- package/dist/core/src/utils/toInternalEventName.d.ts.map +0 -1
- package/dist/core/src/utils/toInternalEventName.test.d.ts +0 -2
- package/dist/core/src/utils/toInternalEventName.test.d.ts.map +0 -1
- package/dist/core/src/utils/toSnakeCaseKeys.d.ts +0 -7
- package/dist/core/src/utils/toSnakeCaseKeys.d.ts.map +0 -1
- package/dist/core/src/utils/toSnakeCaseKeys.test.d.ts +0 -2
- package/dist/core/src/utils/toSnakeCaseKeys.test.d.ts.map +0 -1
- package/dist/core/src/workers/executeActionWorker.d.ts +0 -7
- package/dist/core/src/workers/executeActionWorker.d.ts.map +0 -1
- package/dist/core/src/workers/index.d.ts +0 -2
- package/dist/core/src/workers/index.d.ts.map +0 -1
- package/dist/index.esm.js +0 -4673
- package/dist/index.esm.js.map +0 -7
- package/dist/index.js +0 -4655
- package/dist/index.js.map +0 -7
- package/dist/index.umd.js +0 -31
- package/dist/index.umd.js.map +0 -1
- package/dist/js/src/BaseRoomSession.d.ts +0 -52
- package/dist/js/src/BaseRoomSession.d.ts.map +0 -1
- package/dist/js/src/Client.d.ts +0 -38
- package/dist/js/src/Client.d.ts.map +0 -1
- package/dist/js/src/JWTSession.d.ts +0 -31
- package/dist/js/src/JWTSession.d.ts.map +0 -1
- package/dist/js/src/RoomSessionDevice.d.ts +0 -30
- package/dist/js/src/RoomSessionDevice.d.ts.map +0 -1
- package/dist/js/src/RoomSessionScreenShare.d.ts +0 -26
- package/dist/js/src/RoomSessionScreenShare.d.ts.map +0 -1
- package/dist/js/src/VideoOverlays.d.ts +0 -42
- package/dist/js/src/VideoOverlays.d.ts.map +0 -1
- package/dist/js/src/buildVideoElement.d.ts +0 -18
- package/dist/js/src/buildVideoElement.d.ts.map +0 -1
- package/dist/js/src/cantina/VideoManager.d.ts +0 -16
- package/dist/js/src/cantina/VideoManager.d.ts.map +0 -1
- package/dist/js/src/cantina/index.d.ts +0 -2
- package/dist/js/src/cantina/index.d.ts.map +0 -1
- package/dist/js/src/cantina/workers/index.d.ts +0 -2
- package/dist/js/src/cantina/workers/index.d.ts.map +0 -1
- package/dist/js/src/cantina/workers/videoManagerRoomWorker.d.ts +0 -4
- package/dist/js/src/cantina/workers/videoManagerRoomWorker.d.ts.map +0 -1
- package/dist/js/src/cantina/workers/videoManagerRoomsWorker.d.ts +0 -4
- package/dist/js/src/cantina/workers/videoManagerRoomsWorker.d.ts.map +0 -1
- package/dist/js/src/cantina/workers/videoManagerWorker.d.ts +0 -7
- package/dist/js/src/cantina/workers/videoManagerWorker.d.ts.map +0 -1
- package/dist/js/src/chat/Client.d.ts +0 -46
- package/dist/js/src/chat/Client.d.ts.map +0 -1
- package/dist/js/src/chat/index.d.ts +0 -5
- package/dist/js/src/chat/index.d.ts.map +0 -1
- package/dist/js/src/createClient.d.ts +0 -26
- package/dist/js/src/createClient.d.ts.map +0 -1
- package/dist/js/src/createRoomObject.d.ts +0 -38
- package/dist/js/src/createRoomObject.d.ts.map +0 -1
- package/dist/js/src/fabric/FabricRoomSession.d.ts +0 -80
- package/dist/js/src/fabric/FabricRoomSession.d.ts.map +0 -1
- package/dist/js/src/fabric/FabricRoomSessionMember.d.ts +0 -46
- package/dist/js/src/fabric/FabricRoomSessionMember.d.ts.map +0 -1
- package/dist/js/src/fabric/HTTPClient.d.ts +0 -16
- package/dist/js/src/fabric/HTTPClient.d.ts.map +0 -1
- package/dist/js/src/fabric/IncomingCallManager.d.ts +0 -19
- package/dist/js/src/fabric/IncomingCallManager.d.ts.map +0 -1
- package/dist/js/src/fabric/SATSession.d.ts +0 -25
- package/dist/js/src/fabric/SATSession.d.ts.map +0 -1
- package/dist/js/src/fabric/SignalWire.d.ts +0 -3
- package/dist/js/src/fabric/SignalWire.d.ts.map +0 -1
- package/dist/js/src/fabric/WSClient.d.ts +0 -33
- package/dist/js/src/fabric/WSClient.d.ts.map +0 -1
- package/dist/js/src/fabric/createHttpClient.d.ts +0 -22
- package/dist/js/src/fabric/createHttpClient.d.ts.map +0 -1
- package/dist/js/src/fabric/createWSClient.d.ts +0 -38
- package/dist/js/src/fabric/createWSClient.d.ts.map +0 -1
- package/dist/js/src/fabric/index.d.ts +0 -15
- package/dist/js/src/fabric/index.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/address.d.ts +0 -37
- package/dist/js/src/fabric/interfaces/address.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/capabilities.d.ts +0 -29
- package/dist/js/src/fabric/interfaces/capabilities.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/conversation.d.ts +0 -105
- package/dist/js/src/fabric/interfaces/conversation.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/device.d.ts +0 -18
- package/dist/js/src/fabric/interfaces/device.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/httpClient.d.ts +0 -41
- package/dist/js/src/fabric/interfaces/httpClient.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/incomingCallManager.d.ts +0 -30
- package/dist/js/src/fabric/interfaces/incomingCallManager.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/index.d.ts +0 -71
- package/dist/js/src/fabric/interfaces/index.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/wsClient.d.ts +0 -132
- package/dist/js/src/fabric/interfaces/wsClient.d.ts.map +0 -1
- package/dist/js/src/fabric/utils/capabilitiesHelpers.d.ts +0 -28
- package/dist/js/src/fabric/utils/capabilitiesHelpers.d.ts.map +0 -1
- package/dist/js/src/fabric/utils/constants.d.ts +0 -5
- package/dist/js/src/fabric/utils/constants.d.ts.map +0 -1
- package/dist/js/src/fabric/utils/eventMappers.d.ts +0 -151
- package/dist/js/src/fabric/utils/eventMappers.d.ts.map +0 -1
- package/dist/js/src/fabric/utils/typeGuard.d.ts +0 -6
- package/dist/js/src/fabric/utils/typeGuard.d.ts.map +0 -1
- package/dist/js/src/fabric/utils/validationProxy.d.ts +0 -13
- package/dist/js/src/fabric/utils/validationProxy.d.ts.map +0 -1
- package/dist/js/src/fabric/utils/validators.d.ts +0 -20
- package/dist/js/src/fabric/utils/validators.d.ts.map +0 -1
- package/dist/js/src/fabric/workers/callJoinWorker.d.ts +0 -4
- package/dist/js/src/fabric/workers/callJoinWorker.d.ts.map +0 -1
- package/dist/js/src/fabric/workers/callLeftWorker.d.ts +0 -4
- package/dist/js/src/fabric/workers/callLeftWorker.d.ts.map +0 -1
- package/dist/js/src/fabric/workers/callSegmentWorker.d.ts +0 -4
- package/dist/js/src/fabric/workers/callSegmentWorker.d.ts.map +0 -1
- package/dist/js/src/fabric/workers/fabricMemberWorker.d.ts +0 -4
- package/dist/js/src/fabric/workers/fabricMemberWorker.d.ts.map +0 -1
- package/dist/js/src/fabric/workers/fabricWorker.d.ts +0 -7
- package/dist/js/src/fabric/workers/fabricWorker.d.ts.map +0 -1
- package/dist/js/src/fabric/workers/index.d.ts +0 -3
- package/dist/js/src/fabric/workers/index.d.ts.map +0 -1
- package/dist/js/src/fabric/workers/wsClientWorker.d.ts +0 -4
- package/dist/js/src/fabric/workers/wsClientWorker.d.ts.map +0 -1
- package/dist/js/src/features/actions.d.ts +0 -2
- package/dist/js/src/features/actions.d.ts.map +0 -1
- package/dist/js/src/features/mediaElements/mediaElementsSagas.d.ts +0 -7
- package/dist/js/src/features/mediaElements/mediaElementsSagas.d.ts.map +0 -1
- package/dist/js/src/index.d.ts +0 -87
- package/dist/js/src/index.d.ts.map +0 -1
- package/dist/js/src/joinRoom.d.ts +0 -24
- package/dist/js/src/joinRoom.d.ts.map +0 -1
- package/dist/js/src/pubSub/Client.d.ts +0 -46
- package/dist/js/src/pubSub/Client.d.ts.map +0 -1
- package/dist/js/src/pubSub/index.d.ts +0 -6
- package/dist/js/src/pubSub/index.d.ts.map +0 -1
- package/dist/js/src/setupTests.d.ts +0 -2
- package/dist/js/src/setupTests.d.ts.map +0 -1
- package/dist/js/src/testUtils.d.ts +0 -77
- package/dist/js/src/testUtils.d.ts.map +0 -1
- package/dist/js/src/utils/CloseEvent.d.ts +0 -7
- package/dist/js/src/utils/CloseEvent.d.ts.map +0 -1
- package/dist/js/src/utils/audioElement.d.ts +0 -6
- package/dist/js/src/utils/audioElement.d.ts.map +0 -1
- package/dist/js/src/utils/constants.d.ts +0 -2
- package/dist/js/src/utils/constants.d.ts.map +0 -1
- package/dist/js/src/utils/interfaces/base.d.ts +0 -55
- package/dist/js/src/utils/interfaces/base.d.ts.map +0 -1
- package/dist/js/src/utils/interfaces/fabric.d.ts +0 -71
- package/dist/js/src/utils/interfaces/fabric.d.ts.map +0 -1
- package/dist/js/src/utils/interfaces/index.d.ts +0 -4
- package/dist/js/src/utils/interfaces/index.d.ts.map +0 -1
- package/dist/js/src/utils/interfaces/video.d.ts +0 -307
- package/dist/js/src/utils/interfaces/video.d.ts.map +0 -1
- package/dist/js/src/utils/makeQueryParamsUrl.d.ts +0 -9
- package/dist/js/src/utils/makeQueryParamsUrl.d.ts.map +0 -1
- package/dist/js/src/utils/paginatedResult.d.ts +0 -12
- package/dist/js/src/utils/paginatedResult.d.ts.map +0 -1
- package/dist/js/src/utils/roomSession.d.ts +0 -26
- package/dist/js/src/utils/roomSession.d.ts.map +0 -1
- package/dist/js/src/utils/storage.d.ts +0 -10
- package/dist/js/src/utils/storage.d.ts.map +0 -1
- package/dist/js/src/utils/videoElement.d.ts +0 -35
- package/dist/js/src/utils/videoElement.d.ts.map +0 -1
- package/dist/js/src/video/RoomSession.d.ts +0 -38
- package/dist/js/src/video/RoomSession.d.ts.map +0 -1
- package/dist/js/src/video/VideoRoomSession.d.ts +0 -57
- package/dist/js/src/video/VideoRoomSession.d.ts.map +0 -1
- package/dist/js/src/video/index.d.ts +0 -16
- package/dist/js/src/video/index.d.ts.map +0 -1
- package/dist/js/src/video/workers/childMemberJoinedWorker.d.ts +0 -10
- package/dist/js/src/video/workers/childMemberJoinedWorker.d.ts.map +0 -1
- package/dist/js/src/video/workers/index.d.ts +0 -7
- package/dist/js/src/video/workers/index.d.ts.map +0 -1
- package/dist/js/src/video/workers/memberListUpdatedWorker.d.ts +0 -14
- package/dist/js/src/video/workers/memberListUpdatedWorker.d.ts.map +0 -1
- package/dist/js/src/video/workers/videoPlaybackWorker.d.ts +0 -4
- package/dist/js/src/video/workers/videoPlaybackWorker.d.ts.map +0 -1
- package/dist/js/src/video/workers/videoRecordWorker.d.ts +0 -4
- package/dist/js/src/video/workers/videoRecordWorker.d.ts.map +0 -1
- package/dist/js/src/video/workers/videoStreamWorker.d.ts +0 -4
- package/dist/js/src/video/workers/videoStreamWorker.d.ts.map +0 -1
- package/dist/js/src/video/workers/videoWorker.d.ts +0 -7
- package/dist/js/src/video/workers/videoWorker.d.ts.map +0 -1
- package/dist/js/src/webrtc.d.ts +0 -3
- package/dist/js/src/webrtc.d.ts.map +0 -1
- package/dist/js/tsconfig.build.tsbuildinfo +0 -1
- package/dist/webrtc/src/BaseConnection.d.ts +0 -232
- package/dist/webrtc/src/BaseConnection.d.ts.map +0 -1
- package/dist/webrtc/src/RTCPeer.d.ts +0 -134
- package/dist/webrtc/src/RTCPeer.d.ts.map +0 -1
- package/dist/webrtc/src/RTCPeer.test.d.ts +0 -2
- package/dist/webrtc/src/RTCPeer.test.d.ts.map +0 -1
- package/dist/webrtc/src/RTCPeerConnectionManager.d.ts +0 -63
- package/dist/webrtc/src/RTCPeerConnectionManager.d.ts.map +0 -1
- package/dist/webrtc/src/RTCPeerConnectionManager.test.d.ts +0 -2
- package/dist/webrtc/src/RTCPeerConnectionManager.test.d.ts.map +0 -1
- package/dist/webrtc/src/connectionPoolManager.d.ts +0 -14
- package/dist/webrtc/src/connectionPoolManager.d.ts.map +0 -1
- package/dist/webrtc/src/index.d.ts +0 -7
- package/dist/webrtc/src/index.d.ts.map +0 -1
- package/dist/webrtc/src/index.test.d.ts +0 -1
- package/dist/webrtc/src/index.test.d.ts.map +0 -1
- package/dist/webrtc/src/setupTests.d.ts +0 -2
- package/dist/webrtc/src/setupTests.d.ts.map +0 -1
- package/dist/webrtc/src/utils/constants.d.ts +0 -7
- package/dist/webrtc/src/utils/constants.d.ts.map +0 -1
- package/dist/webrtc/src/utils/deviceHelpers.d.ts +0 -319
- package/dist/webrtc/src/utils/deviceHelpers.d.ts.map +0 -1
- package/dist/webrtc/src/utils/deviceHelpers.test.d.ts +0 -2
- package/dist/webrtc/src/utils/deviceHelpers.test.d.ts.map +0 -1
- package/dist/webrtc/src/utils/enumerateDevices.d.ts +0 -25
- package/dist/webrtc/src/utils/enumerateDevices.d.ts.map +0 -1
- package/dist/webrtc/src/utils/getDisplayMedia.d.ts +0 -17
- package/dist/webrtc/src/utils/getDisplayMedia.d.ts.map +0 -1
- package/dist/webrtc/src/utils/getUserMedia.d.ts +0 -35
- package/dist/webrtc/src/utils/getUserMedia.d.ts.map +0 -1
- package/dist/webrtc/src/utils/helpers.d.ts +0 -18
- package/dist/webrtc/src/utils/helpers.d.ts.map +0 -1
- package/dist/webrtc/src/utils/helpers.test.d.ts +0 -2
- package/dist/webrtc/src/utils/helpers.test.d.ts.map +0 -1
- package/dist/webrtc/src/utils/index.d.ts +0 -8
- package/dist/webrtc/src/utils/index.d.ts.map +0 -1
- package/dist/webrtc/src/utils/interfaces.d.ts +0 -139
- package/dist/webrtc/src/utils/interfaces.d.ts.map +0 -1
- package/dist/webrtc/src/utils/mockTracks.d.ts +0 -26
- package/dist/webrtc/src/utils/mockTracks.d.ts.map +0 -1
- package/dist/webrtc/src/utils/permissions.d.ts +0 -48
- package/dist/webrtc/src/utils/permissions.d.ts.map +0 -1
- package/dist/webrtc/src/utils/primitives.d.ts +0 -54
- package/dist/webrtc/src/utils/primitives.d.ts.map +0 -1
- package/dist/webrtc/src/utils/primitives.native.d.ts +0 -36
- package/dist/webrtc/src/utils/primitives.native.d.ts.map +0 -1
- package/dist/webrtc/src/utils/requestPermissions.d.ts +0 -27
- package/dist/webrtc/src/utils/requestPermissions.d.ts.map +0 -1
- package/dist/webrtc/src/utils/sdpHelpers.d.ts +0 -61
- package/dist/webrtc/src/utils/sdpHelpers.d.ts.map +0 -1
- package/dist/webrtc/src/utils/sdpHelpers.test.d.ts +0 -2
- package/dist/webrtc/src/utils/sdpHelpers.test.d.ts.map +0 -1
- package/dist/webrtc/src/utils/watchRTCPeerMediaPackets.d.ts +0 -7
- package/dist/webrtc/src/utils/watchRTCPeerMediaPackets.d.ts.map +0 -1
- package/dist/webrtc/src/utils/webrtcHelpers.test.d.ts +0 -2
- package/dist/webrtc/src/utils/webrtcHelpers.test.d.ts.map +0 -1
- package/dist/webrtc/src/webrtcMocks.d.ts +0 -110
- package/dist/webrtc/src/webrtcMocks.d.ts.map +0 -1
- package/dist/webrtc/src/workers/connectionPoolWorker.d.ts +0 -7
- package/dist/webrtc/src/workers/connectionPoolWorker.d.ts.map +0 -1
- package/dist/webrtc/src/workers/index.d.ts +0 -7
- package/dist/webrtc/src/workers/index.d.ts.map +0 -1
- package/dist/webrtc/src/workers/promoteDemoteWorker.d.ts +0 -10
- package/dist/webrtc/src/workers/promoteDemoteWorker.d.ts.map +0 -1
- package/dist/webrtc/src/workers/roomSubscribedWorker.d.ts +0 -10
- package/dist/webrtc/src/workers/roomSubscribedWorker.d.ts.map +0 -1
- package/dist/webrtc/src/workers/sessionAuthWorker.d.ts +0 -10
- package/dist/webrtc/src/workers/sessionAuthWorker.d.ts.map +0 -1
- package/dist/webrtc/src/workers/sessionConnectionPoolWorker.d.ts +0 -7
- package/dist/webrtc/src/workers/sessionConnectionPoolWorker.d.ts.map +0 -1
- package/dist/webrtc/src/workers/vertoEventWorker.d.ts +0 -10
- package/dist/webrtc/src/workers/vertoEventWorker.d.ts.map +0 -1
- package/dist/webrtc/src/workers/vertoEventWorker.test.d.ts +0 -2
- package/dist/webrtc/src/workers/vertoEventWorker.test.d.ts.map +0 -1
- package/src/BaseRoomSession.ts +0 -302
- package/src/Client.ts +0 -193
- package/src/JWTSession.test.ts +0 -60
- package/src/JWTSession.ts +0 -146
- package/src/RoomSessionDevice.test.ts +0 -25
- package/src/RoomSessionDevice.ts +0 -62
- package/src/RoomSessionScreenShare.test.ts +0 -25
- package/src/RoomSessionScreenShare.ts +0 -58
- package/src/VideoOverlays.ts +0 -171
- package/src/buildVideoElement.test.ts +0 -933
- package/src/buildVideoElement.ts +0 -290
- package/src/cantina/VideoManager.test.ts +0 -95
- package/src/cantina/VideoManager.ts +0 -72
- package/src/cantina/index.ts +0 -1
- package/src/cantina/workers/index.ts +0 -1
- package/src/cantina/workers/videoManagerRoomWorker.ts +0 -28
- package/src/cantina/workers/videoManagerRoomsWorker.ts +0 -34
- package/src/cantina/workers/videoManagerWorker.ts +0 -64
- package/src/chat/Client.test.ts +0 -688
- package/src/chat/Client.ts +0 -94
- package/src/chat/index.ts +0 -31
- package/src/createClient.test.ts +0 -124
- package/src/createClient.ts +0 -48
- package/src/createRoomObject.ts +0 -149
- package/src/fabric/FabricRoomSession.test.ts +0 -695
- package/src/fabric/FabricRoomSession.ts +0 -446
- package/src/fabric/FabricRoomSessionMember.ts +0 -188
- package/src/fabric/HTTPClient.test.ts +0 -28
- package/src/fabric/HTTPClient.ts +0 -154
- package/src/fabric/IncomingCallManager.test.ts +0 -295
- package/src/fabric/IncomingCallManager.ts +0 -92
- package/src/fabric/SATSession.test.ts +0 -65
- package/src/fabric/SATSession.ts +0 -102
- package/src/fabric/SignalWire.test.ts +0 -115
- package/src/fabric/SignalWire.ts +0 -101
- package/src/fabric/WSClient.ts +0 -430
- package/src/fabric/createHttpClient.ts +0 -188
- package/src/fabric/createWSClient.ts +0 -12
- package/src/fabric/index.ts +0 -30
- package/src/fabric/interfaces/address.ts +0 -46
- package/src/fabric/interfaces/capabilities.ts +0 -30
- package/src/fabric/interfaces/conversation.ts +0 -145
- package/src/fabric/interfaces/device.ts +0 -21
- package/src/fabric/interfaces/httpClient.ts +0 -50
- package/src/fabric/interfaces/incomingCallManager.ts +0 -36
- package/src/fabric/interfaces/index.ts +0 -118
- package/src/fabric/interfaces/wsClient.ts +0 -154
- package/src/fabric/utils/capabilitiesHelpers.test.ts +0 -201
- package/src/fabric/utils/capabilitiesHelpers.ts +0 -208
- package/src/fabric/utils/constants.ts +0 -4
- package/src/fabric/utils/eventMappers.ts +0 -184
- package/src/fabric/utils/typeGuard.ts +0 -31
- package/src/fabric/utils/validationProxy.ts +0 -83
- package/src/fabric/utils/validators.ts +0 -242
- package/src/fabric/workers/callJoinWorker.ts +0 -88
- package/src/fabric/workers/callLeftWorker.ts +0 -32
- package/src/fabric/workers/callSegmentWorker.ts +0 -154
- package/src/fabric/workers/fabricMemberWorker.ts +0 -62
- package/src/fabric/workers/fabricWorker.ts +0 -100
- package/src/fabric/workers/index.ts +0 -2
- package/src/fabric/workers/wsClientWorker.ts +0 -60
- package/src/features/actions.ts +0 -5
- package/src/features/mediaElements/mediaElementsSagas.ts +0 -129
- package/src/index.test.ts +0 -5
- package/src/index.ts +0 -153
- package/src/joinRoom.ts +0 -29
- package/src/pubSub/Client.test.ts +0 -245
- package/src/pubSub/Client.ts +0 -90
- package/src/pubSub/index.ts +0 -10
- package/src/setupTests.ts +0 -122
- package/src/testUtils.ts +0 -259
- package/src/utils/CloseEvent.ts +0 -6
- package/src/utils/audioElement.ts +0 -21
- package/src/utils/constants.ts +0 -7
- package/src/utils/interfaces/base.ts +0 -55
- package/src/utils/interfaces/fabric.ts +0 -156
- package/src/utils/interfaces/index.ts +0 -3
- package/src/utils/interfaces/video.ts +0 -440
- package/src/utils/makeQueryParamsUrl.ts +0 -14
- package/src/utils/paginatedResult.ts +0 -35
- package/src/utils/roomSession.test.ts +0 -140
- package/src/utils/roomSession.ts +0 -85
- package/src/utils/storage.test.ts +0 -24
- package/src/utils/storage.ts +0 -37
- package/src/utils/videoElement.ts +0 -342
- package/src/video/RoomSession.test.ts +0 -31
- package/src/video/RoomSession.ts +0 -290
- package/src/video/VideoRoomSession.test.ts +0 -672
- package/src/video/VideoRoomSession.ts +0 -304
- package/src/video/index.ts +0 -43
- package/src/video/workers/childMemberJoinedWorker.test.ts +0 -99
- package/src/video/workers/childMemberJoinedWorker.ts +0 -75
- package/src/video/workers/index.ts +0 -6
- package/src/video/workers/memberListUpdatedWorker.ts +0 -217
- package/src/video/workers/videoPlaybackWorker.ts +0 -54
- package/src/video/workers/videoRecordWorker.ts +0 -54
- package/src/video/workers/videoStreamWorker.ts +0 -48
- package/src/video/workers/videoWorker.ts +0 -113
- package/src/webrtc.ts +0 -33
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,2690 @@
|
|
|
1
|
+
import { n as JSONRPCRequest, r as JSONRPCResponse, t as EventChannel } from "./base-A5AZTrAd.cjs";
|
|
2
|
+
import * as rxjs0 from "rxjs";
|
|
3
|
+
import { BehaviorSubject, Observable, Observer, ReplaySubject, Subject, Subscription } from "rxjs";
|
|
4
|
+
import { URL as URL$1 } from "node:url";
|
|
5
|
+
|
|
6
|
+
//#region src/behaviors/Destroyable.d.ts
|
|
7
|
+
declare abstract class Destroyable {
|
|
8
|
+
protected subscriptions: Subscription[];
|
|
9
|
+
protected subjects: Subject<unknown>[];
|
|
10
|
+
protected _destroyed$: Subject<void>;
|
|
11
|
+
destroy(): void;
|
|
12
|
+
protected subscribeTo<T>(observable: Observable<T>, observerOrNext: Partial<Observer<T>> | ((value: T) => void) | undefined): void;
|
|
13
|
+
protected createSubject<T>(): Subject<T>;
|
|
14
|
+
protected createReplaySubject<T>(bufferSize?: number, windowTime?: number): ReplaySubject<T>;
|
|
15
|
+
protected createBehaviorSubject<T>(initialValue: T): BehaviorSubject<T>;
|
|
16
|
+
get $(): Observable<this>;
|
|
17
|
+
/**
|
|
18
|
+
* Observable that emits when the instance is destroyed
|
|
19
|
+
*/
|
|
20
|
+
get destroyed$(): Observable<void>;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/core/types/media.types.d.ts
|
|
24
|
+
/** WebRTC transceiver direction for a single media kind. */
|
|
25
|
+
type MediaDirection = RTCRtpTransceiverDirection;
|
|
26
|
+
/** Audio and video directions "inactive" | "recvonly" | "sendonly" | "sendrecv" | "stopped" */
|
|
27
|
+
interface MediaDirections {
|
|
28
|
+
/** Audio direction */
|
|
29
|
+
audio: MediaDirection;
|
|
30
|
+
/** Video direction */
|
|
31
|
+
video: MediaDirection;
|
|
32
|
+
}
|
|
33
|
+
/** Options controlling which media tracks to send and receive. */
|
|
34
|
+
interface MediaOptions {
|
|
35
|
+
/** Enable audio input. */
|
|
36
|
+
audio?: boolean;
|
|
37
|
+
/** Enable video input. */
|
|
38
|
+
video?: boolean;
|
|
39
|
+
/** Custom constraints for the audio input track. */
|
|
40
|
+
inputAudioDeviceConstraints?: MediaTrackConstraints;
|
|
41
|
+
/** Custom constraints for the video input track. */
|
|
42
|
+
inputVideoDeviceConstraints?: MediaTrackConstraints;
|
|
43
|
+
/** Pre-existing audio stream to use instead of `getUserMedia`. */
|
|
44
|
+
inputAudioStream?: MediaStream;
|
|
45
|
+
/** Pre-existing video stream to use instead of `getUserMedia`. */
|
|
46
|
+
inputVideoStream?: MediaStream;
|
|
47
|
+
/** Whether to receive remote audio. */
|
|
48
|
+
receiveAudio?: boolean;
|
|
49
|
+
/** Whether to receive remote video. */
|
|
50
|
+
receiveVideo?: boolean;
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/core/types/common.types.d.ts
|
|
54
|
+
interface JSONSerializable {
|
|
55
|
+
[key: string]: JSONSerializable | string | number | boolean | null | undefined | JSONSerializable[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* HTTP methods supported by the HTTPRequest interface
|
|
59
|
+
*/
|
|
60
|
+
type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
61
|
+
/**
|
|
62
|
+
* HTTP headers as key-value pairs
|
|
63
|
+
*/
|
|
64
|
+
type HTTPHeaders = Record<string, string>;
|
|
65
|
+
/**
|
|
66
|
+
* Represents an HTTP request with all necessary properties for making
|
|
67
|
+
* REST API calls. Compatible with both browser fetch and Node.js http modules.
|
|
68
|
+
*/
|
|
69
|
+
interface HTTPRequest {
|
|
70
|
+
/** HTTP method to use for the request */
|
|
71
|
+
method: HTTPMethod;
|
|
72
|
+
/** Target URL for the request */
|
|
73
|
+
url: string | URL;
|
|
74
|
+
/** Optional HTTP headers */
|
|
75
|
+
headers?: HTTPHeaders;
|
|
76
|
+
/** Optional request body (supports various types for flexibility) */
|
|
77
|
+
body?: string | Blob | ArrayBuffer | FormData | URLSearchParams | ReadableStream | null;
|
|
78
|
+
/** Optional AbortSignal for request cancellation */
|
|
79
|
+
signal?: AbortSignal;
|
|
80
|
+
/** Optional timeout in milliseconds */
|
|
81
|
+
timeout?: number;
|
|
82
|
+
}
|
|
83
|
+
type HttpBody = string | Blob | ArrayBuffer | ReadableStream | null;
|
|
84
|
+
/**
|
|
85
|
+
* Represents an HTTP response with status, headers, and body.
|
|
86
|
+
* Compatible with both browser Response and Node.js http.IncomingMessage.
|
|
87
|
+
*/
|
|
88
|
+
interface HTTPResponse<T extends HttpBody = string> {
|
|
89
|
+
/** HTTP status code (e.g., 200, 404, 500) */
|
|
90
|
+
status: number;
|
|
91
|
+
/** HTTP status text (e.g., "OK", "Not Found") */
|
|
92
|
+
statusText: string;
|
|
93
|
+
/** Response headers */
|
|
94
|
+
headers: HTTPHeaders;
|
|
95
|
+
/** Response body (flexible type to support various response formats) */
|
|
96
|
+
body?: T;
|
|
97
|
+
/** Convenience property: true if status is 200-299 */
|
|
98
|
+
ok: boolean;
|
|
99
|
+
/** Final URL after any redirects */
|
|
100
|
+
url: string;
|
|
101
|
+
}
|
|
102
|
+
interface WebSocketClient {
|
|
103
|
+
addEventListener: WebSocket['addEventListener'];
|
|
104
|
+
removeEventListener: WebSocket['removeEventListener'];
|
|
105
|
+
send: WebSocket['send'];
|
|
106
|
+
close: WebSocket['close'];
|
|
107
|
+
readyState: WebSocket['readyState'];
|
|
108
|
+
}
|
|
109
|
+
interface NodeSocketClient extends WebSocketClient {
|
|
110
|
+
addEventListener(method: 'open' | 'close' | 'error' | 'message', cb: (event: unknown) => void, options?: unknown): void;
|
|
111
|
+
removeEventListener(method: 'open' | 'close' | 'error' | 'message', cb: (event: unknown) => void): void;
|
|
112
|
+
send(data: unknown, cb?: (err?: Error) => void): void;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* There's a difference in `searchParams` between URL from
|
|
116
|
+
* `lib` and URL from `url` (node) that makes using the same
|
|
117
|
+
* not possible for us.
|
|
118
|
+
*/
|
|
119
|
+
interface NodeSocketAdapter {
|
|
120
|
+
new (address: string | URL$1, options?: unknown): NodeSocketClient;
|
|
121
|
+
new (address: string | URL$1, protocols?: string | string[], options?: unknown): NodeSocketClient;
|
|
122
|
+
}
|
|
123
|
+
/** Browser-compatible WebSocket constructor type. */
|
|
124
|
+
type WebSocketAdapter = new (url: string | URL, protocols?: string | string[]) => WebSocketClient;
|
|
125
|
+
/** Authentication credentials for the SDK. */
|
|
126
|
+
interface SDKCredential {
|
|
127
|
+
/** JWT subscriber access token. */
|
|
128
|
+
token?: string;
|
|
129
|
+
/** Pre-authorized session state (alternative to token). */
|
|
130
|
+
authorizationState?: string;
|
|
131
|
+
/** Token expiry timestamp in milliseconds since epoch. */
|
|
132
|
+
expiry_at?: number;
|
|
133
|
+
}
|
|
134
|
+
/** Types of addressable resources in the fabric. */
|
|
135
|
+
type ResourceType = 'app' | 'call' | 'room' | 'subscriber';
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/dependencies/interfaces.d.ts
|
|
138
|
+
type StorageScope = 'local' | 'session';
|
|
139
|
+
interface Storage {
|
|
140
|
+
setItem(key: string, value: string | null, scope: StorageScope): Promise<void>;
|
|
141
|
+
getItem(key: string, scope: StorageScope): Promise<string | null>;
|
|
142
|
+
removeItem(key: string, scope: StorageScope): Promise<void>;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Provides authentication credentials to the SDK.
|
|
146
|
+
*
|
|
147
|
+
* Implementors are responsible for:
|
|
148
|
+
* - Obtaining credentials (e.g. via API calls, user login flows, or third-party auth services).
|
|
149
|
+
* - Returning a valid {@link SDKCredential} with either a `token` or `authorizationState`.
|
|
150
|
+
* - Setting `expiry_at` when the credential has a known expiration so the SDK can schedule refresh.
|
|
151
|
+
* - Handling errors and never leaking sensitive data through error messages.
|
|
152
|
+
*
|
|
153
|
+
* The SDK owns the credential lifecycle: it calls `authenticate` once during initialization
|
|
154
|
+
* and, if `refresh` is provided and `expiry_at` is set, schedules automatic refresh before expiry.
|
|
155
|
+
*/
|
|
156
|
+
interface CredentialProvider {
|
|
157
|
+
/**
|
|
158
|
+
* Obtains the initial credentials. Called once during client initialization.
|
|
159
|
+
*
|
|
160
|
+
* Implementor responsibilities:
|
|
161
|
+
* - Resolve with a valid {@link SDKCredential} on success.
|
|
162
|
+
* - Reject (throw) on failure — this will cause client initialization to fail.
|
|
163
|
+
*
|
|
164
|
+
* SDK behavior:
|
|
165
|
+
* - Awaits this method before establishing the WebSocket connection.
|
|
166
|
+
* - On rejection, propagates the error to the caller of `SignalWire()`.
|
|
167
|
+
*/
|
|
168
|
+
authenticate(): Promise<SDKCredential>;
|
|
169
|
+
/**
|
|
170
|
+
* Obtains fresh credentials before the current ones expire. Optional.
|
|
171
|
+
*
|
|
172
|
+
* Implementor responsibilities:
|
|
173
|
+
* - Resolve with a new {@link SDKCredential} containing an updated `token` (or `authorizationState`) and `expiry_at`.
|
|
174
|
+
* - Reject (throw) if refresh is not possible — the SDK will stop the refresh schedule.
|
|
175
|
+
*
|
|
176
|
+
* SDK behavior:
|
|
177
|
+
* - Only called when `expiry_at` was set on the previous credential.
|
|
178
|
+
* - Scheduled automatically before expiry; implementors do not need to manage timing.
|
|
179
|
+
* - On rejection, the refresh schedule stops and the session continues with the
|
|
180
|
+
* current credentials until they expire.
|
|
181
|
+
* - When not provided, the SDK uses the initial credentials for the entire session lifetime.
|
|
182
|
+
*/
|
|
183
|
+
refresh?: () => Promise<SDKCredential>;
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/managers/StorageManager.d.ts
|
|
187
|
+
declare class StorageManager {
|
|
188
|
+
private storageImpl;
|
|
189
|
+
constructor(storageImpl?: Storage);
|
|
190
|
+
/**
|
|
191
|
+
* Validates that a value can be safely serialized to JSON
|
|
192
|
+
* @throws SerializationError if value contains non-serializable types
|
|
193
|
+
*/
|
|
194
|
+
private serialize;
|
|
195
|
+
/**
|
|
196
|
+
* Stores a value in storage
|
|
197
|
+
* @throws InvalidStorageValueError if value contains non-serializable types
|
|
198
|
+
* @throws SerializationError if JSON serialization fails
|
|
199
|
+
* @throws StorageWriteError if writing to storage fails
|
|
200
|
+
*/
|
|
201
|
+
setItem(key: string, value: unknown, scope?: StorageScope): Promise<void>;
|
|
202
|
+
/**
|
|
203
|
+
* Retrieves a value from storage
|
|
204
|
+
*
|
|
205
|
+
* This method distinguishes between:
|
|
206
|
+
* - Storage errors (network, permission, etc.) - these are thrown
|
|
207
|
+
* - JSON parse errors - these trigger onParseError and return raw string
|
|
208
|
+
* - Missing keys - returns null
|
|
209
|
+
*
|
|
210
|
+
* @returns The parsed value, raw string (on parse error), or null
|
|
211
|
+
* @throws StorageReadError
|
|
212
|
+
*/
|
|
213
|
+
getItem<T = unknown>(key: string, scope?: StorageScope): Promise<T | null>;
|
|
214
|
+
/**
|
|
215
|
+
* Removes a value from storage
|
|
216
|
+
* @throws Error from underlying storage implementation
|
|
217
|
+
*/
|
|
218
|
+
removeItem(key: string, scope?: StorageScope): Promise<void>;
|
|
219
|
+
}
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region src/containers/PreferencesContainer.d.ts
|
|
222
|
+
/**
|
|
223
|
+
* Public preferences API for configuring SDK behavior.
|
|
224
|
+
*
|
|
225
|
+
* Exposed as {@link SignalWire.preferences}. All timeout values
|
|
226
|
+
* are in seconds when accessed through this class.
|
|
227
|
+
*
|
|
228
|
+
* When {@link enableSavePreferences} is called, preferences are
|
|
229
|
+
* automatically loaded from storage and synced back on every change.
|
|
230
|
+
*/
|
|
231
|
+
declare class ClientPreferences {
|
|
232
|
+
private _storage;
|
|
233
|
+
/**
|
|
234
|
+
* Enables persistence of preferences to storage.
|
|
235
|
+
* Loads any previously saved preferences and syncs future changes.
|
|
236
|
+
*/
|
|
237
|
+
enableSavePreferences(storage: StorageManager): void;
|
|
238
|
+
/** WebSocket connection timeout in seconds. */
|
|
239
|
+
get connectionTimeout(): number;
|
|
240
|
+
set connectionTimeout(seconds: number);
|
|
241
|
+
/** Timeout for reconnecting to previously attached calls, in seconds. */
|
|
242
|
+
get reconnectCallsTimeout(): number;
|
|
243
|
+
set reconnectCallsTimeout(seconds: number);
|
|
244
|
+
/** Minimum reconnection backoff delay in seconds. */
|
|
245
|
+
get reconnectDelayMin(): number;
|
|
246
|
+
set reconnectDelayMin(seconds: number);
|
|
247
|
+
/** Maximum reconnection backoff delay in seconds. */
|
|
248
|
+
get reconnectDelayMax(): number;
|
|
249
|
+
set reconnectDelayMax(seconds: number);
|
|
250
|
+
/** Custom relay host URL. Empty string uses the default. */
|
|
251
|
+
get relayHost(): string;
|
|
252
|
+
set relayHost(value: string);
|
|
253
|
+
/** Whether to receive remote video by default. */
|
|
254
|
+
get receiveVideo(): boolean;
|
|
255
|
+
set receiveVideo(value: boolean);
|
|
256
|
+
/** Whether to receive remote audio by default. */
|
|
257
|
+
get receiveAudio(): boolean;
|
|
258
|
+
set receiveAudio(value: boolean);
|
|
259
|
+
/** Preferred audio input device for new calls. */
|
|
260
|
+
get preferredAudioInput(): MediaDeviceInfo | null;
|
|
261
|
+
set preferredAudioInput(value: MediaDeviceInfo | null);
|
|
262
|
+
/** Preferred audio output device for new calls. */
|
|
263
|
+
get preferredAudioOutput(): MediaDeviceInfo | null;
|
|
264
|
+
set preferredAudioOutput(value: MediaDeviceInfo | null);
|
|
265
|
+
/** Preferred video input device for new calls. */
|
|
266
|
+
get preferredVideoInput(): MediaDeviceInfo | null;
|
|
267
|
+
set preferredVideoInput(value: MediaDeviceInfo | null);
|
|
268
|
+
/** Default audio input track constraints. */
|
|
269
|
+
get inputAudioConstraints(): MediaTrackConstraints | undefined;
|
|
270
|
+
set inputAudioConstraints(value: MediaTrackConstraints | undefined);
|
|
271
|
+
/** Default video input track constraints. */
|
|
272
|
+
get inputVideoConstraints(): MediaTrackConstraints | undefined;
|
|
273
|
+
set inputVideoConstraints(value: MediaTrackConstraints | undefined);
|
|
274
|
+
/** Debounce time for device change events, in seconds. */
|
|
275
|
+
get deviceDebounceTime(): number;
|
|
276
|
+
set deviceDebounceTime(seconds: number);
|
|
277
|
+
/** Polling interval for device enumeration, in seconds. */
|
|
278
|
+
get devicePollingInterval(): number;
|
|
279
|
+
set devicePollingInterval(seconds: number);
|
|
280
|
+
/** Whether to filter out UDP-based ICE servers. */
|
|
281
|
+
get disableUdpIceServers(): boolean;
|
|
282
|
+
set disableUdpIceServers(value: boolean);
|
|
283
|
+
/** Whether to force TURN relay-only ICE candidates. */
|
|
284
|
+
get relayOnly(): boolean;
|
|
285
|
+
set relayOnly(value: boolean);
|
|
286
|
+
/** Timeout for individual ICE candidate gathering, in seconds. */
|
|
287
|
+
get iceCandidateTimeout(): number;
|
|
288
|
+
set iceCandidateTimeout(seconds: number);
|
|
289
|
+
/** Timeout for the entire ICE gathering phase, in seconds. */
|
|
290
|
+
get iceGatheringTimeout(): number;
|
|
291
|
+
set iceGatheringTimeout(seconds: number);
|
|
292
|
+
/** Custom ICE servers for TURN/STUN configuration. */
|
|
293
|
+
get iceServers(): RTCIceServer[] | undefined;
|
|
294
|
+
set iceServers(value: RTCIceServer[] | undefined);
|
|
295
|
+
/** Custom user variables attached to calls. */
|
|
296
|
+
get userVariables(): Record<string, unknown>;
|
|
297
|
+
set userVariables(value: Record<string, unknown>);
|
|
298
|
+
/** Saves current preferences to storage (fire-and-forget). */
|
|
299
|
+
private _saveToStorage;
|
|
300
|
+
/** Loads preferences from storage and applies them to the container. */
|
|
301
|
+
private _loadFromStorage;
|
|
302
|
+
}
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region src/controllers/HTTPRequestController.d.ts
|
|
305
|
+
type HTTPRequestStatus = 'idle' | 'requesting' | 'success' | 'error';
|
|
306
|
+
interface HTTPRequestControllerOptions {
|
|
307
|
+
maxRetries?: number;
|
|
308
|
+
retryDelayMin?: number;
|
|
309
|
+
retryDelayMax?: number;
|
|
310
|
+
requestTimeout?: number;
|
|
311
|
+
}
|
|
312
|
+
declare class HTTPRequestController {
|
|
313
|
+
private baseURL;
|
|
314
|
+
private credential;
|
|
315
|
+
private static readonly defaultMaxRetries;
|
|
316
|
+
private static readonly defaultRetryDelayMinMs;
|
|
317
|
+
private static readonly defaultRetryDelayMaxMs;
|
|
318
|
+
private static readonly defaultRequestTimeoutMs;
|
|
319
|
+
private readonly maxRetries;
|
|
320
|
+
private readonly retryDelayMin;
|
|
321
|
+
private readonly retryDelayMax;
|
|
322
|
+
private readonly requestTimeout;
|
|
323
|
+
private _responses$;
|
|
324
|
+
private _errors$;
|
|
325
|
+
private _status$;
|
|
326
|
+
constructor(baseURL: string, credential: SDKCredential, options?: HTTPRequestControllerOptions);
|
|
327
|
+
get status$(): Observable<HTTPRequestStatus>;
|
|
328
|
+
get status(): HTTPRequestStatus;
|
|
329
|
+
get responses$(): Observable<HTTPResponse>;
|
|
330
|
+
get errors$(): Observable<Error>;
|
|
331
|
+
request(request: HTTPRequest): Promise<HTTPResponse>;
|
|
332
|
+
private executeWithRetry;
|
|
333
|
+
private executeRequest;
|
|
334
|
+
private buildURL;
|
|
335
|
+
private buildHeaders;
|
|
336
|
+
private convertResponse;
|
|
337
|
+
}
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region src/behaviors/Fetchable.d.ts
|
|
340
|
+
declare abstract class Fetchable<T = unknown> extends Destroyable {
|
|
341
|
+
fromPath: string;
|
|
342
|
+
protected http: HTTPRequestController;
|
|
343
|
+
fetched$: Observable<boolean>;
|
|
344
|
+
constructor(fromPath: string, http: HTTPRequestController);
|
|
345
|
+
protected abstract populateInstance(data: T): void;
|
|
346
|
+
private fetch;
|
|
347
|
+
}
|
|
348
|
+
//#endregion
|
|
349
|
+
//#region src/core/types/address.types.d.ts
|
|
350
|
+
/**
|
|
351
|
+
* Pure address-related types (no implementation dependencies)
|
|
352
|
+
* Types that reference model implementations are in interfaces.ts
|
|
353
|
+
*/
|
|
354
|
+
interface GetAddressResponse {
|
|
355
|
+
id: string;
|
|
356
|
+
display_name: string;
|
|
357
|
+
name: string;
|
|
358
|
+
preview_url?: string;
|
|
359
|
+
cover_url?: string;
|
|
360
|
+
resource_id: string;
|
|
361
|
+
type: ResourceType;
|
|
362
|
+
channels: {
|
|
363
|
+
audio?: string;
|
|
364
|
+
messaging?: string;
|
|
365
|
+
video?: string;
|
|
366
|
+
};
|
|
367
|
+
locked: boolean;
|
|
368
|
+
created_at: string;
|
|
369
|
+
}
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region src/core/types/subscriber.types.d.ts
|
|
372
|
+
interface GetSubscriberInfoResponse {
|
|
373
|
+
id: string;
|
|
374
|
+
email: string;
|
|
375
|
+
first_name?: string;
|
|
376
|
+
last_name?: string;
|
|
377
|
+
display_name?: string;
|
|
378
|
+
job_title?: string;
|
|
379
|
+
time_zone?: number;
|
|
380
|
+
country?: string;
|
|
381
|
+
region?: string;
|
|
382
|
+
company_name?: string;
|
|
383
|
+
push_notification_key: string;
|
|
384
|
+
app_settings?: {
|
|
385
|
+
display_name: string;
|
|
386
|
+
scopes: string[];
|
|
387
|
+
};
|
|
388
|
+
fabric_addresses: GetAddressResponse[];
|
|
389
|
+
}
|
|
390
|
+
//#endregion
|
|
391
|
+
//#region src/core/entities/Subscriber.d.ts
|
|
392
|
+
/**
|
|
393
|
+
* Authenticated subscriber profile.
|
|
394
|
+
*
|
|
395
|
+
* Fetched automatically when a {@link SignalWire} connects.
|
|
396
|
+
* Contains identity, contact, and organization details.
|
|
397
|
+
*/
|
|
398
|
+
declare class Subscriber extends Fetchable<GetSubscriberInfoResponse> {
|
|
399
|
+
/** Unique subscriber identifier. */
|
|
400
|
+
id: string;
|
|
401
|
+
/** Subscriber email address. */
|
|
402
|
+
email: string;
|
|
403
|
+
/** First name. */
|
|
404
|
+
firstName?: string;
|
|
405
|
+
/** Last name. */
|
|
406
|
+
lastName?: string;
|
|
407
|
+
/** Display name shown to other participants. */
|
|
408
|
+
displayName?: string;
|
|
409
|
+
/** Job title. */
|
|
410
|
+
jobTitle?: string;
|
|
411
|
+
/** Time zone offset. */
|
|
412
|
+
timeZone?: number;
|
|
413
|
+
/** Country code. */
|
|
414
|
+
country?: string;
|
|
415
|
+
/** Region/state. */
|
|
416
|
+
region?: string;
|
|
417
|
+
/** Company name. */
|
|
418
|
+
companyName?: string;
|
|
419
|
+
/** Push notification key for mobile/web push. */
|
|
420
|
+
pushNotificationKey: string;
|
|
421
|
+
/** Application-level settings (display name, permission scopes). */
|
|
422
|
+
appSettings?: {
|
|
423
|
+
displayName: string;
|
|
424
|
+
scopes: string[];
|
|
425
|
+
};
|
|
426
|
+
/** Fabric addresses associated with this subscriber. */
|
|
427
|
+
addresses: GetAddressResponse[];
|
|
428
|
+
constructor(http: HTTPRequestController);
|
|
429
|
+
protected populateInstance(data: GetSubscriberInfoResponse): void;
|
|
430
|
+
}
|
|
431
|
+
//#endregion
|
|
432
|
+
//#region src/core/types/call.types.d.ts
|
|
433
|
+
type RTCPeerConnectionType = 'offer' | 'answer';
|
|
434
|
+
type RTCPeerConnectionPropose = 'main' | 'screenshare' | 'additional-device';
|
|
435
|
+
type CallConnectStates = 'connecting' | 'connected';
|
|
436
|
+
type SignalingCallStates = 'created' | 'ringing' | 'answered' | 'ending' | 'ended';
|
|
437
|
+
type CallDirection = 'inbound' | 'outbound';
|
|
438
|
+
type CallPlayState = 'playing' | 'paused' | 'finished';
|
|
439
|
+
interface CallDeviceCommonParams {
|
|
440
|
+
headers?: unknown[];
|
|
441
|
+
}
|
|
442
|
+
interface CallDeviceWebRTCOrSIPParams extends CallDeviceCommonParams {
|
|
443
|
+
from: string;
|
|
444
|
+
to: string;
|
|
445
|
+
}
|
|
446
|
+
interface CallDevicePhoneParams extends CallDeviceCommonParams {
|
|
447
|
+
from_number: string;
|
|
448
|
+
to_number: string;
|
|
449
|
+
}
|
|
450
|
+
interface CallDeviceWebRTCOrSIP {
|
|
451
|
+
type: 'webrtc' | 'sip';
|
|
452
|
+
params: CallDeviceWebRTCOrSIPParams;
|
|
453
|
+
}
|
|
454
|
+
interface CallDevicePhone {
|
|
455
|
+
type: 'phone';
|
|
456
|
+
params: CallDevicePhoneParams;
|
|
457
|
+
}
|
|
458
|
+
type CallDevice = CallDeviceWebRTCOrSIP | CallDevicePhone;
|
|
459
|
+
type VideoPosition = 'auto' | `reserved-${number}` | `standard-${number}` | 'off-canvas' | 'playback' | 'full-screen';
|
|
460
|
+
//#endregion
|
|
461
|
+
//#region src/core/RPCMessages/types/common.d.ts
|
|
462
|
+
interface Member {
|
|
463
|
+
room_session_id: string;
|
|
464
|
+
room_id: string;
|
|
465
|
+
member_id: string;
|
|
466
|
+
call_id: string;
|
|
467
|
+
name: string;
|
|
468
|
+
type: 'member' | 'screen';
|
|
469
|
+
parent_id?: string;
|
|
470
|
+
requested_position?: string;
|
|
471
|
+
handraised: boolean;
|
|
472
|
+
visible: boolean;
|
|
473
|
+
audio_muted: boolean;
|
|
474
|
+
video_muted: boolean;
|
|
475
|
+
deaf: boolean;
|
|
476
|
+
input_volume: number;
|
|
477
|
+
output_volume: number;
|
|
478
|
+
input_sensitivity: number;
|
|
479
|
+
echo_cancellation: boolean;
|
|
480
|
+
auto_gain: boolean;
|
|
481
|
+
noise_suppression: boolean;
|
|
482
|
+
lowbitrate: boolean;
|
|
483
|
+
denoise: boolean;
|
|
484
|
+
talking: boolean;
|
|
485
|
+
isAudience: boolean;
|
|
486
|
+
meta: Record<string, unknown>;
|
|
487
|
+
subscriber_id: string;
|
|
488
|
+
address_id: string;
|
|
489
|
+
updated?: string[];
|
|
490
|
+
node_id: string;
|
|
491
|
+
}
|
|
492
|
+
interface MemberTalkingInfo {
|
|
493
|
+
member_id: string;
|
|
494
|
+
talking: boolean;
|
|
495
|
+
node_id: string;
|
|
496
|
+
}
|
|
497
|
+
interface RoomSession {
|
|
498
|
+
room_session_id: string;
|
|
499
|
+
room_id: string;
|
|
500
|
+
event_channel: string;
|
|
501
|
+
name: string;
|
|
502
|
+
layout_name: string;
|
|
503
|
+
display_name: string;
|
|
504
|
+
recording: boolean;
|
|
505
|
+
streaming: boolean;
|
|
506
|
+
prioritize_handraise: boolean;
|
|
507
|
+
hide_video_muted: boolean;
|
|
508
|
+
locked: boolean;
|
|
509
|
+
meta: Record<string, unknown>;
|
|
510
|
+
members: Member[];
|
|
511
|
+
recordings: Record<string, unknown>[];
|
|
512
|
+
streams: Record<string, unknown>[];
|
|
513
|
+
playbacks: Record<string, unknown>[];
|
|
514
|
+
}
|
|
515
|
+
interface LayoutLayer {
|
|
516
|
+
layer_index: number;
|
|
517
|
+
z_index: number;
|
|
518
|
+
member_id?: string;
|
|
519
|
+
playing_file: boolean;
|
|
520
|
+
position: VideoPosition;
|
|
521
|
+
reservation: string;
|
|
522
|
+
visible: boolean;
|
|
523
|
+
x: number;
|
|
524
|
+
y: number;
|
|
525
|
+
width: number;
|
|
526
|
+
height: number;
|
|
527
|
+
}
|
|
528
|
+
interface Layout {
|
|
529
|
+
layers: LayoutLayer[];
|
|
530
|
+
id: string;
|
|
531
|
+
name: string;
|
|
532
|
+
}
|
|
533
|
+
interface ConversationDetails {
|
|
534
|
+
status: string;
|
|
535
|
+
start_time: number;
|
|
536
|
+
end_time?: number;
|
|
537
|
+
}
|
|
538
|
+
interface PartialDialogParams {
|
|
539
|
+
callID: string;
|
|
540
|
+
}
|
|
541
|
+
interface AudioMediaParams {
|
|
542
|
+
autoGainControl: boolean;
|
|
543
|
+
echoCancellation: boolean;
|
|
544
|
+
noiseSuppression: boolean;
|
|
545
|
+
}
|
|
546
|
+
interface FrameRateConstraint {
|
|
547
|
+
min: number;
|
|
548
|
+
ideal: number;
|
|
549
|
+
max: number;
|
|
550
|
+
}
|
|
551
|
+
interface AspectRatioConstraint {
|
|
552
|
+
exact: number;
|
|
553
|
+
}
|
|
554
|
+
interface DimensionConstraint {
|
|
555
|
+
min: number;
|
|
556
|
+
ideal: number;
|
|
557
|
+
}
|
|
558
|
+
interface VideoAdvancedConstraint {
|
|
559
|
+
width: DimensionConstraint;
|
|
560
|
+
height: DimensionConstraint;
|
|
561
|
+
frameRate: FrameRateConstraint;
|
|
562
|
+
}
|
|
563
|
+
interface VideoMediaParams {
|
|
564
|
+
frameRate: FrameRateConstraint;
|
|
565
|
+
aspectRatio: AspectRatioConstraint;
|
|
566
|
+
width: DimensionConstraint;
|
|
567
|
+
height: DimensionConstraint;
|
|
568
|
+
advanced: VideoAdvancedConstraint[];
|
|
569
|
+
resizeMode: string;
|
|
570
|
+
}
|
|
571
|
+
interface MediaParams {
|
|
572
|
+
audio?: AudioMediaParams;
|
|
573
|
+
video?: VideoMediaParams;
|
|
574
|
+
}
|
|
575
|
+
//#endregion
|
|
576
|
+
//#region src/core/RPCMessages/types/verto.d.ts
|
|
577
|
+
interface VertoAnswerParams {
|
|
578
|
+
callID: string;
|
|
579
|
+
sdp: string;
|
|
580
|
+
}
|
|
581
|
+
interface VertoMediaParamsParams {
|
|
582
|
+
callID: string;
|
|
583
|
+
mediaParams: MediaParams;
|
|
584
|
+
}
|
|
585
|
+
interface VertoPingParams {
|
|
586
|
+
callID: string;
|
|
587
|
+
dialogParams: PartialDialogParams;
|
|
588
|
+
}
|
|
589
|
+
//#endregion
|
|
590
|
+
//#region src/core/RPCMessages/types/events.d.ts
|
|
591
|
+
interface SignalwireAuthorizationStatePayload {
|
|
592
|
+
authorization_state: string;
|
|
593
|
+
}
|
|
594
|
+
interface WebrtcMessagePayload {
|
|
595
|
+
jsonrpc: '2.0';
|
|
596
|
+
id: number;
|
|
597
|
+
method: string;
|
|
598
|
+
params: VertoAnswerParams | VertoMediaParamsParams | VertoPingParams;
|
|
599
|
+
}
|
|
600
|
+
interface CallJoinedPayload {
|
|
601
|
+
room_session: RoomSession;
|
|
602
|
+
room_id: string;
|
|
603
|
+
room_session_id: string;
|
|
604
|
+
call_id: string;
|
|
605
|
+
member_id: string;
|
|
606
|
+
capabilities: string[];
|
|
607
|
+
origin_call_id: string;
|
|
608
|
+
}
|
|
609
|
+
interface CallLeftPayload {
|
|
610
|
+
room_session: RoomSession;
|
|
611
|
+
room_id: string;
|
|
612
|
+
room_session_id: string;
|
|
613
|
+
call_id: string;
|
|
614
|
+
member_id: string;
|
|
615
|
+
origin_call_id: string;
|
|
616
|
+
reason: string;
|
|
617
|
+
}
|
|
618
|
+
interface MemberUpdatedPayload {
|
|
619
|
+
member: Member;
|
|
620
|
+
room_id: string;
|
|
621
|
+
room_session_id: string;
|
|
622
|
+
}
|
|
623
|
+
interface MemberJoinedPayload {
|
|
624
|
+
member: Member;
|
|
625
|
+
room_id: string;
|
|
626
|
+
room_session_id: string;
|
|
627
|
+
}
|
|
628
|
+
interface MemberLeftPayload {
|
|
629
|
+
member: Member;
|
|
630
|
+
room_id: string;
|
|
631
|
+
room_session_id: string;
|
|
632
|
+
reason: string;
|
|
633
|
+
}
|
|
634
|
+
interface MemberTalkingPayload {
|
|
635
|
+
member: MemberTalkingInfo;
|
|
636
|
+
room_id: string;
|
|
637
|
+
room_session_id: string;
|
|
638
|
+
}
|
|
639
|
+
interface LayoutChangedPayload {
|
|
640
|
+
room_id: string;
|
|
641
|
+
room_session_id: string;
|
|
642
|
+
layout: Layout;
|
|
643
|
+
}
|
|
644
|
+
interface CallUpdatedPayload {
|
|
645
|
+
room_session: RoomSession;
|
|
646
|
+
room_id: string;
|
|
647
|
+
room_session_id: string;
|
|
648
|
+
}
|
|
649
|
+
interface CallStatePayload {
|
|
650
|
+
call_id: string;
|
|
651
|
+
node_id: string;
|
|
652
|
+
segment_id: string;
|
|
653
|
+
call_state: SignalingCallStates;
|
|
654
|
+
direction: CallDirection;
|
|
655
|
+
device: CallDevice;
|
|
656
|
+
start_time: number;
|
|
657
|
+
answer_time: number;
|
|
658
|
+
end_time: number;
|
|
659
|
+
room_session_id: string;
|
|
660
|
+
}
|
|
661
|
+
interface CallPlayPayload {
|
|
662
|
+
control_id: string;
|
|
663
|
+
call_id: string;
|
|
664
|
+
node_id: string;
|
|
665
|
+
state: CallPlayState;
|
|
666
|
+
room_session_id: string;
|
|
667
|
+
}
|
|
668
|
+
interface CallConnectPayload {
|
|
669
|
+
connect_state: CallConnectStates;
|
|
670
|
+
call_id: string;
|
|
671
|
+
node_id: string;
|
|
672
|
+
segment_id: string;
|
|
673
|
+
room_session_id: string;
|
|
674
|
+
peer?: {
|
|
675
|
+
call_id: string;
|
|
676
|
+
node_id: string;
|
|
677
|
+
device: CallDevice;
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
interface ConversationMessagePayload {
|
|
681
|
+
id: string;
|
|
682
|
+
type: string;
|
|
683
|
+
subtype: string;
|
|
684
|
+
kind: string;
|
|
685
|
+
hidden: boolean;
|
|
686
|
+
group_id: string;
|
|
687
|
+
from_fabric_address_id: string;
|
|
688
|
+
ts: number;
|
|
689
|
+
metadata: Record<string, unknown>;
|
|
690
|
+
details: ConversationDetails;
|
|
691
|
+
text: string | null;
|
|
692
|
+
conversation_name: string;
|
|
693
|
+
user_name: string;
|
|
694
|
+
}
|
|
695
|
+
type ConversationMessageUpdatedPayload = ConversationMessagePayload;
|
|
696
|
+
//#endregion
|
|
697
|
+
//#region src/behaviors/types/collection.types.d.ts
|
|
698
|
+
interface Entity {
|
|
699
|
+
id: string;
|
|
700
|
+
}
|
|
701
|
+
type FetchController<T extends Entity = Entity> = { [key in keyof Partial<T>]: (v?: unknown) => Promise<T | undefined> } & {
|
|
702
|
+
next: () => Promise<T[]>;
|
|
703
|
+
hasMore: boolean | undefined;
|
|
704
|
+
filter?: (item: T) => item is T;
|
|
705
|
+
mapper?: (item: unknown) => T;
|
|
706
|
+
};
|
|
707
|
+
interface Collection<T extends Entity = Entity> {
|
|
708
|
+
loading$: Observable<boolean>;
|
|
709
|
+
loading: boolean;
|
|
710
|
+
hasMore$: Observable<boolean>;
|
|
711
|
+
hasMore: boolean;
|
|
712
|
+
values: T[];
|
|
713
|
+
values$: Observable<T[]>;
|
|
714
|
+
get$(id: string): Observable<T> | undefined;
|
|
715
|
+
find$(key: keyof T, value: unknown): Promise<Observable<T> | undefined>;
|
|
716
|
+
loadMore(): void;
|
|
717
|
+
destroy(): void;
|
|
718
|
+
}
|
|
719
|
+
//#endregion
|
|
720
|
+
//#region src/behaviors/Collection.d.ts
|
|
721
|
+
declare class EntityCollection<T extends Entity = Entity> extends Destroyable implements Collection<T> {
|
|
722
|
+
private fetchController;
|
|
723
|
+
private update$;
|
|
724
|
+
private readonly onError?;
|
|
725
|
+
loading$: rxjs0.BehaviorSubject<boolean>;
|
|
726
|
+
values$: ReplaySubject<T[]>;
|
|
727
|
+
hasMore$: Observable<boolean>;
|
|
728
|
+
private collectionData;
|
|
729
|
+
private observablesRegistry;
|
|
730
|
+
private updateSubscription;
|
|
731
|
+
private upsertData;
|
|
732
|
+
private _destroy$;
|
|
733
|
+
constructor(fetchController: FetchController<T>, update$: Observable<Partial<T>>, onError?: ((error: Error) => void) | undefined);
|
|
734
|
+
get loading(): boolean;
|
|
735
|
+
get hasMore(): boolean;
|
|
736
|
+
get updated$(): Observable<void>;
|
|
737
|
+
get values(): T[];
|
|
738
|
+
private init;
|
|
739
|
+
private fetchMore;
|
|
740
|
+
private tryFetch;
|
|
741
|
+
get$(id: string): Observable<T> | undefined;
|
|
742
|
+
find$(key: keyof T, value: unknown): Promise<Observable<T> | undefined>;
|
|
743
|
+
loadMore(): void;
|
|
744
|
+
destroy(): void;
|
|
745
|
+
}
|
|
746
|
+
declare class EntityCollectionTransformed<O extends Entity = Entity, T extends Entity = Entity> implements Collection<T> {
|
|
747
|
+
private originalCollection;
|
|
748
|
+
private filter;
|
|
749
|
+
private mapper;
|
|
750
|
+
constructor(originalCollection: EntityCollection<O>, filter?: (i: unknown) => i is O, mapper?: (item: O) => T);
|
|
751
|
+
get loading$(): Observable<boolean>;
|
|
752
|
+
get loading(): boolean;
|
|
753
|
+
get hasMore$(): Observable<boolean>;
|
|
754
|
+
get hasMore(): boolean;
|
|
755
|
+
get values(): T[];
|
|
756
|
+
get values$(): Observable<T[]>;
|
|
757
|
+
get$(id: string): Observable<T> | undefined;
|
|
758
|
+
find$(key: keyof T, value: unknown): Promise<Observable<T> | undefined>;
|
|
759
|
+
loadMore(): void;
|
|
760
|
+
destroy(): void;
|
|
761
|
+
}
|
|
762
|
+
//#endregion
|
|
763
|
+
//#region src/managers/types/verto-manager.types.d.ts
|
|
764
|
+
type ScreenShareStatus = 'none' | 'starting' | 'started' | 'stopping';
|
|
765
|
+
type SignalingStatus = 'trying' | 'ringing' | 'connecting' | 'connected' | 'disconnected' | 'failed';
|
|
766
|
+
interface TransferOptions {
|
|
767
|
+
destination: string;
|
|
768
|
+
}
|
|
769
|
+
//#endregion
|
|
770
|
+
//#region src/core/RPCMessages/RPCConnect.d.ts
|
|
771
|
+
interface Authorization {
|
|
772
|
+
jti: string;
|
|
773
|
+
project_id: string;
|
|
774
|
+
fabric_subscriber: {
|
|
775
|
+
version: number;
|
|
776
|
+
expires_at: number;
|
|
777
|
+
subscriber_id: string;
|
|
778
|
+
application_id: string;
|
|
779
|
+
project_id: string;
|
|
780
|
+
space_id: string;
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
//#endregion
|
|
784
|
+
//#region src/core/utils.d.ts
|
|
785
|
+
interface PendingRPCOptions {
|
|
786
|
+
/**
|
|
787
|
+
* Timeout in milliseconds. Defaults to 5000ms (5 seconds).
|
|
788
|
+
* If the response is not received within this time, the promise will reject with RPCTimeoutError.
|
|
789
|
+
*/
|
|
790
|
+
timeoutMs?: number;
|
|
791
|
+
/**
|
|
792
|
+
* Optional AbortSignal for cancellation support.
|
|
793
|
+
* If the signal is aborted, the promise will reject with an AbortError.
|
|
794
|
+
*/
|
|
795
|
+
signal?: AbortSignal;
|
|
796
|
+
}
|
|
797
|
+
//#endregion
|
|
798
|
+
//#region src/core/capabilities/types.d.ts
|
|
799
|
+
/**
|
|
800
|
+
* Represents an on/off capability state
|
|
801
|
+
* Both `on` and `off` can be true if the parent permission grants both
|
|
802
|
+
*/
|
|
803
|
+
interface OnOffCapability {
|
|
804
|
+
readonly on: boolean;
|
|
805
|
+
readonly off: boolean;
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Member-level capabilities for self or other members
|
|
809
|
+
*/
|
|
810
|
+
interface MemberCapabilities {
|
|
811
|
+
readonly muteAudio: OnOffCapability;
|
|
812
|
+
readonly muteVideo: OnOffCapability;
|
|
813
|
+
readonly deaf: OnOffCapability;
|
|
814
|
+
readonly raisehand: OnOffCapability;
|
|
815
|
+
readonly microphoneVolume: boolean;
|
|
816
|
+
readonly microphoneSensitivity: boolean;
|
|
817
|
+
readonly speakerVolume: boolean;
|
|
818
|
+
readonly position: boolean;
|
|
819
|
+
readonly meta: boolean;
|
|
820
|
+
readonly remove: boolean;
|
|
821
|
+
readonly audioFlags: boolean;
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Call-level capabilities state
|
|
825
|
+
*/
|
|
826
|
+
interface CallCapabilitiesState {
|
|
827
|
+
readonly self: MemberCapabilities;
|
|
828
|
+
readonly member: MemberCapabilities;
|
|
829
|
+
readonly end: boolean;
|
|
830
|
+
readonly setLayout: boolean;
|
|
831
|
+
readonly sendDigit: boolean;
|
|
832
|
+
readonly vmutedHide: OnOffCapability;
|
|
833
|
+
readonly lock: OnOffCapability;
|
|
834
|
+
readonly device: boolean;
|
|
835
|
+
readonly screenshare: boolean;
|
|
836
|
+
}
|
|
837
|
+
//#endregion
|
|
838
|
+
//#region src/core/capabilities/SelfCapabilities.d.ts
|
|
839
|
+
/**
|
|
840
|
+
* SelfCapabilities manages the capability state for the self participant.
|
|
841
|
+
*
|
|
842
|
+
* Capabilities are received from the server via `call.joined` events and determine
|
|
843
|
+
* what actions the current participant is allowed to perform.
|
|
844
|
+
*
|
|
845
|
+
* Each capability is exposed as both:
|
|
846
|
+
* - An observable (e.g., `end$`) for reactive state management
|
|
847
|
+
* - A synchronous getter (e.g., `end`) for immediate access
|
|
848
|
+
*
|
|
849
|
+
* Member-level capabilities are accessed via the grouped `self` / `member` accessors:
|
|
850
|
+
* - `capabilities.self.muteAudio` (sync)
|
|
851
|
+
* - `capabilities.self$` (observable)
|
|
852
|
+
*
|
|
853
|
+
* When a new `call.joined` event is received, the capabilities state is
|
|
854
|
+
* completely replaced (not merged).
|
|
855
|
+
*/
|
|
856
|
+
declare class SelfCapabilities extends Destroyable {
|
|
857
|
+
private _state$;
|
|
858
|
+
/**
|
|
859
|
+
* Updates the capabilities state from raw capability strings.
|
|
860
|
+
* This completely replaces the current state.
|
|
861
|
+
*
|
|
862
|
+
* @param capabilities - Raw capability strings from the server
|
|
863
|
+
* @internal
|
|
864
|
+
*/
|
|
865
|
+
updateFromRaw(capabilities: string[]): void;
|
|
866
|
+
/** Observable for self member capabilities */
|
|
867
|
+
get self$(): Observable<MemberCapabilities>;
|
|
868
|
+
/** Current self member capabilities */
|
|
869
|
+
get self(): MemberCapabilities;
|
|
870
|
+
/** Observable for other member capabilities */
|
|
871
|
+
get member$(): Observable<MemberCapabilities>;
|
|
872
|
+
/** Current other member capabilities */
|
|
873
|
+
get member(): MemberCapabilities;
|
|
874
|
+
/** Observable for end call capability */
|
|
875
|
+
get end$(): Observable<boolean>;
|
|
876
|
+
/** Current end call capability */
|
|
877
|
+
get end(): boolean;
|
|
878
|
+
/** Observable for set layout capability */
|
|
879
|
+
get setLayout$(): Observable<boolean>;
|
|
880
|
+
/** Current set layout capability */
|
|
881
|
+
get setLayout(): boolean;
|
|
882
|
+
/** Observable for send digit capability */
|
|
883
|
+
get sendDigit$(): Observable<boolean>;
|
|
884
|
+
/** Current send digit capability */
|
|
885
|
+
get sendDigit(): boolean;
|
|
886
|
+
/** Observable for vmuted hide capability */
|
|
887
|
+
get vmutedHide$(): Observable<OnOffCapability>;
|
|
888
|
+
/** Current vmuted hide capability */
|
|
889
|
+
get vmutedHide(): OnOffCapability;
|
|
890
|
+
/** Observable for lock capability */
|
|
891
|
+
get lock$(): Observable<OnOffCapability>;
|
|
892
|
+
/** Current lock capability */
|
|
893
|
+
get lock(): OnOffCapability;
|
|
894
|
+
/** Observable for device capability */
|
|
895
|
+
get device$(): Observable<boolean>;
|
|
896
|
+
/** Current device capability */
|
|
897
|
+
get device(): boolean;
|
|
898
|
+
/** Observable for screenshare capability */
|
|
899
|
+
get screenshare$(): Observable<boolean>;
|
|
900
|
+
/** Current screenshare capability */
|
|
901
|
+
get screenshare(): boolean;
|
|
902
|
+
/** Observable for the full capabilities state */
|
|
903
|
+
get state$(): Observable<CallCapabilitiesState>;
|
|
904
|
+
/** Current full capabilities state */
|
|
905
|
+
get state(): CallCapabilitiesState;
|
|
906
|
+
}
|
|
907
|
+
//#endregion
|
|
908
|
+
//#region src/core/entities/types/participant.types.d.ts
|
|
909
|
+
interface SelectDeviceOptions {
|
|
910
|
+
savePreference?: boolean;
|
|
911
|
+
}
|
|
912
|
+
//#endregion
|
|
913
|
+
//#region src/interfaces/DeviceController.d.ts
|
|
914
|
+
/**
|
|
915
|
+
* Device interface for media device management
|
|
916
|
+
* Provides access to media devices and device selection
|
|
917
|
+
*/
|
|
918
|
+
interface DeviceController {
|
|
919
|
+
readonly audioInputDevices$: Observable<MediaDeviceInfo[]>;
|
|
920
|
+
readonly audioOutputDevices$: Observable<MediaDeviceInfo[]>;
|
|
921
|
+
readonly videoInputDevices$: Observable<MediaDeviceInfo[]>;
|
|
922
|
+
readonly selectedAudioInputDevice$: Observable<MediaDeviceInfo | null>;
|
|
923
|
+
readonly selectedAudioOutputDevice$: Observable<MediaDeviceInfo | null>;
|
|
924
|
+
readonly selectedVideoInputDevice$: Observable<MediaDeviceInfo | null>;
|
|
925
|
+
readonly selectedAudioInputDevice: MediaDeviceInfo | null;
|
|
926
|
+
readonly selectedAudioOutputDevice: MediaDeviceInfo | null;
|
|
927
|
+
readonly selectedVideoInputDevice: MediaDeviceInfo | null;
|
|
928
|
+
readonly audioInputDevices: MediaDeviceInfo[];
|
|
929
|
+
readonly audioOutputDevices: MediaDeviceInfo[];
|
|
930
|
+
readonly videoInputDevices: MediaDeviceInfo[];
|
|
931
|
+
readonly selectedAudioInputDeviceConstraints: MediaTrackConstraints;
|
|
932
|
+
readonly selectedVideoInputDeviceConstraints: MediaTrackConstraints;
|
|
933
|
+
deviceInfoToConstraints(deviceInfo: MediaDeviceInfo | null): MediaTrackConstraints;
|
|
934
|
+
selectAudioInputDevice(device: MediaDeviceInfo | null): void;
|
|
935
|
+
selectVideoInputDevice(device: MediaDeviceInfo | null): void;
|
|
936
|
+
selectAudioOutputDevice(device: MediaDeviceInfo | null): void;
|
|
937
|
+
enableDeviceMonitoring(): void;
|
|
938
|
+
disableDeviceMonitoring(): void;
|
|
939
|
+
getDeviceCapabilities(deviceInfo: MediaDeviceInfo): Promise<MediaTrackCapabilities | null>;
|
|
940
|
+
isValidDevice(deviceInfo: MediaDeviceInfo | null): Promise<boolean>;
|
|
941
|
+
readonly errors$: Observable<Error>;
|
|
942
|
+
}
|
|
943
|
+
//#endregion
|
|
944
|
+
//#region src/interfaces/VertoManager.d.ts
|
|
945
|
+
/**
|
|
946
|
+
* VertoManager interface for WebRTC call management
|
|
947
|
+
* Provides methods for screen sharing, device management, and media constraints
|
|
948
|
+
*/
|
|
949
|
+
interface VertoManager {
|
|
950
|
+
readonly screenShareStatus$: Observable<ScreenShareStatus>;
|
|
951
|
+
readonly screenShareStatus: ScreenShareStatus;
|
|
952
|
+
addScreenMedia(): Promise<void>;
|
|
953
|
+
removeScreenMedia(): Promise<void>;
|
|
954
|
+
addInputDevice(options?: MediaOptions): Promise<string | undefined>;
|
|
955
|
+
removeInputDevices(id: string): Promise<void>;
|
|
956
|
+
addMainInputDevices(options?: MediaOptions): Promise<void>;
|
|
957
|
+
updateMediaConstraints(options?: {
|
|
958
|
+
audio?: MediaTrackConstraints;
|
|
959
|
+
video?: MediaTrackConstraints;
|
|
960
|
+
}): Promise<void>;
|
|
961
|
+
muteMainAudioInputDevice(): void;
|
|
962
|
+
unmuteMainAudioInputDevice(): Promise<void>;
|
|
963
|
+
muteMainVideoInputDevice(): void;
|
|
964
|
+
unmuteMainVideoInputDevice(): Promise<void>;
|
|
965
|
+
}
|
|
966
|
+
//#endregion
|
|
967
|
+
//#region src/core/entities/Participant.d.ts
|
|
968
|
+
/**
|
|
969
|
+
* Callback type for executing call methods
|
|
970
|
+
* Injected to avoid circular dependency with Call class
|
|
971
|
+
*/
|
|
972
|
+
type ExecuteMethod = <T extends JSONRPCResponse = JSONRPCResponse>(target: string, method: string, args: Record<string, unknown>) => Promise<T>;
|
|
973
|
+
type ParticipantState = Member & {
|
|
974
|
+
position: LayoutLayer;
|
|
975
|
+
};
|
|
976
|
+
/**
|
|
977
|
+
* Represents a participant in a call.
|
|
978
|
+
*
|
|
979
|
+
* Provides observable state (audio/video mute, hand raise, volume, etc.)
|
|
980
|
+
* and control methods for the participant. See {@link SelfParticipant} for
|
|
981
|
+
* the local participant with additional device control.
|
|
982
|
+
*/
|
|
983
|
+
declare class Participant extends Destroyable implements CallParticipant {
|
|
984
|
+
protected executeMethod: ExecuteMethod;
|
|
985
|
+
protected deviceController: DeviceController;
|
|
986
|
+
/** Unique member ID of this participant. */
|
|
987
|
+
readonly id: string;
|
|
988
|
+
private _state$;
|
|
989
|
+
constructor(id: string, executeMethod: ExecuteMethod, deviceController: DeviceController);
|
|
990
|
+
/** @internal */
|
|
991
|
+
upnext(data: Partial<ParticipantState>): void;
|
|
992
|
+
/** Observable of the participant's display name. */
|
|
993
|
+
get name$(): Observable<string>;
|
|
994
|
+
/** Observable of the participant type (e.g. `'member'`, `'screen'`). */
|
|
995
|
+
get type$(): Observable<string>;
|
|
996
|
+
/** Observable indicating whether the participant has raised their hand. */
|
|
997
|
+
get handraised$(): Observable<boolean>;
|
|
998
|
+
/** Observable indicating whether the participant is visible in the layout. */
|
|
999
|
+
get visible$(): Observable<boolean>;
|
|
1000
|
+
/** Observable indicating whether the participant's audio is muted. */
|
|
1001
|
+
get audioMuted$(): Observable<boolean>;
|
|
1002
|
+
/** Observable indicating whether the participant's video is muted. */
|
|
1003
|
+
get videoMuted$(): Observable<boolean>;
|
|
1004
|
+
/** Observable indicating whether the participant is deafened. */
|
|
1005
|
+
get deaf$(): Observable<boolean>;
|
|
1006
|
+
/** Observable of the participant's microphone input volume. */
|
|
1007
|
+
get inputVolume$(): Observable<number>;
|
|
1008
|
+
/** Observable of the participant's speaker output volume. */
|
|
1009
|
+
get outputVolume$(): Observable<number>;
|
|
1010
|
+
/** Observable of the microphone input sensitivity level. */
|
|
1011
|
+
get inputSensitivity$(): Observable<number>;
|
|
1012
|
+
/** Observable indicating whether echo cancellation is enabled. */
|
|
1013
|
+
get echoCancellation$(): Observable<boolean>;
|
|
1014
|
+
/** Observable indicating whether auto-gain control is enabled. */
|
|
1015
|
+
get autoGain$(): Observable<boolean>;
|
|
1016
|
+
/** Observable indicating whether noise suppression is enabled. */
|
|
1017
|
+
get noiseSuppression$(): Observable<boolean>;
|
|
1018
|
+
/** Observable indicating whether low-bitrate mode is active. */
|
|
1019
|
+
get lowbitrate$(): Observable<boolean>;
|
|
1020
|
+
/** Observable indicating whether noise reduction is active. */
|
|
1021
|
+
get denoise$(): Observable<boolean>;
|
|
1022
|
+
/** Observable of custom metadata for this participant. */
|
|
1023
|
+
get meta$(): Observable<Record<string, unknown>>;
|
|
1024
|
+
/** Observable of the participant's subscriber ID. */
|
|
1025
|
+
get subscriberId$(): Observable<string>;
|
|
1026
|
+
/** Observable of the participant's address ID. */
|
|
1027
|
+
get addressId$(): Observable<string>;
|
|
1028
|
+
/** Observable of the server node ID for this participant. */
|
|
1029
|
+
get nodeId$(): Observable<string>;
|
|
1030
|
+
/** Observable indicating whether the participant is currently speaking. */
|
|
1031
|
+
get isTalking$(): Observable<boolean>;
|
|
1032
|
+
/** Whether the participant is currently speaking. */
|
|
1033
|
+
get isTalking(): boolean;
|
|
1034
|
+
/** Observable of the participant's layout position. */
|
|
1035
|
+
get position$(): Observable<LayoutLayer | undefined>;
|
|
1036
|
+
/** Current layout position. */
|
|
1037
|
+
get position(): LayoutLayer | undefined;
|
|
1038
|
+
/** Whether the participant is an audience member (view-only). */
|
|
1039
|
+
get isAudience(): boolean;
|
|
1040
|
+
/** Display name of this participant. */
|
|
1041
|
+
get name(): string | undefined;
|
|
1042
|
+
/** Participant type (e.g. `'member'`, `'screen'`). */
|
|
1043
|
+
get type(): string | undefined;
|
|
1044
|
+
get handraised(): boolean;
|
|
1045
|
+
get visible(): boolean;
|
|
1046
|
+
get audioMuted(): boolean;
|
|
1047
|
+
get videoMuted(): boolean;
|
|
1048
|
+
get deaf(): boolean;
|
|
1049
|
+
get inputVolume(): number | undefined;
|
|
1050
|
+
get outputVolume(): number | undefined;
|
|
1051
|
+
get inputSensitivity(): number | undefined;
|
|
1052
|
+
get echoCancellation(): boolean;
|
|
1053
|
+
get autoGain(): boolean;
|
|
1054
|
+
get noiseSuppression(): boolean;
|
|
1055
|
+
get lowbitrate(): boolean;
|
|
1056
|
+
get denoise(): boolean;
|
|
1057
|
+
get meta(): Record<string, unknown> | undefined;
|
|
1058
|
+
get subscriberId(): string | undefined;
|
|
1059
|
+
get addressId(): string | undefined;
|
|
1060
|
+
get nodeId(): string | undefined;
|
|
1061
|
+
/** @internal */
|
|
1062
|
+
get value(): Partial<Member>;
|
|
1063
|
+
/** Toggles the deafened state (mutes/unmutes incoming audio). */
|
|
1064
|
+
toggleDeaf(): Promise<void>;
|
|
1065
|
+
/** Toggles the hand-raised state. */
|
|
1066
|
+
toggleHandraise(): Promise<void>;
|
|
1067
|
+
/** Mutes the participant's audio. */
|
|
1068
|
+
mute(): Promise<void>;
|
|
1069
|
+
/** Unmutes the participant's audio. */
|
|
1070
|
+
unmute(): Promise<void>;
|
|
1071
|
+
/** Toggles the participant's audio mute state. */
|
|
1072
|
+
toggleMute(): Promise<void>;
|
|
1073
|
+
/** Mutes the participant's video. */
|
|
1074
|
+
muteVideo(): Promise<void>;
|
|
1075
|
+
/** Unmutes the participant's video. */
|
|
1076
|
+
unmuteVideo(): Promise<void>;
|
|
1077
|
+
/** Toggles the participant's video mute state. */
|
|
1078
|
+
toggleMuteVideo(): Promise<void>;
|
|
1079
|
+
/** Toggles echo cancellation on the audio input. */
|
|
1080
|
+
toggleEchoCancellation(): Promise<void>;
|
|
1081
|
+
/** Toggles automatic gain control on the audio input. */
|
|
1082
|
+
toggleAudioInputAutoGain(): Promise<void>;
|
|
1083
|
+
/** Toggles noise suppression on the audio input. */
|
|
1084
|
+
toggleNoiseSuppression(): Promise<void>;
|
|
1085
|
+
toggleLowbitrate(): Promise<void>;
|
|
1086
|
+
/** Sets the microphone input sensitivity level. */
|
|
1087
|
+
setAudioInputSensitivity(value: number): Promise<void>;
|
|
1088
|
+
/** Sets the microphone input volume level. */
|
|
1089
|
+
setAudioInputVolume(value: number): Promise<void>;
|
|
1090
|
+
/** Sets the speaker output volume level. */
|
|
1091
|
+
setAudioOutputVolume(value: number): Promise<void>;
|
|
1092
|
+
/** Sets the participant's position in the video layout. */
|
|
1093
|
+
setPosition(value: VideoPosition): Promise<void>;
|
|
1094
|
+
/** Removes this participant from the call. */
|
|
1095
|
+
remove(): Promise<void>;
|
|
1096
|
+
/** Ends the call for this participant. */
|
|
1097
|
+
end(): Promise<void>;
|
|
1098
|
+
setMeta(_meta: Record<string, unknown>): Promise<void>;
|
|
1099
|
+
updateMeta(_meta: Record<string, unknown>): Promise<void>;
|
|
1100
|
+
destroy(): void;
|
|
1101
|
+
}
|
|
1102
|
+
/**
|
|
1103
|
+
* The local participant in a call, with additional device and media control.
|
|
1104
|
+
*
|
|
1105
|
+
* Extends {@link Participant} with screen sharing, device selection,
|
|
1106
|
+
* and local media stream management.
|
|
1107
|
+
*/
|
|
1108
|
+
declare class SelfParticipant extends Participant implements CallSelfParticipant {
|
|
1109
|
+
private vertoManager;
|
|
1110
|
+
/**
|
|
1111
|
+
* Capabilities for this participant.
|
|
1112
|
+
* Contains all capability flags as both observables and values.
|
|
1113
|
+
*/
|
|
1114
|
+
readonly capabilities: SelfCapabilities;
|
|
1115
|
+
constructor(id: string, executeMethod: ExecuteMethod, vertoManager: VertoManager, deviceController: DeviceController);
|
|
1116
|
+
destroy(): void;
|
|
1117
|
+
/** Starts sharing the local screen. */
|
|
1118
|
+
startScreenShare(): Promise<void>;
|
|
1119
|
+
/** Observable of the current screen share status. */
|
|
1120
|
+
get screenShareStatus$(): Observable<ScreenShareStatus>;
|
|
1121
|
+
/** Current screen share status. */
|
|
1122
|
+
get screenShareStatus(): ScreenShareStatus;
|
|
1123
|
+
/** Stops the current screen share. */
|
|
1124
|
+
stopScreenShare(): Promise<void>;
|
|
1125
|
+
/** Adds an additional media input device to the call. */
|
|
1126
|
+
addAdditionalDevice(options: MediaOptions): Promise<void>;
|
|
1127
|
+
/** Removes an additional media input device by ID. */
|
|
1128
|
+
removeAdditionalDevice(id: string): Promise<void>;
|
|
1129
|
+
/** Adds or replaces the primary audio input device with optional constraints or stream. */
|
|
1130
|
+
addAudioInputDevice({
|
|
1131
|
+
constraints,
|
|
1132
|
+
stream
|
|
1133
|
+
}?: {
|
|
1134
|
+
constraints?: MediaTrackConstraints;
|
|
1135
|
+
stream?: MediaStream;
|
|
1136
|
+
}): Promise<void>;
|
|
1137
|
+
/** Adds or replaces the primary video input device with optional constraints or stream. */
|
|
1138
|
+
addVideoInputDevice({
|
|
1139
|
+
constraints,
|
|
1140
|
+
stream
|
|
1141
|
+
}?: {
|
|
1142
|
+
constraints?: MediaTrackConstraints;
|
|
1143
|
+
stream?: MediaStream;
|
|
1144
|
+
}): Promise<void>;
|
|
1145
|
+
/** Adds or replaces primary input devices (audio and/or video). */
|
|
1146
|
+
addInputDevices(options?: MediaOptions): Promise<void>;
|
|
1147
|
+
/** Selects the audio input device for future calls. Optionally saves as a preference. */
|
|
1148
|
+
selectAudioInputDevice(device: MediaDeviceInfo, options?: SelectDeviceOptions): void;
|
|
1149
|
+
/** Updates the audio input track constraints for the active call. */
|
|
1150
|
+
setAudioInputDeviceConstraints(constraints: MediaTrackConstraints): Promise<void>;
|
|
1151
|
+
/** Updates both audio and video input track constraints for the active call. */
|
|
1152
|
+
setInputDevicesConstraints(constraints: {
|
|
1153
|
+
audio: MediaTrackConstraints;
|
|
1154
|
+
video: MediaTrackConstraints;
|
|
1155
|
+
}): Promise<void>;
|
|
1156
|
+
/** Selects the video input device for future calls. Optionally saves as a preference. */
|
|
1157
|
+
selectVideoInputDevice(device: MediaDeviceInfo, options?: SelectDeviceOptions): void;
|
|
1158
|
+
/** Updates the video input track constraints for the active call. */
|
|
1159
|
+
setVideoInputDeviceConstraints(constraints: MediaTrackConstraints): Promise<void>;
|
|
1160
|
+
/** Selects the audio output device. Optionally saves as a preference. */
|
|
1161
|
+
selectAudioOutputDevice(device: MediaDeviceInfo, options?: SelectDeviceOptions): void;
|
|
1162
|
+
mute(): Promise<void>;
|
|
1163
|
+
unmute(): Promise<void>;
|
|
1164
|
+
muteVideo(): Promise<void>;
|
|
1165
|
+
unmuteVideo(): Promise<void>;
|
|
1166
|
+
}
|
|
1167
|
+
/** Type guard that checks if a participant is the local {@link SelfParticipant}. */
|
|
1168
|
+
declare const isSelfParticipant: (participant: Participant) => participant is SelfParticipant;
|
|
1169
|
+
//#endregion
|
|
1170
|
+
//#region src/core/entities/types/call.types.d.ts
|
|
1171
|
+
/**
|
|
1172
|
+
* Base participant interface for call participants
|
|
1173
|
+
* Defines the full public contract for participant objects exposed by Call
|
|
1174
|
+
*/
|
|
1175
|
+
interface CallParticipant {
|
|
1176
|
+
readonly id: string;
|
|
1177
|
+
readonly name$: Observable<string>;
|
|
1178
|
+
readonly type$: Observable<string>;
|
|
1179
|
+
readonly handraised$: Observable<boolean>;
|
|
1180
|
+
readonly visible$: Observable<boolean>;
|
|
1181
|
+
readonly audioMuted$: Observable<boolean>;
|
|
1182
|
+
readonly videoMuted$: Observable<boolean>;
|
|
1183
|
+
readonly deaf$: Observable<boolean>;
|
|
1184
|
+
readonly inputVolume$: Observable<number>;
|
|
1185
|
+
readonly outputVolume$: Observable<number>;
|
|
1186
|
+
readonly inputSensitivity$: Observable<number>;
|
|
1187
|
+
readonly echoCancellation$: Observable<boolean>;
|
|
1188
|
+
readonly autoGain$: Observable<boolean>;
|
|
1189
|
+
readonly noiseSuppression$: Observable<boolean>;
|
|
1190
|
+
readonly lowbitrate$: Observable<boolean>;
|
|
1191
|
+
readonly denoise$: Observable<boolean>;
|
|
1192
|
+
readonly meta$: Observable<Record<string, unknown>>;
|
|
1193
|
+
readonly subscriberId$: Observable<string>;
|
|
1194
|
+
readonly addressId$: Observable<string>;
|
|
1195
|
+
readonly nodeId$: Observable<string>;
|
|
1196
|
+
readonly isTalking$: Observable<boolean>;
|
|
1197
|
+
readonly position$: Observable<LayoutLayer | undefined>;
|
|
1198
|
+
readonly name: string | undefined;
|
|
1199
|
+
readonly type: string | undefined;
|
|
1200
|
+
readonly handraised: boolean;
|
|
1201
|
+
readonly visible: boolean;
|
|
1202
|
+
readonly audioMuted: boolean;
|
|
1203
|
+
readonly videoMuted: boolean;
|
|
1204
|
+
readonly deaf: boolean;
|
|
1205
|
+
readonly inputVolume: number | undefined;
|
|
1206
|
+
readonly outputVolume: number | undefined;
|
|
1207
|
+
readonly inputSensitivity: number | undefined;
|
|
1208
|
+
readonly echoCancellation: boolean;
|
|
1209
|
+
readonly autoGain: boolean;
|
|
1210
|
+
readonly noiseSuppression: boolean;
|
|
1211
|
+
readonly lowbitrate: boolean;
|
|
1212
|
+
readonly denoise: boolean;
|
|
1213
|
+
readonly meta: Record<string, unknown> | undefined;
|
|
1214
|
+
readonly subscriberId: string | undefined;
|
|
1215
|
+
readonly addressId: string | undefined;
|
|
1216
|
+
readonly nodeId: string | undefined;
|
|
1217
|
+
readonly isTalking: boolean;
|
|
1218
|
+
readonly position: LayoutLayer | undefined;
|
|
1219
|
+
readonly isAudience: boolean;
|
|
1220
|
+
toggleDeaf(): Promise<void>;
|
|
1221
|
+
toggleHandraise(): Promise<void>;
|
|
1222
|
+
mute(): Promise<void>;
|
|
1223
|
+
unmute(): Promise<void>;
|
|
1224
|
+
toggleMute(): Promise<void>;
|
|
1225
|
+
muteVideo(): Promise<void>;
|
|
1226
|
+
unmuteVideo(): Promise<void>;
|
|
1227
|
+
toggleMuteVideo(): Promise<void>;
|
|
1228
|
+
toggleEchoCancellation(): Promise<void>;
|
|
1229
|
+
toggleAudioInputAutoGain(): Promise<void>;
|
|
1230
|
+
toggleNoiseSuppression(): Promise<void>;
|
|
1231
|
+
toggleLowbitrate(): Promise<void>;
|
|
1232
|
+
setAudioInputSensitivity(value: number): Promise<void>;
|
|
1233
|
+
setAudioInputVolume(value: number): Promise<void>;
|
|
1234
|
+
setAudioOutputVolume(value: number): Promise<void>;
|
|
1235
|
+
setPosition(value: VideoPosition): Promise<void>;
|
|
1236
|
+
remove(): Promise<void>;
|
|
1237
|
+
end(): Promise<void>;
|
|
1238
|
+
setMeta(meta: Record<string, unknown>): Promise<void>;
|
|
1239
|
+
updateMeta(meta: Record<string, unknown>): Promise<void>;
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* Self participant interface with control methods
|
|
1243
|
+
* Extends CallParticipant with methods for controlling the local participant
|
|
1244
|
+
*/
|
|
1245
|
+
interface CallSelfParticipant extends CallParticipant {
|
|
1246
|
+
readonly screenShareStatus$: Observable<string>;
|
|
1247
|
+
readonly screenShareStatus: string;
|
|
1248
|
+
startScreenShare(): Promise<void>;
|
|
1249
|
+
stopScreenShare(): Promise<void>;
|
|
1250
|
+
selectAudioInputDevice(device: MediaDeviceInfo): void;
|
|
1251
|
+
selectVideoInputDevice(device: MediaDeviceInfo): void;
|
|
1252
|
+
selectAudioOutputDevice(device: MediaDeviceInfo): void;
|
|
1253
|
+
}
|
|
1254
|
+
/**
|
|
1255
|
+
* Minimal interface for a collection with pagination
|
|
1256
|
+
*/
|
|
1257
|
+
interface CallTextMessageCollection {
|
|
1258
|
+
readonly values$: Observable<unknown[]>;
|
|
1259
|
+
readonly hasMore$: Observable<boolean>;
|
|
1260
|
+
loadMore(): void;
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* Minimal address interface for call context
|
|
1264
|
+
* Avoids circular dependency with full Address class
|
|
1265
|
+
*/
|
|
1266
|
+
interface CallAddress {
|
|
1267
|
+
readonly id: string;
|
|
1268
|
+
readonly displayName?: string;
|
|
1269
|
+
readonly type?: string;
|
|
1270
|
+
sendText(text: string): Promise<void>;
|
|
1271
|
+
readonly textMessages$: Observable<CallTextMessageCollection | undefined>;
|
|
1272
|
+
}
|
|
1273
|
+
/** Lifecycle status of a call. */
|
|
1274
|
+
type CallStatus = 'new' | 'trying' | 'ringing' | 'connecting' | 'connected' | 'disconnecting' | 'disconnected' | 'failed' | 'destroyed';
|
|
1275
|
+
/** Configuration options for creating a call. */
|
|
1276
|
+
interface CallOptions extends MediaOptions {
|
|
1277
|
+
/** Target server node ID. */
|
|
1278
|
+
readonly nodeId?: string;
|
|
1279
|
+
/** Pre-assigned call ID (used for reattach). */
|
|
1280
|
+
readonly callId?: string;
|
|
1281
|
+
/** Destination URI. */
|
|
1282
|
+
readonly to?: string;
|
|
1283
|
+
/** SDP offer for inbound calls. */
|
|
1284
|
+
readonly initOffer?: string;
|
|
1285
|
+
/** Whether this call is being reattached after reconnect. */
|
|
1286
|
+
readonly reattach?: boolean;
|
|
1287
|
+
/** Display name of the caller. */
|
|
1288
|
+
readonly fromName?: string;
|
|
1289
|
+
/** Address URI of the caller. */
|
|
1290
|
+
readonly from?: string;
|
|
1291
|
+
/** Display name of the callee. */
|
|
1292
|
+
readonly toName?: string;
|
|
1293
|
+
/** Direction hint for display purposes. */
|
|
1294
|
+
readonly displayDirection?: string;
|
|
1295
|
+
/** Custom user variables sent with the call invite. */
|
|
1296
|
+
readonly userVariables?: Record<string, unknown>;
|
|
1297
|
+
}
|
|
1298
|
+
/** Observable state of a call (status, recording, participants, etc.). */
|
|
1299
|
+
interface CallState {
|
|
1300
|
+
readonly id: string;
|
|
1301
|
+
readonly status$: Observable<CallStatus>;
|
|
1302
|
+
readonly status: CallStatus;
|
|
1303
|
+
readonly recording$: Observable<boolean>;
|
|
1304
|
+
readonly recording: boolean;
|
|
1305
|
+
readonly streaming$: Observable<boolean>;
|
|
1306
|
+
readonly streaming: boolean;
|
|
1307
|
+
readonly raiseHandPriority$: Observable<boolean>;
|
|
1308
|
+
readonly raiseHandPriority: boolean;
|
|
1309
|
+
readonly locked$: Observable<boolean>;
|
|
1310
|
+
readonly locked: boolean;
|
|
1311
|
+
readonly meta$: Observable<Record<string, unknown>>;
|
|
1312
|
+
readonly meta: Record<string, unknown>;
|
|
1313
|
+
readonly participants$: Observable<CallParticipant[]>;
|
|
1314
|
+
readonly participants: CallParticipant[];
|
|
1315
|
+
setMeta(meta: Record<string, unknown>): Promise<void>;
|
|
1316
|
+
updateMeta(meta: Record<string, unknown>): Promise<void>;
|
|
1317
|
+
}
|
|
1318
|
+
/**
|
|
1319
|
+
* Public interface for an active WebRTC call.
|
|
1320
|
+
*
|
|
1321
|
+
* Provides access to media streams, participants, layout, signaling events,
|
|
1322
|
+
* and control actions (hangup, mute, transfer, etc.).
|
|
1323
|
+
*/
|
|
1324
|
+
interface Call extends CallState {
|
|
1325
|
+
readonly capabilities$: Observable<string[]>;
|
|
1326
|
+
readonly capabilities: string[];
|
|
1327
|
+
readonly mediaDirections$: Observable<MediaDirections>;
|
|
1328
|
+
readonly mediaDirections: MediaDirections;
|
|
1329
|
+
readonly self$: Observable<CallSelfParticipant | null>;
|
|
1330
|
+
readonly self: CallSelfParticipant | null;
|
|
1331
|
+
readonly to?: string;
|
|
1332
|
+
readonly direction: 'inbound' | 'outbound';
|
|
1333
|
+
readonly layouts$: Observable<string[]>;
|
|
1334
|
+
readonly layouts: string[];
|
|
1335
|
+
readonly layout$: Observable<string>;
|
|
1336
|
+
readonly layout?: string;
|
|
1337
|
+
readonly layoutLayers$: Observable<LayoutLayer[]>;
|
|
1338
|
+
readonly layoutLayers: LayoutLayer[];
|
|
1339
|
+
readonly localStream$: Observable<MediaStream | null>;
|
|
1340
|
+
readonly localStream: MediaStream | null;
|
|
1341
|
+
readonly remoteStream$: Observable<MediaStream | null>;
|
|
1342
|
+
readonly remoteStream: MediaStream | null;
|
|
1343
|
+
readonly rtcPeerConnection: RTCPeerConnection | undefined;
|
|
1344
|
+
readonly errors$: Observable<Error>;
|
|
1345
|
+
readonly signalingEvent$: Observable<Record<string, unknown>>;
|
|
1346
|
+
readonly address?: CallAddress;
|
|
1347
|
+
readonly address$: Observable<CallAddress | undefined>;
|
|
1348
|
+
hangup(): Promise<void>;
|
|
1349
|
+
toggleLock(): Promise<void>;
|
|
1350
|
+
toggleHold(): Promise<void>;
|
|
1351
|
+
setLayout(layout: string, positions: Record<string, VideoPosition>): Promise<void>;
|
|
1352
|
+
startRecording(): Promise<void>;
|
|
1353
|
+
startStreaming(): Promise<void>;
|
|
1354
|
+
transfer(options: TransferOptions): Promise<void>;
|
|
1355
|
+
toggleIncomingVideo(): Promise<void>;
|
|
1356
|
+
toggleIncomingAudio(): Promise<void>;
|
|
1357
|
+
answer(): void;
|
|
1358
|
+
reject(): void;
|
|
1359
|
+
sendDigits(digits: string): Promise<void>;
|
|
1360
|
+
executeMethod<T extends JSONRPCResponse = JSONRPCResponse>(target: string, method: string, args: Record<string, unknown>): Promise<T>;
|
|
1361
|
+
}
|
|
1362
|
+
/**
|
|
1363
|
+
* Extended Call interface with internal management capabilities
|
|
1364
|
+
* Provides access to lower-level call operations, event streams, and session management
|
|
1365
|
+
*/
|
|
1366
|
+
interface CallManager extends Call {
|
|
1367
|
+
readonly options: CallOptions;
|
|
1368
|
+
readonly fromName?: string;
|
|
1369
|
+
readonly from?: string;
|
|
1370
|
+
readonly toName?: string;
|
|
1371
|
+
readonly selfId$: Observable<string | null>;
|
|
1372
|
+
readonly selfId: string | null;
|
|
1373
|
+
readonly nodeId$: Observable<string | null>;
|
|
1374
|
+
readonly nodeId: string | null;
|
|
1375
|
+
readonly answered$: Observable<boolean>;
|
|
1376
|
+
readonly callUpdated$: Observable<CallUpdatedPayload>;
|
|
1377
|
+
readonly memberJoined$: Observable<MemberJoinedPayload>;
|
|
1378
|
+
readonly memberLeft$: Observable<MemberLeftPayload>;
|
|
1379
|
+
readonly memberUpdated$: Observable<MemberUpdatedPayload>;
|
|
1380
|
+
readonly memberTalking$: Observable<MemberTalkingPayload>;
|
|
1381
|
+
readonly callStates$: Observable<CallStatePayload>;
|
|
1382
|
+
readonly layoutUpdates$: Observable<LayoutChangedPayload>;
|
|
1383
|
+
readonly callEvent$: Observable<unknown>;
|
|
1384
|
+
addCallId(callId: string): void;
|
|
1385
|
+
/** @internal */
|
|
1386
|
+
createParticipant(memberId: string, selfId?: string | null): Participant | SelfParticipant;
|
|
1387
|
+
execute<T extends JSONRPCResponse = JSONRPCResponse>(request: JSONRPCRequest, options?: PendingRPCOptions): Promise<T>;
|
|
1388
|
+
destroy(): void;
|
|
1389
|
+
}
|
|
1390
|
+
//#endregion
|
|
1391
|
+
//#region src/interfaces/AddressProvider.d.ts
|
|
1392
|
+
/**
|
|
1393
|
+
* Provider interface for resolving addresses by ID
|
|
1394
|
+
*
|
|
1395
|
+
* This interface breaks the circular dependency between Address and Directory
|
|
1396
|
+
* by providing a minimal contract that Address needs from the Directory.
|
|
1397
|
+
*
|
|
1398
|
+
* @typeParam TAddress - The Address type, defaults to never to enforce explicit typing
|
|
1399
|
+
*
|
|
1400
|
+
* @remarks
|
|
1401
|
+
* Uses a generic type parameter to maintain type safety while avoiding
|
|
1402
|
+
* circular dependencies. Implementations should provide the concrete Address type.
|
|
1403
|
+
*/
|
|
1404
|
+
interface AddressProvider<TAddress = never> {
|
|
1405
|
+
/**
|
|
1406
|
+
* Get an observable stream for a specific address by ID
|
|
1407
|
+
*
|
|
1408
|
+
* @param id - The address ID to retrieve
|
|
1409
|
+
* @returns Observable of the address, or undefined if not found
|
|
1410
|
+
*/
|
|
1411
|
+
get$(id: string): Observable<TAddress> | undefined;
|
|
1412
|
+
}
|
|
1413
|
+
//#endregion
|
|
1414
|
+
//#region src/core/types/conversation.types.d.ts
|
|
1415
|
+
/**
|
|
1416
|
+
* Address history entry from conversation messages
|
|
1417
|
+
* Contains a reference to the sender address as an observable
|
|
1418
|
+
*
|
|
1419
|
+
* @typeParam TAddress - The Address type, provided by the implementation
|
|
1420
|
+
*
|
|
1421
|
+
* @remarks
|
|
1422
|
+
* Uses a generic type parameter to maintain type safety while avoiding
|
|
1423
|
+
* circular dependencies. The Address class provides the concrete type.
|
|
1424
|
+
*/
|
|
1425
|
+
interface AddressHistory<TAddress = never> {
|
|
1426
|
+
id: string;
|
|
1427
|
+
kind: string;
|
|
1428
|
+
status: string;
|
|
1429
|
+
started: number;
|
|
1430
|
+
ended?: number;
|
|
1431
|
+
fromAddress$: Observable<TAddress> | undefined;
|
|
1432
|
+
}
|
|
1433
|
+
/**
|
|
1434
|
+
* Text message from conversation
|
|
1435
|
+
* Contains a reference to the sender address as an observable
|
|
1436
|
+
*
|
|
1437
|
+
* @typeParam TAddress - The Address type, provided by the implementation
|
|
1438
|
+
*
|
|
1439
|
+
* @remarks
|
|
1440
|
+
* Uses a generic type parameter to maintain type safety while avoiding
|
|
1441
|
+
* circular dependencies. The Address class provides the concrete type.
|
|
1442
|
+
*/
|
|
1443
|
+
interface TextMessage<TAddress = never> {
|
|
1444
|
+
id: string;
|
|
1445
|
+
fromAddress$: Observable<TAddress> | undefined;
|
|
1446
|
+
created: number;
|
|
1447
|
+
text: string;
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Conversation message response from backend
|
|
1451
|
+
*/
|
|
1452
|
+
interface GetConversationMessageResponse {
|
|
1453
|
+
id: string;
|
|
1454
|
+
from_fabric_address_id: string;
|
|
1455
|
+
group_id: string;
|
|
1456
|
+
ts: number;
|
|
1457
|
+
details: ConversationDetails;
|
|
1458
|
+
type: string;
|
|
1459
|
+
subtype: string;
|
|
1460
|
+
kind?: string;
|
|
1461
|
+
text?: string;
|
|
1462
|
+
}
|
|
1463
|
+
//#endregion
|
|
1464
|
+
//#region src/interfaces/Conversations.d.ts
|
|
1465
|
+
/**
|
|
1466
|
+
* Interface for conversation message collection
|
|
1467
|
+
*
|
|
1468
|
+
* Type alias for EntityCollection specialized for conversation messages.
|
|
1469
|
+
* Decouples Address from ConversationsManager's concrete ConversationMessageCollection class.
|
|
1470
|
+
*
|
|
1471
|
+
* @remarks
|
|
1472
|
+
* The concrete ConversationMessageCollection class in ConversationsManager.ts
|
|
1473
|
+
* extends EntityCollection<GetConversationMessageResponse> and satisfies this type.
|
|
1474
|
+
*/
|
|
1475
|
+
type ConversationMessageCollection = EntityCollection<GetConversationMessageResponse>;
|
|
1476
|
+
/**
|
|
1477
|
+
* Provider interface for conversation management
|
|
1478
|
+
*
|
|
1479
|
+
* Defines the minimal interface required by Address and other consumers
|
|
1480
|
+
* of conversation functionality. Implemented by ConversationsManager.
|
|
1481
|
+
*
|
|
1482
|
+
* @remarks
|
|
1483
|
+
* This interface enables dependency injection and breaks circular dependencies
|
|
1484
|
+
* by allowing consumers to depend on the interface rather than the concrete manager.
|
|
1485
|
+
*/
|
|
1486
|
+
interface ConversationsProvider {
|
|
1487
|
+
/**
|
|
1488
|
+
* Get or create a conversation message collection for an address
|
|
1489
|
+
*
|
|
1490
|
+
* @param addressId - The fabric address ID to get messages for
|
|
1491
|
+
* @returns Promise resolving to a collection of conversation messages
|
|
1492
|
+
*
|
|
1493
|
+
* @remarks
|
|
1494
|
+
* This method handles joining conversations if needed and creates
|
|
1495
|
+
* a reactive collection that updates with new messages via observables
|
|
1496
|
+
*/
|
|
1497
|
+
getConversationMessageCollection(addressId: string): Promise<ConversationMessageCollection>;
|
|
1498
|
+
/**
|
|
1499
|
+
* Send a text message to an address
|
|
1500
|
+
*
|
|
1501
|
+
* @param text - The message text to send
|
|
1502
|
+
* @param destinationAddressId - The fabric address ID to send to
|
|
1503
|
+
* @returns Promise that resolves when message is sent
|
|
1504
|
+
*
|
|
1505
|
+
* @throws {ConversationError} If sending fails
|
|
1506
|
+
*/
|
|
1507
|
+
sendText(text: string, destinationAddressId: string): Promise<void>;
|
|
1508
|
+
}
|
|
1509
|
+
//#endregion
|
|
1510
|
+
//#region src/core/entities/Address.d.ts
|
|
1511
|
+
type AddressState = GetAddressResponse;
|
|
1512
|
+
/**
|
|
1513
|
+
* Represents a contact or room in the directory.
|
|
1514
|
+
*
|
|
1515
|
+
* Provides identity metadata, conversation history, text messaging,
|
|
1516
|
+
* and activity state for an address entry.
|
|
1517
|
+
*/
|
|
1518
|
+
declare class Address extends Destroyable {
|
|
1519
|
+
private readonly addressId;
|
|
1520
|
+
private conversationManager;
|
|
1521
|
+
private addressProvider;
|
|
1522
|
+
private initConversationMessages;
|
|
1523
|
+
/** Observable of text messages for this address. Lazily loads conversation data. */
|
|
1524
|
+
textMessages$: Observable<EntityCollectionTransformed<GetConversationMessageResponse, TextMessage<Address>> | undefined>;
|
|
1525
|
+
/** Observable of call history for this address. Lazily loads conversation data. */
|
|
1526
|
+
history$: Observable<EntityCollectionTransformed<GetConversationMessageResponse, AddressHistory<Address>> | undefined>;
|
|
1527
|
+
private _conversationMessages?;
|
|
1528
|
+
private _state$;
|
|
1529
|
+
private _history$?;
|
|
1530
|
+
private _textMessages$?;
|
|
1531
|
+
constructor(addressId: string, conversationManager: ConversationsProvider, addressProvider: AddressProvider<Address>);
|
|
1532
|
+
/** @internal */
|
|
1533
|
+
upnext(state: Partial<AddressState>): void;
|
|
1534
|
+
/** @internal */
|
|
1535
|
+
get state(): AddressState | null;
|
|
1536
|
+
/** Unique address identifier. */
|
|
1537
|
+
get id(): string;
|
|
1538
|
+
/** Address name (resource identifier). */
|
|
1539
|
+
get name(): string;
|
|
1540
|
+
/** ISO timestamp of when the address was created. */
|
|
1541
|
+
get createdAt(): string;
|
|
1542
|
+
/** Default communication channel URI (video for rooms, audio otherwise). */
|
|
1543
|
+
get defaultChannel(): string | undefined;
|
|
1544
|
+
/** Observable of the human-readable display name. */
|
|
1545
|
+
get displayName$(): Observable<string>;
|
|
1546
|
+
/** Human-readable display name. */
|
|
1547
|
+
get displayName(): string;
|
|
1548
|
+
/** Observable of the preview image URL. */
|
|
1549
|
+
get previewUrl$(): Observable<string | undefined>;
|
|
1550
|
+
/** Preview image URL. */
|
|
1551
|
+
get previewUrl(): string | undefined;
|
|
1552
|
+
/** Observable of the cover image URL. */
|
|
1553
|
+
get coverUrl$(): Observable<string | undefined>;
|
|
1554
|
+
/** Cover image URL. */
|
|
1555
|
+
get coverUrl(): string | undefined;
|
|
1556
|
+
/** Observable of the underlying resource ID. */
|
|
1557
|
+
get resourceId$(): Observable<string>;
|
|
1558
|
+
/** Underlying resource ID. */
|
|
1559
|
+
get resourceId(): string;
|
|
1560
|
+
/** Observable of the resource type (e.g. `'room'`, `'subscriber'`). */
|
|
1561
|
+
get type$(): Observable<ResourceType>;
|
|
1562
|
+
/** Resource type (e.g. `'room'`, `'subscriber'`). */
|
|
1563
|
+
get type(): ResourceType;
|
|
1564
|
+
/** Observable of available communication channels (audio, video, messaging). */
|
|
1565
|
+
get channels$(): Observable<{
|
|
1566
|
+
audio?: string;
|
|
1567
|
+
messaging?: string;
|
|
1568
|
+
video?: string;
|
|
1569
|
+
}>;
|
|
1570
|
+
/** Available communication channels. */
|
|
1571
|
+
get channels(): {
|
|
1572
|
+
audio?: string;
|
|
1573
|
+
messaging?: string;
|
|
1574
|
+
video?: string;
|
|
1575
|
+
};
|
|
1576
|
+
/** Whether the address (room) is locked. */
|
|
1577
|
+
get locked(): boolean;
|
|
1578
|
+
/** Observable indicating whether the address (room) is locked. */
|
|
1579
|
+
get locked$(): Observable<boolean>;
|
|
1580
|
+
/** Sends a text message to this address. */
|
|
1581
|
+
sendText(text: string): Promise<void>;
|
|
1582
|
+
/** Collection of text messages for this address, with pagination support. */
|
|
1583
|
+
get textMessage(): EntityCollectionTransformed<GetConversationMessageResponse, TextMessage<Address>> | undefined;
|
|
1584
|
+
/** Collection of call history entries for this address, with pagination support. */
|
|
1585
|
+
get history(): EntityCollectionTransformed<GetConversationMessageResponse, AddressHistory<Address>> | undefined;
|
|
1586
|
+
/** Observable of active call states for this address. @throws {UnimplementedError} Requires presence support. */
|
|
1587
|
+
get activity$(): Observable<CallState[]>;
|
|
1588
|
+
/** Active call states for this address. @throws {UnimplementedError} Requires presence support. */
|
|
1589
|
+
get activity(): CallState[];
|
|
1590
|
+
}
|
|
1591
|
+
//#endregion
|
|
1592
|
+
//#region src/managers/AttachManager.d.ts
|
|
1593
|
+
interface AttachableCall {
|
|
1594
|
+
id: string;
|
|
1595
|
+
to?: string;
|
|
1596
|
+
mediaDirections: MediaDirections;
|
|
1597
|
+
}
|
|
1598
|
+
interface OutboundCallProvider {
|
|
1599
|
+
createOutboundCall(destination: string | Address, options?: CallOptions): Promise<Call>;
|
|
1600
|
+
}
|
|
1601
|
+
declare class AttachManager {
|
|
1602
|
+
private readonly storage;
|
|
1603
|
+
private readonly deviceController;
|
|
1604
|
+
private readonly reconnectCallsTimeout;
|
|
1605
|
+
private attachKey;
|
|
1606
|
+
private session;
|
|
1607
|
+
constructor(storage: StorageManager, deviceController: DeviceController, reconnectCallsTimeout: number, attachKey: string);
|
|
1608
|
+
detachAll(): Promise<void>;
|
|
1609
|
+
setSession(session: OutboundCallProvider): void;
|
|
1610
|
+
private readAttached;
|
|
1611
|
+
private writeAttached;
|
|
1612
|
+
attach(call: AttachableCall): Promise<void>;
|
|
1613
|
+
detach(call: AttachableCall): Promise<void>;
|
|
1614
|
+
flush(): Promise<void>;
|
|
1615
|
+
reattachCalls(): Promise<void>;
|
|
1616
|
+
private buildCallOptions;
|
|
1617
|
+
private detachExpired;
|
|
1618
|
+
}
|
|
1619
|
+
//#endregion
|
|
1620
|
+
//#region src/managers/TransportManager.d.ts
|
|
1621
|
+
declare class TransportManager extends Destroyable {
|
|
1622
|
+
private readonly storage;
|
|
1623
|
+
private readonly protocolKey;
|
|
1624
|
+
private readonly onError?;
|
|
1625
|
+
private initialized$;
|
|
1626
|
+
protocol$: rxjs0.ReplaySubject<string | undefined>;
|
|
1627
|
+
private isConnecting;
|
|
1628
|
+
private isConnected;
|
|
1629
|
+
private ackEvent;
|
|
1630
|
+
private replySignalwirePing;
|
|
1631
|
+
private _outgoingMessages$;
|
|
1632
|
+
private _webSocketConnections;
|
|
1633
|
+
private _jsonRPCMessage$;
|
|
1634
|
+
private _jsonRPCResponse$;
|
|
1635
|
+
private _incomingEvent$;
|
|
1636
|
+
constructor(storage: StorageManager, protocolKey: string, webSocketConstructor: WebSocketAdapter | NodeSocketAdapter, relayHost: string, onError?: ((error: Error) => void) | undefined);
|
|
1637
|
+
setProtocol(protocol: string | undefined): Promise<void>;
|
|
1638
|
+
get incomingEvent$(): Observable<JSONRPCRequest | JSONRPCResponse>;
|
|
1639
|
+
get connectionStatus$(): Observable<string>;
|
|
1640
|
+
connect(): Promise<void>;
|
|
1641
|
+
reconnect(): void;
|
|
1642
|
+
execute<T extends JSONRPCResponse = JSONRPCResponse>(request: JSONRPCRequest, options?: PendingRPCOptions): Promise<T>;
|
|
1643
|
+
send(message: unknown): void;
|
|
1644
|
+
disconnect(): void;
|
|
1645
|
+
destroy(): void;
|
|
1646
|
+
private _loadProtocolFromStorage;
|
|
1647
|
+
private _updateProtocolInStorage;
|
|
1648
|
+
private _init;
|
|
1649
|
+
}
|
|
1650
|
+
//#endregion
|
|
1651
|
+
//#region src/core/entities/Directory.d.ts
|
|
1652
|
+
/**
|
|
1653
|
+
* Directory interface for managing addresses
|
|
1654
|
+
*
|
|
1655
|
+
* This is the public API contract for address directory functionality.
|
|
1656
|
+
* It provides access to addresses, loading capabilities, and search functionality.
|
|
1657
|
+
*
|
|
1658
|
+
* @public
|
|
1659
|
+
*/
|
|
1660
|
+
interface Directory extends AddressProvider<Address> {
|
|
1661
|
+
/**
|
|
1662
|
+
* Observable stream of all addresses in the directory
|
|
1663
|
+
* Emits a new array whenever addresses are added, removed, or updated
|
|
1664
|
+
*/
|
|
1665
|
+
readonly addresses$: Observable<Address[]>;
|
|
1666
|
+
/**
|
|
1667
|
+
* Current snapshot of all addresses in the directory
|
|
1668
|
+
*/
|
|
1669
|
+
readonly addresses: Address[];
|
|
1670
|
+
/**
|
|
1671
|
+
* Observable indicating whether more addresses can be loaded from the server
|
|
1672
|
+
*/
|
|
1673
|
+
readonly hasMore$: Observable<boolean>;
|
|
1674
|
+
/**
|
|
1675
|
+
* Observable indicating the current loading state
|
|
1676
|
+
* Emits `true` when loading, `false` when idle
|
|
1677
|
+
*/
|
|
1678
|
+
readonly loading$: Observable<boolean>;
|
|
1679
|
+
readonly loading: boolean;
|
|
1680
|
+
/**
|
|
1681
|
+
* Load more addresses from the server
|
|
1682
|
+
* Only loads if `hasMore` is true
|
|
1683
|
+
*/
|
|
1684
|
+
loadMore(): void;
|
|
1685
|
+
/**
|
|
1686
|
+
* Get a specific address by ID
|
|
1687
|
+
*
|
|
1688
|
+
* @param addressId - The address ID to retrieve
|
|
1689
|
+
* @returns The address instance, or undefined if not found
|
|
1690
|
+
*/
|
|
1691
|
+
get(addressId: string): Address | undefined;
|
|
1692
|
+
/**
|
|
1693
|
+
* Find an address ID by searching for a name
|
|
1694
|
+
*
|
|
1695
|
+
* @param uri - The address name to search for
|
|
1696
|
+
* @returns Promise resolving to the address ID, or undefined if not found
|
|
1697
|
+
*/
|
|
1698
|
+
findAddressIdByURI(uri: string): Promise<string | undefined>;
|
|
1699
|
+
}
|
|
1700
|
+
//#endregion
|
|
1701
|
+
//#region src/interfaces/ClientSession.d.ts
|
|
1702
|
+
/**
|
|
1703
|
+
* Minimal interface for what Call needs from session management
|
|
1704
|
+
* need to interact with the session layer
|
|
1705
|
+
*/
|
|
1706
|
+
interface ClientSession {
|
|
1707
|
+
/**
|
|
1708
|
+
* Execute an RPC request through the session transport
|
|
1709
|
+
* @param request - The JSON-RPC request to execute
|
|
1710
|
+
* @param options - Optional RPC execution options (timeout, etc.)
|
|
1711
|
+
* @returns Promise resolving to the RPC response
|
|
1712
|
+
*/
|
|
1713
|
+
execute<T extends JSONRPCResponse = JSONRPCResponse>(request: JSONRPCRequest, options?: PendingRPCOptions): Promise<T>;
|
|
1714
|
+
/**
|
|
1715
|
+
* Observable stream of incoming signaling events
|
|
1716
|
+
* Used by Call to listen for call-related events from the server
|
|
1717
|
+
*/
|
|
1718
|
+
readonly signalingEvent$: Observable<Record<string, unknown>>;
|
|
1719
|
+
/**
|
|
1720
|
+
* ICE servers configuration for WebRTC peer connections
|
|
1721
|
+
* Used by VertoManager to configure RTCPeerConnection
|
|
1722
|
+
*/
|
|
1723
|
+
readonly iceServers: RTCIceServer[] | undefined;
|
|
1724
|
+
}
|
|
1725
|
+
//#endregion
|
|
1726
|
+
//#region src/managers/ClientSessionManager.d.ts
|
|
1727
|
+
declare class ClientSessionManager extends Destroyable implements ClientSession {
|
|
1728
|
+
private credential;
|
|
1729
|
+
private readonly transport;
|
|
1730
|
+
private readonly storage;
|
|
1731
|
+
private readonly authorizationStateKey;
|
|
1732
|
+
private readonly attachManager;
|
|
1733
|
+
private callFactory;
|
|
1734
|
+
private callCreateTimeout;
|
|
1735
|
+
private readonly agent;
|
|
1736
|
+
private readonly eventAcks;
|
|
1737
|
+
initialized$: Observable<boolean>;
|
|
1738
|
+
authorization$: rxjs0.Subject<Authorization>;
|
|
1739
|
+
private authorizationState$;
|
|
1740
|
+
private connectVersion;
|
|
1741
|
+
private _errors$;
|
|
1742
|
+
private _directory?;
|
|
1743
|
+
private _authenticated$;
|
|
1744
|
+
private _subscriberInfo$;
|
|
1745
|
+
private _calls$;
|
|
1746
|
+
private _iceServers$;
|
|
1747
|
+
constructor(credential: SDKCredential, transport: TransportManager, storage: StorageManager, authorizationStateKey: string, deviceController: DeviceController, attachManager: AttachManager);
|
|
1748
|
+
get incomingCalls$(): Observable<Call[]>;
|
|
1749
|
+
get incomingCalls(): Call[];
|
|
1750
|
+
get subscriberInfo$(): Observable<Address | null>;
|
|
1751
|
+
get subscriberInfo(): Address | null;
|
|
1752
|
+
get calls$(): Observable<Call[]>;
|
|
1753
|
+
get calls(): Call[];
|
|
1754
|
+
get iceServers(): RTCIceServer[] | undefined;
|
|
1755
|
+
get errors$(): Observable<Error>;
|
|
1756
|
+
get authenticated$(): Observable<boolean>;
|
|
1757
|
+
get authenticated(): boolean;
|
|
1758
|
+
/**
|
|
1759
|
+
* Set the directory instance
|
|
1760
|
+
* Called by SignalWire after directory is created
|
|
1761
|
+
* @internal
|
|
1762
|
+
*/
|
|
1763
|
+
setDirectory(directory: Directory): void;
|
|
1764
|
+
execute<T extends JSONRPCResponse = JSONRPCResponse>(request: JSONRPCRequest, options?: PendingRPCOptions): Promise<T>;
|
|
1765
|
+
send(message: JSONSerializable): void;
|
|
1766
|
+
private init;
|
|
1767
|
+
private setupMessageHandlers;
|
|
1768
|
+
private loadAuthorizationStateFromStorage;
|
|
1769
|
+
private updateAuthorizationStateInStorage;
|
|
1770
|
+
private get authStateEvent$();
|
|
1771
|
+
get signalingEvent$(): Observable<{
|
|
1772
|
+
event_type: "webrtc.message";
|
|
1773
|
+
event_channel: string;
|
|
1774
|
+
timestamp: number;
|
|
1775
|
+
project_id: string;
|
|
1776
|
+
node_id: string;
|
|
1777
|
+
params: WebrtcMessagePayload;
|
|
1778
|
+
} | {
|
|
1779
|
+
event_type: "signalwire.authorization.state";
|
|
1780
|
+
params: SignalwireAuthorizationStatePayload;
|
|
1781
|
+
} | {
|
|
1782
|
+
event_type: "call.joined";
|
|
1783
|
+
event_channel: string;
|
|
1784
|
+
timestamp: number;
|
|
1785
|
+
params: CallJoinedPayload;
|
|
1786
|
+
} | {
|
|
1787
|
+
event_type: "call.left";
|
|
1788
|
+
event_channel: string;
|
|
1789
|
+
timestamp: number;
|
|
1790
|
+
params: CallLeftPayload;
|
|
1791
|
+
} | {
|
|
1792
|
+
event_type: "call.updated";
|
|
1793
|
+
event_channel: string;
|
|
1794
|
+
timestamp: number;
|
|
1795
|
+
params: CallUpdatedPayload;
|
|
1796
|
+
} | {
|
|
1797
|
+
event_type: "call.state";
|
|
1798
|
+
event_channel: string;
|
|
1799
|
+
timestamp: number;
|
|
1800
|
+
params: CallStatePayload;
|
|
1801
|
+
} | {
|
|
1802
|
+
event_type: "call.play";
|
|
1803
|
+
event_channel: string;
|
|
1804
|
+
timestamp: number;
|
|
1805
|
+
params: CallPlayPayload;
|
|
1806
|
+
} | {
|
|
1807
|
+
event_type: "call.connect";
|
|
1808
|
+
event_channel: string;
|
|
1809
|
+
timestamp: number;
|
|
1810
|
+
params: CallConnectPayload;
|
|
1811
|
+
} | {
|
|
1812
|
+
event_type: "member.updated";
|
|
1813
|
+
event_channel: EventChannel;
|
|
1814
|
+
timestamp: number;
|
|
1815
|
+
params: MemberUpdatedPayload;
|
|
1816
|
+
} | {
|
|
1817
|
+
event_type: "member.joined";
|
|
1818
|
+
event_channel: EventChannel;
|
|
1819
|
+
timestamp: number;
|
|
1820
|
+
params: MemberJoinedPayload;
|
|
1821
|
+
} | {
|
|
1822
|
+
event_type: "member.left";
|
|
1823
|
+
event_channel: EventChannel;
|
|
1824
|
+
timestamp: number;
|
|
1825
|
+
params: MemberLeftPayload;
|
|
1826
|
+
} | {
|
|
1827
|
+
event_type: "member.talking";
|
|
1828
|
+
event_channel: EventChannel;
|
|
1829
|
+
timestamp: number;
|
|
1830
|
+
params: MemberTalkingPayload;
|
|
1831
|
+
} | {
|
|
1832
|
+
event_type: "layout.changed";
|
|
1833
|
+
event_channel: EventChannel;
|
|
1834
|
+
timestamp: number;
|
|
1835
|
+
params: LayoutChangedPayload;
|
|
1836
|
+
} | {
|
|
1837
|
+
event_type: "conversation.message";
|
|
1838
|
+
event_channel: string;
|
|
1839
|
+
timestamp: string;
|
|
1840
|
+
is_author: boolean;
|
|
1841
|
+
params: ConversationMessagePayload;
|
|
1842
|
+
} | {
|
|
1843
|
+
event_type: "conversation.message.updated";
|
|
1844
|
+
event_channel: string;
|
|
1845
|
+
timestamp: string;
|
|
1846
|
+
is_author: boolean;
|
|
1847
|
+
params: ConversationMessageUpdatedPayload;
|
|
1848
|
+
}>;
|
|
1849
|
+
private get vertoInvite$();
|
|
1850
|
+
private get contexts();
|
|
1851
|
+
private get eventing();
|
|
1852
|
+
private get topics();
|
|
1853
|
+
private get authentication();
|
|
1854
|
+
connect(): Promise<void>;
|
|
1855
|
+
private handleAuthenticationError;
|
|
1856
|
+
cleanupStoredConnectionParams(): Promise<void>;
|
|
1857
|
+
protected updateAuthState(authorization_state: string): Promise<void>;
|
|
1858
|
+
private authenticate;
|
|
1859
|
+
disconnect(): Promise<void>;
|
|
1860
|
+
private createInboundCall;
|
|
1861
|
+
createOutboundCall(destination: string | Address, options?: CallOptions): Promise<Call>;
|
|
1862
|
+
private createCall;
|
|
1863
|
+
destroy(): void;
|
|
1864
|
+
}
|
|
1865
|
+
declare class ClientSessionWrapper {
|
|
1866
|
+
private clientSessionManager;
|
|
1867
|
+
constructor(clientSessionManager: ClientSessionManager);
|
|
1868
|
+
get authenticated$(): Observable<boolean>;
|
|
1869
|
+
get authenticated(): boolean;
|
|
1870
|
+
get signalingEvent$(): Observable<{
|
|
1871
|
+
event_type: "webrtc.message";
|
|
1872
|
+
event_channel: string;
|
|
1873
|
+
timestamp: number;
|
|
1874
|
+
project_id: string;
|
|
1875
|
+
node_id: string;
|
|
1876
|
+
params: WebrtcMessagePayload;
|
|
1877
|
+
} | {
|
|
1878
|
+
event_type: "signalwire.authorization.state";
|
|
1879
|
+
params: SignalwireAuthorizationStatePayload;
|
|
1880
|
+
} | {
|
|
1881
|
+
event_type: "call.joined";
|
|
1882
|
+
event_channel: string;
|
|
1883
|
+
timestamp: number;
|
|
1884
|
+
params: CallJoinedPayload;
|
|
1885
|
+
} | {
|
|
1886
|
+
event_type: "call.left";
|
|
1887
|
+
event_channel: string;
|
|
1888
|
+
timestamp: number;
|
|
1889
|
+
params: CallLeftPayload;
|
|
1890
|
+
} | {
|
|
1891
|
+
event_type: "call.updated";
|
|
1892
|
+
event_channel: string;
|
|
1893
|
+
timestamp: number;
|
|
1894
|
+
params: CallUpdatedPayload;
|
|
1895
|
+
} | {
|
|
1896
|
+
event_type: "call.state";
|
|
1897
|
+
event_channel: string;
|
|
1898
|
+
timestamp: number;
|
|
1899
|
+
params: CallStatePayload;
|
|
1900
|
+
} | {
|
|
1901
|
+
event_type: "call.play";
|
|
1902
|
+
event_channel: string;
|
|
1903
|
+
timestamp: number;
|
|
1904
|
+
params: CallPlayPayload;
|
|
1905
|
+
} | {
|
|
1906
|
+
event_type: "call.connect";
|
|
1907
|
+
event_channel: string;
|
|
1908
|
+
timestamp: number;
|
|
1909
|
+
params: CallConnectPayload;
|
|
1910
|
+
} | {
|
|
1911
|
+
event_type: "member.updated";
|
|
1912
|
+
event_channel: EventChannel;
|
|
1913
|
+
timestamp: number;
|
|
1914
|
+
params: MemberUpdatedPayload;
|
|
1915
|
+
} | {
|
|
1916
|
+
event_type: "member.joined";
|
|
1917
|
+
event_channel: EventChannel;
|
|
1918
|
+
timestamp: number;
|
|
1919
|
+
params: MemberJoinedPayload;
|
|
1920
|
+
} | {
|
|
1921
|
+
event_type: "member.left";
|
|
1922
|
+
event_channel: EventChannel;
|
|
1923
|
+
timestamp: number;
|
|
1924
|
+
params: MemberLeftPayload;
|
|
1925
|
+
} | {
|
|
1926
|
+
event_type: "member.talking";
|
|
1927
|
+
event_channel: EventChannel;
|
|
1928
|
+
timestamp: number;
|
|
1929
|
+
params: MemberTalkingPayload;
|
|
1930
|
+
} | {
|
|
1931
|
+
event_type: "layout.changed";
|
|
1932
|
+
event_channel: EventChannel;
|
|
1933
|
+
timestamp: number;
|
|
1934
|
+
params: LayoutChangedPayload;
|
|
1935
|
+
} | {
|
|
1936
|
+
event_type: "conversation.message";
|
|
1937
|
+
event_channel: string;
|
|
1938
|
+
timestamp: string;
|
|
1939
|
+
is_author: boolean;
|
|
1940
|
+
params: ConversationMessagePayload;
|
|
1941
|
+
} | {
|
|
1942
|
+
event_type: "conversation.message.updated";
|
|
1943
|
+
event_channel: string;
|
|
1944
|
+
timestamp: string;
|
|
1945
|
+
is_author: boolean;
|
|
1946
|
+
params: ConversationMessageUpdatedPayload;
|
|
1947
|
+
}>;
|
|
1948
|
+
execute<T extends JSONRPCResponse = JSONRPCResponse>(request: JSONRPCRequest, options?: PendingRPCOptions): Promise<T>;
|
|
1949
|
+
get incomingCalls$(): Observable<Call[]>;
|
|
1950
|
+
get incomingCalls(): Call[];
|
|
1951
|
+
get calls$(): Observable<Call[]>;
|
|
1952
|
+
get calls(): Call[];
|
|
1953
|
+
}
|
|
1954
|
+
//#endregion
|
|
1955
|
+
//#region src/clients/SignalWire.d.ts
|
|
1956
|
+
/** Options for constructing a {@link SignalWire}. */
|
|
1957
|
+
interface SignalWireOptions {
|
|
1958
|
+
/** Skip automatic WebSocket connection on construction. */
|
|
1959
|
+
skipConnection?: boolean;
|
|
1960
|
+
/** Skip automatic subscriber registration on construction. */
|
|
1961
|
+
skipRegister?: boolean;
|
|
1962
|
+
/** Skip reconnecting to previously attached calls. */
|
|
1963
|
+
skipReconnect?: boolean;
|
|
1964
|
+
/** Skip monitoring media device changes. */
|
|
1965
|
+
skipDeviceMonitoring?: boolean;
|
|
1966
|
+
/** Whether to reconnect to previously attached calls. */
|
|
1967
|
+
reconnectAttachedCalls?: boolean;
|
|
1968
|
+
/** Whether to save preferences. */
|
|
1969
|
+
savePreferences?: boolean;
|
|
1970
|
+
/** Custom storage implementation for persistence. */
|
|
1971
|
+
storageImplementation?: Storage;
|
|
1972
|
+
/** Custom WebSocket constructor */
|
|
1973
|
+
webSocketConstructor?: WebSocketAdapter | NodeSocketAdapter;
|
|
1974
|
+
}
|
|
1975
|
+
/** Options for {@link SignalWire.dial}. Extends {@link MediaOptions} with dial-specific settings. */
|
|
1976
|
+
interface DialOptions extends MediaOptions {}
|
|
1977
|
+
/**
|
|
1978
|
+
* Main entry point for the SignalWire Browser SDK.
|
|
1979
|
+
*
|
|
1980
|
+
* Manages authentication, WebSocket transport, call creation, and media devices.
|
|
1981
|
+
*
|
|
1982
|
+
* @example
|
|
1983
|
+
* ```ts
|
|
1984
|
+
* const client = new SignalWire(credentialProvider);
|
|
1985
|
+
* client.isConnected$.subscribe(connected => console.log('Connected:', connected));
|
|
1986
|
+
* const call = await client.dial('/public/my-room');
|
|
1987
|
+
* ```
|
|
1988
|
+
*/
|
|
1989
|
+
declare class SignalWire extends Destroyable implements DeviceController {
|
|
1990
|
+
/** Global SDK preferences (timeouts, ICE config, media defaults). */
|
|
1991
|
+
preferences: ClientPreferences;
|
|
1992
|
+
private _subscriber$;
|
|
1993
|
+
private _directory$;
|
|
1994
|
+
private _transport;
|
|
1995
|
+
private _clientSession;
|
|
1996
|
+
private _publicSession;
|
|
1997
|
+
private _deviceController;
|
|
1998
|
+
private _attachManager?;
|
|
1999
|
+
private _isConnected$;
|
|
2000
|
+
private _isRegistered$;
|
|
2001
|
+
private _errors$;
|
|
2002
|
+
private _options;
|
|
2003
|
+
private _refreshTimerId?;
|
|
2004
|
+
private _deps;
|
|
2005
|
+
constructor(credentialProvider: CredentialProvider, options?: SignalWireOptions);
|
|
2006
|
+
private validateCredentials;
|
|
2007
|
+
private init;
|
|
2008
|
+
private handleAttachments;
|
|
2009
|
+
/**
|
|
2010
|
+
* Establishes the WebSocket connection and authenticates the session.
|
|
2011
|
+
*
|
|
2012
|
+
* ## Reconnection behavior
|
|
2013
|
+
*
|
|
2014
|
+
* After a successful connection the underlying {@link WebSocketController}
|
|
2015
|
+
* automatically attempts to reconnect whenever the socket closes
|
|
2016
|
+
* unexpectedly (e.g. network change, server restart). Reconnection uses an
|
|
2017
|
+
* **exponential back-off** strategy:
|
|
2018
|
+
*
|
|
2019
|
+
* - First retry after `reconnectDelayMin` (default **1 s**).
|
|
2020
|
+
* - Each subsequent retry doubles the delay up to `reconnectDelayMax`
|
|
2021
|
+
* (default **30 s**).
|
|
2022
|
+
* - The delay resets to `reconnectDelayMin` once a connection succeeds.
|
|
2023
|
+
* - A per-attempt `connectionTimeout` (default **10 s**) aborts the
|
|
2024
|
+
* attempt and schedules the next retry if the server does not respond.
|
|
2025
|
+
*
|
|
2026
|
+
* Calling {@link disconnect} stops the reconnection loop entirely.
|
|
2027
|
+
*
|
|
2028
|
+
* ## Message handling during temporary disconnections
|
|
2029
|
+
*
|
|
2030
|
+
* While the socket is not in the `connected` state, **outgoing messages
|
|
2031
|
+
* are queued** in an internal buffer. Once the connection is
|
|
2032
|
+
* re-established the queue is flushed in order so no outgoing RPC call is
|
|
2033
|
+
* lost.
|
|
2034
|
+
*
|
|
2035
|
+
* **Incoming** server-to-client messages that arrive while the socket is
|
|
2036
|
+
* down are *not* buffered by the SDK — they are expected to be
|
|
2037
|
+
* re-delivered by the server after the session is re-authenticated.
|
|
2038
|
+
* Active RPC calls that were awaiting a response will time out
|
|
2039
|
+
* (default **5 s**) and reject with an `RPCTimeoutError`; callers should
|
|
2040
|
+
* handle this and retry if appropriate.
|
|
2041
|
+
*
|
|
2042
|
+
* The connection status can be observed via the `status$` observable on
|
|
2043
|
+
* the transport layer, which emits `'connecting'`, `'connected'`,
|
|
2044
|
+
* `'reconnecting'`, `'disconnecting'`, or `'disconnected'`.
|
|
2045
|
+
*/
|
|
2046
|
+
connect(): Promise<void>;
|
|
2047
|
+
/**
|
|
2048
|
+
* Observable that emits the {@link Subscriber} profile once fetched,
|
|
2049
|
+
* or `undefined` before authentication completes.
|
|
2050
|
+
*
|
|
2051
|
+
* @example
|
|
2052
|
+
* ```ts
|
|
2053
|
+
* client.subscriber$.subscribe(sub => {
|
|
2054
|
+
* if (sub) console.log('Logged in as', sub.email);
|
|
2055
|
+
* });
|
|
2056
|
+
* ```
|
|
2057
|
+
*/
|
|
2058
|
+
get subscriber$(): Observable<Subscriber | undefined>;
|
|
2059
|
+
/** Current subscriber snapshot, or `undefined` if not yet authenticated. */
|
|
2060
|
+
get subscriber(): Subscriber | undefined;
|
|
2061
|
+
/**
|
|
2062
|
+
* Observable that emits the {@link Directory} instance once the client is connected,
|
|
2063
|
+
* or `undefined` while disconnected. Subscribe to this to safely wait for the directory
|
|
2064
|
+
* to become available without risking an error.
|
|
2065
|
+
*
|
|
2066
|
+
* @example
|
|
2067
|
+
* ```ts
|
|
2068
|
+
* client.directory$.subscribe(dir => {
|
|
2069
|
+
* if (dir) dir.addresses$.subscribe(console.log);
|
|
2070
|
+
* });
|
|
2071
|
+
* ```
|
|
2072
|
+
*/
|
|
2073
|
+
get directory$(): Observable<Directory | undefined>;
|
|
2074
|
+
/**
|
|
2075
|
+
* Current directory snapshot, or `undefined` if the client is not yet connected.
|
|
2076
|
+
* Prefer {@link directory$} when you need to react to the directory becoming available.
|
|
2077
|
+
*/
|
|
2078
|
+
get directory(): Directory | undefined;
|
|
2079
|
+
/** Observable that emits when the subscriber registration state changes. */
|
|
2080
|
+
get isRegistered$(): Observable<boolean>;
|
|
2081
|
+
/** Whether the subscriber is currently registered. */
|
|
2082
|
+
get isRegistered(): boolean;
|
|
2083
|
+
/** Whether the client is currently connected. */
|
|
2084
|
+
get isConnected(): boolean;
|
|
2085
|
+
/** Observable that emits when the connection state changes. */
|
|
2086
|
+
get isConnected$(): Observable<boolean>;
|
|
2087
|
+
/** Observable that emits `true` when the client is both connected and authenticated. */
|
|
2088
|
+
get ready$(): Observable<boolean>;
|
|
2089
|
+
/** Observable stream of errors from transport, authentication, and devices. */
|
|
2090
|
+
get errors$(): Observable<Error>;
|
|
2091
|
+
/** Disconnects the WebSocket and tears down the session. */
|
|
2092
|
+
disconnect(): Promise<void>;
|
|
2093
|
+
private waitAuthentication;
|
|
2094
|
+
/** Registers the subscriber as online to receive inbound calls and events. */
|
|
2095
|
+
register(): Promise<void>;
|
|
2096
|
+
/** Unregisters the subscriber, going offline for inbound calls. */
|
|
2097
|
+
unregister(): Promise<void>;
|
|
2098
|
+
/**
|
|
2099
|
+
* Places an outbound call to the given destination.
|
|
2100
|
+
* @param destination - Address URI string or {@link Address} instance to call.
|
|
2101
|
+
* @param options - Media and dial options (audio/video, constraints).
|
|
2102
|
+
* @returns The created {@link Call} instance.
|
|
2103
|
+
*/
|
|
2104
|
+
dial(destination: string | Address, options?: DialOptions): Promise<Call>;
|
|
2105
|
+
/** The underlying client session for advanced RPC operations. */
|
|
2106
|
+
get session(): ClientSessionWrapper;
|
|
2107
|
+
/** Observable list of available audio input (microphone) devices. */
|
|
2108
|
+
get audioInputDevices$(): Observable<MediaDeviceInfo[]>;
|
|
2109
|
+
/** Current snapshot of available audio input devices. */
|
|
2110
|
+
get audioInputDevices(): MediaDeviceInfo[];
|
|
2111
|
+
/** Observable list of available audio output (speaker) devices. */
|
|
2112
|
+
get audioOutputDevices$(): Observable<MediaDeviceInfo[]>;
|
|
2113
|
+
/** Current snapshot of available audio output devices. */
|
|
2114
|
+
get audioOutputDevices(): MediaDeviceInfo[];
|
|
2115
|
+
/** Observable list of available video input (camera) devices. */
|
|
2116
|
+
get videoInputDevices$(): Observable<MediaDeviceInfo[]>;
|
|
2117
|
+
/** Current snapshot of available video input devices. */
|
|
2118
|
+
get videoInputDevices(): MediaDeviceInfo[];
|
|
2119
|
+
/** Observable of the currently selected audio input device. */
|
|
2120
|
+
get selectedAudioInputDevice$(): Observable<MediaDeviceInfo | null>;
|
|
2121
|
+
/** Observable of the currently selected audio output device. */
|
|
2122
|
+
get selectedAudioOutputDevice$(): Observable<MediaDeviceInfo | null>;
|
|
2123
|
+
/** Observable of the currently selected video input device. */
|
|
2124
|
+
get selectedVideoInputDevice$(): Observable<MediaDeviceInfo | null>;
|
|
2125
|
+
/** Currently selected audio input device, or `null` if none. */
|
|
2126
|
+
get selectedAudioInputDevice(): MediaDeviceInfo | null;
|
|
2127
|
+
/** Currently selected audio output device, or `null` if none. */
|
|
2128
|
+
get selectedAudioOutputDevice(): MediaDeviceInfo | null;
|
|
2129
|
+
/** Currently selected video input device, or `null` if none. */
|
|
2130
|
+
get selectedVideoInputDevice(): MediaDeviceInfo | null;
|
|
2131
|
+
/** Media track constraints for the selected audio input device. */
|
|
2132
|
+
get selectedAudioInputDeviceConstraints(): MediaTrackConstraints;
|
|
2133
|
+
/** Media track constraints for the selected video input device. */
|
|
2134
|
+
get selectedVideoInputDeviceConstraints(): MediaTrackConstraints;
|
|
2135
|
+
/** Converts a `MediaDeviceInfo` to track constraints suitable for `getUserMedia`. */
|
|
2136
|
+
deviceInfoToConstraints(deviceInfo: MediaDeviceInfo | null): MediaTrackConstraints;
|
|
2137
|
+
/** Sets the preferred audio input device. */
|
|
2138
|
+
selectAudioInputDevice(device: MediaDeviceInfo | null): void;
|
|
2139
|
+
/** Sets the preferred video input device. */
|
|
2140
|
+
selectVideoInputDevice(device: MediaDeviceInfo | null): void;
|
|
2141
|
+
/** Sets the preferred audio output device. */
|
|
2142
|
+
selectAudioOutputDevice(device: MediaDeviceInfo | null): void;
|
|
2143
|
+
/** Starts monitoring for media device changes (connect/disconnect). */
|
|
2144
|
+
enableDeviceMonitoring(): void;
|
|
2145
|
+
/** Stops monitoring for media device changes. */
|
|
2146
|
+
disableDeviceMonitoring(): void;
|
|
2147
|
+
getDeviceCapabilities(deviceInfo: MediaDeviceInfo): Promise<MediaTrackCapabilities | null>;
|
|
2148
|
+
isValidDevice(deviceInfo: MediaDeviceInfo | null): Promise<boolean>;
|
|
2149
|
+
destroy(): void;
|
|
2150
|
+
}
|
|
2151
|
+
//#endregion
|
|
2152
|
+
//#region src/utils/embeddableCall.d.ts
|
|
2153
|
+
/** Options for {@link embeddableCall}. */
|
|
2154
|
+
interface EmbeddableCallOptions {
|
|
2155
|
+
/** Destination URI to call. */
|
|
2156
|
+
to: string;
|
|
2157
|
+
/** Embed token for authentication. */
|
|
2158
|
+
embedToken: string;
|
|
2159
|
+
/** SignalWire host URL. */
|
|
2160
|
+
host: string;
|
|
2161
|
+
}
|
|
2162
|
+
/**
|
|
2163
|
+
* Creates a call using an embed token for simple, embeddable integrations.
|
|
2164
|
+
*
|
|
2165
|
+
* Handles client creation, authentication, and dialing in a single call.
|
|
2166
|
+
*
|
|
2167
|
+
* @param options - Embed token, host, and destination.
|
|
2168
|
+
* @returns The created {@link Call} instance.
|
|
2169
|
+
*/
|
|
2170
|
+
declare function embeddableCall(options: EmbeddableCallOptions): Promise<Call>;
|
|
2171
|
+
//#endregion
|
|
2172
|
+
//#region src/dependencies/StaticCredentialProvider.d.ts
|
|
2173
|
+
/**
|
|
2174
|
+
* Credential provider that returns a fixed set of credentials.
|
|
2175
|
+
*
|
|
2176
|
+
* Use when the token is already available (e.g. from a backend endpoint).
|
|
2177
|
+
*
|
|
2178
|
+
* @example
|
|
2179
|
+
* ```ts
|
|
2180
|
+
* const provider = new StaticCredentialProvider({ token: 'my-sat-token' });
|
|
2181
|
+
* const client = new SignalWire(provider);
|
|
2182
|
+
* ```
|
|
2183
|
+
*/
|
|
2184
|
+
declare class StaticCredentialProvider implements CredentialProvider {
|
|
2185
|
+
private credentials;
|
|
2186
|
+
constructor(credentials: SDKCredential);
|
|
2187
|
+
/** Returns the static credentials. */
|
|
2188
|
+
authenticate(): Promise<SDKCredential>;
|
|
2189
|
+
}
|
|
2190
|
+
//#endregion
|
|
2191
|
+
//#region src/core/errors.d.ts
|
|
2192
|
+
declare class CallCreateError extends Error {
|
|
2193
|
+
message: string;
|
|
2194
|
+
error: unknown;
|
|
2195
|
+
constructor(message: string, error?: unknown, options?: ErrorOptions);
|
|
2196
|
+
}
|
|
2197
|
+
declare class VertoPongError extends Error {
|
|
2198
|
+
originalError: unknown;
|
|
2199
|
+
constructor(originalError: unknown);
|
|
2200
|
+
}
|
|
2201
|
+
declare class MessageParseError extends Error {
|
|
2202
|
+
originalError: unknown;
|
|
2203
|
+
constructor(originalError: unknown);
|
|
2204
|
+
}
|
|
2205
|
+
declare class CollectionFetchError extends Error {
|
|
2206
|
+
operation: string;
|
|
2207
|
+
originalError: unknown;
|
|
2208
|
+
constructor(operation: string, originalError: unknown);
|
|
2209
|
+
}
|
|
2210
|
+
declare class MediaTrackError extends Error {
|
|
2211
|
+
operation: string;
|
|
2212
|
+
kind: string;
|
|
2213
|
+
originalError: unknown;
|
|
2214
|
+
constructor(operation: string, kind: string, originalError: unknown);
|
|
2215
|
+
}
|
|
2216
|
+
//#endregion
|
|
2217
|
+
//#region src/controllers/RTCPeerConnectionController.d.ts
|
|
2218
|
+
interface RTCPeerConnectionControllerOptions extends MediaOptions {
|
|
2219
|
+
callId?: string;
|
|
2220
|
+
WebRTCPeerConnectionConstructor?: typeof RTCPeerConnection;
|
|
2221
|
+
getUserMedia?: (constraints: MediaStreamConstraints) => Promise<MediaStream>;
|
|
2222
|
+
getDisplayMedia?: (options: DisplayMediaStreamOptions) => Promise<MediaStream>;
|
|
2223
|
+
rtcConfiguration?: RTCConfiguration;
|
|
2224
|
+
simulcast?: boolean;
|
|
2225
|
+
sfu?: boolean;
|
|
2226
|
+
msStreamsNumber?: number;
|
|
2227
|
+
propose: RTCPeerConnectionPropose;
|
|
2228
|
+
iceServers?: RTCIceServer[];
|
|
2229
|
+
disableUdpIceServers?: boolean;
|
|
2230
|
+
relayOnly?: boolean;
|
|
2231
|
+
iceCandidateTimeout?: number;
|
|
2232
|
+
iceGatheringTimeout?: number;
|
|
2233
|
+
}
|
|
2234
|
+
type RTCPeerConnectionControllerOptionsPartial = Partial<RTCPeerConnectionControllerOptions>;
|
|
2235
|
+
interface UpdateSDPStatusParams {
|
|
2236
|
+
status: 'received' | 'sent' | 'failed';
|
|
2237
|
+
sdp?: string;
|
|
2238
|
+
}
|
|
2239
|
+
declare class RTCPeerConnectionController extends Destroyable {
|
|
2240
|
+
protected options: RTCPeerConnectionControllerOptionsPartial;
|
|
2241
|
+
readonly id: string;
|
|
2242
|
+
firstSDPExchangeCompleted: boolean;
|
|
2243
|
+
sdpInit?: RTCSessionDescriptionInit;
|
|
2244
|
+
private negotiationNeeded$;
|
|
2245
|
+
private deviceController;
|
|
2246
|
+
private localStreamController;
|
|
2247
|
+
private transceiverController?;
|
|
2248
|
+
readonly localDescription$: Observable<RTCSessionDescription | null>;
|
|
2249
|
+
peerConnection?: RTCPeerConnection;
|
|
2250
|
+
private initPromise?;
|
|
2251
|
+
private connectionTimeout;
|
|
2252
|
+
private connectionTimer?;
|
|
2253
|
+
private oniceconnectionstatechangeHandler;
|
|
2254
|
+
private onconnectionstatechangeHandler;
|
|
2255
|
+
private onsignalingstatechangeHandler;
|
|
2256
|
+
private onicegatheringstatechangeHandler;
|
|
2257
|
+
private onnegotiationneededHandler;
|
|
2258
|
+
private updateSelectedInputDevice;
|
|
2259
|
+
private _isNegotiating$;
|
|
2260
|
+
private _iceGatheringController?;
|
|
2261
|
+
private _memberId;
|
|
2262
|
+
private _type;
|
|
2263
|
+
private _iceConnectionState$;
|
|
2264
|
+
private _connectionState$;
|
|
2265
|
+
private _signalingState$;
|
|
2266
|
+
private _iceGatheringState$;
|
|
2267
|
+
private _errors$;
|
|
2268
|
+
private _iceCandidates$;
|
|
2269
|
+
private _initialized$;
|
|
2270
|
+
private _remoteDescription$;
|
|
2271
|
+
private _remoteStream$;
|
|
2272
|
+
constructor(options?: RTCPeerConnectionControllerOptionsPartial, remoteSessionDescription?: string, deviceController?: DeviceController);
|
|
2273
|
+
private get iceGatheringController();
|
|
2274
|
+
private get shouldEmitLocalDescription();
|
|
2275
|
+
private removeConnectionTimer;
|
|
2276
|
+
setMemberId(memberId: string | null): void;
|
|
2277
|
+
get memberId(): string | null;
|
|
2278
|
+
stopTrackSender(kind: 'audio' | 'video' | 'both', options?: {
|
|
2279
|
+
updateTransceiverDirection: boolean;
|
|
2280
|
+
}): void;
|
|
2281
|
+
get isNegotiating$(): Observable<boolean>;
|
|
2282
|
+
get isNegotiating(): boolean;
|
|
2283
|
+
updateMediaDevicesOptions(options: MediaOptions): void;
|
|
2284
|
+
get iceGatheringState$(): Observable<RTCIceGatheringState>;
|
|
2285
|
+
get mediaTrackEnded$(): Observable<MediaStreamTrack>;
|
|
2286
|
+
get errors$(): Observable<Error>;
|
|
2287
|
+
get iceCandidates$(): Observable<RTCIceCandidate[]>;
|
|
2288
|
+
get initialized$(): Observable<boolean>;
|
|
2289
|
+
get remoteDescription$(): Observable<RTCSessionDescription | null>;
|
|
2290
|
+
get localStream$(): Observable<MediaStream | null>;
|
|
2291
|
+
get remoteStream$(): Observable<MediaStream | null>;
|
|
2292
|
+
get localAudioTracks$(): Observable<MediaStreamTrack[]>;
|
|
2293
|
+
get localVideoTracks$(): Observable<MediaStreamTrack[]>;
|
|
2294
|
+
get iceConnectionState$(): Observable<RTCIceConnectionState>;
|
|
2295
|
+
get connectionState$(): Observable<RTCPeerConnectionState>;
|
|
2296
|
+
get signalingState$(): Observable<RTCSignalingState>;
|
|
2297
|
+
get type(): RTCPeerConnectionType;
|
|
2298
|
+
get propose(): RTCPeerConnectionPropose;
|
|
2299
|
+
get isAdditionalDevice(): boolean;
|
|
2300
|
+
get isMainDevice(): boolean;
|
|
2301
|
+
get isScreenShare(): boolean;
|
|
2302
|
+
protected get iceServers(): RTCIceServer[];
|
|
2303
|
+
private get rtcConfiguration();
|
|
2304
|
+
get receiveVideo(): boolean;
|
|
2305
|
+
get receiveAudio(): boolean;
|
|
2306
|
+
get localStream(): MediaStream | null;
|
|
2307
|
+
get remoteStream(): MediaStream | null;
|
|
2308
|
+
private get inputAudioDeviceConstraints();
|
|
2309
|
+
private get inputVideoDeviceConstraints();
|
|
2310
|
+
private get WebRTCPeerConnectionConstructor();
|
|
2311
|
+
private get offerOptions();
|
|
2312
|
+
private get answerOptions();
|
|
2313
|
+
/**
|
|
2314
|
+
* Initialize the RTCPeerConnection and setup event listeners.
|
|
2315
|
+
* Called automatically when localDescription$ is subscribed to (deferred pattern).
|
|
2316
|
+
* Uses Promise memoization to ensure initialization only happens once,
|
|
2317
|
+
* even if called concurrently.
|
|
2318
|
+
*/
|
|
2319
|
+
private init;
|
|
2320
|
+
/**
|
|
2321
|
+
* Internal initialization implementation.
|
|
2322
|
+
* Should only be called via init() to ensure single execution.
|
|
2323
|
+
*/
|
|
2324
|
+
private doInit;
|
|
2325
|
+
private setupPeerConnection;
|
|
2326
|
+
private startNegotiation;
|
|
2327
|
+
/**
|
|
2328
|
+
* Create an SDP offer and set it as local description.
|
|
2329
|
+
*/
|
|
2330
|
+
private createOffer;
|
|
2331
|
+
updateAnswerStatus({
|
|
2332
|
+
status,
|
|
2333
|
+
sdp
|
|
2334
|
+
}: UpdateSDPStatusParams): Promise<void>;
|
|
2335
|
+
updateOfferStatus({
|
|
2336
|
+
status,
|
|
2337
|
+
sdp
|
|
2338
|
+
}: UpdateSDPStatusParams): Promise<void>;
|
|
2339
|
+
private handleOfferReceived;
|
|
2340
|
+
private readyToConnect;
|
|
2341
|
+
private setRemoteDescriptionBefore;
|
|
2342
|
+
protected setLocalDescription(params: RTCSessionDescriptionInit): Promise<void>;
|
|
2343
|
+
setLocalDescriptionBefore(sdp?: string): Promise<string>;
|
|
2344
|
+
/**
|
|
2345
|
+
* Create an SDP answer and set it as local description.
|
|
2346
|
+
*/
|
|
2347
|
+
private createAnswer;
|
|
2348
|
+
/**
|
|
2349
|
+
* Setup event listeners on RTCPeerConnection for state changes.
|
|
2350
|
+
*/
|
|
2351
|
+
private setupEventListeners;
|
|
2352
|
+
private negotiationEnded;
|
|
2353
|
+
restarIce(): void;
|
|
2354
|
+
/**
|
|
2355
|
+
* Setup track handling for remote tracks.
|
|
2356
|
+
*/
|
|
2357
|
+
private setupTrackHandling;
|
|
2358
|
+
private setupLocalTracks;
|
|
2359
|
+
private getUserMedia;
|
|
2360
|
+
private getDisplayMedia;
|
|
2361
|
+
private setupRemoteTracks;
|
|
2362
|
+
restoreTrackSender(kind: 'audio' | 'video' | 'both'): Promise<void>;
|
|
2363
|
+
/**
|
|
2364
|
+
* Add a local media track to the peer connection.
|
|
2365
|
+
* @param track - The MediaStreamTrack to add
|
|
2366
|
+
*/
|
|
2367
|
+
addLocalTrack(track: MediaStreamTrack): void;
|
|
2368
|
+
/**
|
|
2369
|
+
* Remove a local media track from the peer connection.
|
|
2370
|
+
* @param trackId - The ID of the track to remove
|
|
2371
|
+
*/
|
|
2372
|
+
removeLocalTrack(trackId: string): void;
|
|
2373
|
+
/**
|
|
2374
|
+
* Replace all existing media tracks with a new media track.
|
|
2375
|
+
* Convenience method for single-track scenarios.
|
|
2376
|
+
* @param track - The MediaStreamTrack to set
|
|
2377
|
+
*/
|
|
2378
|
+
setLocalTrack(track: MediaStreamTrack): void;
|
|
2379
|
+
updateSendersConstraints(kind: 'audio' | 'video', constraints?: MediaTrackConstraints): Promise<void>;
|
|
2380
|
+
/**
|
|
2381
|
+
* Clean up resources and close the peer connection.
|
|
2382
|
+
* Completes all observables to prevent memory leaks.
|
|
2383
|
+
*/
|
|
2384
|
+
destroy(): void;
|
|
2385
|
+
private removeAllListeners;
|
|
2386
|
+
private stopRemoteTracks;
|
|
2387
|
+
get mediaDirections(): {
|
|
2388
|
+
audio: RTCRtpTransceiverDirection;
|
|
2389
|
+
video: RTCRtpTransceiverDirection;
|
|
2390
|
+
};
|
|
2391
|
+
protected _setRemoteDescription(params: RTCSessionDescriptionInit): Promise<void>;
|
|
2392
|
+
}
|
|
2393
|
+
//#endregion
|
|
2394
|
+
//#region src/interfaces/WebRTCVerto.d.ts
|
|
2395
|
+
/**
|
|
2396
|
+
* Extended interface for WebRTC Verto Manager
|
|
2397
|
+
* Includes WebRTC-specific state and peer connection management
|
|
2398
|
+
*/
|
|
2399
|
+
interface WebRTCVerto extends VertoManager {
|
|
2400
|
+
readonly selfId$: Observable<string | null>;
|
|
2401
|
+
readonly selfId: string | null;
|
|
2402
|
+
readonly nodeId$: Observable<string | null>;
|
|
2403
|
+
readonly nodeId: string | null;
|
|
2404
|
+
readonly localStream$: Observable<MediaStream>;
|
|
2405
|
+
readonly localStream: MediaStream | null;
|
|
2406
|
+
readonly remoteStream$: Observable<MediaStream>;
|
|
2407
|
+
readonly remoteStream: MediaStream | null;
|
|
2408
|
+
readonly mediaDirections$: Observable<MediaDirections>;
|
|
2409
|
+
readonly mediaDirections: MediaDirections;
|
|
2410
|
+
readonly signalingStatus$: Observable<SignalingStatus>;
|
|
2411
|
+
readonly mainPeerConnection: RTCPeerConnectionController;
|
|
2412
|
+
bye(cause?: string): Promise<void>;
|
|
2413
|
+
sendDigits(dtmf: string): Promise<void>;
|
|
2414
|
+
hold(): Promise<void>;
|
|
2415
|
+
unhold(): Promise<void>;
|
|
2416
|
+
destroy(): void;
|
|
2417
|
+
transfer(options: TransferOptions): Promise<void>;
|
|
2418
|
+
}
|
|
2419
|
+
//#endregion
|
|
2420
|
+
//#region src/managers/CallEventsManager.d.ts
|
|
2421
|
+
interface WebRTCCallEventManagerOptions {}
|
|
2422
|
+
declare class CallEventsManager extends Destroyable {
|
|
2423
|
+
protected webRtcCallSession: CallManager;
|
|
2424
|
+
protected options: WebRTCCallEventManagerOptions;
|
|
2425
|
+
private selfId?;
|
|
2426
|
+
private originCallId?;
|
|
2427
|
+
private callIds;
|
|
2428
|
+
private roomSessionIds;
|
|
2429
|
+
private _status$;
|
|
2430
|
+
private _participants$;
|
|
2431
|
+
private _self$;
|
|
2432
|
+
private _sessionState$;
|
|
2433
|
+
constructor(webRtcCallSession: CallManager, options?: WebRTCCallEventManagerOptions);
|
|
2434
|
+
get participants$(): Observable<CallParticipant[]>;
|
|
2435
|
+
get self$(): Observable<CallSelfParticipant>;
|
|
2436
|
+
get status$(): Observable<CallStatus>;
|
|
2437
|
+
get status(): CallStatus;
|
|
2438
|
+
isRoomSessionIdValid(roomSessionId: string): boolean;
|
|
2439
|
+
addCallId(callId: string): void;
|
|
2440
|
+
isCallIdValid(callId: string): boolean;
|
|
2441
|
+
get recording$(): Observable<boolean>;
|
|
2442
|
+
get recordings$(): Observable<Record<string, unknown>[]>;
|
|
2443
|
+
get streaming$(): Observable<boolean>;
|
|
2444
|
+
get streams$(): Observable<Record<string, unknown>[]>;
|
|
2445
|
+
get playbacks$(): Observable<Record<string, unknown>[]>;
|
|
2446
|
+
get raiseHandPriority$(): Observable<boolean>;
|
|
2447
|
+
get locked$(): Observable<boolean>;
|
|
2448
|
+
get meta$(): Observable<Record<string, unknown>>;
|
|
2449
|
+
get capabilities$(): Observable<string[]>;
|
|
2450
|
+
get layout$(): Observable<string>;
|
|
2451
|
+
get layouts$(): Observable<string[]>;
|
|
2452
|
+
get layoutLayers$(): Observable<LayoutLayer[]>;
|
|
2453
|
+
get self(): CallSelfParticipant | null;
|
|
2454
|
+
get layoutLayers(): LayoutLayer[];
|
|
2455
|
+
get recording(): boolean;
|
|
2456
|
+
get streaming(): boolean;
|
|
2457
|
+
get raiseHandPriority(): boolean;
|
|
2458
|
+
get locked(): boolean;
|
|
2459
|
+
get meta(): Record<string, unknown>;
|
|
2460
|
+
get layout(): string | undefined;
|
|
2461
|
+
get layouts(): string[];
|
|
2462
|
+
get capabilities(): string[];
|
|
2463
|
+
isSessionEvent(id: string): boolean;
|
|
2464
|
+
protected initSubscriptions(): void;
|
|
2465
|
+
private updateParticipantPositions;
|
|
2466
|
+
updateLayouts(): void;
|
|
2467
|
+
private updateParticipants;
|
|
2468
|
+
private upsertParticipant;
|
|
2469
|
+
private get callJoinedEvent$();
|
|
2470
|
+
private get layoutChangedEvent$();
|
|
2471
|
+
private get memberUpdates$();
|
|
2472
|
+
destroy(): void;
|
|
2473
|
+
}
|
|
2474
|
+
//#endregion
|
|
2475
|
+
//#region src/core/entities/Call.d.ts
|
|
2476
|
+
/**
|
|
2477
|
+
* Manager instances returned by initialization callback
|
|
2478
|
+
*/
|
|
2479
|
+
interface CallManagers {
|
|
2480
|
+
vertoManager: WebRTCVerto;
|
|
2481
|
+
callEventsManager: CallEventsManager;
|
|
2482
|
+
}
|
|
2483
|
+
/**
|
|
2484
|
+
* Initialization callback that creates managers for a Call instance
|
|
2485
|
+
* @param call - The WebRTCCall instance being initialized
|
|
2486
|
+
* @returns Manager instances for the call
|
|
2487
|
+
*/
|
|
2488
|
+
type ManagerInitializer = (call: WebRTCCall) => CallManagers;
|
|
2489
|
+
/**
|
|
2490
|
+
* Required initialization configuration for Call constructor.
|
|
2491
|
+
* Calls must be created via {@link CallFactory} which provides these dependencies.
|
|
2492
|
+
*/
|
|
2493
|
+
interface CallInitialization {
|
|
2494
|
+
/**
|
|
2495
|
+
* Callback function that creates and wires manager instances
|
|
2496
|
+
*/
|
|
2497
|
+
initializeManagers: ManagerInitializer;
|
|
2498
|
+
/**
|
|
2499
|
+
* Device controller for media device access
|
|
2500
|
+
*/
|
|
2501
|
+
deviceController: DeviceController;
|
|
2502
|
+
}
|
|
2503
|
+
/**
|
|
2504
|
+
* Concrete WebRTC call implementation.
|
|
2505
|
+
*
|
|
2506
|
+
* Manages the full lifecycle of a call including signaling, media streams,
|
|
2507
|
+
* participants, layout, and event routing. Created via {@link SignalWire.dial}
|
|
2508
|
+
* or received as an inbound call.
|
|
2509
|
+
*/
|
|
2510
|
+
declare class WebRTCCall extends Destroyable implements CallManager {
|
|
2511
|
+
clientSession: ClientSession;
|
|
2512
|
+
options: CallOptions;
|
|
2513
|
+
address?: Address | undefined;
|
|
2514
|
+
/** Unique identifier for this call. */
|
|
2515
|
+
readonly id: string;
|
|
2516
|
+
/** Destination URI this call was placed to. */
|
|
2517
|
+
to?: string;
|
|
2518
|
+
protected readonly participantsMap: Map<string, Participant>;
|
|
2519
|
+
private vertoManager;
|
|
2520
|
+
private callEventsManager;
|
|
2521
|
+
private participantFactory;
|
|
2522
|
+
private _errors$;
|
|
2523
|
+
private _status$;
|
|
2524
|
+
private _answered$;
|
|
2525
|
+
private _holdState;
|
|
2526
|
+
constructor(clientSession: ClientSession, options: CallOptions, initialization: CallInitialization, address?: Address | undefined);
|
|
2527
|
+
/** Observable stream of errors from media, signaling, and peer connection layers. */
|
|
2528
|
+
get errors$(): Observable<Error>;
|
|
2529
|
+
/** @internal Push an error to the call's error stream. */
|
|
2530
|
+
emitError(error: Error): void;
|
|
2531
|
+
/** Whether this call is `'inbound'` or `'outbound'`. */
|
|
2532
|
+
get direction(): CallDirection;
|
|
2533
|
+
/** Observable of the address associated with this call. */
|
|
2534
|
+
get address$(): Observable<Address | undefined>;
|
|
2535
|
+
/** Display name of the caller. */
|
|
2536
|
+
get fromName(): string | undefined;
|
|
2537
|
+
/** Address URI of the caller. */
|
|
2538
|
+
get from(): string | undefined;
|
|
2539
|
+
/** Display name of the callee. */
|
|
2540
|
+
get toName(): string | undefined;
|
|
2541
|
+
/** Toggles whether incoming video is received. @throws {UnimplementedError} Not yet implemented. */
|
|
2542
|
+
toggleIncomingVideo(): Promise<void>;
|
|
2543
|
+
/** Toggles whether incoming audio is received. @throws {UnimplementedError} Not yet implemented. */
|
|
2544
|
+
toggleIncomingAudio(): Promise<void>;
|
|
2545
|
+
/** @internal Registers an additional call ID for event routing. */
|
|
2546
|
+
addCallId(callId: string): void;
|
|
2547
|
+
/** List of capabilities available in the current call. */
|
|
2548
|
+
get capabilities(): string[];
|
|
2549
|
+
/** Current snapshot of all participants in the call. */
|
|
2550
|
+
get participants(): CallParticipant[];
|
|
2551
|
+
/** The local participant, or `null` if not yet joined. */
|
|
2552
|
+
get self(): CallSelfParticipant | null;
|
|
2553
|
+
toggleLock(): Promise<void>;
|
|
2554
|
+
toggleHold(): Promise<void>;
|
|
2555
|
+
startRecording(): Promise<void>;
|
|
2556
|
+
startStreaming(): Promise<void>;
|
|
2557
|
+
setMeta(_meta: Record<string, unknown>): Promise<void>;
|
|
2558
|
+
updateMeta(_meta: Record<string, unknown>): Promise<void>;
|
|
2559
|
+
/** Observable of layout layer positions for all participants. */
|
|
2560
|
+
get layoutLayers$(): Observable<LayoutLayer[]>;
|
|
2561
|
+
/** Current snapshot of layout layers. */
|
|
2562
|
+
get layoutLayers(): LayoutLayer[];
|
|
2563
|
+
/** Executes a Verto RPC method targeting a specific participant. */
|
|
2564
|
+
executeMethod<T extends JSONRPCResponse = JSONRPCResponse>(target: string, method: string, args: Record<string, unknown>): Promise<T>;
|
|
2565
|
+
private buildMethodParams;
|
|
2566
|
+
/** Observable of the current call status (e.g. `'ringing'`, `'connected'`). */
|
|
2567
|
+
get status$(): Observable<CallStatus>;
|
|
2568
|
+
/** Observable of the participants list, emits on join/leave/update. */
|
|
2569
|
+
get participants$(): Observable<CallParticipant[]>;
|
|
2570
|
+
/** Observable of the local (self) participant. */
|
|
2571
|
+
get self$(): Observable<CallSelfParticipant>;
|
|
2572
|
+
/** Observable indicating whether the call is being recorded. */
|
|
2573
|
+
get recording$(): Observable<boolean>;
|
|
2574
|
+
/** Observable indicating whether the call is being streamed. */
|
|
2575
|
+
get streaming$(): Observable<boolean>;
|
|
2576
|
+
/** Observable indicating whether raise-hand priority is active. */
|
|
2577
|
+
get raiseHandPriority$(): Observable<boolean>;
|
|
2578
|
+
/** Observable indicating whether the call room is locked. */
|
|
2579
|
+
get locked$(): Observable<boolean>;
|
|
2580
|
+
/** Observable of custom metadata associated with the call. */
|
|
2581
|
+
get meta$(): Observable<Record<string, unknown>>;
|
|
2582
|
+
/** Observable of the call's capability flags. */
|
|
2583
|
+
get capabilities$(): Observable<string[]>;
|
|
2584
|
+
/** Observable of the current layout name. */
|
|
2585
|
+
get layout$(): Observable<string>;
|
|
2586
|
+
/** Current call status. */
|
|
2587
|
+
get status(): CallStatus;
|
|
2588
|
+
/** Whether the call is currently being recorded. */
|
|
2589
|
+
get recording(): boolean;
|
|
2590
|
+
/** Whether the call is currently being streamed. */
|
|
2591
|
+
get streaming(): boolean;
|
|
2592
|
+
/** Whether raise-hand priority is active. */
|
|
2593
|
+
get raiseHandPriority(): boolean;
|
|
2594
|
+
/** Whether the call room is locked. */
|
|
2595
|
+
get locked(): boolean;
|
|
2596
|
+
/** Current custom metadata of the call. */
|
|
2597
|
+
get meta(): Record<string, unknown>;
|
|
2598
|
+
/** Current layout name, or `undefined` if not set. */
|
|
2599
|
+
get layout(): string | undefined;
|
|
2600
|
+
/** Observable of available layout names. */
|
|
2601
|
+
get layouts$(): Observable<string[]>;
|
|
2602
|
+
/** Current snapshot of available layout names. */
|
|
2603
|
+
get layouts(): string[];
|
|
2604
|
+
/** Observable of the local media stream (camera/microphone). */
|
|
2605
|
+
get localStream$(): Observable<MediaStream>;
|
|
2606
|
+
/** Current local media stream, or `null` if not available. */
|
|
2607
|
+
get localStream(): MediaStream | null;
|
|
2608
|
+
/** Observable of the remote media stream from the far end. */
|
|
2609
|
+
get remoteStream$(): Observable<MediaStream>;
|
|
2610
|
+
/** Current remote media stream, or `null` if not available. */
|
|
2611
|
+
get remoteStream(): MediaStream | null;
|
|
2612
|
+
/** @internal */
|
|
2613
|
+
createParticipant(memberId: string, selfId?: string | null): Participant | SelfParticipant;
|
|
2614
|
+
/** Observable of the current audio/video send/receive directions. */
|
|
2615
|
+
get mediaDirections$(): Observable<MediaDirections>;
|
|
2616
|
+
/** Current audio/video send/receive directions. */
|
|
2617
|
+
get mediaDirections(): MediaDirections;
|
|
2618
|
+
protected get participantsId$(): Observable<string[]>;
|
|
2619
|
+
/** Executes a raw JSON-RPC request on the client session. */
|
|
2620
|
+
execute<T extends JSONRPCResponse = JSONRPCResponse>(request: JSONRPCRequest, options?: PendingRPCOptions): Promise<T>;
|
|
2621
|
+
/** Observable of the local participant's member ID. */
|
|
2622
|
+
get selfId$(): Observable<string | null>;
|
|
2623
|
+
/** Local participant's member ID, or `null` if not joined. */
|
|
2624
|
+
get selfId(): string | null;
|
|
2625
|
+
/** Observable of the server node ID handling this call. */
|
|
2626
|
+
get nodeId$(): Observable<string | null>;
|
|
2627
|
+
/** Server node ID handling this call, or `null`. */
|
|
2628
|
+
get nodeId(): string | null;
|
|
2629
|
+
private isCallSessionEvent;
|
|
2630
|
+
private get callSessionEvents$();
|
|
2631
|
+
/** Observable of call-updated events. */
|
|
2632
|
+
get callUpdated$(): Observable<CallUpdatedPayload>;
|
|
2633
|
+
/** Observable of member-joined events. */
|
|
2634
|
+
get memberJoined$(): Observable<MemberJoinedPayload>;
|
|
2635
|
+
/** Observable of member-left events. */
|
|
2636
|
+
get memberLeft$(): Observable<MemberLeftPayload>;
|
|
2637
|
+
/** Observable of member-updated events (mute, volume, etc.). */
|
|
2638
|
+
get memberUpdated$(): Observable<MemberUpdatedPayload>;
|
|
2639
|
+
/** Observable of member-talking events (speech start/stop). */
|
|
2640
|
+
get memberTalking$(): Observable<MemberTalkingPayload>;
|
|
2641
|
+
/** Observable of call state-change events. */
|
|
2642
|
+
get callStates$(): Observable<CallStatePayload>;
|
|
2643
|
+
/** Observable of layout-changed events. */
|
|
2644
|
+
get layoutUpdates$(): Observable<LayoutChangedPayload>;
|
|
2645
|
+
/** Underlying `RTCPeerConnection`, for advanced use cases. */
|
|
2646
|
+
get rtcPeerConnection(): RTCPeerConnection | undefined;
|
|
2647
|
+
/** Observable of raw signaling events as plain objects. */
|
|
2648
|
+
get signalingEvent$(): Observable<Record<string, unknown>>;
|
|
2649
|
+
/** Observable of WebRTC-specific signaling messages. */
|
|
2650
|
+
get webrtcMessages$(): Observable<WebrtcMessagePayload>;
|
|
2651
|
+
/** Observable of call-level signaling events. */
|
|
2652
|
+
get callEvent$(): Observable<WebrtcMessagePayload | CallJoinedPayload | CallLeftPayload | CallUpdatedPayload | CallStatePayload | CallPlayPayload | CallConnectPayload | MemberUpdatedPayload | MemberJoinedPayload | MemberLeftPayload | MemberTalkingPayload | LayoutChangedPayload | ConversationMessagePayload>;
|
|
2653
|
+
/** Observable of layout-changed signaling events. */
|
|
2654
|
+
get layoutEvent$(): Observable<LayoutChangedPayload>;
|
|
2655
|
+
/** Hangs up the call and releases all resources. */
|
|
2656
|
+
hangup(): Promise<void>;
|
|
2657
|
+
/** Sends DTMF digits (e.g. `'1234#'`) on the call. */
|
|
2658
|
+
sendDigits(dtmf: string): Promise<void>;
|
|
2659
|
+
/** Accepts an inbound call. */
|
|
2660
|
+
answer(): void;
|
|
2661
|
+
/** Rejects an inbound call. */
|
|
2662
|
+
reject(): void;
|
|
2663
|
+
/** Observable that emits `true` when answered, `false` when rejected. */
|
|
2664
|
+
get answered$(): Observable<boolean>;
|
|
2665
|
+
/**
|
|
2666
|
+
* Sets the call layout and participant positions.
|
|
2667
|
+
* @param layout - Layout name (must be one of {@link layouts}).
|
|
2668
|
+
* @param positions - Map of member IDs to video positions.
|
|
2669
|
+
*/
|
|
2670
|
+
setLayout(layout: string, positions: Record<string, VideoPosition>): Promise<void>;
|
|
2671
|
+
/** Transfers the call to other participants. */
|
|
2672
|
+
transfer(options: TransferOptions): Promise<void>;
|
|
2673
|
+
/** Destroys the call, releasing all resources and subscriptions. */
|
|
2674
|
+
destroy(): void;
|
|
2675
|
+
}
|
|
2676
|
+
//#endregion
|
|
2677
|
+
//#region src/index.d.ts
|
|
2678
|
+
/**
|
|
2679
|
+
* Library version from package.json, injected at build time.
|
|
2680
|
+
*/
|
|
2681
|
+
declare const version: string;
|
|
2682
|
+
/**
|
|
2683
|
+
* Flag indicating the library has been loaded and is ready to use.
|
|
2684
|
+
* For UMD builds: `window.SignalWire.ready`
|
|
2685
|
+
* For ES modules: `import { ready } from '@signalwire/js'`
|
|
2686
|
+
*/
|
|
2687
|
+
declare const ready: boolean;
|
|
2688
|
+
//#endregion
|
|
2689
|
+
export { Address, type AddressHistory, type Call, type CallAddress, CallCreateError, type CallOptions, type CallParticipant, type CallSelfParticipant, type CallState, type CallStatus, ClientPreferences, CollectionFetchError, type DialOptions, type Directory, type ExecuteMethod, type LayoutLayer, type MediaDirection, type MediaDirections, type MediaOptions, MediaTrackError, MessageParseError, type NodeSocketAdapter, Participant, type SDKCredential, SelfParticipant, SignalWire, type SignalWireOptions, StaticCredentialProvider, Subscriber, type TextMessage, VertoPongError, WebRTCCall, type WebSocketAdapter, embeddableCall, isSelfParticipant, ready, version };
|
|
2690
|
+
//# sourceMappingURL=index.d.cts.map
|