@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
|
@@ -1,79 +1,93 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type definitions for Telnyx React Native Voice SDK
|
|
3
|
-
* This file provides type definitions without importing the actual SDK
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
declare module '@telnyx/react-native-voice-sdk' {
|
|
7
|
-
import { EventEmitter } from 'eventemitter3';
|
|
8
|
-
|
|
9
|
-
export interface CallOptions {
|
|
10
|
-
callerIdName?: string;
|
|
11
|
-
callerIdNumber?: string;
|
|
12
|
-
customHeaders?: Record<string, string>;
|
|
13
|
-
clientState?: string;
|
|
14
|
-
destinationNumber?: string;
|
|
15
|
-
audio?: boolean;
|
|
16
|
-
video?: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface ClientOptions {
|
|
20
|
-
login?: string;
|
|
21
|
-
password?: string;
|
|
22
|
-
token?: string;
|
|
23
|
-
login_token?: string;
|
|
24
|
-
ringtoneFile?: string;
|
|
25
|
-
ringbackFile?: string;
|
|
26
|
-
debug?: boolean;
|
|
27
|
-
logLevel?: string;
|
|
28
|
-
pushNotificationDeviceToken?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export enum CallState {
|
|
32
|
-
NEW = 'new',
|
|
33
|
-
CONNECTING = 'connecting',
|
|
34
|
-
RINGING = 'ringing',
|
|
35
|
-
ACTIVE = 'active',
|
|
36
|
-
HELD = 'held',
|
|
37
|
-
HANGUP = 'hangup',
|
|
38
|
-
DESTROY = 'destroy',
|
|
39
|
-
PURGE = 'purge',
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export class Call extends EventEmitter {
|
|
43
|
-
callId: string;
|
|
44
|
-
state: CallState;
|
|
45
|
-
direction: 'inbound' | 'outbound';
|
|
46
|
-
remoteCallerIdName?: string;
|
|
47
|
-
remoteCallerIdNumber?: string;
|
|
48
|
-
localCallerIdName?: string;
|
|
49
|
-
localCallerIdNumber?: string;
|
|
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
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for Telnyx React Native Voice SDK
|
|
3
|
+
* This file provides type definitions without importing the actual SDK
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
declare module '@telnyx/react-native-voice-sdk' {
|
|
7
|
+
import { EventEmitter } from 'eventemitter3';
|
|
8
|
+
|
|
9
|
+
export interface CallOptions {
|
|
10
|
+
callerIdName?: string;
|
|
11
|
+
callerIdNumber?: string;
|
|
12
|
+
customHeaders?: Record<string, string>;
|
|
13
|
+
clientState?: string;
|
|
14
|
+
destinationNumber?: string;
|
|
15
|
+
audio?: boolean;
|
|
16
|
+
video?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ClientOptions {
|
|
20
|
+
login?: string;
|
|
21
|
+
password?: string;
|
|
22
|
+
token?: string;
|
|
23
|
+
login_token?: string;
|
|
24
|
+
ringtoneFile?: string;
|
|
25
|
+
ringbackFile?: string;
|
|
26
|
+
debug?: boolean;
|
|
27
|
+
logLevel?: string;
|
|
28
|
+
pushNotificationDeviceToken?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export enum CallState {
|
|
32
|
+
NEW = 'new',
|
|
33
|
+
CONNECTING = 'connecting',
|
|
34
|
+
RINGING = 'ringing',
|
|
35
|
+
ACTIVE = 'active',
|
|
36
|
+
HELD = 'held',
|
|
37
|
+
HANGUP = 'hangup',
|
|
38
|
+
DESTROY = 'destroy',
|
|
39
|
+
PURGE = 'purge',
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export class Call extends EventEmitter {
|
|
43
|
+
callId: string;
|
|
44
|
+
state: CallState;
|
|
45
|
+
direction: 'inbound' | 'outbound';
|
|
46
|
+
remoteCallerIdName?: string;
|
|
47
|
+
remoteCallerIdNumber?: string;
|
|
48
|
+
localCallerIdName?: string;
|
|
49
|
+
localCallerIdNumber?: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Custom headers received from the WebRTC INVITE message.
|
|
53
|
+
* These headers are passed during call initiation and can contain application-specific information.
|
|
54
|
+
* Format should be [{"name": "X-Header-Name", "value": "Value"}] where header names must start with "X-".
|
|
55
|
+
*/
|
|
56
|
+
inviteCustomHeaders: { name: string; value: string }[] | null;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Custom headers received from the WebRTC ANSWER message.
|
|
60
|
+
* These headers are passed during call acceptance and can contain application-specific information.
|
|
61
|
+
* Format should be [{"name": "X-Header-Name", "value": "Value"}] where header names must start with "X-".
|
|
62
|
+
*/
|
|
63
|
+
answerCustomHeaders: { name: string; value: string }[] | null;
|
|
64
|
+
|
|
65
|
+
constructor(options: any);
|
|
66
|
+
|
|
67
|
+
answer(customHeaders?: { name: string; value: string }[]): Promise<void>;
|
|
68
|
+
hangup(customHeaders?: { name: string; value: string }[]): Promise<void>;
|
|
69
|
+
hold(): Promise<void>;
|
|
70
|
+
unhold(): Promise<void>;
|
|
71
|
+
mute(): Promise<void>;
|
|
72
|
+
unmute(): Promise<void>;
|
|
73
|
+
dtmf(digits: string): Promise<void>;
|
|
74
|
+
|
|
75
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
76
|
+
off(event: string, listener: (...args: any[]) => void): this;
|
|
77
|
+
emit(event: string, ...args: any[]): boolean;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export class TelnyxRTC extends EventEmitter {
|
|
81
|
+
constructor(options: ClientOptions);
|
|
82
|
+
|
|
83
|
+
connect(): Promise<void>;
|
|
84
|
+
disconnect(): void;
|
|
85
|
+
newCall(options: CallOptions): Promise<Call>;
|
|
86
|
+
|
|
87
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
88
|
+
off(event: string, listener: (...args: any[]) => void): this;
|
|
89
|
+
emit(event: string, ...args: any[]): boolean;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { TelnyxRTC as default };
|
|
93
|
+
}
|