@telnyx/react-voice-commons-sdk 0.1.1 → 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 (66) hide show
  1. package/README.md +483 -0
  2. package/ios/README.md +211 -211
  3. package/lib/callkit/callkit-coordinator.d.ts +117 -113
  4. package/lib/callkit/callkit-coordinator.js +727 -681
  5. package/lib/callkit/callkit.d.ts +41 -41
  6. package/lib/callkit/callkit.js +242 -252
  7. package/lib/callkit/index.js +47 -15
  8. package/lib/callkit/use-callkit-coordinator.d.ts +21 -21
  9. package/lib/callkit/use-callkit-coordinator.js +53 -53
  10. package/lib/callkit/use-callkit.d.ts +19 -19
  11. package/lib/callkit/use-callkit.js +310 -270
  12. package/lib/context/TelnyxVoiceContext.d.ts +9 -9
  13. package/lib/context/TelnyxVoiceContext.js +13 -10
  14. package/lib/hooks/use-callkit-coordinator.d.ts +17 -9
  15. package/lib/hooks/use-callkit-coordinator.js +50 -45
  16. package/lib/hooks/useAppReadyNotifier.js +15 -13
  17. package/lib/hooks/useAppStateHandler.d.ts +11 -6
  18. package/lib/hooks/useAppStateHandler.js +110 -95
  19. package/lib/index.d.ts +21 -3
  20. package/lib/index.js +201 -50
  21. package/lib/internal/CallKitHandler.d.ts +6 -6
  22. package/lib/internal/CallKitHandler.js +104 -96
  23. package/lib/internal/callkit-manager.d.ts +57 -57
  24. package/lib/internal/callkit-manager.js +316 -299
  25. package/lib/internal/calls/call-state-controller.d.ts +86 -81
  26. package/lib/internal/calls/call-state-controller.js +307 -269
  27. package/lib/internal/session/session-manager.d.ts +75 -75
  28. package/lib/internal/session/session-manager.js +424 -350
  29. package/lib/internal/user-defaults-helpers.js +39 -49
  30. package/lib/internal/voice-pn-bridge.d.ts +11 -11
  31. package/lib/internal/voice-pn-bridge.js +3 -3
  32. package/lib/models/call-state.d.ts +44 -44
  33. package/lib/models/call-state.js +68 -66
  34. package/lib/models/call.d.ts +133 -133
  35. package/lib/models/call.js +382 -354
  36. package/lib/models/config.d.ts +18 -11
  37. package/lib/models/config.js +35 -37
  38. package/lib/models/connection-state.d.ts +10 -10
  39. package/lib/models/connection-state.js +16 -16
  40. package/lib/telnyx-voice-app.d.ts +28 -28
  41. package/lib/telnyx-voice-app.js +482 -424
  42. package/lib/telnyx-voip-client.d.ts +167 -165
  43. package/lib/telnyx-voip-client.js +390 -383
  44. package/package.json +104 -104
  45. package/src/callkit/callkit-coordinator.ts +846 -846
  46. package/src/callkit/callkit.ts +322 -322
  47. package/src/callkit/index.ts +4 -4
  48. package/src/callkit/use-callkit.ts +345 -345
  49. package/src/context/TelnyxVoiceContext.tsx +33 -33
  50. package/src/hooks/use-callkit-coordinator.ts +60 -60
  51. package/src/hooks/useAppReadyNotifier.ts +25 -25
  52. package/src/hooks/useAppStateHandler.ts +134 -134
  53. package/src/index.ts +56 -56
  54. package/src/internal/CallKitHandler.tsx +149 -149
  55. package/src/internal/callkit-manager.ts +335 -335
  56. package/src/internal/calls/call-state-controller.ts +384 -384
  57. package/src/internal/session/session-manager.ts +467 -467
  58. package/src/internal/user-defaults-helpers.ts +58 -58
  59. package/src/internal/voice-pn-bridge.ts +18 -18
  60. package/src/models/call-state.ts +98 -98
  61. package/src/models/call.ts +388 -388
  62. package/src/models/config.ts +125 -125
  63. package/src/models/connection-state.ts +50 -50
  64. package/src/telnyx-voice-app.tsx +690 -690
  65. package/src/telnyx-voip-client.ts +539 -539
  66. package/src/types/telnyx-sdk.d.ts +79 -79
@@ -1,79 +1,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
- constructor(options: any);
52
-
53
- answer(): Promise<void>;
54
- hangup(): Promise<void>;
55
- hold(): Promise<void>;
56
- unhold(): Promise<void>;
57
- mute(): Promise<void>;
58
- unmute(): Promise<void>;
59
- dtmf(digits: string): Promise<void>;
60
-
61
- on(event: string, listener: (...args: any[]) => void): this;
62
- off(event: string, listener: (...args: any[]) => void): this;
63
- emit(event: string, ...args: any[]): boolean;
64
- }
65
-
66
- export class TelnyxRTC extends EventEmitter {
67
- constructor(options: ClientOptions);
68
-
69
- connect(): Promise<void>;
70
- disconnect(): void;
71
- newCall(options: CallOptions): Promise<Call>;
72
-
73
- on(event: string, listener: (...args: any[]) => void): this;
74
- off(event: string, listener: (...args: any[]) => void): this;
75
- emit(event: string, ...args: any[]): boolean;
76
- }
77
-
78
- export { TelnyxRTC as default };
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
+ constructor(options: any);
52
+
53
+ answer(): Promise<void>;
54
+ hangup(): Promise<void>;
55
+ hold(): Promise<void>;
56
+ unhold(): Promise<void>;
57
+ mute(): Promise<void>;
58
+ unmute(): Promise<void>;
59
+ dtmf(digits: string): Promise<void>;
60
+
61
+ on(event: string, listener: (...args: any[]) => void): this;
62
+ off(event: string, listener: (...args: any[]) => void): this;
63
+ emit(event: string, ...args: any[]): boolean;
64
+ }
65
+
66
+ export class TelnyxRTC extends EventEmitter {
67
+ constructor(options: ClientOptions);
68
+
69
+ connect(): Promise<void>;
70
+ disconnect(): void;
71
+ newCall(options: CallOptions): Promise<Call>;
72
+
73
+ on(event: string, listener: (...args: any[]) => void): this;
74
+ off(event: string, listener: (...args: any[]) => void): this;
75
+ emit(event: string, ...args: any[]): boolean;
76
+ }
77
+
78
+ export { TelnyxRTC as default };
79
+ }