@telnyx/react-voice-commons-sdk 0.1.2 → 0.1.4
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/CHANGELOG.md +60 -0
- package/README.md +469 -483
- package/ios/CallKitBridge.swift +2 -7
- package/lib/callkit/callkit-coordinator.d.ts +110 -117
- package/lib/callkit/callkit-coordinator.js +664 -727
- package/lib/callkit/callkit.d.ts +41 -41
- package/lib/callkit/callkit.js +252 -242
- package/lib/callkit/index.js +15 -47
- package/lib/callkit/use-callkit.d.ts +19 -19
- package/lib/callkit/use-callkit.js +270 -310
- package/lib/context/TelnyxVoiceContext.d.ts +9 -9
- package/lib/context/TelnyxVoiceContext.js +10 -13
- package/lib/hooks/use-callkit-coordinator.d.ts +9 -17
- package/lib/hooks/use-callkit-coordinator.js +45 -50
- package/lib/hooks/useAppReadyNotifier.js +13 -15
- package/lib/hooks/useAppStateHandler.d.ts +6 -11
- package/lib/hooks/useAppStateHandler.js +95 -110
- package/lib/hooks/useNetworkStateHandler.d.ts +0 -0
- package/lib/hooks/useNetworkStateHandler.js +0 -0
- package/lib/index.d.ts +3 -21
- package/lib/index.js +50 -201
- package/lib/internal/CallKitHandler.d.ts +6 -6
- package/lib/internal/CallKitHandler.js +96 -104
- package/lib/internal/callkit-manager.d.ts +57 -57
- package/lib/internal/callkit-manager.js +299 -316
- package/lib/internal/calls/call-state-controller.d.ts +73 -86
- package/lib/internal/calls/call-state-controller.js +263 -307
- package/lib/internal/session/session-manager.d.ts +71 -75
- package/lib/internal/session/session-manager.js +360 -424
- package/lib/internal/user-defaults-helpers.js +49 -39
- package/lib/internal/voice-pn-bridge.d.ts +114 -12
- package/lib/internal/voice-pn-bridge.js +212 -5
- package/lib/models/call-state.d.ts +46 -44
- package/lib/models/call-state.js +70 -68
- package/lib/models/call.d.ts +161 -133
- package/lib/models/call.js +454 -382
- package/lib/models/config.d.ts +11 -18
- package/lib/models/config.js +37 -35
- package/lib/models/connection-state.d.ts +10 -10
- package/lib/models/connection-state.js +16 -16
- package/lib/telnyx-voice-app.d.ts +28 -28
- package/lib/telnyx-voice-app.js +513 -480
- package/lib/telnyx-voip-client.d.ts +167 -167
- package/lib/telnyx-voip-client.js +385 -390
- package/package.json +115 -104
- package/src/callkit/callkit-coordinator.ts +830 -846
- package/src/hooks/useNetworkStateHandler.ts +0 -0
- package/src/internal/calls/call-state-controller.ts +407 -384
- package/src/internal/session/session-manager.ts +483 -467
- package/src/internal/voice-pn-bridge.ts +266 -18
- package/src/models/call-state.ts +105 -98
- package/src/models/call.ts +502 -388
- package/src/telnyx-voice-app.tsx +788 -690
- package/src/telnyx-voip-client.ts +551 -539
- package/src/types/telnyx-sdk.d.ts +93 -79
|
@@ -8,90 +8,77 @@ import { SessionManager } from '../session/session-manager';
|
|
|
8
8
|
* and provides reactive streams for call-related state changes.
|
|
9
9
|
*/
|
|
10
10
|
export declare class CallStateController {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
private _handleCallUpdate;
|
|
85
|
-
/**
|
|
86
|
-
* Add a call to our tracking
|
|
87
|
-
*/
|
|
88
|
-
private _addCall;
|
|
89
|
-
/**
|
|
90
|
-
* Remove a call from our tracking
|
|
91
|
-
*/
|
|
92
|
-
private _removeCall;
|
|
93
|
-
/**
|
|
94
|
-
* Generate a unique call ID
|
|
95
|
-
*/
|
|
96
|
-
private _generateCallId;
|
|
11
|
+
private readonly _sessionManager;
|
|
12
|
+
private readonly _calls;
|
|
13
|
+
private readonly _callMap;
|
|
14
|
+
private _disposed;
|
|
15
|
+
private _isWaitingForInvite?;
|
|
16
|
+
private _onInviteAutoAccepted?;
|
|
17
|
+
constructor(_sessionManager: SessionManager);
|
|
18
|
+
/**
|
|
19
|
+
* Observable stream of all current calls
|
|
20
|
+
*/
|
|
21
|
+
get calls$(): Observable<Call[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Observable stream of the currently active call
|
|
24
|
+
*/
|
|
25
|
+
get activeCall$(): Observable<Call | null>;
|
|
26
|
+
/**
|
|
27
|
+
* Current list of calls (synchronous access)
|
|
28
|
+
*/
|
|
29
|
+
get currentCalls(): Call[];
|
|
30
|
+
/**
|
|
31
|
+
* Current active call (synchronous access)
|
|
32
|
+
*/
|
|
33
|
+
get currentActiveCall(): Call | null;
|
|
34
|
+
/**
|
|
35
|
+
* Set a call to connecting state (used for push notification calls when answered via CallKit)
|
|
36
|
+
* @param callId The ID of the call to set to connecting state
|
|
37
|
+
*/
|
|
38
|
+
setCallConnecting(callId: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Find a call by its underlying Telnyx call ID
|
|
41
|
+
* @param telnyxCall The Telnyx call object to find
|
|
42
|
+
*/
|
|
43
|
+
findCallByTelnyxCall(telnyxCall: any): Call | null;
|
|
44
|
+
/**
|
|
45
|
+
* Initialize client listeners when the Telnyx client becomes available
|
|
46
|
+
* This should be called by the session manager after client creation
|
|
47
|
+
*/
|
|
48
|
+
initializeClientListeners(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Initiate a new outgoing call
|
|
51
|
+
*/
|
|
52
|
+
newCall(destination: string, callerName?: string, callerNumber?: string, customHeaders?: Record<string, string>): Promise<Call>;
|
|
53
|
+
/**
|
|
54
|
+
* Set callbacks for waiting for invite logic (used for push notifications)
|
|
55
|
+
*/
|
|
56
|
+
setWaitingForInviteCallbacks(callbacks: {
|
|
57
|
+
isWaitingForInvite: () => boolean;
|
|
58
|
+
onInviteAutoAccepted: () => void;
|
|
59
|
+
}): void;
|
|
60
|
+
/**
|
|
61
|
+
* Dispose of the controller and clean up resources
|
|
62
|
+
*/
|
|
63
|
+
dispose(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Set up event listeners for the Telnyx client
|
|
66
|
+
*/
|
|
67
|
+
private _setupClientListeners;
|
|
68
|
+
/**
|
|
69
|
+
* Handle incoming call or reattached call
|
|
70
|
+
*/
|
|
71
|
+
private _handleIncomingCall;
|
|
72
|
+
/**
|
|
73
|
+
* Add a call to our tracking
|
|
74
|
+
*/
|
|
75
|
+
private _addCall;
|
|
76
|
+
/**
|
|
77
|
+
* Remove a call from our tracking
|
|
78
|
+
*/
|
|
79
|
+
private _removeCall;
|
|
80
|
+
/**
|
|
81
|
+
* Generate a unique call ID
|
|
82
|
+
*/
|
|
83
|
+
private _generateCallId;
|
|
97
84
|
}
|