dev-classes 1.3.11 → 1.3.13
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.
- package/README.md +12 -0
- package/dist/classes/HTTPSApi/deps/apiRequest/apiRequest.js +316 -315
- package/dist/classes/Utils/NetworkInformation/classes/InternetWatchers.d.ts +3 -1
- package/dist/classes/Utils/NetworkInformation/classes/InternetWatchers.js +9 -9
- package/dist/classes/Utils/NetworkInformation/classes/NetworkInformationCordova.js +8 -8
- package/dist/classes/Utils/NetworkInformation/classes/NetworkInformationPC.js +8 -8
- package/dist/classes/Utils/NetworkInformation/classes/types/types.abscruct.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var i = (e, t, s) => (
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var u = (e, t, s) => t in e ? c(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var i = (e, t, s) => (u(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
4
|
const l = {
|
|
5
5
|
isNetworkStatus: window.navigator.onLine,
|
|
6
6
|
listCloseSignals: [],
|
|
7
7
|
isWatcher: !1
|
|
8
8
|
};
|
|
9
|
-
class
|
|
9
|
+
class f {
|
|
10
10
|
constructor() {
|
|
11
11
|
i(this, "state", l);
|
|
12
12
|
i(this, "resetState", () => this.state = l);
|
|
@@ -15,12 +15,12 @@ class g {
|
|
|
15
15
|
if (!this.state.isWatcher) {
|
|
16
16
|
this.state.isWatcher = !0;
|
|
17
17
|
const s = [
|
|
18
|
-
{ event: "online", status: !0 },
|
|
19
|
-
{ event: "offline", status: !1 }
|
|
18
|
+
{ event: "online", status: !0, textStatus: "network" },
|
|
19
|
+
{ event: "offline", status: !1, textStatus: "none" }
|
|
20
20
|
];
|
|
21
21
|
for (let a = 0; a < s.length; a++) {
|
|
22
|
-
const n = new AbortController(), { event: o, status: r } = s[a];
|
|
23
|
-
this.state.listCloseSignals.push(n), window.addEventListener(o, () => t(r), { signal: n.signal });
|
|
22
|
+
const n = new AbortController(), { event: o, status: r, textStatus: h } = s[a];
|
|
23
|
+
this.state.listCloseSignals.push(n), window.addEventListener(o, () => t(r, h), { signal: n.signal });
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -35,5 +35,5 @@ class g {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
export {
|
|
38
|
-
|
|
38
|
+
f as InternetWatchers
|
|
39
39
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
var s = Object.defineProperty;
|
|
2
|
-
var h = (
|
|
3
|
-
var
|
|
2
|
+
var h = (e, o, r) => o in e ? s(e, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[o] = r;
|
|
3
|
+
var t = (e, o, r) => (h(e, typeof o != "symbol" ? o + "" : o, r), r);
|
|
4
4
|
import { NetworkInformationAbstract as i } from "./types/types.abscruct.js";
|
|
5
5
|
class d extends i {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
|
-
|
|
9
|
-
const c = (
|
|
10
|
-
console.error(
|
|
11
|
-
}, a = (
|
|
12
|
-
r(!(
|
|
8
|
+
t(this, "watchers", (r) => {
|
|
9
|
+
const c = (n) => {
|
|
10
|
+
console.error(n);
|
|
11
|
+
}, a = (n) => {
|
|
12
|
+
r(!(n === "unknown" || n === "none"), n);
|
|
13
13
|
};
|
|
14
14
|
navigator == null || navigator.connection.getInfo(a, c);
|
|
15
15
|
});
|
|
16
|
-
|
|
16
|
+
t(this, "getControls", () => ({
|
|
17
17
|
system: "cordova",
|
|
18
18
|
addWatchers: this.watchers,
|
|
19
19
|
removeWatchers: () => {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var o = (r, e, t) => (
|
|
4
|
-
import { InternetWatchers as
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var s = (r, e, t) => e in r ? n(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var o = (r, e, t) => (s(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { InternetWatchers as a } from "./InternetWatchers.js";
|
|
5
5
|
import { NetworkInformationAbstract as h } from "./types/types.abscruct.js";
|
|
6
|
-
class
|
|
6
|
+
class c extends h {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
9
|
-
o(this, "network", new
|
|
9
|
+
o(this, "network", new a());
|
|
10
10
|
o(this, "watchers", (t) => {
|
|
11
|
-
navigator.onLine ? t(!0) : t(!1), this.network.addWatchers(t);
|
|
11
|
+
navigator.onLine ? t(!0, "network") : t(!1, "none"), this.network.addWatchers(t);
|
|
12
12
|
});
|
|
13
13
|
o(this, "getControls", () => ({
|
|
14
14
|
system: "pc",
|
|
@@ -18,5 +18,5 @@ class w extends h {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
c as NetworkInformationPC
|
|
22
22
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type SystemType = 'pc' | 'cordova';
|
|
2
|
-
export type WatcherCB = (status: boolean) => void;
|
|
2
|
+
export type WatcherCB = (status: boolean, textStatus: string) => void;
|
|
3
3
|
export declare abstract class NetworkInformationAbstract {
|
|
4
4
|
protected abstract watchers(cb: WatcherCB): void;
|
|
5
5
|
abstract getControls(): {
|