@nathanclaire/edge-telemetry-sdk 3.0.0

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 (155) hide show
  1. package/README.md +348 -0
  2. package/dist/appLifecycle-Cynw0kAv.js +14 -0
  3. package/dist/appLifecycle-Cynw0kAv.js.map +1 -0
  4. package/dist/appLifecycle-DvJIt7ym.cjs +2 -0
  5. package/dist/appLifecycle-DvJIt7ym.cjs.map +1 -0
  6. package/dist/batch-CLBFgYPC.cjs +2 -0
  7. package/dist/batch-CLBFgYPC.cjs.map +1 -0
  8. package/dist/batch-DLG_gtOm.js +12 -0
  9. package/dist/batch-DLG_gtOm.js.map +1 -0
  10. package/dist/crashCapture-BYTM4FLC.cjs +2 -0
  11. package/dist/crashCapture-BYTM4FLC.cjs.map +1 -0
  12. package/dist/crashCapture-D_rkkBVa.js +31 -0
  13. package/dist/crashCapture-D_rkkBVa.js.map +1 -0
  14. package/dist/crashHandler.web-BSxDpFTo.cjs +2 -0
  15. package/dist/crashHandler.web-BSxDpFTo.cjs.map +1 -0
  16. package/dist/crashHandler.web-D59bmhg9.js +32 -0
  17. package/dist/crashHandler.web-D59bmhg9.js.map +1 -0
  18. package/dist/crashHandlerNative.native-DeAFze4E.cjs +2 -0
  19. package/dist/crashHandlerNative.native-DeAFze4E.cjs.map +1 -0
  20. package/dist/crashHandlerNative.native-d7qJkzA6.js +41 -0
  21. package/dist/crashHandlerNative.native-d7qJkzA6.js.map +1 -0
  22. package/dist/debug-DsvQ9y3W.js +68 -0
  23. package/dist/debug-DsvQ9y3W.js.map +1 -0
  24. package/dist/debug-rnOOxFpN.cjs +2 -0
  25. package/dist/debug-rnOOxFpN.cjs.map +1 -0
  26. package/dist/deviceInfo.native-7hbRYixR.cjs +2 -0
  27. package/dist/deviceInfo.native-7hbRYixR.cjs.map +1 -0
  28. package/dist/deviceInfo.native-D2k0LDhI.js +1171 -0
  29. package/dist/deviceInfo.native-D2k0LDhI.js.map +1 -0
  30. package/dist/deviceInfo.web-ByNAlEJh.cjs +2 -0
  31. package/dist/deviceInfo.web-ByNAlEJh.cjs.map +1 -0
  32. package/dist/deviceInfo.web-DzQyEku6.js +40 -0
  33. package/dist/deviceInfo.web-DzQyEku6.js.map +1 -0
  34. package/dist/frameAggregate-C_HoVFcK.cjs +2 -0
  35. package/dist/frameAggregate-C_HoVFcK.cjs.map +1 -0
  36. package/dist/frameAggregate-Cwh1juw1.js +17 -0
  37. package/dist/frameAggregate-Cwh1juw1.js.map +1 -0
  38. package/dist/frameDropsNative.native-CP7zrXDf.js +23 -0
  39. package/dist/frameDropsNative.native-CP7zrXDf.js.map +1 -0
  40. package/dist/frameDropsNative.native-DKqEDqip.cjs +2 -0
  41. package/dist/frameDropsNative.native-DKqEDqip.cjs.map +1 -0
  42. package/dist/frameDropsWeb.web-C9Lt3Fuj.js +22 -0
  43. package/dist/frameDropsWeb.web-C9Lt3Fuj.js.map +1 -0
  44. package/dist/frameDropsWeb.web-azpwQCUz.cjs +2 -0
  45. package/dist/frameDropsWeb.web-azpwQCUz.cjs.map +1 -0
  46. package/dist/httpAttributes-BV50UKQU.js +19 -0
  47. package/dist/httpAttributes-BV50UKQU.js.map +1 -0
  48. package/dist/httpAttributes-xXOD9trQ.cjs +2 -0
  49. package/dist/httpAttributes-xXOD9trQ.cjs.map +1 -0
  50. package/dist/index.native.cjs +2 -0
  51. package/dist/index.native.cjs.map +1 -0
  52. package/dist/index.native.d.ts +2 -0
  53. package/dist/index.native.js +109 -0
  54. package/dist/index.native.js.map +1 -0
  55. package/dist/index.web.cjs +2 -0
  56. package/dist/index.web.cjs.map +1 -0
  57. package/dist/index.web.d.ts +2 -0
  58. package/dist/index.web.js +80 -0
  59. package/dist/index.web.js.map +1 -0
  60. package/dist/interaction-CH8yoY5-.js +23 -0
  61. package/dist/interaction-CH8yoY5-.js.map +1 -0
  62. package/dist/interaction-DcNFBW7a.cjs +2 -0
  63. package/dist/interaction-DcNFBW7a.cjs.map +1 -0
  64. package/dist/interceptFetchNative.native-VlhtMG-U.js +49 -0
  65. package/dist/interceptFetchNative.native-VlhtMG-U.js.map +1 -0
  66. package/dist/interceptFetchNative.native-jEAldH14.cjs +2 -0
  67. package/dist/interceptFetchNative.native-jEAldH14.cjs.map +1 -0
  68. package/dist/interceptFetchWeb.web-DFzZliik.cjs +2 -0
  69. package/dist/interceptFetchWeb.web-DFzZliik.cjs.map +1 -0
  70. package/dist/interceptFetchWeb.web-DfsMfoRP.js +77 -0
  71. package/dist/interceptFetchWeb.web-DfsMfoRP.js.map +1 -0
  72. package/dist/memoryNative.native-BWLh2S9L.js +48 -0
  73. package/dist/memoryNative.native-BWLh2S9L.js.map +1 -0
  74. package/dist/memoryNative.native-DCXSOd4Q.cjs +2 -0
  75. package/dist/memoryNative.native-DCXSOd4Q.cjs.map +1 -0
  76. package/dist/memoryWeb.web-B3YuV-cB.js +48 -0
  77. package/dist/memoryWeb.web-B3YuV-cB.js.map +1 -0
  78. package/dist/memoryWeb.web-CheXAcJn.cjs +2 -0
  79. package/dist/memoryWeb.web-CheXAcJn.cjs.map +1 -0
  80. package/dist/nativeSender-BE_mzw_S.js +70 -0
  81. package/dist/nativeSender-BE_mzw_S.js.map +1 -0
  82. package/dist/nativeSender-DyAUGY7c.cjs +2 -0
  83. package/dist/nativeSender-DyAUGY7c.cjs.map +1 -0
  84. package/dist/navigationNative.native-3tO5JxSd.cjs +2 -0
  85. package/dist/navigationNative.native-3tO5JxSd.cjs.map +1 -0
  86. package/dist/navigationNative.native-BUCGPQX2.js +25 -0
  87. package/dist/navigationNative.native-BUCGPQX2.js.map +1 -0
  88. package/dist/navigationTracker-B2GMwyKk.cjs +2 -0
  89. package/dist/navigationTracker-B2GMwyKk.cjs.map +1 -0
  90. package/dist/navigationTracker-Cts68dgG.js +19 -0
  91. package/dist/navigationTracker-Cts68dgG.js.map +1 -0
  92. package/dist/navigationWeb.web-B0necr5j.cjs +2 -0
  93. package/dist/navigationWeb.web-B0necr5j.cjs.map +1 -0
  94. package/dist/navigationWeb.web-CORzE_Id.js +46 -0
  95. package/dist/navigationWeb.web-CORzE_Id.js.map +1 -0
  96. package/dist/networkChange-CUO1hRLj.cjs +2 -0
  97. package/dist/networkChange-CUO1hRLj.cjs.map +1 -0
  98. package/dist/networkChange-D39hdSb0.js +16 -0
  99. package/dist/networkChange-D39hdSb0.js.map +1 -0
  100. package/dist/networkInfo.native-BK5fpAOL.js +343 -0
  101. package/dist/networkInfo.native-BK5fpAOL.js.map +1 -0
  102. package/dist/networkInfo.native-cxuw93Uy.cjs +2 -0
  103. package/dist/networkInfo.native-cxuw93Uy.cjs.map +1 -0
  104. package/dist/networkInfo.web-DJmw1sNK.cjs +2 -0
  105. package/dist/networkInfo.web-DJmw1sNK.cjs.map +1 -0
  106. package/dist/networkInfo.web-twcNn_hc.js +32 -0
  107. package/dist/networkInfo.web-twcNn_hc.js.map +1 -0
  108. package/dist/src/adapters/appLifecycle.d.ts +15 -0
  109. package/dist/src/adapters/batch.d.ts +2 -0
  110. package/dist/src/adapters/crashCapture.d.ts +13 -0
  111. package/dist/src/adapters/frameAggregate.d.ts +12 -0
  112. package/dist/src/adapters/httpAttributes.d.ts +9 -0
  113. package/dist/src/adapters/interaction.d.ts +17 -0
  114. package/dist/src/adapters/native/crashHandlerNative.native.d.ts +9 -0
  115. package/dist/src/adapters/native/deviceInfo.native.d.ts +10 -0
  116. package/dist/src/adapters/native/frameDropsNative.native.d.ts +16 -0
  117. package/dist/src/adapters/native/interceptFetchNative.native.d.ts +23 -0
  118. package/dist/src/adapters/native/memoryNative.native.d.ts +25 -0
  119. package/dist/src/adapters/native/navigationNative.native.d.ts +12 -0
  120. package/dist/src/adapters/native/networkInfo.native.d.ts +12 -0
  121. package/dist/src/adapters/nativeSender.d.ts +3 -0
  122. package/dist/src/adapters/navigationTracker.d.ts +6 -0
  123. package/dist/src/adapters/networkChange.d.ts +15 -0
  124. package/dist/src/adapters/screenTiming.d.ts +9 -0
  125. package/dist/src/adapters/web/crashHandler.web.d.ts +9 -0
  126. package/dist/src/adapters/web/deviceInfo.web.d.ts +7 -0
  127. package/dist/src/adapters/web/frameDropsWeb.web.d.ts +16 -0
  128. package/dist/src/adapters/web/interceptFetchWeb.web.d.ts +29 -0
  129. package/dist/src/adapters/web/memoryWeb.web.d.ts +26 -0
  130. package/dist/src/adapters/web/navigationWeb.web.d.ts +29 -0
  131. package/dist/src/adapters/web/networkInfo.web.d.ts +8 -0
  132. package/dist/src/adapters/webSender.d.ts +3 -0
  133. package/dist/src/core/breadcrumbs.d.ts +12 -0
  134. package/dist/src/core/debug.d.ts +6 -0
  135. package/dist/src/core/telemetry.d.ts +233 -0
  136. package/dist/src/core/utils/uuid.d.ts +2 -0
  137. package/dist/src/createTelemetry.native.d.ts +16 -0
  138. package/dist/src/createTelemetry.web.d.ts +16 -0
  139. package/dist/src/index.base.d.ts +36 -0
  140. package/dist/src/index.native.d.ts +28 -0
  141. package/dist/src/index.web.d.ts +24 -0
  142. package/dist/src/shims/react-native-web-shim.d.ts +6 -0
  143. package/dist/telemetry-Co4MYdwa.cjs +2 -0
  144. package/dist/telemetry-Co4MYdwa.cjs.map +1 -0
  145. package/dist/telemetry-KI0x4gzC.js +389 -0
  146. package/dist/telemetry-KI0x4gzC.js.map +1 -0
  147. package/dist/v4-BysszJq8.js +31 -0
  148. package/dist/v4-BysszJq8.js.map +1 -0
  149. package/dist/v4-CqdK_b8Y.cjs +2 -0
  150. package/dist/v4-CqdK_b8Y.cjs.map +1 -0
  151. package/dist/webSender-B27tmT1w.js +42 -0
  152. package/dist/webSender-B27tmT1w.js.map +1 -0
  153. package/dist/webSender-BWi4x1df.cjs +2 -0
  154. package/dist/webSender-BWi4x1df.cjs.map +1 -0
  155. package/package.json +91 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networkInfo.native-BK5fpAOL.js","sources":["../node_modules/@react-native-community/netinfo/lib/module/internal/defaultConfiguration.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/privateTypes.js","../node_modules/@react-native-community/netinfo/lib/module/internal/types.js","../node_modules/@react-native-community/netinfo/lib/module/internal/nativeModule.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/nativeInterface.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/internetReachability.js","../node_modules/@react-native-community/netinfo/lib/module/internal/state.js","../node_modules/@react-native-community/netinfo/lib/module/index.js","../src/adapters/native/networkInfo.native.ts"],"sourcesContent":["const DEFAULT_CONFIGURATION = {\n reachabilityUrl: '/',\n reachabilityMethod: \"HEAD\",\n reachabilityHeaders: {},\n reachabilityTest: response => Promise.resolve(response.status === 200),\n reachabilityShortTimeout: 5 * 1000,\n // 5s\n reachabilityLongTimeout: 60 * 1000,\n // 60s\n reachabilityRequestTimeout: 15 * 1000,\n // 15s\n reachabilityShouldRun: () => true,\n shouldFetchWiFiSSID: true,\n useNativeReachability: true\n};\nexport default DEFAULT_CONFIGURATION;\n//# sourceMappingURL=defaultConfiguration.web.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport const DEVICE_CONNECTIVITY_EVENT = 'netInfo.networkStatusDidChange'; // Certain properties are optional when sent by the native module and are handled by the JS code\n//# sourceMappingURL=privateTypes.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport let NetInfoStateType;\n\n(function (NetInfoStateType) {\n NetInfoStateType[\"unknown\"] = \"unknown\";\n NetInfoStateType[\"none\"] = \"none\";\n NetInfoStateType[\"cellular\"] = \"cellular\";\n NetInfoStateType[\"wifi\"] = \"wifi\";\n NetInfoStateType[\"bluetooth\"] = \"bluetooth\";\n NetInfoStateType[\"ethernet\"] = \"ethernet\";\n NetInfoStateType[\"wimax\"] = \"wimax\";\n NetInfoStateType[\"vpn\"] = \"vpn\";\n NetInfoStateType[\"other\"] = \"other\";\n})(NetInfoStateType || (NetInfoStateType = {}));\n\nexport let NetInfoCellularGeneration;\n\n(function (NetInfoCellularGeneration) {\n NetInfoCellularGeneration[\"2g\"] = \"2g\";\n NetInfoCellularGeneration[\"3g\"] = \"3g\";\n NetInfoCellularGeneration[\"4g\"] = \"4g\";\n NetInfoCellularGeneration[\"5g\"] = \"5g\";\n})(NetInfoCellularGeneration || (NetInfoCellularGeneration = {}));\n//# sourceMappingURL=types.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { DEVICE_CONNECTIVITY_EVENT } from './privateTypes';\nimport { NetInfoCellularGeneration, NetInfoStateType } from './types'; // See https://wicg.github.io/netinfo/#dom-connectiontype\n\n// Use a constant test of this form because in SSR on next.js, optional chaining is not sufficient,\n// but this test correctly detects that window is not available and allows for conditionals before access\nconst isWindowPresent = typeof window !== 'undefined'; // Check if window exists and if the browser supports the connection API\n\nconst connection = isWindowPresent && !window.hasOwnProperty('tizen') && !window.hasOwnProperty('webOS') ? window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection : undefined; // Map browser types to native types\n\nconst typeMapping = {\n bluetooth: NetInfoStateType.bluetooth,\n cellular: NetInfoStateType.cellular,\n ethernet: NetInfoStateType.ethernet,\n none: NetInfoStateType.none,\n other: NetInfoStateType.other,\n unknown: NetInfoStateType.unknown,\n wifi: NetInfoStateType.wifi,\n wimax: NetInfoStateType.wimax,\n mixed: NetInfoStateType.other\n};\nconst effectiveTypeMapping = {\n '2g': NetInfoCellularGeneration['2g'],\n '3g': NetInfoCellularGeneration['3g'],\n '4g': NetInfoCellularGeneration['4g'],\n 'slow-2g': NetInfoCellularGeneration['2g']\n}; // Determine current state of connection\n\nconst getCurrentState = _requestedInterface => {\n const isConnected = isWindowPresent ? navigator.onLine : false;\n const baseState = {\n isInternetReachable: null\n }; // If we don't have a connection object, we return minimal information\n\n if (!connection) {\n if (isConnected) {\n const state = { ...baseState,\n isConnected: true,\n type: NetInfoStateType.other,\n details: {\n isConnectionExpensive: false\n }\n };\n return state;\n }\n\n const state = { ...baseState,\n isConnected: false,\n isInternetReachable: false,\n type: NetInfoStateType.none,\n details: null\n };\n return state;\n } // Otherwise try to return detailed information\n\n\n const isConnectionExpensive = connection.saveData;\n const type = connection.type ? typeMapping[connection.type] : isConnected ? NetInfoStateType.other : NetInfoStateType.unknown;\n\n if (type === NetInfoStateType.bluetooth) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n } else if (type === NetInfoStateType.cellular) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n cellularGeneration: effectiveTypeMapping[connection.effectiveType] || null,\n carrier: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.ethernet) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n ipAddress: null,\n subnet: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.wifi) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n ssid: null,\n bssid: null,\n strength: null,\n ipAddress: null,\n subnet: null,\n frequency: null,\n linkSpeed: null,\n rxLinkSpeed: null,\n txLinkSpeed: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.wimax) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n } else if (type === NetInfoStateType.none) {\n const state = { ...baseState,\n isConnected: false,\n isInternetReachable: false,\n type,\n details: null\n };\n return state;\n } else if (type === NetInfoStateType.unknown) {\n const state = { ...baseState,\n isConnected,\n isInternetReachable: null,\n type,\n details: null\n };\n return state;\n }\n\n const state = { ...baseState,\n isConnected: true,\n type: NetInfoStateType.other,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n};\n\nconst handlers = [];\nconst nativeHandlers = [];\nconst RNCNetInfo = {\n addListener(type, handler) {\n switch (type) {\n case DEVICE_CONNECTIVITY_EVENT:\n {\n const nativeHandler = () => {\n handler(getCurrentState());\n };\n\n if (connection) {\n connection.addEventListener('change', nativeHandler);\n } else {\n if (isWindowPresent) {\n window.addEventListener('online', nativeHandler, false);\n window.addEventListener('offline', nativeHandler, false);\n }\n } // Remember handlers\n\n\n handlers.push(handler);\n nativeHandlers.push(nativeHandler);\n break;\n }\n }\n },\n\n removeListeners(type, handler) {\n switch (type) {\n case DEVICE_CONNECTIVITY_EVENT:\n {\n // Get native handler\n const index = handlers.indexOf(handler);\n const nativeHandler = nativeHandlers[index];\n\n if (connection) {\n connection.removeEventListener('change', nativeHandler);\n } else {\n if (isWindowPresent) {\n window.removeEventListener('online', nativeHandler);\n window.removeEventListener('offline', nativeHandler);\n }\n } // Remove handlers\n\n\n handlers.splice(index, 1);\n nativeHandlers.splice(index, 1);\n break;\n }\n }\n },\n\n async getCurrentState(requestedInterface) {\n return getCurrentState(requestedInterface);\n },\n\n configure() {\n return;\n }\n\n};\nexport default RNCNetInfo;\n//# sourceMappingURL=nativeModule.web.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { NativeEventEmitter } from 'react-native';\nimport RNCNetInfo from './nativeModule';\nimport { DEVICE_CONNECTIVITY_EVENT } from './privateTypes';\nconst nativeEventEmitter = new NativeEventEmitter(); // Listen to connectivity events\n\nRNCNetInfo.addListener(DEVICE_CONNECTIVITY_EVENT, event => {\n nativeEventEmitter.emit(DEVICE_CONNECTIVITY_EVENT, event);\n});\nexport default { ...RNCNetInfo,\n eventEmitter: nativeEventEmitter\n};\n//# sourceMappingURL=nativeInterface.web.js.map","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport default class InternetReachability {\n constructor(configuration, listener) {\n _defineProperty(this, \"_configuration\", void 0);\n\n _defineProperty(this, \"_listener\", void 0);\n\n _defineProperty(this, \"_isInternetReachable\", undefined);\n\n _defineProperty(this, \"_currentInternetReachabilityCheckHandler\", null);\n\n _defineProperty(this, \"_currentTimeoutHandle\", null);\n\n _defineProperty(this, \"_setIsInternetReachable\", isInternetReachable => {\n if (this._isInternetReachable === isInternetReachable) {\n return;\n }\n\n this._isInternetReachable = isInternetReachable;\n\n this._listener(this._isInternetReachable);\n });\n\n _defineProperty(this, \"_setExpectsConnection\", expectsConnection => {\n // Cancel any pending check\n if (this._currentInternetReachabilityCheckHandler !== null) {\n this._currentInternetReachabilityCheckHandler.cancel();\n\n this._currentInternetReachabilityCheckHandler = null;\n } // Cancel any pending timeout\n\n\n if (this._currentTimeoutHandle !== null) {\n clearTimeout(this._currentTimeoutHandle);\n this._currentTimeoutHandle = null;\n }\n\n if (expectsConnection && this._configuration.reachabilityShouldRun()) {\n // If we expect a connection, start the process for finding if we have one\n // Set the state to \"null\" if it was previously false\n if (!this._isInternetReachable) {\n this._setIsInternetReachable(null);\n } // Start a network request to check for internet\n\n\n this._currentInternetReachabilityCheckHandler = this._checkInternetReachability();\n } else {\n // If we don't expect a connection or don't run reachability check, just change the state to \"false\"\n this._setIsInternetReachable(false);\n }\n });\n\n _defineProperty(this, \"_checkInternetReachability\", () => {\n const controller = new AbortController();\n const responsePromise = fetch(this._configuration.reachabilityUrl, {\n headers: this._configuration.reachabilityHeaders,\n method: this._configuration.reachabilityMethod,\n cache: 'no-cache',\n signal: controller.signal\n }); // Create promise that will reject after the request timeout has been reached\n\n let timeoutHandle;\n const timeoutPromise = new Promise((_, reject) => {\n timeoutHandle = setTimeout(() => reject('timedout'), this._configuration.reachabilityRequestTimeout);\n }); // Create promise that makes it possible to cancel a pending request through a reject\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n\n let cancel = () => {};\n\n const cancelPromise = new Promise((_, reject) => {\n cancel = () => reject('canceled');\n });\n const promise = Promise.race([responsePromise, timeoutPromise, cancelPromise]).then(response => {\n return this._configuration.reachabilityTest(response);\n }).then(result => {\n this._setIsInternetReachable(result);\n\n const nextTimeoutInterval = this._isInternetReachable ? this._configuration.reachabilityLongTimeout : this._configuration.reachabilityShortTimeout;\n this._currentTimeoutHandle = setTimeout(this._checkInternetReachability, nextTimeoutInterval);\n }).catch(error => {\n if ('canceled' === error) {\n controller.abort();\n } else {\n if ('timedout' === error) {\n controller.abort();\n }\n\n this._setIsInternetReachable(false);\n\n this._currentTimeoutHandle = setTimeout(this._checkInternetReachability, this._configuration.reachabilityShortTimeout);\n }\n }) // Clear request timeout and propagate any errors\n .then(() => {\n clearTimeout(timeoutHandle);\n }, error => {\n clearTimeout(timeoutHandle);\n throw error;\n });\n return {\n promise,\n cancel\n };\n });\n\n _defineProperty(this, \"update\", state => {\n if (typeof state.isInternetReachable === 'boolean' && this._configuration.useNativeReachability) {\n this._setIsInternetReachable(state.isInternetReachable);\n } else {\n this._setExpectsConnection(state.isConnected);\n }\n });\n\n _defineProperty(this, \"currentState\", () => {\n return this._isInternetReachable;\n });\n\n _defineProperty(this, \"tearDown\", () => {\n // Cancel any pending check\n if (this._currentInternetReachabilityCheckHandler !== null) {\n this._currentInternetReachabilityCheckHandler.cancel();\n\n this._currentInternetReachabilityCheckHandler = null;\n } // Cancel any pending timeout\n\n\n if (this._currentTimeoutHandle !== null) {\n clearTimeout(this._currentTimeoutHandle);\n this._currentTimeoutHandle = null;\n }\n });\n\n this._configuration = configuration;\n this._listener = listener;\n }\n\n}\n//# sourceMappingURL=internetReachability.js.map","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport NativeInterface from './nativeInterface';\nimport InternetReachability from './internetReachability';\nimport * as PrivateTypes from './privateTypes';\nexport default class State {\n constructor(configuration) {\n _defineProperty(this, \"_nativeEventSubscription\", null);\n\n _defineProperty(this, \"_subscriptions\", new Set());\n\n _defineProperty(this, \"_latestState\", null);\n\n _defineProperty(this, \"_internetReachability\", void 0);\n\n _defineProperty(this, \"_handleNativeStateUpdate\", state => {\n // Update the internet reachability module\n this._internetReachability.update(state); // Convert the state from native to JS shape\n\n\n const convertedState = this._convertState(state); // Update the listeners\n\n\n this._latestState = convertedState;\n\n this._subscriptions.forEach(handler => handler(convertedState));\n });\n\n _defineProperty(this, \"_handleInternetReachabilityUpdate\", isInternetReachable => {\n if (!this._latestState) {\n return;\n }\n\n const nextState = { ...this._latestState,\n isInternetReachable\n };\n this._latestState = nextState;\n\n this._subscriptions.forEach(handler => handler(nextState));\n });\n\n _defineProperty(this, \"_fetchCurrentState\", async requestedInterface => {\n const state = await NativeInterface.getCurrentState(requestedInterface); // Update the internet reachability module\n\n this._internetReachability.update(state); // Convert and store the new state\n\n\n const convertedState = this._convertState(state);\n\n if (!requestedInterface) {\n this._latestState = convertedState;\n\n this._subscriptions.forEach(handler => handler(convertedState));\n }\n\n return convertedState;\n });\n\n _defineProperty(this, \"_convertState\", input => {\n if (typeof input.isInternetReachable === 'boolean') {\n return input;\n } else {\n return { ...input,\n isInternetReachable: this._internetReachability.currentState()\n };\n }\n });\n\n _defineProperty(this, \"latest\", requestedInterface => {\n if (requestedInterface) {\n return this._fetchCurrentState(requestedInterface);\n } else if (this._latestState) {\n return Promise.resolve(this._latestState);\n } else {\n return this._fetchCurrentState();\n }\n });\n\n _defineProperty(this, \"add\", handler => {\n // Add the subscription handler to our set\n this._subscriptions.add(handler); // Send it the latest data we have\n\n\n if (this._latestState) {\n handler(this._latestState);\n } else {\n this.latest().then(handler);\n }\n });\n\n _defineProperty(this, \"remove\", handler => {\n this._subscriptions.delete(handler);\n });\n\n _defineProperty(this, \"tearDown\", () => {\n if (this._internetReachability) {\n this._internetReachability.tearDown();\n }\n\n if (this._nativeEventSubscription) {\n this._nativeEventSubscription.remove();\n }\n\n this._subscriptions.clear();\n });\n\n // Add the listener to the internet connectivity events\n this._internetReachability = new InternetReachability(configuration, this._handleInternetReachabilityUpdate); // Add the subscription to the native events\n\n this._nativeEventSubscription = NativeInterface.eventEmitter.addListener(PrivateTypes.DEVICE_CONNECTIVITY_EVENT, this._handleNativeStateUpdate); // Fetch the current state from the native module\n\n this._fetchCurrentState();\n }\n\n}\n//# sourceMappingURL=state.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { useState, useEffect, useCallback } from 'react';\nimport { Platform } from 'react-native';\nimport DEFAULT_CONFIGURATION from './internal/defaultConfiguration';\nimport NativeInterface from './internal/nativeInterface';\nimport State from './internal/state';\nimport * as Types from './internal/types'; // Stores the currently used configuration\n\nlet _configuration = DEFAULT_CONFIGURATION; // Stores the singleton reference to the state manager\n\nlet _state = null;\n\nconst createState = () => {\n return new State(_configuration);\n}; // Track ongoing requests\n\n\nlet isRequestInProgress = false;\nlet requestQueue = [];\n/**\n * Configures the library with the given configuration. Note that calling this will stop all\n * previously added listeners from being called again. It is best to call this right when your\n * application is started to avoid issues. The configuration sets up a global singleton instance.\n *\n * @param configuration The new configuration to set.\n */\n\nexport function configure(configuration) {\n _configuration = { ...DEFAULT_CONFIGURATION,\n ...configuration\n };\n\n if (_state) {\n _state.tearDown();\n\n _state = createState();\n }\n\n if (Platform.OS === 'ios') {\n NativeInterface.configure(configuration);\n }\n}\n/**\n * Returns a `Promise` that resolves to a `NetInfoState` object.\n * This function operates on the global singleton instance configured using `configure()`\n *\n * @param [requestedInterface] interface from which to obtain the information\n *\n * @returns A Promise which contains the current connection state.\n */\n\nexport function fetch(requestedInterface) {\n if (!_state) {\n _state = createState();\n }\n\n return _state.latest(requestedInterface);\n}\n/**\n * Force-refreshes the internal state of the global singleton managed by this library.\n *\n * @returns A Promise which contains the updated connection state.\n */\n\nexport function refresh() {\n if (!_state) {\n _state = createState();\n } // If a request is already in progress, return a promise that will resolve when the current request finishes\n\n\n if (isRequestInProgress) {\n return new Promise(resolve => {\n requestQueue.push(resolve);\n });\n }\n\n isRequestInProgress = true;\n return _state._fetchCurrentState().then(result => {\n requestQueue.forEach(resolve => resolve(result));\n requestQueue = [];\n return result;\n }).finally(() => {\n isRequestInProgress = false;\n });\n}\n/**\n * Subscribe to the global singleton's connection information. The callback is called with a parameter of type\n * [`NetInfoState`](README.md#netinfostate) whenever the connection state changes. Your listener\n * will be called with the latest information soon after you subscribe and then with any\n * subsequent changes afterwards. You should not assume that the listener is called in the same\n * way across devices or platforms.\n *\n * @param listener The listener which is called when the network state changes.\n *\n * @returns A function which can be called to unsubscribe.\n */\n\nexport function addEventListener(listener) {\n if (!_state) {\n _state = createState();\n }\n\n _state.add(listener);\n\n return () => {\n _state && _state.remove(listener);\n };\n}\n/**\n * A React Hook into this library's singleton which updates when the connection state changes.\n *\n * @param {Partial<Types.NetInfoConfiguration>} configuration - Configure the isolated network checker managed by this hook\n *\n * @returns The connection state.\n */\n\nexport function useNetInfo(configuration) {\n if (configuration) {\n configure(configuration);\n }\n\n const [netInfo, setNetInfo] = useState({\n type: Types.NetInfoStateType.unknown,\n isConnected: null,\n isInternetReachable: null,\n details: null\n });\n useEffect(() => {\n const unsubscribe = addEventListener(setNetInfo);\n return () => unsubscribe();\n }, []);\n return netInfo;\n}\n/**\n * A React Hook which manages an isolated instance of the network info manager.\n * This is not a hook into a singleton shared state. NetInfo.configure, NetInfo.addEventListener,\n * NetInfo.fetch, NetInfo.refresh are performed on a global singleton and have no affect on this hook.\n * @param {boolean} isPaused - Pause the internal network checks.\n * @param {Partial<Types.NetInfoConfiguration>} configuration - Configure the isolated network checker managed by this hook\n *\n * @returns the netInfo state and a refresh function\n */\n\nexport function useNetInfoInstance(isPaused = false, configuration) {\n const [networkInfoManager, setNetworkInfoManager] = useState();\n const [netInfo, setNetInfo] = useState({\n type: Types.NetInfoStateType.unknown,\n isConnected: null,\n isInternetReachable: null,\n details: null\n });\n useEffect(() => {\n if (isPaused) {\n return;\n }\n\n const config = { ...DEFAULT_CONFIGURATION,\n ...configuration\n };\n const state = new State(config);\n setNetworkInfoManager(state);\n state.add(setNetInfo);\n return state.tearDown;\n }, [isPaused, configuration]);\n const refresh = useCallback(() => {\n if (networkInfoManager && !isRequestInProgress) {\n isRequestInProgress = true;\n\n networkInfoManager._fetchCurrentState().finally(() => {\n isRequestInProgress = false;\n });\n }\n }, [networkInfoManager]);\n return {\n netInfo,\n refresh\n };\n}\nexport * from './internal/types';\nexport default {\n configure,\n fetch,\n refresh,\n addEventListener,\n useNetInfo,\n useNetInfoInstance\n};\n//# sourceMappingURL=index.js.map","// adapters/native/networkInfoNative.native.ts\nimport NetInfo from \"@react-native-community/netinfo\";\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\nexport class NetworkInfoTrackerNative {\n private telemetry?: Telemetry;\n\n constructor() {\n\n }\n\n async collect(): Promise<NetworkInfo> {\n try {\n const netState = await NetInfo.fetch();\n return {\n type: netState.type,\n isConnected: netState.isConnected ?? undefined,\n };\n } catch {\n return { type: \"unknown\", isConnected: undefined };\n }\n }\n\n /**\n * collect() feeds the steady-state Context block on every event (no standalone\n * network_info event, ADR-0002). A connectivity *transition* is still its own\n * v3 `network_change` event, emitted via the shared NetworkChangeEmitter.\n */\n async start(telemetry: Telemetry): Promise<NetworkInfo> {\n this.telemetry = telemetry;\n const changes = new NetworkChangeEmitter(telemetry);\n const info = await this.collect();\n changes.onSample(info.type); // seed baseline so the first real transition emits\n NetInfo.addEventListener(state => changes.onSample(state.type));\n return info;\n }\n}\n"],"names":["DEFAULT_CONFIGURATION","response","DEVICE_CONNECTIVITY_EVENT","NetInfoStateType","NetInfoCellularGeneration","isWindowPresent","connection","typeMapping","effectiveTypeMapping","getCurrentState","_requestedInterface","isConnected","baseState","isConnectionExpensive","type","handlers","nativeHandlers","RNCNetInfo","handler","nativeHandler","index","requestedInterface","nativeEventEmitter","NativeEventEmitter","event","NativeInterface","_defineProperty","obj","key","value","InternetReachability","configuration","listener","isInternetReachable","expectsConnection","controller","responsePromise","timeoutHandle","timeoutPromise","_","reject","cancel","cancelPromise","result","nextTimeoutInterval","error","state","State","convertedState","nextState","input","PrivateTypes.DEVICE_CONNECTIVITY_EVENT","_configuration","_state","createState","isRequestInProgress","requestQueue","configure","Platform","fetch","refresh","resolve","addEventListener","useNetInfo","netInfo","setNetInfo","useState","Types.NetInfoStateType","useEffect","unsubscribe","useNetInfoInstance","isPaused","networkInfoManager","setNetworkInfoManager","config","useCallback","NetInfo","NetworkInfoTrackerNative","netState","telemetry","changes","NetworkChangeEmitter","info"],"mappings":";;;AAAA,MAAMA,IAAwB;AAAA,EAC5B,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,qBAAqB,CAAA;AAAA,EACrB,kBAAkB,CAAAC,MAAY,QAAQ,QAAQA,EAAS,WAAW,GAAG;AAAA,EACrE,0BAA0B,IAAI;AAAA;AAAA,EAE9B,yBAAyB,KAAK;AAAA;AAAA,EAE9B,4BAA4B,KAAK;AAAA;AAAA,EAEjC,uBAAuB,MAAM;AAAA,EAC7B,qBAAqB;AAAA,EACrB,uBAAuB;AACzB,GCNaC,IAA4B;ACAlC,IAAIC;AAAA,CAEV,SAAUA,GAAkB;AAC3B,EAAAA,EAAiB,UAAa,WAC9BA,EAAiB,OAAU,QAC3BA,EAAiB,WAAc,YAC/BA,EAAiB,OAAU,QAC3BA,EAAiB,YAAe,aAChCA,EAAiB,WAAc,YAC/BA,EAAiB,QAAW,SAC5BA,EAAiB,MAAS,OAC1BA,EAAiB,QAAW;AAC9B,GAAGA,MAAqBA,IAAmB,CAAA,EAAG;AAEvC,IAAIC;AAAA,CAEV,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EAAQ,iBAAiB,CAAA9B,MAASkC,EAAQ,SAASlC,EAAM,IAAI,CAAC,GACvDoC;AAAA,EACX;AACJ;","x_google_ignoreList":[0,1,2,3,4,5,6,7]}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),H=require("react-native"),q=require("./networkChange-CUO1hRLj.cjs"),E={reachabilityUrl:"/",reachabilityMethod:"HEAD",reachabilityHeaders:{},reachabilityTest:t=>Promise.resolve(t.status===200),reachabilityShortTimeout:5*1e3,reachabilityLongTimeout:60*1e3,reachabilityRequestTimeout:15*1e3,reachabilityShouldRun:()=>!0,shouldFetchWiFiSSID:!0,useNativeReachability:!0},y="netInfo.networkStatusDidChange";let r;(function(t){t.unknown="unknown",t.none="none",t.cellular="cellular",t.wifi="wifi",t.bluetooth="bluetooth",t.ethernet="ethernet",t.wimax="wimax",t.vpn="vpn",t.other="other"})(r||(r={}));let _;(function(t){t["2g"]="2g",t["3g"]="3g",t["4g"]="4g",t["5g"]="5g"})(_||(_={}));const p=typeof window<"u",h=p&&!window.hasOwnProperty("tizen")&&!window.hasOwnProperty("webOS")?window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection:void 0,U={bluetooth:r.bluetooth,cellular:r.cellular,ethernet:r.ethernet,none:r.none,other:r.other,unknown:r.unknown,wifi:r.wifi,wimax:r.wimax,mixed:r.other},M={"2g":_["2g"],"3g":_["3g"],"4g":_["4g"],"slow-2g":_["2g"]},k=t=>{const i=p?navigator.onLine:!1,e={isInternetReachable:null};if(!h)return i?{...e,isConnected:!0,type:r.other,details:{isConnectionExpensive:!1}}:{...e,isConnected:!1,isInternetReachable:!1,type:r.none,details:null};const n=h.saveData,s=h.type?U[h.type]:i?r.other:r.unknown;return s===r.bluetooth?{...e,isConnected:!0,type:s,details:{isConnectionExpensive:n}}:s===r.cellular?{...e,isConnected:!0,type:s,details:{isConnectionExpensive:n,cellularGeneration:M[h.effectiveType]||null,carrier:null}}:s===r.ethernet?{...e,isConnected:!0,type:s,details:{isConnectionExpensive:n,ipAddress:null,subnet:null}}:s===r.wifi?{...e,isConnected:!0,type:s,details:{isConnectionExpensive:n,ssid:null,bssid:null,strength:null,ipAddress:null,subnet:null,frequency:null,linkSpeed:null,rxLinkSpeed:null,txLinkSpeed:null}}:s===r.wimax?{...e,isConnected:!0,type:s,details:{isConnectionExpensive:n}}:s===r.none?{...e,isConnected:!1,isInternetReachable:!1,type:s,details:null}:s===r.unknown?{...e,isConnected:i,isInternetReachable:null,type:s,details:null}:{...e,isConnected:!0,type:r.other,details:{isConnectionExpensive:n}}},I=[],R=[],L={addListener(t,i){switch(t){case y:{const e=()=>{i(k())};h?h.addEventListener("change",e):p&&(window.addEventListener("online",e,!1),window.addEventListener("offline",e,!1)),I.push(i),R.push(e);break}}},removeListeners(t,i){switch(t){case y:{const e=I.indexOf(i),n=R[e];h?h.removeEventListener("change",n):p&&(window.removeEventListener("online",n),window.removeEventListener("offline",n)),I.splice(e,1),R.splice(e,1);break}}},async getCurrentState(t){return k()},configure(){}},P=new H.NativeEventEmitter;L.addListener(y,t=>{P.emit(y,t)});const C={...L,eventEmitter:P};function l(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}class A{constructor(i,e){l(this,"_configuration",void 0),l(this,"_listener",void 0),l(this,"_isInternetReachable",void 0),l(this,"_currentInternetReachabilityCheckHandler",null),l(this,"_currentTimeoutHandle",null),l(this,"_setIsInternetReachable",n=>{this._isInternetReachable!==n&&(this._isInternetReachable=n,this._listener(this._isInternetReachable))}),l(this,"_setExpectsConnection",n=>{this._currentInternetReachabilityCheckHandler!==null&&(this._currentInternetReachabilityCheckHandler.cancel(),this._currentInternetReachabilityCheckHandler=null),this._currentTimeoutHandle!==null&&(clearTimeout(this._currentTimeoutHandle),this._currentTimeoutHandle=null),n&&this._configuration.reachabilityShouldRun()?(this._isInternetReachable||this._setIsInternetReachable(null),this._currentInternetReachabilityCheckHandler=this._checkInternetReachability()):this._setIsInternetReachable(!1)}),l(this,"_checkInternetReachability",()=>{const n=new AbortController,s=fetch(this._configuration.reachabilityUrl,{headers:this._configuration.reachabilityHeaders,method:this._configuration.reachabilityMethod,cache:"no-cache",signal:n.signal});let d;const o=new Promise((u,v)=>{d=setTimeout(()=>v("timedout"),this._configuration.reachabilityRequestTimeout)});let w=()=>{};const m=new Promise((u,v)=>{w=()=>v("canceled")});return{promise:Promise.race([s,o,m]).then(u=>this._configuration.reachabilityTest(u)).then(u=>{this._setIsInternetReachable(u);const v=this._isInternetReachable?this._configuration.reachabilityLongTimeout:this._configuration.reachabilityShortTimeout;this._currentTimeoutHandle=setTimeout(this._checkInternetReachability,v)}).catch(u=>{u==="canceled"?n.abort():(u==="timedout"&&n.abort(),this._setIsInternetReachable(!1),this._currentTimeoutHandle=setTimeout(this._checkInternetReachability,this._configuration.reachabilityShortTimeout))}).then(()=>{clearTimeout(d)},u=>{throw clearTimeout(d),u}),cancel:w}}),l(this,"update",n=>{typeof n.isInternetReachable=="boolean"&&this._configuration.useNativeReachability?this._setIsInternetReachable(n.isInternetReachable):this._setExpectsConnection(n.isConnected)}),l(this,"currentState",()=>this._isInternetReachable),l(this,"tearDown",()=>{this._currentInternetReachabilityCheckHandler!==null&&(this._currentInternetReachabilityCheckHandler.cancel(),this._currentInternetReachabilityCheckHandler=null),this._currentTimeoutHandle!==null&&(clearTimeout(this._currentTimeoutHandle),this._currentTimeoutHandle=null)}),this._configuration=i,this._listener=e}}function c(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}class x{constructor(i){c(this,"_nativeEventSubscription",null),c(this,"_subscriptions",new Set),c(this,"_latestState",null),c(this,"_internetReachability",void 0),c(this,"_handleNativeStateUpdate",e=>{this._internetReachability.update(e);const n=this._convertState(e);this._latestState=n,this._subscriptions.forEach(s=>s(n))}),c(this,"_handleInternetReachabilityUpdate",e=>{if(!this._latestState)return;const n={...this._latestState,isInternetReachable:e};this._latestState=n,this._subscriptions.forEach(s=>s(n))}),c(this,"_fetchCurrentState",async e=>{const n=await C.getCurrentState(e);this._internetReachability.update(n);const s=this._convertState(n);return e||(this._latestState=s,this._subscriptions.forEach(d=>d(s))),s}),c(this,"_convertState",e=>typeof e.isInternetReachable=="boolean"?e:{...e,isInternetReachable:this._internetReachability.currentState()}),c(this,"latest",e=>e?this._fetchCurrentState(e):this._latestState?Promise.resolve(this._latestState):this._fetchCurrentState()),c(this,"add",e=>{this._subscriptions.add(e),this._latestState?e(this._latestState):this.latest().then(e)}),c(this,"remove",e=>{this._subscriptions.delete(e)}),c(this,"tearDown",()=>{this._internetReachability&&this._internetReachability.tearDown(),this._nativeEventSubscription&&this._nativeEventSubscription.remove(),this._subscriptions.clear()}),this._internetReachability=new A(i,this._handleInternetReachabilityUpdate),this._nativeEventSubscription=C.eventEmitter.addListener(y,this._handleNativeStateUpdate),this._fetchCurrentState()}}let N=E,a=null;const g=()=>new x(N);let b=!1,S=[];function D(t){N={...E,...t},a&&(a.tearDown(),a=g()),H.Platform.OS==="ios"&&C.configure(t)}function F(t){return a||(a=g()),a.latest(t)}function V(){return a||(a=g()),b?new Promise(t=>{S.push(t)}):(b=!0,a._fetchCurrentState().then(t=>(S.forEach(i=>i(t)),S=[],t)).finally(()=>{b=!1}))}function O(t){return a||(a=g()),a.add(t),()=>{a&&a.remove(t)}}function z(t){t&&D(t);const[i,e]=f.useState({type:r.unknown,isConnected:null,isInternetReachable:null,details:null});return f.useEffect(()=>{const n=O(e);return()=>n()},[]),i}function W(t=!1,i){const[e,n]=f.useState(),[s,d]=f.useState({type:r.unknown,isConnected:null,isInternetReachable:null,details:null});f.useEffect(()=>{if(t)return;const w={...E,...i},m=new x(w);return n(m),m.add(d),m.tearDown},[t,i]);const o=f.useCallback(()=>{e&&!b&&(b=!0,e._fetchCurrentState().finally(()=>{b=!1}))},[e]);return{netInfo:s,refresh:o}}const T={configure:D,fetch:F,refresh:V,addEventListener:O,useNetInfo:z,useNetInfoInstance:W};class ${constructor(){}async collect(){try{const i=await T.fetch();return{type:i.type,isConnected:i.isConnected??void 0}}catch{return{type:"unknown",isConnected:void 0}}}async start(i){this.telemetry=i;const e=new q.NetworkChangeEmitter(i),n=await this.collect();return e.onSample(n.type),T.addEventListener(s=>e.onSample(s.type)),n}}exports.NetworkInfoTrackerNative=$;
