@cloudflare/realtimekit-react-native 0.1.4-staging.1 → 0.1.4-staging.10

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 (92) hide show
  1. package/lib/commonjs/AudioSampleHandler.js +61 -0
  2. package/lib/commonjs/AudioSampleHandler.js.map +1 -0
  3. package/lib/commonjs/BackgroundHandler.js +109 -0
  4. package/lib/commonjs/BackgroundHandler.js.map +1 -0
  5. package/lib/commonjs/DeviceInfo.js +37 -0
  6. package/lib/commonjs/DeviceInfo.js.map +1 -0
  7. package/lib/commonjs/LocalMediaError.js +18 -0
  8. package/lib/commonjs/LocalMediaError.js.map +1 -0
  9. package/lib/commonjs/LocalMediaHandler.js +791 -0
  10. package/lib/commonjs/LocalMediaHandler.js.map +1 -0
  11. package/lib/commonjs/LocalMediaInterfaces.js +2 -0
  12. package/lib/commonjs/LocalMediaInterfaces.js.map +1 -0
  13. package/lib/commonjs/LocalMediaUtils.js +298 -0
  14. package/lib/commonjs/LocalMediaUtils.js.map +1 -0
  15. package/lib/commonjs/NativeAudioManager.js +72 -0
  16. package/lib/commonjs/NativeAudioManager.js.map +1 -0
  17. package/lib/commonjs/PermissionHandler.js +157 -0
  18. package/lib/commonjs/PermissionHandler.js.map +1 -0
  19. package/lib/commonjs/ReactContext.js +116 -0
  20. package/lib/commonjs/ReactContext.js.map +1 -0
  21. package/lib/commonjs/ReactHooks.js +99 -0
  22. package/lib/commonjs/ReactHooks.js.map +1 -0
  23. package/lib/commonjs/index.js +95 -0
  24. package/lib/commonjs/index.js.map +1 -0
  25. package/lib/commonjs/utils/constants.js +7 -0
  26. package/lib/commonjs/utils/constants.js.map +1 -0
  27. package/lib/commonjs/utils/crypto.js +76 -0
  28. package/lib/commonjs/utils/crypto.js.map +1 -0
  29. package/lib/commonjs/utils/version.js +8 -0
  30. package/lib/commonjs/utils/version.js.map +1 -0
  31. package/lib/module/AudioSampleHandler.js +54 -0
  32. package/lib/module/AudioSampleHandler.js.map +1 -0
  33. package/lib/module/BackgroundHandler.js +103 -0
  34. package/lib/module/BackgroundHandler.js.map +1 -0
  35. package/lib/module/DeviceInfo.js +31 -0
  36. package/lib/module/DeviceInfo.js.map +1 -0
  37. package/lib/module/LocalMediaError.js +11 -0
  38. package/lib/module/LocalMediaError.js.map +1 -0
  39. package/lib/module/LocalMediaHandler.js +784 -0
  40. package/lib/module/LocalMediaHandler.js.map +1 -0
  41. package/lib/module/LocalMediaInterfaces.js +2 -0
  42. package/lib/module/LocalMediaInterfaces.js.map +1 -0
  43. package/lib/module/LocalMediaUtils.js +290 -0
  44. package/lib/module/LocalMediaUtils.js.map +1 -0
  45. package/lib/module/NativeAudioManager.js +65 -0
  46. package/lib/module/NativeAudioManager.js.map +1 -0
  47. package/lib/module/PermissionHandler.js +149 -0
  48. package/lib/module/PermissionHandler.js.map +1 -0
  49. package/lib/module/ReactContext.js +107 -0
  50. package/lib/module/ReactContext.js.map +1 -0
  51. package/lib/module/ReactHooks.js +75 -0
  52. package/lib/module/ReactHooks.js.map +1 -0
  53. package/lib/{src → module}/index.js +32 -32
  54. package/lib/module/index.js.map +1 -0
  55. package/lib/module/utils/constants.js +5 -0
  56. package/lib/module/utils/constants.js.map +1 -0
  57. package/lib/module/utils/crypto.js +74 -0
  58. package/lib/module/utils/crypto.js.map +1 -0
  59. package/lib/module/utils/version.js +2 -0
  60. package/lib/module/utils/version.js.map +1 -0
  61. package/lib/{src → typescript}/LocalMediaHandler.d.ts +0 -4
  62. package/lib/{src → typescript}/ReactHooks.d.ts +2 -2
  63. package/lib/typescript/utils/constants.d.ts +1 -0
  64. package/lib/typescript/utils/version.d.ts +1 -0
  65. package/package.json +5 -4
  66. package/plugin/build/withRTK.js +43 -17
  67. package/plugin/src/withRTK.ts +55 -25
  68. package/android/src/main/res/values/strings.xml +0 -3
  69. package/lib/package.json +0 -168
  70. package/lib/src/AudioSampleHandler.js +0 -57
  71. package/lib/src/BackgroundHandler.js +0 -100
  72. package/lib/src/DeviceInfo.js +0 -27
  73. package/lib/src/LocalMediaError.js +0 -6
  74. package/lib/src/LocalMediaHandler.js +0 -860
  75. package/lib/src/LocalMediaInterfaces.js +0 -1
  76. package/lib/src/LocalMediaUtils.js +0 -288
  77. package/lib/src/NativeAudioManager.js +0 -93
  78. package/lib/src/PermissionHandler.js +0 -179
  79. package/lib/src/ReactContext.js +0 -90
  80. package/lib/src/ReactHooks.js +0 -80
  81. package/lib/src/utils/crypto.js +0 -82
  82. /package/lib/{src → typescript}/AudioSampleHandler.d.ts +0 -0
  83. /package/lib/{src → typescript}/BackgroundHandler.d.ts +0 -0
  84. /package/lib/{src → typescript}/DeviceInfo.d.ts +0 -0
  85. /package/lib/{src → typescript}/LocalMediaError.d.ts +0 -0
  86. /package/lib/{src → typescript}/LocalMediaInterfaces.d.ts +0 -0
  87. /package/lib/{src → typescript}/LocalMediaUtils.d.ts +0 -0
  88. /package/lib/{src → typescript}/NativeAudioManager.d.ts +0 -0
  89. /package/lib/{src → typescript}/PermissionHandler.d.ts +0 -0
  90. /package/lib/{src → typescript}/ReactContext.d.ts +0 -0
  91. /package/lib/{src → typescript}/index.d.ts +0 -0
  92. /package/lib/{src → typescript}/utils/crypto.d.ts +0 -0
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+
3
+ const base64Decode = require('fast-base64-decode');
4
+ const {
5
+ NativeModules
6
+ } = require('react-native');
7
+ class TypeMismatchError extends Error {}
8
+ class QuotaExceededError extends Error {}
9
+ let warned = false;
10
+ function insecureRandomValues(array) {
11
+ if (!warned) {
12
+ console.warn('Using an insecure random number generator, this should only happen when running in a debugger without support for crypto.getRandomValues');
13
+ warned = true;
14
+ }
15
+ for (let i = 0, r; i < array.length; i++) {
16
+ if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
17
+ array[i] = r >>> ((i & 0x03) << 3) & 0xff;
18
+ }
19
+ return array;
20
+ }
21
+
22
+ /**
23
+ * @param {number} byteLength
24
+ * @returns {string}
25
+ */
26
+ function getRandomBase64(byteLength) {
27
+ if (NativeModules.Core) {
28
+ return NativeModules.Core.getRandomBase64(byteLength);
29
+ } else if (NativeModules.ExpoRandom) {
30
+ // Expo SDK 41-44
31
+ return NativeModules.ExpoRandom.getRandomBase64String(byteLength);
32
+ } else if (global.ExpoModules) {
33
+ // Expo SDK 45+
34
+ return global.ExpoModules.ExpoRandom.getRandomBase64String(byteLength);
35
+ } else {
36
+ throw new Error('Native module not found');
37
+ }
38
+ }
39
+
40
+ /**
41
+ * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Uint8ClampedArray} array
42
+ */
43
+ function getRandomValues(array) {
44
+ if (!(array instanceof Int8Array || array instanceof Uint8Array || array instanceof Int16Array || array instanceof Uint16Array || array instanceof Int32Array || array instanceof Uint32Array || array instanceof Uint8ClampedArray)) {
45
+ throw new TypeMismatchError('Expected an integer array');
46
+ }
47
+ if (array.byteLength > 65536) {
48
+ throw new QuotaExceededError('Can only request a maximum of 65536 bytes');
49
+ }
50
+
51
+ // Expo SDK 48+
52
+ if (global.expo && global.expo.modules && global.expo.modules.ExpoCrypto && global.expo.modules.ExpoCrypto.getRandomValues) {
53
+ // ExpoCrypto.getRandomValues doesn't return the array
54
+ global.expo.modules.ExpoCrypto.getRandomValues(array);
55
+ return array;
56
+ }
57
+
58
+ // Calling getRandomBase64 in debug mode leads to the error
59
+ // "Calling synchronous methods on native modules is not supported in Chrome".
60
+ // So in that specific case we fall back to just using Math.random.
61
+ if (__DEV__) {
62
+ if (typeof global.nativeCallSyncHook === 'undefined') {
63
+ return insecureRandomValues(array);
64
+ }
65
+ }
66
+ base64Decode(getRandomBase64(array.byteLength), new Uint8Array(array.buffer, array.byteOffset, array.byteLength));
67
+ return array;
68
+ }
69
+ if (typeof global.crypto !== 'object') {
70
+ // @ts-ignore
71
+ global.crypto = {};
72
+ }
73
+ if (typeof global.crypto.getRandomValues !== 'function') {
74
+ global.crypto.getRandomValues = getRandomValues;
75
+ }
76
+ //# sourceMappingURL=crypto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["base64Decode","require","NativeModules","TypeMismatchError","Error","QuotaExceededError","warned","insecureRandomValues","array","console","warn","i","r","length","Math","random","getRandomBase64","byteLength","Core","ExpoRandom","getRandomBase64String","global","ExpoModules","getRandomValues","Int8Array","Uint8Array","Int16Array","Uint16Array","Int32Array","Uint32Array","Uint8ClampedArray","expo","modules","ExpoCrypto","__DEV__","nativeCallSyncHook","buffer","byteOffset","crypto"],"sources":["crypto.ts"],"sourcesContent":["const base64Decode = require('fast-base64-decode');\nconst { NativeModules } = require('react-native');\n\nclass TypeMismatchError extends Error {}\nclass QuotaExceededError extends Error {}\n\nlet warned = false;\nfunction insecureRandomValues(array) {\n if (!warned) {\n console.warn(\n 'Using an insecure random number generator, this should only happen when running in a debugger without support for crypto.getRandomValues'\n );\n warned = true;\n }\n\n for (let i = 0, r; i < array.length; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n array[i] = (r >>> ((i & 0x03) << 3)) & 0xff;\n }\n\n return array;\n}\n\n/**\n * @param {number} byteLength\n * @returns {string}\n */\nfunction getRandomBase64(byteLength) {\n if (NativeModules.Core) {\n return NativeModules.Core.getRandomBase64(byteLength);\n } else if (NativeModules.ExpoRandom) {\n // Expo SDK 41-44\n return NativeModules.ExpoRandom.getRandomBase64String(byteLength);\n } else if (global.ExpoModules) {\n // Expo SDK 45+\n return global.ExpoModules.ExpoRandom.getRandomBase64String(byteLength);\n } else {\n throw new Error('Native module not found');\n }\n}\n\n/**\n * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Uint8ClampedArray} array\n */\nfunction getRandomValues(array) {\n if (\n !(\n array instanceof Int8Array ||\n array instanceof Uint8Array ||\n array instanceof Int16Array ||\n array instanceof Uint16Array ||\n array instanceof Int32Array ||\n array instanceof Uint32Array ||\n array instanceof Uint8ClampedArray\n )\n ) {\n throw new TypeMismatchError('Expected an integer array');\n }\n\n if (array.byteLength > 65536) {\n throw new QuotaExceededError('Can only request a maximum of 65536 bytes');\n }\n\n // Expo SDK 48+\n if (\n global.expo &&\n global.expo.modules &&\n global.expo.modules.ExpoCrypto &&\n global.expo.modules.ExpoCrypto.getRandomValues\n ) {\n // ExpoCrypto.getRandomValues doesn't return the array\n global.expo.modules.ExpoCrypto.getRandomValues(array);\n return array;\n }\n\n // Calling getRandomBase64 in debug mode leads to the error\n // \"Calling synchronous methods on native modules is not supported in Chrome\".\n // So in that specific case we fall back to just using Math.random.\n if (__DEV__) {\n if (typeof global.nativeCallSyncHook === 'undefined') {\n return insecureRandomValues(array);\n }\n }\n\n base64Decode(\n getRandomBase64(array.byteLength),\n new Uint8Array(array.buffer, array.byteOffset, array.byteLength)\n );\n\n return array;\n}\n\nif (typeof global.crypto !== 'object') {\n // @ts-ignore\n global.crypto = {};\n}\n\nif (typeof global.crypto.getRandomValues !== 'function') {\n global.crypto.getRandomValues = getRandomValues;\n}\n"],"mappings":";;AAAA,MAAMA,YAAY,GAAGC,OAAO,CAAC,oBAAoB,CAAC;AAClD,MAAM;EAAEC;AAAc,CAAC,GAAGD,OAAO,CAAC,cAAc,CAAC;AAEjD,MAAME,iBAAiB,SAASC,KAAK,CAAC;AACtC,MAAMC,kBAAkB,SAASD,KAAK,CAAC;AAEvC,IAAIE,MAAM,GAAG,KAAK;AAClB,SAASC,oBAAoBA,CAACC,KAAK,EAAE;EACnC,IAAI,CAACF,MAAM,EAAE;IACXG,OAAO,CAACC,IAAI,CACV,0IACF,CAAC;IACDJ,MAAM,GAAG,IAAI;EACf;EAEA,KAAK,IAAIK,CAAC,GAAG,CAAC,EAAEC,CAAC,EAAED,CAAC,GAAGH,KAAK,CAACK,MAAM,EAAEF,CAAC,EAAE,EAAE;IACxC,IAAI,CAACA,CAAC,GAAG,IAAI,MAAM,CAAC,EAAEC,CAAC,GAAGE,IAAI,CAACC,MAAM,CAAC,CAAC,GAAG,WAAW;IACrDP,KAAK,CAACG,CAAC,CAAC,GA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IACA;IACAF,MAAM,CAACU,IAAI,CAACC,OAAO,CAACC,UAAU,CAACV,eAAe,CAACf,KAAK,CAAC;IACrD,OAAOA,KAAK;EACd;;EAEA;EACA;EACA;EACA,IAAI0B,OAAO,EAAE;IACX,IAAI,OAAOb,MAAM,CAACc,kBAAkB,KAAK,WAAW,EAAE;MACpD,OAAO5B,oBAAoB,CAACC,KAAK,CAAC;IACpC;EACF;EAEAR,YAAY,CACVgB,eAAe,CAACR,KAAK,CAACS,UAAU,CAAC,EACjC,IAAIQ,UAAU,CAACjB,KAAK,CAAC4B,MAAM,EAAE5B,KAAK,CAAC6B,UAAU,EAAE7B,KAAK,CAACS,UAAU,CACjE,CAAC;EAED,OAAOT,KAAK;AACd;AAEA,IAAI,OAAOa,MAAM,CAACiB,MAAM,KAAK,QAAQ,EAAE;EACrC;EACAjB,MAAM,CAACiB,MAAM,GAAG,CAAC,CAAC;AACpB;AAEA,IAAI,OAAOjB,MAAM,CAACiB,MAAM,CAACf,eAAe,KAAK,UAAU,EAAE;EACvDF,MAAM,CAACiB,MAAM,CAACf,eAAe,GAAGA,eAAe;AACjD","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SDK_VERSION = void 0;
7
+ const SDK_VERSION = exports.SDK_VERSION = '0.1.4-staging.10';
8
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SDK_VERSION","exports"],"sources":["version.ts"],"sourcesContent":["export const SDK_VERSION = '0.1.4-staging.10';\n"],"mappings":";;;;;;AAAO,MAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,kBAAkB","ignoreList":[]}
@@ -0,0 +1,54 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
+ import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
5
+ import { EventEmitter } from 'events';
6
+ const {
7
+ WebRTCModule
8
+ } = NativeModules;
9
+ export default class AudioSampleHandler extends EventEmitter {
10
+ constructor() {
11
+ super();
12
+ _defineProperty(this, "webRTCModuleEmitter", void 0);
13
+ _defineProperty(this, "_audioSamplesListener", void 0);
14
+ _defineProperty(this, "_isListening", false);
15
+ _defineProperty(this, "_currentSamples", void 0);
16
+ this.webRTCModuleEmitter = new NativeEventEmitter(WebRTCModule);
17
+ this._audioSampleHandler = this._audioSampleHandler.bind(this);
18
+ this._currentSamples = new Float32Array(1024);
19
+ this.initialiseSampler();
20
+ }
21
+ static async init() {
22
+ return new AudioSampleHandler();
23
+ }
24
+ _audioSampleHandler(audioData) {
25
+ this._currentSamples.fill(0);
26
+ if (Platform.OS === 'android') {
27
+ this._currentSamples.set(audioData);
28
+ } else {
29
+ this._currentSamples.set(audioData.samples);
30
+ }
31
+ }
32
+ initialiseSampler() {
33
+ this._audioSamplesListener = this.webRTCModuleEmitter.addListener('audioSamples', this._audioSampleHandler);
34
+ this._isListening = true;
35
+ }
36
+ getFloatTimeDomainData(samples) {
37
+ if (!this._isListening) {
38
+ this.initialiseSampler();
39
+ }
40
+ samples.set(this._currentSamples);
41
+ }
42
+ stopListening() {
43
+ if (this._audioSamplesListener) {
44
+ this._audioSamplesListener.remove();
45
+ this._audioSamplesListener = undefined;
46
+ this._isListening = false;
47
+ this._currentSamples.fill(0);
48
+ }
49
+ }
50
+ destructor() {
51
+ this.stopListening();
52
+ }
53
+ }
54
+ //# sourceMappingURL=AudioSampleHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","Platform","EventEmitter","WebRTCModule","AudioSampleHandler","constructor","_defineProperty","webRTCModuleEmitter","_audioSampleHandler","bind","_currentSamples","Float32Array","initialiseSampler","init","audioData","fill","OS","set","samples","_audioSamplesListener","addListener","_isListening","getFloatTimeDomainData","stopListening","remove","undefined","destructor"],"sources":["AudioSampleHandler.ts"],"sourcesContent":["import {\n NativeEventEmitter,\n NativeEventSubscription,\n NativeModules,\n Platform,\n} from 'react-native';\nimport { EventEmitter } from 'events';\n\nconst { WebRTCModule } = NativeModules;\n\nexport default class AudioSampleHandler extends EventEmitter {\n private webRTCModuleEmitter: NativeEventEmitter;\n private _audioSamplesListener?: NativeEventSubscription;\n private _isListening = false;\n private _currentSamples: Float32Array;\n\n constructor() {\n super();\n this.webRTCModuleEmitter = new NativeEventEmitter(WebRTCModule);\n this._audioSampleHandler = this._audioSampleHandler.bind(this);\n this._currentSamples = new Float32Array(1024);\n this.initialiseSampler();\n }\n\n public static async init() {\n return new AudioSampleHandler();\n }\n\n private _audioSampleHandler(audioData: any) {\n this._currentSamples.fill(0);\n if (Platform.OS === 'android') {\n this._currentSamples.set(audioData);\n } else {\n this._currentSamples.set(audioData.samples);\n }\n }\n\n private initialiseSampler() {\n this._audioSamplesListener = this.webRTCModuleEmitter.addListener(\n 'audioSamples',\n this._audioSampleHandler\n );\n this._isListening = true;\n }\n\n public getFloatTimeDomainData(samples: Float32Array) {\n if (!this._isListening) {\n this.initialiseSampler();\n }\n samples.set(this._currentSamples);\n }\n\n public stopListening() {\n if (this._audioSamplesListener) {\n this._audioSamplesListener.remove();\n this._audioSamplesListener = undefined;\n this._isListening = false;\n this._currentSamples.fill(0);\n }\n }\n\n public destructor() {\n this.stopListening();\n }\n}\n"],"mappings":";;;AAAA,SACEA,kBAAkB,EAElBC,aAAa,EACbC,QAAQ,QACH,cAAc;AACrB,SAASC,YAAY,QAAQ,QAAQ;AAErC,MAAM;EAAEC;AAAa,CAAC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BAAqB,EAAE;MAC9B,IAAI,CAACA,qBAAqB,CAACK,MAAM,CAAC,CAAC;MACnC,IAAI,CAACL,qBAAqB,GAAGM,SAAS;MACtC,IAAI,CAACJ,YAAY,GAAG,KAAK;MACzB,IAAI,CAACX,eAAe,CAACK,IAAI,CAAC,CAAC,CAAC;IAC9B;EACF;EAEOW,UAAUA,CAAA,EAAG;IAClB,IAAI,CAACH,aAAa,CAAC,CAAC;EACtB;AACF","ignoreList":[]}
@@ -0,0 +1,103 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
+ import { DeviceEventEmitter, NativeAppEventEmitter, NativeEventEmitter, NativeModules, Platform } from 'react-native';
5
+ const {
6
+ RTKRNBackgroundTimer
7
+ } = NativeModules;
8
+ const Emitter = new NativeEventEmitter(RTKRNBackgroundTimer);
9
+ class BackgroundTimer {
10
+ constructor() {
11
+ _defineProperty(this, "uniqueId", void 0);
12
+ _defineProperty(this, "callbacks", void 0);
13
+ _defineProperty(this, "backgroundTimer", void 0);
14
+ _defineProperty(this, "backgroundListener", void 0);
15
+ this.uniqueId = 0;
16
+ this.callbacks = {};
17
+ Emitter.addListener('backgroundTimer.timeout', id => {
18
+ if (this.callbacks[id]) {
19
+ const callbackById = this.callbacks[id];
20
+ const {
21
+ callback
22
+ } = callbackById;
23
+ if (!this.callbacks[id].interval) {
24
+ delete this.callbacks[id];
25
+ } else {
26
+ Platform.OS === 'android' ? RTKRNBackgroundTimer.backgroundTimerSetTimeout(id, this.callbacks[id].timeout) : RTKRNBackgroundTimer.setTimeout(id, this.callbacks[id].timeout);
27
+ }
28
+ callback();
29
+ }
30
+ });
31
+ }
32
+ init() {
33
+ return new BackgroundTimer();
34
+ }
35
+
36
+ // Original API
37
+ start(delay = 0) {
38
+ return Platform.OS === 'android' ? RTKRNBackgroundTimer.backgroundTimerStart(delay) : RTKRNBackgroundTimer.start(delay);
39
+ }
40
+ stop() {
41
+ Emitter.removeAllListeners('backgroundTimer.timeout');
42
+ return Platform.OS === 'android' ? RTKRNBackgroundTimer.backgroundTimerStop() : RTKRNBackgroundTimer.stop();
43
+ }
44
+ runBackgroundTimer(callback, delay) {
45
+ const EventEmitter = Platform.select({
46
+ ios: () => NativeAppEventEmitter,
47
+ android: () => DeviceEventEmitter
48
+ })();
49
+ this.start(0);
50
+ this.backgroundListener = EventEmitter.addListener('backgroundTimer', () => {
51
+ this.backgroundListener.remove();
52
+ this.backgroundClockMethod(callback, delay);
53
+ });
54
+ }
55
+ backgroundClockMethod(callback, delay) {
56
+ this.backgroundTimer = this.setTimeout(() => {
57
+ callback();
58
+ this.backgroundClockMethod(callback, delay);
59
+ }, delay);
60
+ }
61
+ stopBackgroundTimer() {
62
+ this.stop();
63
+ this.clearTimeout(this.backgroundTimer);
64
+ }
65
+
66
+ // New API, allowing for multiple timers
67
+ setTimeout(callback, timeout) {
68
+ this.uniqueId += 1;
69
+ const timeoutId = this.uniqueId;
70
+ this.callbacks[timeoutId] = {
71
+ callback,
72
+ interval: false,
73
+ timeout
74
+ };
75
+ Platform.OS === 'android' ? RTKRNBackgroundTimer.backgroundTimerSetTimeout(timeoutId, timeout) : RTKRNBackgroundTimer.setTimeout(timeoutId, timeout);
76
+ return timeoutId;
77
+ }
78
+ clearTimeout(timeoutId) {
79
+ if (this.callbacks[timeoutId]) {
80
+ delete this.callbacks[timeoutId];
81
+ // RTKRNBackgroundTimer.clearTimeout(timeoutId);
82
+ }
83
+ }
84
+ setInterval(callback, timeout) {
85
+ this.uniqueId += 1;
86
+ const intervalId = this.uniqueId;
87
+ this.callbacks[intervalId] = {
88
+ callback,
89
+ interval: true,
90
+ timeout
91
+ };
92
+ Platform.OS === 'android' ? RTKRNBackgroundTimer.backgroundTimerSetTimeout(intervalId, timeout) : RTKRNBackgroundTimer.setTimeout(intervalId, timeout);
93
+ return intervalId;
94
+ }
95
+ clearInterval(intervalId) {
96
+ if (this.callbacks[intervalId]) {
97
+ delete this.callbacks[intervalId];
98
+ // RTKRNBackgroundTimer.clearTimeout(intervalId);
99
+ }
100
+ }
101
+ }
102
+ export default new BackgroundTimer();
103
+ //# sourceMappingURL=BackgroundHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DeviceEventEmitter","NativeAppEventEmitter","NativeEventEmitter","NativeModules","Platform","RTKRNBackgroundTimer","Emitter","BackgroundTimer","constructor","_defineProperty","uniqueId","callbacks","addListener","id","callbackById","callback","interval","OS","backgroundTimerSetTimeout","timeout","setTimeout","init","start","delay","backgroundTimerStart","stop","removeAllListeners","backgroundTimerStop","runBackgroundTimer","EventEmitter","select","ios","android","backgroundListener","remove","backgroundClockMethod","backgroundTimer","stopBackgroundTimer","clearTimeout","timeoutId","setInterval","intervalId","clearInterval"],"sources":["BackgroundHandler.ts"],"sourcesContent":["import {\n DeviceEventEmitter,\n NativeAppEventEmitter,\n NativeEventEmitter,\n NativeModules,\n Platform,\n} from 'react-native';\n\nconst { RTKRNBackgroundTimer } = NativeModules;\nconst Emitter = new NativeEventEmitter(RTKRNBackgroundTimer);\n\nclass BackgroundTimer {\n uniqueId: number;\n\n callbacks: { [key: string]: any };\n\n backgroundTimer: number | NodeJS.Timeout | null;\n\n backgroundListener: any;\n\n constructor() {\n this.uniqueId = 0;\n this.callbacks = {};\n\n Emitter.addListener('backgroundTimer.timeout', (id) => {\n if (this.callbacks[id]) {\n const callbackById = this.callbacks[id];\n const { callback } = callbackById;\n if (!this.callbacks[id].interval) {\n delete this.callbacks[id];\n } else {\n Platform.OS === 'android'\n ? RTKRNBackgroundTimer.backgroundTimerSetTimeout(\n id,\n this.callbacks[id].timeout\n )\n : RTKRNBackgroundTimer.setTimeout(id, this.callbacks[id].timeout);\n }\n callback();\n }\n });\n }\n\n init() {\n return new BackgroundTimer();\n }\n\n // Original API\n start(delay = 0) {\n return Platform.OS === 'android'\n ? RTKRNBackgroundTimer.backgroundTimerStart(delay)\n : RTKRNBackgroundTimer.start(delay);\n }\n\n stop() {\n Emitter.removeAllListeners('backgroundTimer.timeout');\n return Platform.OS === 'android'\n ? RTKRNBackgroundTimer.backgroundTimerStop()\n : RTKRNBackgroundTimer.stop();\n }\n\n runBackgroundTimer(callback, delay) {\n const EventEmitter = Platform.select({\n ios: () => NativeAppEventEmitter,\n android: () => DeviceEventEmitter,\n })();\n this.start(0);\n this.backgroundListener = EventEmitter.addListener(\n 'backgroundTimer',\n () => {\n this.backgroundListener.remove();\n this.backgroundClockMethod(callback, delay);\n }\n );\n }\n\n backgroundClockMethod(callback, delay) {\n this.backgroundTimer = this.setTimeout(() => {\n callback();\n this.backgroundClockMethod(callback, delay);\n }, delay);\n }\n\n stopBackgroundTimer() {\n this.stop();\n this.clearTimeout(this.backgroundTimer);\n }\n\n // New API, allowing for multiple timers\n setTimeout(callback, timeout) {\n this.uniqueId += 1;\n const timeoutId = this.uniqueId;\n this.callbacks[timeoutId] = {\n callback,\n interval: false,\n timeout,\n };\n Platform.OS === 'android'\n ? RTKRNBackgroundTimer.backgroundTimerSetTimeout(timeoutId, timeout)\n : RTKRNBackgroundTimer.setTimeout(timeoutId, timeout);\n return timeoutId;\n }\n\n clearTimeout(timeoutId) {\n if (this.callbacks[timeoutId]) {\n delete this.callbacks[timeoutId];\n // RTKRNBackgroundTimer.clearTimeout(timeoutId);\n }\n }\n\n setInterval(callback, timeout) {\n this.uniqueId += 1;\n const intervalId = this.uniqueId;\n this.callbacks[intervalId] = {\n callback,\n interval: true,\n timeout,\n };\n Platform.OS === 'android'\n ? RTKRNBackgroundTimer.backgroundTimerSetTimeout(intervalId, timeout)\n : RTKRNBackgroundTimer.setTimeout(intervalId, timeout);\n return intervalId;\n }\n\n clearInterval(intervalId) {\n if (this.callbacks[intervalId]) {\n delete this.callbacks[intervalId];\n // RTKRNBackgroundTimer.clearTimeout(intervalId);\n }\n }\n}\n\nexport default new BackgroundTimer();\n"],"mappings":";;;AAAA,SACEA,kBAAkB,EAClBC,qBAAqB,EACrBC,kBAAkB,EAClBC,aAAa,EACbC,QAAQ,QACH,cAAc;AAErB,MAAM;EAAEC;AAAqB,CAAC,GAAGF,aAAa;AAC9C,MAAMG,OAAO,GAAG,IAAIJ,kBAAkB,CAACG,oBAAoB,CAAC;AAE5D,MAAME,eAAe,CAAC;EASpBC,WAAWA,CAAA,EAAG;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACZ,IAAI,CAACC,QAAQ,GAAG,CAAC;IACjB,IAAI,CAACC,SAAS,GAAG,CAAC,CAAC;IAEnBL,OAAO,CAACM,WAAW,CAAC,yBAAyB,EAAGC,EAAE,IAAK;MACrD,IAAI,IAAI,CAACF,SAAS,CAACE,EAAE,CAAC,EAAE;QACtB,MAAMC,YAAY,GAAG,IAAI,CAACH,SAAS,CAACE,EAAE,CAAC;QACvC,MAAM;UAAEE;QAAS,CAAC,GAAGD,YAAY;QACjC,IAAI,CAAC,IAAI,CAACH,SAAS,CAACE,EAAE,CAAC,CAACG,QAAQ,EAAE;UAChC,OAAO,IAAI,CAACL,SAAS,CAACE,EAAE,CAAC;QAC3B,CAAC,MAAM;UACLT,QAAQ,CAACa,EAAE,KAAK,SAAS,GACrBZ,oBAAoB,CAACa,yBAAyB,CAC5CL,EAAE,EACF,IAAI,CAACF,SAAS,CAACE,EAAE,CAAC,CAACM,OACrB,CAAC,GACDd,oBAAoB,CAACe,UAAU,CAACP,EAAE,EAAE,IAAI,CAACF,SAAS,CAACE,EAAE,CAAC,CAACM,OAAO,CAAC;QACrE;QACAJ,QAAQ,CAAC,CAAC;MACZ;IACF,C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EAAE;MAC9B,OAAO,IAAI,CAAC9B,SAAS,CAAC8B,UAAU,CAAC;MACjC;IACF;EACF;AACF;AAEA,eAAe,IAAIlC,eAAe,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,31 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
+ import { Platform } from 'react-native';
5
+ import { SDK_VERSION } from './utils/version';
6
+ class DeviceInfo {
7
+ constructor() {
8
+ _defineProperty(this, "deviceInfo", void 0);
9
+ this.deviceInfo = {
10
+ isMobile: true,
11
+ isReactNative: true,
12
+ osName: Platform.OS,
13
+ osVersion: Platform.Version,
14
+ reactNativeVersion: this.getReactNativeVersion(),
15
+ sdkType: 'realtimekit-react-native',
16
+ reactNativeSdkVersion: this.getSdkVersion()
17
+ };
18
+ }
19
+ getSdkVersion() {
20
+ return SDK_VERSION;
21
+ }
22
+ getReactNativeVersion() {
23
+ const version = Platform.constants.reactNativeVersion;
24
+ return version.major + '.' + version.minor + '.' + version.patch;
25
+ }
26
+ getDeviceInfo() {
27
+ return this.deviceInfo;
28
+ }
29
+ }
30
+ export default new DeviceInfo();
31
+ //# sourceMappingURL=DeviceInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Platform","SDK_VERSION","DeviceInfo","constructor","_defineProperty","deviceInfo","isMobile","isReactNative","osName","OS","osVersion","Version","reactNativeVersion","getReactNativeVersion","sdkType","reactNativeSdkVersion","getSdkVersion","version","constants","major","minor","patch","getDeviceInfo"],"sources":["DeviceInfo.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport { SDK_VERSION } from './utils/version';\n\nclass DeviceInfo {\n private deviceInfo: any;\n\n constructor() {\n this.deviceInfo = {\n isMobile: true,\n isReactNative: true,\n osName: Platform.OS,\n osVersion: Platform.Version,\n reactNativeVersion: this.getReactNativeVersion(),\n sdkType: 'realtimekit-react-native',\n reactNativeSdkVersion: this.getSdkVersion(),\n };\n }\n\n private getSdkVersion() {\n return SDK_VERSION;\n }\n\n private getReactNativeVersion() {\n const version = Platform.constants.reactNativeVersion;\n return version.major + '.' + version.minor + '.' + version.patch;\n }\n\n getDeviceInfo() {\n return this.deviceInfo;\n }\n}\n\nexport default new DeviceInfo();\n"],"mappings":";;;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,WAAW,QAAQ,iBAAiB;AAE7C,MAAMC,UAAU,CAAC;EAGfC,WAAWA,CAAA,EAAG;IAAAC,eAAA;IACZ,IAAI,CAACC,UAAU,GAAG;MAChBC,QAAQ,EAAE,IAAI;MACdC,aAAa,EAAE,IAAI;MACnBC,MAAM,EAAER,QAAQ,CAACS,EAAE;MACnBC,SAAS,EAAEV,QAAQ,CAACW,OAAO;MAC3BC,kBAAkB,EAAE,IAAI,CAACC,qBAAqB,CAAC,CAAC;MAChDC,OAAO,EAAE,0BAA0B;MACnCC,qBAAqB,EAAE,IAAI,CAACC,aAAa,CAAC;IAC5C,CAAC;EACH;EAEQA,aAAaA,CAAA,EAAG;IACtB,OAAOf,WAAW;EACpB;EAEQY,qBAAqBA,CAAA,EAAG;IAC9B,MAAMI,OAAO,GAAGjB,QAAQ,CAACkB,SAAS,CAACN,kBAAkB;IACrD,OAAOK,OAAO,CAACE,KAAK,GAAG,GAAG,GAAGF,OAAO,CAACG,KAAK,GAAG,GAAG,GAAGH,OAAO,CAACI,KAAK;EAClE;EAEAC,aAAaA,CAAA,EAAG;IACd,OAAO,IAAI,CAACjB,UAAU;EACxB;AACF;AAEA,eAAe,IAAIH,UAAU,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
+ export default class LocalMediaError extends Error {
5
+ constructor(message, code) {
6
+ super(message);
7
+ _defineProperty(this, "code", void 0);
8
+ this.code = code;
9
+ }
10
+ }
11
+ //# sourceMappingURL=LocalMediaError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["LocalMediaError","Error","constructor","message","code","_defineProperty"],"sources":["LocalMediaError.ts"],"sourcesContent":["export default class LocalMediaError extends Error {\n code: string;\n\n constructor(message: string, code: string) {\n super(message);\n this.code = code;\n }\n}\n"],"mappings":";;;AAAA,eAAe,MAAMA,eAAe,SAASC,KAAK,CAAC;EAGjDC,WAAWA,CAACC,OAAe,EAAEC,IAAY,EAAE;IACzC,KAAK,CAACD,OAAO,CAAC;IAACE,eAAA;IACf,IAAI,CAACD,IAAI,GAAGA,IAAI;EAClB;AACF","ignoreList":[]}