@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.
- package/README.md +483 -0
- package/TelnyxVoiceCommons.podspec +31 -31
- package/ios/CallKitBridge.m +43 -43
- package/ios/CallKitBridge.swift +879 -879
- package/ios/VoicePnBridge.m +30 -30
- package/ios/VoicePnBridge.swift +86 -86
- package/lib/callkit/callkit-coordinator.d.ts +117 -113
- package/lib/callkit/callkit-coordinator.js +727 -681
- package/lib/callkit/callkit.d.ts +41 -41
- package/lib/callkit/callkit.js +242 -252
- package/lib/callkit/index.js +47 -15
- package/lib/callkit/use-callkit.d.ts +19 -19
- package/lib/callkit/use-callkit.js +310 -270
- package/lib/context/TelnyxVoiceContext.d.ts +9 -9
- package/lib/context/TelnyxVoiceContext.js +13 -10
- package/lib/hooks/use-callkit-coordinator.d.ts +17 -9
- package/lib/hooks/use-callkit-coordinator.js +50 -45
- package/lib/hooks/useAppReadyNotifier.js +15 -13
- package/lib/hooks/useAppStateHandler.d.ts +11 -6
- package/lib/hooks/useAppStateHandler.js +110 -95
- package/lib/index.d.ts +21 -3
- package/lib/index.js +201 -50
- package/lib/internal/CallKitHandler.d.ts +6 -6
- package/lib/internal/CallKitHandler.js +104 -96
- package/lib/internal/callkit-manager.d.ts +57 -57
- package/lib/internal/callkit-manager.js +316 -299
- package/lib/internal/calls/call-state-controller.d.ts +86 -81
- package/lib/internal/calls/call-state-controller.js +307 -269
- package/lib/internal/session/session-manager.d.ts +75 -75
- package/lib/internal/session/session-manager.js +424 -350
- package/lib/internal/user-defaults-helpers.js +39 -49
- package/lib/internal/voice-pn-bridge.d.ts +11 -11
- package/lib/internal/voice-pn-bridge.js +3 -3
- package/lib/models/call-state.d.ts +44 -44
- package/lib/models/call-state.js +68 -66
- package/lib/models/call.d.ts +133 -133
- package/lib/models/call.js +382 -354
- package/lib/models/config.d.ts +18 -11
- package/lib/models/config.js +35 -37
- 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 +482 -424
- package/lib/telnyx-voip-client.d.ts +167 -155
- package/lib/telnyx-voip-client.js +392 -331
- package/package.json +1 -1
- package/src/telnyx-voip-client.ts +64 -0
package/lib/models/call.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
}
|