2
+ //# sourceMappingURL=networkInfo.native-cxuw93Uy.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networkInfo.native-cxuw93Uy.cjs","sources":["../node_modules/@react-native-community/netinfo/lib/module/internal/defaultConfiguration.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/privateTypes.js","../node_modules/@react-native-community/netinfo/lib/module/internal/types.js","../node_modules/@react-native-community/netinfo/lib/module/internal/nativeModule.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/nativeInterface.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/internetReachability.js","../node_modules/@react-native-community/netinfo/lib/module/internal/state.js","../node_modules/@react-native-community/netinfo/lib/module/index.js","../src/adapters/native/networkInfo.native.ts"],"sourcesContent":["const DEFAULT_CONFIGURATION = {\n reachabilityUrl: '/',\n reachabilityMethod: \"HEAD\",\n reachabilityHeaders: {},\n reachabilityTest: response => Promise.resolve(response.status === 200),\n reachabilityShortTimeout: 5 * 1000,\n // 5s\n reachabilityLongTimeout: 60 * 1000,\n // 60s\n reachabilityRequestTimeout: 15 * 1000,\n // 15s\n reachabilityShouldRun: () => true,\n shouldFetchWiFiSSID: true,\n useNativeReachability: true\n};\nexport default DEFAULT_CONFIGURATION;\n//# sourceMappingURL=defaultConfiguration.web.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport const DEVICE_CONNECTIVITY_EVENT = 'netInfo.networkStatusDidChange'; // Certain properties are optional when sent by the native module and are handled by the JS code\n//# sourceMappingURL=privateTypes.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport let NetInfoStateType;\n\n(function (NetInfoStateType) {\n NetInfoStateType[\"unknown\"] = \"unknown\";\n NetInfoStateType[\"none\"] = \"none\";\n NetInfoStateType[\"cellular\"] = \"cellular\";\n NetInfoStateType[\"wifi\"] = \"wifi\";\n NetInfoStateType[\"bluetooth\"] = \"bluetooth\";\n NetInfoStateType[\"ethernet\"] = \"ethernet\";\n NetInfoStateType[\"wimax\"] = \"wimax\";\n NetInfoStateType[\"vpn\"] = \"vpn\";\n NetInfoStateType[\"other\"] = \"other\";\n})(NetInfoStateType || (NetInfoStateType = {}));\n\nexport let NetInfoCellularGeneration;\n\n(function (NetInfoCellularGeneration) {\n NetInfoCellularGeneration[\"2g\"] = \"2g\";\n NetInfoCellularGeneration[\"3g\"] = \"3g\";\n NetInfoCellularGeneration[\"4g\"] = \"4g\";\n NetInfoCellularGeneration[\"5g\"] = \"5g\";\n})(NetInfoCellularGeneration || (NetInfoCellularGeneration = {}));\n//# sourceMappingURL=types.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { DEVICE_CONNECTIVITY_EVENT } from './privateTypes';\nimport { NetInfoCellularGeneration, NetInfoStateType } from './types'; // See https://wicg.github.io/netinfo/#dom-connectiontype\n\n// Use a constant test of this form because in SSR on next.js, optional chaining is not sufficient,\n// but this test correctly detects that window is not available and allows for conditionals before access\nconst isWindowPresent = typeof window !== 'undefined'; // Check if window exists and if the browser supports the connection API\n\nconst connection = isWindowPresent && !window.hasOwnProperty('tizen') && !window.hasOwnProperty('webOS') ? window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection : undefined; // Map browser types to native types\n\nconst typeMapping = {\n bluetooth: NetInfoStateType.bluetooth,\n cellular: NetInfoStateType.cellular,\n ethernet: NetInfoStateType.ethernet,\n none: NetInfoStateType.none,\n other: NetInfoStateType.other,\n unknown: NetInfoStateType.unknown,\n wifi: NetInfoStateType.wifi,\n wimax: NetInfoStateType.wimax,\n mixed: NetInfoStateType.other\n};\nconst effectiveTypeMapping = {\n '2g': NetInfoCellularGeneration['2g'],\n '3g': NetInfoCellularGeneration['3g'],\n '4g': NetInfoCellularGeneration['4g'],\n 'slow-2g': NetInfoCellularGeneration['2g']\n}; // Determine current state of connection\n\nconst getCurrentState = _requestedInterface => {\n const isConnected = isWindowPresent ? navigator.onLine : false;\n const baseState = {\n isInternetReachable: null\n }; // If we don't have a connection object, we return minimal information\n\n if (!connection) {\n if (isConnected) {\n const state = { ...baseState,\n isConnected: true,\n type: NetInfoStateType.other,\n details: {\n isConnectionExpensive: false\n }\n };\n return state;\n }\n\n const state = { ...baseState,\n isConnected: false,\n isInternetReachable: false,\n type: NetInfoStateType.none,\n details: null\n };\n return state;\n } // Otherwise try to return detailed information\n\n\n const isConnectionExpensive = connection.saveData;\n const type = connection.type ? typeMapping[connection.type] : isConnected ? NetInfoStateType.other : NetInfoStateType.unknown;\n\n if (type === NetInfoStateType.bluetooth) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n } else if (type === NetInfoStateType.cellular) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n cellularGeneration: effectiveTypeMapping[connection.effectiveType] || null,\n carrier: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.ethernet) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n ipAddress: null,\n subnet: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.wifi) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n ssid: null,\n bssid: null,\n strength: null,\n ipAddress: null,\n subnet: null,\n frequency: null,\n linkSpeed: null,\n rxLinkSpeed: null,\n txLinkSpeed: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.wimax) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n } else if (type === NetInfoStateType.none) {\n const state = { ...baseState,\n isConnected: false,\n isInternetReachable: false,\n type,\n details: null\n };\n return state;\n } else if (type === NetInfoStateType.unknown) {\n const state = { ...baseState,\n isConnected,\n isInternetReachable: null,\n type,\n details: null\n };\n return state;\n }\n\n const state = { ...baseState,\n isConnected: true,\n type: NetInfoStateType.other,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n};\n\nconst handlers = [];\nconst nativeHandlers = [];\nconst RNCNetInfo = {\n addListener(type, handler) {\n switch (type) {\n case DEVICE_CONNECTIVITY_EVENT:\n {\n const nativeHandler = () => {\n handler(getCurrentState());\n };\n\n if (connection) {\n connection.addEventListener('change', nativeHandler);\n } else {\n if (isWindowPresent) {\n window.addEventListener('online', nativeHandler, false);\n window.addEventListener('offline', nativeHandler, false);\n }\n } // Remember handlers\n\n\n handlers.push(handler);\n nativeHandlers.push(nativeHandler);\n break;\n }\n }\n },\n\n removeListeners(type, handler) {\n switch (type) {\n case DEVICE_CONNECTIVITY_EVENT:\n {\n // Get native handler\n const index = handlers.indexOf(handler);\n const nativeHandler = nativeHandlers[index];\n\n if (connection) {\n connection.removeEventListener('change', nativeHandler);\n } else {\n if (isWindowPresent) {\n window.removeEventListener('online', nativeHandler);\n window.removeEventListener('offline', nativeHandler);\n }\n } // Remove handlers\n\n\n handlers.splice(index, 1);\n nativeHandlers.splice(index, 1);\n break;\n }\n }\n },\n\n async getCurrentState(requestedInterface) {\n return getCurrentState(requestedInterface);\n },\n\n configure() {\n return;\n }\n\n};\nexport default RNCNetInfo;\n//# sourceMappingURL=nativeModule.web.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { NativeEventEmitter } from 'react-native';\nimport RNCNetInfo from './nativeModule';\nimport { DEVICE_CONNECTIVITY_EVENT } from './privateTypes';\nconst nativeEventEmitter = new NativeEventEmitter(); // Listen to connectivity events\n\nRNCNetInfo.addListener(DEVICE_CONNECTIVITY_EVENT, event => {\n nativeEventEmitter.emit(DEVICE_CONNECTIVITY_EVENT, event);\n});\nexport default { ...RNCNetInfo,\n eventEmitter: nativeEventEmitter\n};\n//# sourceMappingURL=nativeInterface.web.js.map","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport default class InternetReachability {\n constructor(configuration, listener) {\n _defineProperty(this, \"_configuration\", void 0);\n\n _defineProperty(this, \"_listener\", void 0);\n\n _defineProperty(this, \"_isInternetReachable\", undefined);\n\n _defineProperty(this, \"_currentInternetReachabilityCheckHandler\", null);\n\n _defineProperty(this, \"_currentTimeoutHandle\", null);\n\n _defineProperty(this, \"_setIsInternetReachable\", isInternetReachable => {\n if (this._isInternetReachable === isInternetReachable) {\n return;\n }\n\n this._isInternetReachable = isInternetReachable;\n\n this._listener(this._isInternetReachable);\n });\n\n _defineProperty(this, \"_setExpectsConnection\", expectsConnection => {\n // Cancel any pending check\n if (this._currentInternetReachabilityCheckHandler !== null) {\n this._currentInternetReachabilityCheckHandler.cancel();\n\n this._currentInternetReachabilityCheckHandler = null;\n } // Cancel any pending timeout\n\n\n if (this._currentTimeoutHandle !== null) {\n clearTimeout(this._currentTimeoutHandle);\n this._currentTimeoutHandle = null;\n }\n\n if (expectsConnection && this._configuration.reachabilityShouldRun()) {\n // If we expect a connection, start the process for finding if we have one\n // Set the state to \"null\" if it was previously false\n if (!this._isInternetReachable) {\n this._setIsInternetReachable(null);\n } // Start a network request to check for internet\n\n\n this._currentInternetReachabilityCheckHandler = this._checkInternetReachability();\n } else {\n // If we don't expect a connection or don't run reachability check, just change the state to \"false\"\n this._setIsInternetReachable(false);\n }\n });\n\n _defineProperty(this, \"_checkInternetReachability\", () => {\n const controller = new AbortController();\n const responsePromise = fetch(this._configuration.reachabilityUrl, {\n headers: this._configuration.reachabilityHeaders,\n method: this._configuration.reachabilityMethod,\n cache: 'no-cache',\n signal: controller.signal\n }); // Create promise that will reject after the request timeout has been reached\n\n let timeoutHandle;\n const timeoutPromise = new Promise((_, reject) => {\n timeoutHandle = setTimeout(() => reject('timedout'), this._configuration.reachabilityRequestTimeout);\n }); // Create promise that makes it possible to cancel a pending request through a reject\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n\n let cancel = () => {};\n\n const cancelPromise = new Promise((_, reject) => {\n cancel = () => reject('canceled');\n });\n const promise = Promise.race([responsePromise, timeoutPromise, cancelPromise]).then(response => {\n return this._configuration.reachabilityTest(response);\n }).then(result => {\n this._setIsInternetReachable(result);\n\n const nextTimeoutInterval = this._isInternetReachable ? this._configuration.reachabilityLongTimeout : this._configuration.reachabilityShortTimeout;\n this._currentTimeoutHandle = setTimeout(this._checkInternetReachability, nextTimeoutInterval);\n }).catch(error => {\n if ('canceled' === error) {\n controller.abort();\n } else {\n if ('timedout' === error) {\n controller.abort();\n }\n\n this._setIsInternetReachable(false);\n\n this._currentTimeoutHandle = setTimeout(this._checkInternetReachability, this._configuration.reachabilityShortTimeout);\n }\n }) // Clear request timeout and propagate any errors\n .then(() => {\n clearTimeout(timeoutHandle);\n }, error => {\n clearTimeout(timeoutHandle);\n throw error;\n });\n return {\n promise,\n cancel\n };\n });\n\n _defineProperty(this, \"update\", state => {\n if (typeof state.isInternetReachable === 'boolean' && this._configuration.useNativeReachability) {\n this._setIsInternetReachable(state.isInternetReachable);\n } else {\n this._setExpectsConnection(state.isConnected);\n }\n });\n\n _defineProperty(this, \"currentState\", () => {\n return this._isInternetReachable;\n });\n\n _defineProperty(this, \"tearDown\", () => {\n // Cancel any pending check\n if (this._currentInternetReachabilityCheckHandler !== null) {\n this._currentInternetReachabilityCheckHandler.cancel();\n\n this._currentInternetReachabilityCheckHandler = null;\n } // Cancel any pending timeout\n\n\n if (this._currentTimeoutHandle !== null) {\n clearTimeout(this._currentTimeoutHandle);\n this._currentTimeoutHandle = null;\n }\n });\n\n this._configuration = configuration;\n this._listener = listener;\n }\n\n}\n//# sourceMappingURL=internetReachability.js.map","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport NativeInterface from './nativeInterface';\nimport InternetReachability from './internetReachability';\nimport * as PrivateTypes from './privateTypes';\nexport default class State {\n constructor(configuration) {\n _defineProperty(this, \"_nativeEventSubscription\", null);\n\n _defineProperty(this, \"_subscriptions\", new Set());\n\n _defineProperty(this, \"_latestState\", null);\n\n _defineProperty(this, \"_internetReachability\", void 0);\n\n _defineProperty(this, \"_handleNativeStateUpdate\", state => {\n // Update the internet reachability module\n this._internetReachability.update(state); // Convert the state from native to JS shape\n\n\n const convertedState = this._convertState(state); // Update the listeners\n\n\n this._latestState = convertedState;\n\n this._subscriptions.forEach(handler => handler(convertedState));\n });\n\n _defineProperty(this, \"_handleInternetReachabilityUpdate\", isInternetReachable => {\n if (!this._latestState) {\n return;\n }\n\n const nextState = { ...this._latestState,\n isInternetReachable\n };\n this._latestState = nextState;\n\n this._subscriptions.forEach(handler => handler(nextState));\n });\n\n _defineProperty(this, \"_fetchCurrentState\", async requestedInterface => {\n const state = await NativeInterface.getCurrentState(requestedInterface); // Update the internet reachability module\n\n this._internetReachability.update(state); // Convert and store the new state\n\n\n const convertedState = this._convertState(state);\n\n if (!requestedInterface) {\n this._latestState = convertedState;\n\n this._subscriptions.forEach(handler => handler(convertedState));\n }\n\n return convertedState;\n });\n\n _defineProperty(this, \"_convertState\", input => {\n if (typeof input.isInternetReachable === 'boolean') {\n return input;\n } else {\n return { ...input,\n isInternetReachable: this._internetReachability.currentState()\n };\n }\n });\n\n _defineProperty(this, \"latest\", requestedInterface => {\n if (requestedInterface) {\n return this._fetchCurrentState(requestedInterface);\n } else if (this._latestState) {\n return Promise.resolve(this._latestState);\n } else {\n return this._fetchCurrentState();\n }\n });\n\n _defineProperty(this, \"add\", handler => {\n // Add the subscription handler to our set\n this._subscriptions.add(handler); // Send it the latest data we have\n\n\n if (this._latestState) {\n handler(this._latestState);\n } else {\n this.latest().then(handler);\n }\n });\n\n _defineProperty(this, \"remove\", handler => {\n this._subscriptions.delete(handler);\n });\n\n _defineProperty(this, \"tearDown\", () => {\n if (this._internetReachability) {\n this._internetReachability.tearDown();\n }\n\n if (this._nativeEventSubscription) {\n this._nativeEventSubscription.remove();\n }\n\n this._subscriptions.clear();\n });\n\n // Add the listener to the internet connectivity events\n this._internetReachability = new InternetReachability(configuration, this._handleInternetReachabilityUpdate); // Add the subscription to the native events\n\n this._nativeEventSubscription = NativeInterface.eventEmitter.addListener(PrivateTypes.DEVICE_CONNECTIVITY_EVENT, this._handleNativeStateUpdate); // Fetch the current state from the native module\n\n this._fetchCurrentState();\n }\n\n}\n//# sourceMappingURL=state.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { useState, useEffect, useCallback } from 'react';\nimport { Platform } from 'react-native';\nimport DEFAULT_CONFIGURATION from './internal/defaultConfiguration';\nimport NativeInterface from './internal/nativeInterface';\nimport State from './internal/state';\nimport * as Types from './internal/types'; // Stores the currently used configuration\n\nlet _configuration = DEFAULT_CONFIGURATION; // Stores the singleton reference to the state manager\n\nlet _state = null;\n\nconst createState = () => {\n return new State(_configuration);\n}; // Track ongoing requests\n\n\nlet isRequestInProgress = false;\nlet requestQueue = [];\n/**\n * Configures the library with the given configuration. Note that calling this will stop all\n * previously added listeners from being called again. It is best to call this right when your\n * application is started to avoid issues. The configuration sets up a global singleton instance.\n *\n * @param configuration The new configuration to set.\n */\n\nexport function configure(configuration) {\n _configuration = { ...DEFAULT_CONFIGURATION,\n ...configuration\n };\n\n if (_state) {\n _state.tearDown();\n\n _state = createState();\n }\n\n if (Platform.OS === 'ios') {\n NativeInterface.configure(configuration);\n }\n}\n/**\n * Returns a `Promise` that resolves to a `NetInfoState` object.\n * This function operates on the global singleton instance configured using `configure()`\n *\n * @param [requestedInterface] interface from which to obtain the information\n *\n * @returns A Promise which contains the current connection state.\n */\n\nexport function fetch(requestedInterface) {\n if (!_state) {\n _state = createState();\n }\n\n return _state.latest(requestedInterface);\n}\n/**\n * Force-refreshes the internal state of the global singleton managed by this library.\n *\n * @returns A Promise which contains the updated connection state.\n */\n\nexport function refresh() {\n if (!_state) {\n _state = createState();\n } // If a request is already in progress, return a promise that will resolve when the current request finishes\n\n\n if (isRequestInProgress) {\n return new Promise(resolve => {\n requestQueue.push(resolve);\n });\n }\n\n isRequestInProgress = true;\n return _state._fetchCurrentState().then(result => {\n requestQueue.forEach(resolve => resolve(result));\n requestQueue = [];\n return result;\n }).finally(() => {\n isRequestInProgress = false;\n });\n}\n/**\n * Subscribe to the global singleton's connection information. The callback is called with a parameter of type\n * [`NetInfoState`](README.md#netinfostate) whenever the connection state changes. Your listener\n * will be called with the latest information soon after you subscribe and then with any\n * subsequent changes afterwards. You should not assume that the listener is called in the same\n * way across devices or platforms.\n *\n * @param listener The listener which is called when the network state changes.\n *\n * @returns A function which can be called to unsubscribe.\n */\n\nexport function addEventListener(listener) {\n if (!_state) {\n _state = createState();\n }\n\n _state.add(listener);\n\n return () => {\n _state && _state.remove(listener);\n };\n}\n/**\n * A React Hook into this library's singleton which updates when the connection state changes.\n *\n * @param {Partial<Types.NetInfoConfiguration>} configuration - Configure the isolated network checker managed by this hook\n *\n * @returns The connection state.\n */\n\nexport function useNetInfo(configuration) {\n if (configuration) {\n configure(configuration);\n }\n\n const [netInfo, setNetInfo] = useState({\n type: Types.NetInfoStateType.unknown,\n isConnected: null,\n isInternetReachable: null,\n details: null\n });\n useEffect(() => {\n const unsubscribe = addEventListener(setNetInfo);\n return () => unsubscribe();\n }, []);\n return netInfo;\n}\n/**\n * A React Hook which manages an isolated instance of the network info manager.\n * This is not a hook into a singleton shared state. NetInfo.configure, NetInfo.addEventListener,\n * NetInfo.fetch, NetInfo.refresh are performed on a global singleton and have no affect on this hook.\n * @param {boolean} isPaused - Pause the internal network checks.\n * @param {Partial<Types.NetInfoConfiguration>} configuration - Configure the isolated network checker managed by this hook\n *\n * @returns the netInfo state and a refresh function\n */\n\nexport function useNetInfoInstance(isPaused = false, configuration) {\n const [networkInfoManager, setNetworkInfoManager] = useState();\n const [netInfo, setNetInfo] = useState({\n type: Types.NetInfoStateType.unknown,\n isConnected: null,\n isInternetReachable: null,\n details: null\n });\n useEffect(() => {\n if (isPaused) {\n return;\n }\n\n const config = { ...DEFAULT_CONFIGURATION,\n ...configuration\n };\n const state = new State(config);\n setNetworkInfoManager(state);\n state.add(setNetInfo);\n return state.tearDown;\n }, [isPaused, configuration]);\n const refresh = useCallback(() => {\n if (networkInfoManager && !isRequestInProgress) {\n isRequestInProgress = true;\n\n networkInfoManager._fetchCurrentState().finally(() => {\n isRequestInProgress = false;\n });\n }\n }, [networkInfoManager]);\n return {\n netInfo,\n refresh\n };\n}\nexport * from './internal/types';\nexport default {\n configure,\n fetch,\n refresh,\n addEventListener,\n useNetInfo,\n useNetInfoInstance\n};\n//# sourceMappingURL=index.js.map","// adapters/native/networkInfoNative.native.ts\nimport NetInfo from \"@react-native-community/netinfo\";\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\nexport class NetworkInfoTrackerNative {\n private telemetry?: Telemetry;\n\n constructor() {\n\n }\n\n async collect(): Promise<NetworkInfo> {\n try {\n const netState = await NetInfo.fetch();\n return {\n type: netState.type,\n isConnected: netState.isConnected ?? undefined,\n };\n } catch {\n return { type: \"unknown\", isConnected: undefined };\n }\n }\n\n /**\n * collect() feeds the steady-state Context block on every event (no standalone\n * network_info event, ADR-0002). A connectivity *transition* is still its own\n * v3 `network_change` event, emitted via the shared NetworkChangeEmitter.\n */\n async start(telemetry: Telemetry): Promise<NetworkInfo> {\n this.telemetry = telemetry;\n const changes = new NetworkChangeEmitter(telemetry);\n const info = await this.collect();\n changes.onSample(info.type); // seed baseline so the first real transition emits\n NetInfo.addEventListener(state => changes.onSample(state.type));\n return info;\n }\n}\n"],"names":["DEFAULT_CONFIGURATION","response","DEVICE_CONNECTIVITY_EVENT","NetInfoStateType","NetInfoCellularGeneration","isWindowPresent","connection","typeMapping","effectiveTypeMapping","getCurrentState","_requestedInterface","isConnected","baseState","isConnectionExpensive","type","handlers","nativeHandlers","RNCNetInfo","handler","nativeHandler","index","requestedInterface","nativeEventEmitter","NativeEventEmitter","event","NativeInterface","_defineProperty","obj","key","value","InternetReachability","configuration","listener","isInternetReachable","expectsConnection","controller","responsePromise","timeoutHandle","timeoutPromise","_","reject","cancel","cancelPromise","result","nextTimeoutInterval","error","state","State","convertedState","nextState","input","PrivateTypes.DEVICE_CONNECTIVITY_EVENT","_configuration","_state","createState","isRequestInProgress","requestQueue","configure","Platform","fetch","refresh","resolve","addEventListener","useNetInfo","netInfo","setNetInfo","useState","Types.NetInfoStateType","useEffect","unsubscribe","useNetInfoInstance","isPaused","networkInfoManager","setNetworkInfoManager","config","useCallback","NetInfo","NetworkInfoTrackerNative","netState","telemetry","changes","NetworkChangeEmitter","info"],"mappings":"6KAAMA,EAAwB,CAC5B,gBAAiB,IACjB,mBAAoB,OACpB,oBAAqB,CAAA,EACrB,iBAAkBC,GAAY,QAAQ,QAAQA,EAAS,SAAW,GAAG,EACrE,yBAA0B,EAAI,IAE9B,wBAAyB,GAAK,IAE9B,2BAA4B,GAAK,IAEjC,sBAAuB,IAAM,GAC7B,oBAAqB,GACr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,KAAK,UAAYA,EACjB,MAAMC,EAAU,IAAIC,EAAAA,qBAAqBF,CAAS,EAC5CG,EAAO,MAAM,KAAK,QAAA,EACxB,OAAAF,EAAQ,SAASE,EAAK,IAAI,EAC1BN,EAAQ,iBAAiB9B,GAASkC,EAAQ,SAASlC,EAAM,IAAI,CAAC,EACvDoC,CACX,CACJ","x_google_ignoreList":[0,1,2,3,4,5,6,7]}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./networkChange-CUO1hRLj.cjs");async function e(){return typeof navigator<"u"&&"connection"in navigator?{type:navigator.connection.type||"unknown",isConnected:navigator.onLine}:{type:"unknown",isConnected:typeof navigator<"u"?navigator.onLine:void 0}}class c{constructor(){}async collect(){return e()}async start(t){this.telemetry=t;const o=new r.NetworkChangeEmitter(t),i=await this.collect();o.onSample(i.type);const n=async()=>o.onSample((await e()).type);return(typeof navigator<"u"?navigator.connection:void 0)?.addEventListener?.("change",n),typeof window<"u"&&(window.addEventListener("online",n),window.addEventListener("offline",n)),i}}exports.NetworkInfoTrackerWeb=c;exports.getNetworkInfo=e;
2
+ //# sourceMappingURL=networkInfo.web-DJmw1sNK.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networkInfo.web-DJmw1sNK.cjs","sources":["../src/adapters/web/networkInfo.web.ts"],"sourcesContent":["// adapters/web/networkInfoWeb.web.ts\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\n\n\nexport async function getNetworkInfo(): Promise<NetworkInfo> {\n if (typeof navigator !== \"undefined\" && \"connection\" in navigator) {\n const conn = (navigator as any).connection;\n return {\n type: conn.type || \"unknown\",\n isConnected: navigator.onLine,\n // downlink: conn.downlink,\n // effectiveType: conn.effectiveType,\n };\n }\n\n // Fallback\n return {\n type: \"unknown\",\n isConnected: typeof navigator !== \"undefined\" ? navigator.onLine : undefined,\n };\n}\n\nexport class NetworkInfoTrackerWeb {\n // constructor(private telemetry: Telemetry) { }\n constructor() { }\n\n async collect(): Promise<NetworkInfo> {\n return getNetworkInfo();\n }\n\n private telemetry!: Telemetry;\n\n async start(telemetry: Telemetry): Promise<NetworkInfo> {\n // collect() feeds the steady-state Context block (no standalone network_info event,\n // ADR-0002). A connectivity *transition* is its own v3 `network_change` event,\n // emitted via the shared NetworkChangeEmitter (lockstep with native).\n this.telemetry = telemetry;\n const changes = new NetworkChangeEmitter(telemetry);\n const info = await this.collect();\n changes.onSample(info.type); // seed baseline so the first real transition emits\n const sample = async () => changes.onSample((await getNetworkInfo()).type);\n\n const conn = typeof navigator !== \"undefined\" ? (navigator as any).connection : undefined;\n conn?.addEventListener?.(\"change\", sample);\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"online\", sample);\n window.addEventListener(\"offline\", sample);\n }\n return info;\n }\n}\n"],"names":["getNetworkInfo","NetworkInfoTrackerWeb","telemetry","changes","NetworkChangeEmitter","info","sample"],"mappings":"gIAOA,eAAsBA,GAAuC,CACzD,OAAI,OAAO,UAAc,KAAe,eAAgB,UAE7C,CACH,KAFU,UAAkB,WAEjB,MAAQ,UACnB,YAAa,UAAU,MAAA,EAOxB,CACH,KAAM,UACN,YAAa,OAAO,UAAc,IAAc,UAAU,OAAS,MAAA,CAE3E,CAEO,MAAMC,CAAsB,CAE/B,aAAc,CAAE,CAEhB,MAAM,SAAgC,CAClC,OAAOD,EAAA,CACX,CAIA,MAAM,MAAME,EAA4C,CAIpD,KAAK,UAAYA,EACjB,MAAMC,EAAU,IAAIC,EAAAA,qBAAqBF,CAAS,EAC5CG,EAAO,MAAM,KAAK,QAAA,EACxBF,EAAQ,SAASE,EAAK,IAAI,EAC1B,MAAMC,EAAS,SAAYH,EAAQ,UAAU,MAAMH,EAAA,GAAkB,IAAI,EAGzE,OADa,OAAO,UAAc,IAAe,UAAkB,WAAa,SAC1E,mBAAmB,SAAUM,CAAM,EACrC,OAAO,OAAW,MAClB,OAAO,iBAAiB,SAAUA,CAAM,EACxC,OAAO,iBAAiB,UAAWA,CAAM,GAEtCD,CACX,CACJ"}
@@ -0,0 +1,32 @@
1
+ import { N as c } from "./networkChange-D39hdSb0.js";
2
+ async function i() {
3
+ return typeof navigator < "u" && "connection" in navigator ? {
4
+ type: navigator.connection.type || "unknown",
5
+ isConnected: navigator.onLine
6
+ // downlink: conn.downlink,
7
+ // effectiveType: conn.effectiveType,
8
+ } : {
9
+ type: "unknown",
10
+ isConnected: typeof navigator < "u" ? navigator.onLine : void 0
11
+ };
12
+ }
13
+ class d {
14
+ // constructor(private telemetry: Telemetry) { }
15
+ constructor() {
16
+ }
17
+ async collect() {
18
+ return i();
19
+ }
20
+ async start(e) {
21
+ this.telemetry = e;
22
+ const o = new c(e), t = await this.collect();
23
+ o.onSample(t.type);
24
+ const n = async () => o.onSample((await i()).type);
25
+ return (typeof navigator < "u" ? navigator.connection : void 0)?.addEventListener?.("change", n), typeof window < "u" && (window.addEventListener("online", n), window.addEventListener("offline", n)), t;
26
+ }
27
+ }
28
+ export {
29
+ d as NetworkInfoTrackerWeb,
30
+ i as getNetworkInfo
31
+ };
32
+ //# sourceMappingURL=networkInfo.web-twcNn_hc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networkInfo.web-twcNn_hc.js","sources":["../src/adapters/web/networkInfo.web.ts"],"sourcesContent":["// adapters/web/networkInfoWeb.web.ts\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\n\n\nexport async function getNetworkInfo(): Promise<NetworkInfo> {\n if (typeof navigator !== \"undefined\" && \"connection\" in navigator) {\n const conn = (navigator as any).connection;\n return {\n type: conn.type || \"unknown\",\n isConnected: navigator.onLine,\n // downlink: conn.downlink,\n // effectiveType: conn.effectiveType,\n };\n }\n\n // Fallback\n return {\n type: \"unknown\",\n isConnected: typeof navigator !== \"undefined\" ? navigator.onLine : undefined,\n };\n}\n\nexport class NetworkInfoTrackerWeb {\n // constructor(private telemetry: Telemetry) { }\n constructor() { }\n\n async collect(): Promise<NetworkInfo> {\n return getNetworkInfo();\n }\n\n private telemetry!: Telemetry;\n\n async start(telemetry: Telemetry): Promise<NetworkInfo> {\n // collect() feeds the steady-state Context block (no standalone network_info event,\n // ADR-0002). A connectivity *transition* is its own v3 `network_change` event,\n // emitted via the shared NetworkChangeEmitter (lockstep with native).\n this.telemetry = telemetry;\n const changes = new NetworkChangeEmitter(telemetry);\n const info = await this.collect();\n changes.onSample(info.type); // seed baseline so the first real transition emits\n const sample = async () => changes.onSample((await getNetworkInfo()).type);\n\n const conn = typeof navigator !== \"undefined\" ? (navigator as any).connection : undefined;\n conn?.addEventListener?.(\"change\", sample);\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"online\", sample);\n window.addEventListener(\"offline\", sample);\n }\n return info;\n }\n}\n"],"names":["getNetworkInfo","NetworkInfoTrackerWeb","telemetry","changes","NetworkChangeEmitter","info","sample"],"mappings":";AAOA,eAAsBA,IAAuC;AACzD,SAAI,OAAO,YAAc,OAAe,gBAAgB,YAE7C;AAAA,IACH,MAFU,UAAkB,WAEjB,QAAQ;AAAA,IACnB,aAAa,UAAU;AAAA;AAAA;AAAA,EAAA,IAOxB;AAAA,IACH,MAAM;AAAA,IACN,aAAa,OAAO,YAAc,MAAc,UAAU,SAAS;AAAA,EAAA;AAE3E;AAEO,MAAMC,EAAsB;AAAA;AAAA,EAE/B,cAAc;AAAA,EAAE;AAAA,EAEhB,MAAM,UAAgC;AAClC,WAAOD,EAAA;AAAA,EACX;AAAA,EAIA,MAAM,MAAME,GAA4C;AAIpD,SAAK,YAAYA;AACjB,UAAMC,IAAU,IAAIC,EAAqBF,CAAS,GAC5CG,IAAO,MAAM,KAAK,QAAA;AACxB,IAAAF,EAAQ,SAASE,EAAK,IAAI;AAC1B,UAAMC,IAAS,YAAYH,EAAQ,UAAU,MAAMH,EAAA,GAAkB,IAAI;AAGzE,YADa,OAAO,YAAc,MAAe,UAAkB,aAAa,SAC1E,mBAAmB,UAAUM,CAAM,GACrC,OAAO,SAAW,QAClB,OAAO,iBAAiB,UAAUA,CAAM,GACxC,OAAO,iBAAiB,WAAWA,CAAM,IAEtCD;AAAA,EACX;AACJ;"}
@@ -0,0 +1,15 @@
1
+ import { Telemetry } from '../core/telemetry';
2
+ /**
3
+ * Shared foreground/background emitter — the single source of truth so the native
4
+ * (RN AppState) and web (visibilitychange) lifecycle adapters stay in lockstep on the
5
+ * v3 `app_lifecycle` contract (#30).
6
+ *
7
+ * Feed it the current active state via `onState(isActive)`. It emits `app_lifecycle` only
8
+ * on a transition, carrying the direction as `app_lifecycle.state` (foreground|background).
9
+ */
10
+ export declare class AppLifecycleEmitter {
11
+ private telemetry;
12
+ private active?;
13
+ constructor(telemetry: Telemetry);
14
+ onState(isActive: boolean): void;
15
+ }
@@ -0,0 +1,2 @@
1
+ import { TelemetryEvent } from '../core/telemetry';
2
+ export declare function buildBatch(events: TelemetryEvent[]): string;
@@ -0,0 +1,13 @@
1
+ import { Telemetry } from '../core/telemetry';
2
+ export type CrashCause = "Error" | "UnhandledRejection" | "ConsoleError" | "ConsoleWarn";
3
+ export declare function buildCrashAttributes(cause: CrashCause, fields?: {
4
+ message?: unknown;
5
+ stacktrace?: unknown;
6
+ fatal?: boolean;
7
+ }): Record<string, any>;
8
+ /**
9
+ * Patch console.error/warn to funnel into `app.crash` (cause ConsoleError/ConsoleWarn).
10
+ * Opt-out: callers only invoke this when console capture is enabled. Returns a restore fn.
11
+ * A reentrancy guard prevents the SDK's own console writes during logging from re-capturing.
12
+ */
13
+ export declare function captureConsole(telemetry: Telemetry, target?: Pick<Console, "error" | "warn">): () => void;
@@ -0,0 +1,12 @@
1
+ export interface FrameAggregate {
2
+ value: number;
3
+ attributes: {
4
+ "frame.max_ms": number;
5
+ "frame.p95_ms": number;
6
+ "frame.dropped_count": number;
7
+ "frame.target_hz": number;
8
+ "frame.source": string;
9
+ };
10
+ }
11
+ /** deltas must be non-empty. Percentile is nearest-rank on the sorted deltas. */
12
+ export declare function aggregateFrames(deltas: number[], targetFPS: number, source: string): FrameAggregate;
@@ -0,0 +1,9 @@
1
+ export declare function buildHttpAttributes(args: {
2
+ url: string;
3
+ method: string;
4
+ statusCode: number;
5
+ durationMs: number;
6
+ error?: unknown;
7
+ requestBody?: unknown;
8
+ responseSize?: number;
9
+ }): Record<string, any>;
@@ -0,0 +1,17 @@
1
+ import { Telemetry } from '../core/telemetry';
2
+ /**
3
+ * Best-effort native tap capture → v3 `user.interaction` (#33). No DOM `target_tag`/
4
+ * `target_class` — those are web-only; their absence on native is intentional, not an error.
5
+ *
6
+ * RN has no global tap stream, so `responderProps()` returns a top-level responder-capture
7
+ * handler the consumer spreads onto their app root <View>. It records the tap and returns
8
+ * false, so it observes the gesture without ever claiming it.
9
+ */
10
+ export declare class InteractionEmitter {
11
+ private telemetry;
12
+ constructor(telemetry: Telemetry);
13
+ record(type?: string, extra?: Record<string, any>): Promise<void>;
14
+ responderProps(): {
15
+ onStartShouldSetResponderCapture: () => boolean;
16
+ };
17
+ }
@@ -0,0 +1,9 @@
1
+ import { Telemetry } from '../../core/telemetry';
2
+ export type CrashHandlerOptions = {
3
+ captureConsole?: boolean;
4
+ };
5
+ export declare class CrashHandlerNative {
6
+ private telemetry;
7
+ constructor(telemetry: Telemetry);
8
+ attach(options?: CrashHandlerOptions): Promise<void>;
9
+ }
@@ -0,0 +1,10 @@
1
+ import { Telemetry, DeviceInfo } from '../../core/telemetry';
2
+ export declare class DeviceInfoTrackerNative {
3
+ constructor();
4
+ collect(): Promise<DeviceInfo>;
5
+ /**
6
+ * Context-only adapter. collect() feeds the Context block on every event;
7
+ * start() emits no standalone device_info event (ADR-0002).
8
+ */
9
+ start(_telemetry: Telemetry): Promise<void>;
10
+ }
@@ -0,0 +1,16 @@
1
+ import { Telemetry } from '../../core/telemetry';
2
+ /**
3
+ * Samples frame deltas via requestAnimationFrame and emits an aggregated
4
+ * `frame_render_time` metric (max/p95/dropped_count) once per window — instead of one event
5
+ * per dropped frame. The metric shape matches the iOS contract (docs/edgerum-contract.md).
6
+ */
7
+ export declare class FrameDropTrackerNative {
8
+ private telemetry;
9
+ private targetFPS;
10
+ private windowMs;
11
+ private lastFrameTime;
12
+ private windowStart;
13
+ private deltas;
14
+ constructor(telemetry: Telemetry, targetFPS?: number, windowMs?: number);
15
+ start(): Promise<void>;
16
+ }
@@ -0,0 +1,23 @@
1
+ import { Telemetry } from '../../core/telemetry';
2
+ /**
3
+ * Intercepts global `fetch` calls in React Native to log detailed telemetry data
4
+ * about network requests, including timing, method, status, payload sizes, and errors.
5
+ *
6
+ * Use the `start()` method to begin interception.
7
+ */
8
+ export declare class NetworkTrackerNative {
9
+ private telemetry;
10
+ private originalFetch;
11
+ constructor(telemetry: Telemetry);
12
+ /**
13
+ * Starts intercepting global fetch requests.
14
+ * Wraps `global.fetch` with telemetry logging.
15
+ *
16
+ * @returns Promise<void> resolves immediately after interception is set up.
17
+ */
18
+ start(): Promise<void>;
19
+ /**
20
+ * Restores the original fetch function, removing the interception.
21
+ */
22
+ stop(): void;
23
+ }
@@ -0,0 +1,25 @@
1
+ import { Telemetry } from '../../core/telemetry';
2
+ /**
3
+ * Logs JavaScript memory usage and pressure level at regular intervals
4
+ * in a React Native environment.
5
+ */
6
+ export declare class TelemetryMemoryUsageNative {
7
+ private telemetry;
8
+ private intervalId;
9
+ constructor(telemetry: Telemetry);
10
+ /**
11
+ * Records a memory_usage metric (value = used heap MB) per sample, on the v3 metric path.
12
+ */
13
+ recordMemoryUsage(): void;
14
+ /**
15
+ * Starts periodic memory usage logging at the given interval.
16
+ * Returns a resolved Promise for async startup flows.
17
+ *
18
+ * @param intervalMs Sampling interval in milliseconds (default: 30s)
19
+ */
20
+ start(intervalMs?: number): Promise<void>;
21
+ /**
22
+ * Stops the periodic memory logging if it was started.
23
+ */
24
+ stop(): void;
25
+ }
@@ -0,0 +1,12 @@
1
+ import { Telemetry } from '../../core/telemetry';
2
+ /**
3
+ * Hook into React Navigation events
4
+ * Usage: pass your navigationContainerRef
5
+ */
6
+ export declare class NavigationTrackerNative {
7
+ private tracker;
8
+ private currentRoute?;
9
+ constructor(telemetry: Telemetry);
10
+ attach(navigationRef: any): void;
11
+ private getActiveRouteName;
12
+ }
@@ -0,0 +1,12 @@
1
+ import { NetworkInfo, Telemetry } from '../../core/telemetry';
2
+ export declare class NetworkInfoTrackerNative {
3
+ private telemetry?;
4
+ constructor();
5
+ collect(): Promise<NetworkInfo>;
6
+ /**
7
+ * collect() feeds the steady-state Context block on every event (no standalone
8
+ * network_info event, ADR-0002). A connectivity *transition* is still its own
9
+ * v3 `network_change` event, emitted via the shared NetworkChangeEmitter.
10
+ */
11
+ start(telemetry: Telemetry): Promise<NetworkInfo>;
12
+ }
@@ -0,0 +1,3 @@
1
+ import { Sender } from '../core/telemetry';
2
+ export declare function nativeSender(endpoint?: string, apiKey?: string): Sender;
3
+ export declare function replayFailedNative(endpoint?: string, apiKey?: string): Promise<void>;
@@ -0,0 +1,6 @@
1
+ import { Telemetry } from '../core/telemetry';
2
+ export declare class NavigationTracker {
3
+ private telemetry;
4
+ constructor(telemetry: Telemetry);
5
+ recordRouteChange(from: string, to: string): void;
6
+ }
@@ -0,0 +1,15 @@
1
+ import { Telemetry } from '../core/telemetry';
2
+ /**
3
+ * Shared connectivity-transition emitter — the single source of truth so the web and
4
+ * native network adapters stay in lockstep on the v3 `network_change` contract (#27).
5
+ *
6
+ * Feed it every connectivity sample via `onSample`. It emits `network_change` only on an
7
+ * actual type transition, carrying `network.previous_type`; the current `network.*` context
8
+ * rides on the event via the Context block (and is echoed here for an explicit at-emit value).
9
+ */
10
+ export declare class NetworkChangeEmitter {
11
+ private telemetry;
12
+ private previousType?;
13
+ constructor(telemetry: Telemetry);
14
+ onSample(currentType: string | undefined): void;
15
+ }
@@ -0,0 +1,9 @@
1
+ import { Telemetry } from '../core/telemetry';
2
+ export declare class ScreenTimingTracker {
3
+ private telemetry;
4
+ private startTimes;
5
+ private lastScreen?;
6
+ constructor(telemetry: Telemetry);
7
+ startScreen(screen: string): void;
8
+ endScreen(screen: string): void;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { Telemetry } from '../../core/telemetry';
2
+ export type CrashHandlerOptions = {
3
+ captureConsole?: boolean;
4
+ };
5
+ export declare class CrashHandler {
6
+ private telemetry;
7
+ constructor(telemetry: Telemetry);
8
+ attach(options?: CrashHandlerOptions): Promise<void>;
9
+ }
@@ -0,0 +1,7 @@
1
+ import { DeviceInfo, Telemetry } from '../../core/telemetry';
2
+ export declare class DeviceInfoTrackerWeb {
3
+ private telemetry?;
4
+ constructor();
5
+ collect(): Promise<DeviceInfo>;
6
+ start(telemetry: Telemetry): Promise<void>;
7
+ }
@@ -0,0 +1,16 @@
1
+ import { Telemetry } from '../../core/telemetry';
2
+ /**
3
+ * Samples frame deltas via requestAnimationFrame and emits an aggregated
4
+ * `frame_render_time` metric (max/p95/dropped_count) once per window — instead of one event
5
+ * per dropped frame. The metric shape matches the iOS contract (docs/edgerum-contract.md).
6
+ */
7
+ export declare class FrameDropTrackerWeb {
8
+ private telemetry;
9
+ private targetFPS;
10
+ private windowMs;
11
+ private lastFrameTime;
12
+ private windowStart;
13
+ private deltas;
14
+ constructor(telemetry: Telemetry, targetFPS?: number, windowMs?: number);
15
+ start(): Promise<void>;
16
+ }
@@ -0,0 +1,29 @@
1
+ import { Telemetry } from '../../core/telemetry';
2
+ /**
3
+ * NetworkTrackerWeb intercepts all HTTP requests made through
4
+ * `window.fetch` and `XMLHttpRequest` in a browser environment.
5
+ *
6
+ * It logs detailed telemetry data such as request URL, HTTP method,
7
+ * response status, request and response body sizes, request duration,
8
+ * and error information, if any.
9
+ *
10
+ * This class should be instantiated once and the `start` method called
11
+ * during application initialization to begin interception.
12
+ */
13
+ export declare class NetworkTrackerWeb {
14
+ private telemetry;
15
+ /**
16
+ * Create a NetworkTrackerWeb instance.
17
+ * @param telemetry - An instance of Telemetry used for logging network events.
18
+ */
19
+ constructor(telemetry: Telemetry);
20
+ /**
21
+ * Starts intercepting HTTP requests made through `fetch` and `XMLHttpRequest`.
22
+ *
23
+ * This method patches the global `fetch` function and `XMLHttpRequest` methods
24
+ * `open` and `send` to gather telemetry and log it asynchronously.
25
+ *
26
+ * @returns A Promise that resolves immediately once interception is setup.
27
+ */
28
+ start(): Promise<void>;
29
+ }
@@ -0,0 +1,26 @@
1
+ import { Telemetry } from '../../core/telemetry';
2
+ /**
3
+ * Logs JavaScript heap memory usage and pressure level at regular intervals
4
+ * in browser environments using the Performance API.
5
+ */
6
+ export declare class TelemetryMemoryUsageWeb {
7
+ private telemetry;
8
+ private intervalId;
9
+ constructor(telemetry: Telemetry);
10
+ /**
11
+ * Records a memory_usage metric (value = used heap MB) per sample, on the v3 metric path.
12
+ */
13
+ recordMemoryUsage(): void;
14
+ /**
15
+ * Starts periodic memory usage logging at the specified interval.
16
+ * Returns a Promise that resolves immediately for async compatibility.
17
+ *
18
+ * @param intervalMs Interval in milliseconds between samples (default 30s)
19
+ * @returns Promise<void>
20
+ */
21
+ start(intervalMs?: number): Promise<void>;
22
+ /**
23
+ * Stops the periodic memory logging if running.
24
+ */
25
+ stop(): void;
26
+ }