@telnyx/react-voice-commons-sdk 0.1.0 → 0.1.2

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.
Files changed (47) hide show
  1. package/README.md +483 -0
  2. package/TelnyxVoiceCommons.podspec +31 -31
  3. package/ios/CallKitBridge.m +43 -43
  4. package/ios/CallKitBridge.swift +879 -879
  5. package/ios/VoicePnBridge.m +30 -30
  6. package/ios/VoicePnBridge.swift +86 -86
  7. package/lib/callkit/callkit-coordinator.d.ts +117 -113
  8. package/lib/callkit/callkit-coordinator.js +727 -681
  9. package/lib/callkit/callkit.d.ts +41 -41
  10. package/lib/callkit/callkit.js +242 -252
  11. package/lib/callkit/index.js +47 -15
  12. package/lib/callkit/use-callkit.d.ts +19 -19
  13. package/lib/callkit/use-callkit.js +310 -270
  14. package/lib/context/TelnyxVoiceContext.d.ts +9 -9
  15. package/lib/context/TelnyxVoiceContext.js +13 -10
  16. package/lib/hooks/use-callkit-coordinator.d.ts +17 -9
  17. package/lib/hooks/use-callkit-coordinator.js +50 -45
  18. package/lib/hooks/useAppReadyNotifier.js +15 -13
  19. package/lib/hooks/useAppStateHandler.d.ts +11 -6
  20. package/lib/hooks/useAppStateHandler.js +110 -95
  21. package/lib/index.d.ts +21 -3
  22. package/lib/index.js +201 -50
  23. package/lib/internal/CallKitHandler.d.ts +6 -6
  24. package/lib/internal/CallKitHandler.js +104 -96
  25. package/lib/internal/callkit-manager.d.ts +57 -57
  26. package/lib/internal/callkit-manager.js +316 -299
  27. package/lib/internal/calls/call-state-controller.d.ts +86 -81
  28. package/lib/internal/calls/call-state-controller.js +307 -269
  29. package/lib/internal/session/session-manager.d.ts +75 -75
  30. package/lib/internal/session/session-manager.js +424 -350
  31. package/lib/internal/user-defaults-helpers.js +39 -49
  32. package/lib/internal/voice-pn-bridge.d.ts +11 -11
  33. package/lib/internal/voice-pn-bridge.js +3 -3
  34. package/lib/models/call-state.d.ts +44 -44
  35. package/lib/models/call-state.js +68 -66
  36. package/lib/models/call.d.ts +133 -133
  37. package/lib/models/call.js +382 -354
  38. package/lib/models/config.d.ts +18 -11
  39. package/lib/models/config.js +35 -37
  40. package/lib/models/connection-state.d.ts +10 -10
  41. package/lib/models/connection-state.js +16 -16
  42. package/lib/telnyx-voice-app.d.ts +28 -28
  43. package/lib/telnyx-voice-app.js +482 -424
  44. package/lib/telnyx-voip-client.d.ts +167 -155
  45. package/lib/telnyx-voip-client.js +392 -331
  46. package/package.json +1 -1
  47. package/src/telnyx-voip-client.ts +64 -0
@@ -8,85 +8,90 @@ 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
- 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, debug?: boolean): 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
70
- */
71
- private _handleIncomingCall;
72
- /**
73
- * Handle call state changes from the Telnyx client
74
- */
75
- private _handleCallStateChange;
76
- /**
77
- * Handle call updates from notifications
78
- */
79
- private _handleCallUpdate;
80
- /**
81
- * Add a call to our tracking
82
- */
83
- private _addCall;
84
- /**
85
- * Remove a call from our tracking
86
- */
87
- private _removeCall;
88
- /**
89
- * Generate a unique call ID
90
- */
91
- 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(
53
+ destination: string,
54
+ callerName?: string,
55
+ callerNumber?: string,
56
+ debug?: boolean
57
+ ): Promise<Call>;
58
+ /**
59
+ * Set callbacks for waiting for invite logic (used for push notifications)
60
+ */
61
+ setWaitingForInviteCallbacks(callbacks: {
62
+ isWaitingForInvite: () => boolean;
63
+ onInviteAutoAccepted: () => void;
64
+ }): void;
65
+ /**
66
+ * Dispose of the controller and clean up resources
67
+ */
68
+ dispose(): void;
69
+ /**
70
+ * Set up event listeners for the Telnyx client
71
+ */
72
+ private _setupClientListeners;
73
+ /**
74
+ * Handle incoming call
75
+ */
76
+ private _handleIncomingCall;
77
+ /**
78
+ * Handle call state changes from the Telnyx client
79
+ */
80
+ private _handleCallStateChange;
81
+ /**
82
+ * Handle call updates from notifications
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;
92
97
  }