@telnyx/react-voice-commons-sdk 0.1.4 → 0.1.5

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 (56) hide show
  1. package/CHANGELOG.md +19 -16
  2. package/README.md +469 -469
  3. package/TelnyxVoiceCommons.podspec +31 -31
  4. package/ios/CallKitBridge.m +43 -43
  5. package/ios/CallKitBridge.swift +874 -874
  6. package/ios/VoicePnBridge.m +30 -30
  7. package/ios/VoicePnBridge.swift +86 -86
  8. package/lib/callkit/callkit-coordinator.d.ts +114 -110
  9. package/lib/callkit/callkit-coordinator.js +706 -664
  10. package/lib/callkit/callkit.d.ts +41 -41
  11. package/lib/callkit/callkit.js +242 -252
  12. package/lib/callkit/index.js +47 -15
  13. package/lib/callkit/use-callkit.d.ts +19 -19
  14. package/lib/callkit/use-callkit.js +310 -270
  15. package/lib/context/TelnyxVoiceContext.d.ts +9 -9
  16. package/lib/context/TelnyxVoiceContext.js +13 -10
  17. package/lib/hooks/use-callkit-coordinator.d.ts +17 -9
  18. package/lib/hooks/use-callkit-coordinator.js +50 -45
  19. package/lib/hooks/useAppReadyNotifier.js +15 -13
  20. package/lib/hooks/useAppStateHandler.d.ts +11 -6
  21. package/lib/hooks/useAppStateHandler.js +110 -95
  22. package/lib/index.d.ts +21 -3
  23. package/lib/index.js +201 -50
  24. package/lib/internal/CallKitHandler.d.ts +6 -6
  25. package/lib/internal/CallKitHandler.js +104 -96
  26. package/lib/internal/callkit-manager.d.ts +57 -57
  27. package/lib/internal/callkit-manager.js +316 -299
  28. package/lib/internal/calls/call-state-controller.d.ts +78 -73
  29. package/lib/internal/calls/call-state-controller.js +326 -265
  30. package/lib/internal/session/session-manager.d.ts +71 -71
  31. package/lib/internal/session/session-manager.js +437 -360
  32. package/lib/internal/user-defaults-helpers.js +39 -49
  33. package/lib/internal/voice-pn-bridge.d.ts +112 -104
  34. package/lib/internal/voice-pn-bridge.js +193 -203
  35. package/lib/models/call-state.d.ts +46 -46
  36. package/lib/models/call-state.js +74 -70
  37. package/lib/models/call.d.ts +173 -157
  38. package/lib/models/call.js +492 -448
  39. package/lib/models/config.d.ts +18 -11
  40. package/lib/models/config.js +35 -37
  41. package/lib/models/connection-state.d.ts +10 -10
  42. package/lib/models/connection-state.js +16 -16
  43. package/lib/telnyx-voice-app.d.ts +28 -28
  44. package/lib/telnyx-voice-app.js +561 -509
  45. package/lib/telnyx-voip-client.d.ts +174 -167
  46. package/lib/telnyx-voip-client.js +397 -385
  47. package/package.json +115 -115
  48. package/src/callkit/callkit-coordinator.ts +830 -830
  49. package/src/internal/calls/call-state-controller.ts +407 -407
  50. package/src/internal/session/session-manager.ts +483 -483
  51. package/src/internal/voice-pn-bridge.ts +266 -266
  52. package/src/models/call-state.ts +105 -105
  53. package/src/models/call.ts +502 -502
  54. package/src/telnyx-voice-app.tsx +787 -788
  55. package/src/telnyx-voip-client.ts +551 -551
  56. package/src/types/telnyx-sdk.d.ts +93 -93
@@ -1,93 +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
- * 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
- }
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
+ }