@vonage/client-sdk 2.2.0 → 2.3.0-alpha.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.
@@ -14,7 +14,7 @@ import { ConversationEvent } from '../kotlin/JsUnions';
14
14
  * @packageDocumentation
15
15
  */
16
16
  export * from '../utils';
17
- type VonageEventOverride = Omit<vonage.CombinedEvents, 'conversationEvent' | 'callHangup' | 'callMediaDisconnect' | 'legStatusUpdate' | 'rtcStatsUpdate' | 'callInvite' | 'callInviteCancel' | 'sessionError' | 'callMediaError'> & {
17
+ type VonageEventOverride = Omit<vonage.CombinedEvents, 'conversationEvent' | 'callHangup' | 'callMediaDisconnect' | 'legStatusUpdate' | 'rtcStatsUpdate' | 'callInvite' | 'callInviteCancel' | 'sessionError' | 'callMediaError' | 'emergencyCallDisconnected' | 'emergencyCallHangup'> & {
18
18
  conversationEvent: (event: ConversationEvent) => void;
19
19
  callHangup: (callId: string, callQuality: RTCQuality, reason: HangupReason) => void;
20
20
  callMediaDisconnect: (callId: string, reason: CallDisconnectReason) => void;
@@ -24,6 +24,8 @@ type VonageEventOverride = Omit<vonage.CombinedEvents, 'conversationEvent' | 'ca
24
24
  callInvite: (callId: string, from: string, channelType: VoiceChannelType) => void;
25
25
  sessionError: (reason: SessionErrorReason) => void;
26
26
  callMediaError: (callId: string, error: VonageError) => void;
27
+ emergencyCallDisconnected: (callId: string) => void;
28
+ emergencyCallHangup: (callId: string) => void;
27
29
  };
28
30
  /**
29
31
  * Vonage Event Names
@@ -119,6 +121,23 @@ export type CallSayParams = Partial<vonage.CallSayParams> & {
119
121
  * @group Voice
120
122
  */
121
123
  export type RtcStats = vonage.RTCStatsJS;
124
+ /**
125
+ * Data for an emergency call
126
+ *
127
+ * @property callId The call ID
128
+ * @property reconnectToken The reconnect token for the call
129
+ * @interface
130
+ * @group Emergency
131
+ */
132
+ export type EmergencyCallData = vonage.emergency.EmergencyCallDataJS;
133
+ /**
134
+ * Options for an emergency call
135
+ *
136
+ * @property ringbackTone Optional URL to a custom ringback tone audio file
137
+ * @interface
138
+ * @group Emergency
139
+ */
140
+ export type EmergencyCallOptions = vonage.emergency.EmergencyCallOptionsJS;
122
141
  /**
123
142
  * VonageClient is the main entry point for the Vonage Client SDK.
124
143
  *
@@ -204,7 +223,7 @@ export declare class VonageClient extends vonage.CombinedClientJS {
204
223
  * @group Voice
205
224
  * @param id - The Call Id
206
225
  */
207
- getPeerConnection(id: string): RTCPeerConnection;
226
+ getPeerConnection(id: string): RTCPeerConnection | undefined;
208
227
  /**
209
228
  * Get the HTML Audio Element for the SDK.
210
229
  * It can be used to route output to other devices.
@@ -551,5 +570,66 @@ export declare class VonageClient extends vonage.CombinedClientJS {
551
570
  * @returns the `timestamp` of the message
552
571
  */
553
572
  sendMessageSeenEvent(id: number, conversationId: string): Promise<string>;
573
+ /**
574
+ * Starts an emergency call.
575
+ *
576
+ * @group Emergency
577
+ * @param token
578
+ * @param from
579
+ * @param to
580
+ * @param options - Optional {@link EmergencyCallOptions} containing call options
581
+ * @returns the result containing `callId` and `reconnectToken`
582
+ */
583
+ emergencyCall(token: string, from: string, to: string, options?: Nullable<EmergencyCallOptions>): Promise<EmergencyCallData>;
584
+ /**
585
+ * Reconnects an existing emergency call.
586
+ *
587
+ * @group Emergency
588
+ * @param token
589
+ * @param callId
590
+ * @param reconnectToken
591
+ * @returns void
592
+ */
593
+ reconnectEmergencyCall(token: string, callId: string, reconnectToken: string): Promise<void>;
594
+ /**
595
+ * Hangup an emergency call.
596
+ *
597
+ * @group Emergency
598
+ * @param callId - the `callId` of the call to hangup
599
+ * @returns void
600
+ */
601
+ hangupEmergencyCall(callId: string): Promise<void>;
602
+ /**
603
+ * Mute an emergency call.
604
+ *
605
+ * @group Emergency
606
+ * @param callId - the `callId` of the call to mute
607
+ * @returns void
608
+ */
609
+ muteEmergencyCall(callId: string): Promise<void>;
610
+ /**
611
+ * Unmute an emergency call.
612
+ *
613
+ * @group Emergency
614
+ * @param callId - the `callId` of the call to unmute
615
+ * @returns void
616
+ */
617
+ unmuteEmergencyCall(callId: string): Promise<void>;
618
+ /**
619
+ * Enable earmuff for an emergency call.
620
+ *
621
+ * @group Emergency
622
+ * @param callId - the `callId` of the call to enable earmuff for
623
+ * @returns void
624
+ */
625
+ enableEarmuffEmergencyCall(callId: string): Promise<void>;
626
+ /**
627
+ * Disable earmuff for an emergency call.
628
+ *
629
+ * @group Emergency
630
+ * @param callId - the `callId` of the call to disable earmuff for
631
+ * @returns void
632
+ */
633
+ disableEarmuffEmergencyCall(callId: string): Promise<void>;
554
634
  }
555
635
  export default VonageClient;