dev-classes 1.4.37 → 1.4.38

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.
@@ -1,4 +1,4 @@
1
- import { NetworkStatusInfoTracker, OnStatusChange, NetworkConstructorConfig } from './NetworkStatusTracker.types';
1
+ import { NetworkStatusInfoTracker, NetworkStatusConfig, OnStatusChange, NetworkConstructorConfig } from './NetworkStatusTracker.types';
2
2
  export declare class NetworkStatusTracker {
3
3
  private networkInfo;
4
4
  private listUrls;
@@ -6,7 +6,6 @@ export declare class NetworkStatusTracker {
6
6
  private setState;
7
7
  private getState;
8
8
  constructor(listUrls: string[]);
9
- private getFetchOptions;
10
9
  private getConnection;
11
10
  private getIsNetwork;
12
11
  private getTypeNetwork;
@@ -22,8 +21,10 @@ export declare class NetworkStatusTracker {
22
21
  private getControllersMonitoring;
23
22
  private setControllersMonitoring;
24
23
  private startFetching;
25
- private stopFetching;
24
+ stopFetching(): void;
26
25
  checkStatus(onStatusChange?: OnStatusChange, config?: NetworkConstructorConfig): Promise<NetworkStatusInfoTracker>;
27
- private fetchingNetwork;
26
+ fetchingNetwork(onStatusChange: OnStatusChange, config: Required<NetworkStatusConfig>): {
27
+ stop: () => void;
28
+ };
28
29
  getCurrentState(): NetworkStatusInfoTracker;
29
30
  }
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- var k = Object.defineProperty;
2
- var M = (r, e, t) => e in r ? k(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
1
+ var v = Object.defineProperty;
2
+ var M = (r, e, t) => e in r ? v(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var c = (r, e, t) => (M(r, typeof e != "symbol" ? e + "" : e, t), t);
4
4
  const h = class h {
5
5
  static isBrightAndVivid(e) {
@@ -1701,8 +1701,8 @@ const getBodyLength = async (r) => {
1701
1701
  const S = supportsResponseStream && (l === "stream" || l === "response");
1702
1702
  if (supportsResponseStream && (a || S && g)) {
1703
1703
  const R = {};
1704
- ["status", "statusText", "headers"].forEach((v) => {
1705
- R[v] = A[v];
1704
+ ["status", "statusText", "headers"].forEach((k) => {
1705
+ R[k] = A[k];
1706
1706
  });
1707
1707
  const T = utils$1.toFiniteNumber(A.headers.get("content-length")), [C, N] = a && progressEventDecorator(
1708
1708
  T,
@@ -2624,18 +2624,8 @@ class NetworkStatusTracker {
2624
2624
  isMonitoring: !1,
2625
2625
  checkIntervalId: null
2626
2626
  });
2627
- c(this, "getFetchOptions", (e) => ({
2628
- method: "HEAD",
2629
- cache: "no-store",
2630
- signal: e.signal,
2631
- headers: {
2632
- "Cache-Control": "no-cache, no-store, must-revalidate",
2633
- Pragma: "no-cache",
2634
- Expires: "0"
2635
- }
2636
- }));
2637
2627
  c(this, "getIsNetwork", (e) => !["unknown", "none"].includes(e));
2638
- c(this, "getTypeNetwork", ({ effectiveType: e, type: t }, s) => (s || s === null) && (e || t) || "none");
2628
+ c(this, "getTypeNetwork", (e, t) => t || t === null ? "4g" : "none");
2639
2629
  /*-----------------------------------------------------------------------------*/
2640
2630
  c(this, "controllersEvents", {
2641
2631
  online: null,
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "url": "git+https://github.com/SinGlEBW/dev-classes.git"
12
12
  },
13
13
  "license": "MIT",
14
- "version": "1.4.37",
14
+ "version": "1.4.38",
15
15
  "type": "module",
16
16
  "module": "./dist/index.js",
17
17
  "main": "./dist/index.js",