@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
@@ -9,137 +9,137 @@ import { Call as TelnyxCall } from '@telnyx/react-native-voice-sdk';
9
9
  * integrate with any state management solution.
10
10
  */
11
11
  export declare class Call {
12
- private readonly _telnyxCall;
13
- private readonly _callId;
14
- private readonly _destination;
15
- private readonly _isIncoming;
16
- private readonly _callState;
17
- private readonly _isMuted;
18
- private readonly _isHeld;
19
- private readonly _duration;
20
- private _durationTimer?;
21
- private _startTime?;
22
- constructor(_telnyxCall: TelnyxCall, _callId: string, _destination: string, _isIncoming: boolean);
23
- /**
24
- * Unique identifier for this call
25
- */
26
- get callId(): string;
27
- /**
28
- * The destination number or SIP URI
29
- */
30
- get destination(): string;
31
- /**
32
- * Whether this is an incoming call
33
- */
34
- get isIncoming(): boolean;
35
- /**
36
- * Whether this is an outgoing call
37
- */
38
- get isOutgoing(): boolean;
39
- /**
40
- * Current call state (synchronous access)
41
- */
42
- get currentState(): TelnyxCallState;
43
- /**
44
- * Current mute state (synchronous access)
45
- */
46
- get currentIsMuted(): boolean;
47
- /**
48
- * Current hold state (synchronous access)
49
- */
50
- get currentIsHeld(): boolean;
51
- /**
52
- * Current call duration in seconds (synchronous access)
53
- */
54
- get currentDuration(): number;
55
- /**
56
- * Get the underlying Telnyx Call object (for internal use)
57
- * @internal
58
- */
59
- get telnyxCall(): TelnyxCall;
60
- /**
61
- * Observable stream of call state changes
62
- */
63
- get callState$(): Observable<TelnyxCallState>;
64
- /**
65
- * Observable stream of mute state changes
66
- */
67
- get isMuted$(): Observable<boolean>;
68
- /**
69
- * Observable stream of hold state changes
70
- */
71
- get isHeld$(): Observable<boolean>;
72
- /**
73
- * Observable stream of call duration changes (in seconds)
74
- */
75
- get duration$(): Observable<number>;
76
- /**
77
- * Observable that emits true when the call can be answered
78
- */
79
- get canAnswer$(): Observable<boolean>;
80
- /**
81
- * Observable that emits true when the call can be hung up
82
- */
83
- get canHangup$(): Observable<boolean>;
84
- /**
85
- * Observable that emits true when the call can be put on hold
86
- */
87
- get canHold$(): Observable<boolean>;
88
- /**
89
- * Observable that emits true when the call can be resumed from hold
90
- */
91
- get canResume$(): Observable<boolean>;
92
- /**
93
- * Answer the incoming call
94
- */
95
- answer(): Promise<void>;
96
- /**
97
- * Hang up the call
98
- */
99
- hangup(): Promise<void>;
100
- /**
101
- * Put the call on hold
102
- */
103
- hold(): Promise<void>;
104
- /**
105
- * Resume the call from hold
106
- */
107
- resume(): Promise<void>;
108
- /**
109
- * Mute the call
110
- */
111
- mute(): Promise<void>;
112
- /**
113
- * Unmute the call
114
- */
115
- unmute(): Promise<void>;
116
- /**
117
- * Toggle mute state
118
- */
119
- toggleMute(): Promise<void>;
120
- /**
121
- * Set the call to connecting state (used for push notification calls when answered via CallKit)
122
- * @internal
123
- */
124
- setConnecting(): void;
125
- /**
126
- * Clean up resources when the call is disposed
127
- */
128
- dispose(): void;
129
- /**
130
- * Set up listeners for the underlying Telnyx call
131
- */
132
- private _setupCallListeners;
133
- /**
134
- * Map Telnyx SDK call states to our simplified call states
135
- */
136
- private _mapToTelnyxCallState;
137
- /**
138
- * Start the duration timer
139
- */
140
- private _startDurationTimer;
141
- /**
142
- * Stop the duration timer
143
- */
144
- private _stopDurationTimer;
12
+ private readonly _telnyxCall;
13
+ private readonly _callId;
14
+ private readonly _destination;
15
+ private readonly _isIncoming;
16
+ private readonly _callState;
17
+ private readonly _isMuted;
18
+ private readonly _isHeld;
19
+ private readonly _duration;
20
+ private _durationTimer?;
21
+ private _startTime?;
22
+ constructor(_telnyxCall: TelnyxCall, _callId: string, _destination: string, _isIncoming: boolean);
23
+ /**
24
+ * Unique identifier for this call
25
+ */
26
+ get callId(): string;
27
+ /**
28
+ * The destination number or SIP URI
29
+ */
30
+ get destination(): string;
31
+ /**
32
+ * Whether this is an incoming call
33
+ */
34
+ get isIncoming(): boolean;
35
+ /**
36
+ * Whether this is an outgoing call
37
+ */
38
+ get isOutgoing(): boolean;
39
+ /**
40
+ * Current call state (synchronous access)
41
+ */
42
+ get currentState(): TelnyxCallState;
43
+ /**
44
+ * Current mute state (synchronous access)
45
+ */
46
+ get currentIsMuted(): boolean;
47
+ /**
48
+ * Current hold state (synchronous access)
49
+ */
50
+ get currentIsHeld(): boolean;
51
+ /**
52
+ * Current call duration in seconds (synchronous access)
53
+ */
54
+ get currentDuration(): number;
55
+ /**
56
+ * Get the underlying Telnyx Call object (for internal use)
57
+ * @internal
58
+ */
59
+ get telnyxCall(): TelnyxCall;
60
+ /**
61
+ * Observable stream of call state changes
62
+ */
63
+ get callState$(): Observable<TelnyxCallState>;
64
+ /**
65
+ * Observable stream of mute state changes
66
+ */
67
+ get isMuted$(): Observable<boolean>;
68
+ /**
69
+ * Observable stream of hold state changes
70
+ */
71
+ get isHeld$(): Observable<boolean>;
72
+ /**
73
+ * Observable stream of call duration changes (in seconds)
74
+ */
75
+ get duration$(): Observable<number>;
76
+ /**
77
+ * Observable that emits true when the call can be answered
78
+ */
79
+ get canAnswer$(): Observable<boolean>;
80
+ /**
81
+ * Observable that emits true when the call can be hung up
82
+ */
83
+ get canHangup$(): Observable<boolean>;
84
+ /**
85
+ * Observable that emits true when the call can be put on hold
86
+ */
87
+ get canHold$(): Observable<boolean>;
88
+ /**
89
+ * Observable that emits true when the call can be resumed from hold
90
+ */
91
+ get canResume$(): Observable<boolean>;
92
+ /**
93
+ * Answer the incoming call
94
+ */
95
+ answer(): Promise<void>;
96
+ /**
97
+ * Hang up the call
98
+ */
99
+ hangup(): Promise<void>;
100
+ /**
101
+ * Put the call on hold
102
+ */
103
+ hold(): Promise<void>;
104
+ /**
105
+ * Resume the call from hold
106
+ */
107
+ resume(): Promise<void>;
108
+ /**
109
+ * Mute the call
110
+ */
111
+ mute(): Promise<void>;
112
+ /**
113
+ * Unmute the call
114
+ */
115
+ unmute(): Promise<void>;
116
+ /**
117
+ * Toggle mute state
118
+ */
119
+ toggleMute(): Promise<void>;
120
+ /**
121
+ * Set the call to connecting state (used for push notification calls when answered via CallKit)
122
+ * @internal
123
+ */
124
+ setConnecting(): void;
125
+ /**
126
+ * Clean up resources when the call is disposed
127
+ */
128
+ dispose(): void;
129
+ /**
130
+ * Set up listeners for the underlying Telnyx call
131
+ */
132
+ private _setupCallListeners;
133
+ /**
134
+ * Map Telnyx SDK call states to our simplified call states
135
+ */
136
+ private _mapToTelnyxCallState;
137
+ /**
138
+ * Start the duration timer
139
+ */
140
+ private _startDurationTimer;
141
+ /**
142
+ * Stop the duration timer
143
+ */
144
+ private _stopDurationTimer;
145
145
  }