dev-classes 1.0.1
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/dist/classes/Color.d.ts +60 -0
- package/dist/classes/Color.js +198 -0
- package/dist/classes/ControlAppBySocket.d.ts +3 -0
- package/dist/classes/ControlAppBySocket.js +8 -0
- package/dist/classes/DateProcessing.d.ts +63 -0
- package/dist/classes/DateProcessing.js +133 -0
- package/dist/classes/Delay.d.ts +25 -0
- package/dist/classes/Delay.js +66 -0
- package/dist/classes/DownloadFile.d.ts +8 -0
- package/dist/classes/DownloadFile.js +23 -0
- package/dist/classes/Lodash.d.ts +4 -0
- package/dist/classes/Lodash.js +9 -0
- package/dist/classes/Numbers.d.ts +4 -0
- package/dist/classes/Numbers.js +17 -0
- package/dist/classes/ProcessingWS.d.ts +11 -0
- package/dist/classes/ProcessingWS.js +20 -0
- package/dist/classes/SocketApi/SocketApi.d.ts +39 -0
- package/dist/classes/SocketApi/SocketApi.js +108 -0
- package/dist/classes/SocketApi/deps/ConfigInfoConnect/ConfigInfoConnect.d.ts +6 -0
- package/dist/classes/SocketApi/deps/ConfigInfoConnect/ConfigInfoConnect.js +16 -0
- package/dist/classes/SocketApi/deps/ConfigInfoConnect/types.d.js +1 -0
- package/dist/classes/SocketApi/deps/InternetWatcher/InternetWatcher.d.ts +8 -0
- package/dist/classes/SocketApi/deps/InternetWatcher/InternetWatcher.js +24 -0
- package/dist/classes/SocketApi/deps/WsApi/WsApi.d.ts +28 -0
- package/dist/classes/SocketApi/deps/WsApi/WsApi.js +88 -0
- package/dist/classes/SocketApi/deps/WsApi/index.d.ts +2 -0
- package/dist/classes/SocketApi/deps/WsApi/index.js +4 -0
- package/dist/classes/SocketApi/deps/WsApi/types.d.js +1 -0
- package/dist/classes/Utils.d.ts +12 -0
- package/dist/classes/Utils.js +43 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +27 -0
- package/package.json +41 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export type ColorRgba = [number, number, number, number];
|
|
2
|
+
export type ColorRgb = [number, number, number];
|
|
3
|
+
export type ColorHsla = Record<"h" | "s" | "l" | "a", number>;
|
|
4
|
+
export declare class Color {
|
|
5
|
+
private static componentToHex;
|
|
6
|
+
static getNumberRGB: (getComputedStyleRGB: string) => number[] | RegExpMatchArray;
|
|
7
|
+
static rgbToHex: (r: any, g: any, b: any) => string;
|
|
8
|
+
/**
|
|
9
|
+
* https://stackoverflow.com/a/54070620/6758968
|
|
10
|
+
* r, g, b in [0, 255]
|
|
11
|
+
* @returns h in [0,360) and s, v in [0,1]
|
|
12
|
+
*/
|
|
13
|
+
static rgbToHsv(r: number, g: number, b: number): [number, number, number];
|
|
14
|
+
/**
|
|
15
|
+
* https://stackoverflow.com/a/54024653/6758968
|
|
16
|
+
* @param h [0, 360]
|
|
17
|
+
* @param s [0, 1]
|
|
18
|
+
* @param v [0, 1]
|
|
19
|
+
* @returns r, g, b in [0, 255]
|
|
20
|
+
*/
|
|
21
|
+
static hsvToRgb(h: number, s: number, v: number): ColorRgb;
|
|
22
|
+
/**
|
|
23
|
+
* @returns h [0, 360], s [0, 100], l [0, 100], a [0, 1]
|
|
24
|
+
*/
|
|
25
|
+
static rgbaToHsla(r: number, g: number, b: number, a?: number): ColorHsla;
|
|
26
|
+
/**
|
|
27
|
+
* Converts an HSL color value to RGB. Conversion formula
|
|
28
|
+
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
|
|
29
|
+
*
|
|
30
|
+
* @param {number} h The hue [0, 360]
|
|
31
|
+
* @param {number} s The saturation [0, 1]
|
|
32
|
+
* @param {number} l The lightness [0, 1]
|
|
33
|
+
* @return {Array} The RGB representation [0, 255]
|
|
34
|
+
*/
|
|
35
|
+
static hslaToRgba(h: number, s: number, l: number, a: number): ColorRgba;
|
|
36
|
+
static hslaStringToRgba(hsla: string): ColorRgba;
|
|
37
|
+
static hexaToRgba(hexa: string): ColorRgba;
|
|
38
|
+
static hexToRgb(hex: string): ColorRgb;
|
|
39
|
+
static hexaToHsla(hexa: string): ColorHsla;
|
|
40
|
+
static rgbaToHexa(rgba: ColorRgba | ColorRgb): string;
|
|
41
|
+
static hslaStringToHexa(hsla: string): string;
|
|
42
|
+
static hslaStringToHex(hsla: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* @param weight [0, 1]
|
|
45
|
+
*/
|
|
46
|
+
static mixColors(color1: ColorRgb, color2: ColorRgb, weight: number): ColorRgb;
|
|
47
|
+
static computePerceivedBrightness(color: ColorRgb): number;
|
|
48
|
+
static getAverageColor(color1: ColorRgb, color2: ColorRgb): ColorRgb;
|
|
49
|
+
static getAccentColor(baseHsv: number[], baseColor: ColorRgb, elementColor: ColorRgb): ColorRgb;
|
|
50
|
+
static changeColorAccent(baseHsv: number[], accentHsv: number[], color: ColorRgb, isDarkTheme: boolean): ColorRgb;
|
|
51
|
+
static changeBrightness(color: ColorRgb, amount: number): ColorRgb;
|
|
52
|
+
static getHexColorFromTelegramColor(color: number): string;
|
|
53
|
+
static getRgbColorFromTelegramColor(color: number): ColorRgb;
|
|
54
|
+
static getColorsFromWallPaper(wallPaper: any): string;
|
|
55
|
+
static rgbaToRgb(rgba: ColorRgba, bg: ColorRgb): ColorRgb;
|
|
56
|
+
static calculateLuminance(rgb: ColorRgb): number;
|
|
57
|
+
static getTextColor(luminance: number): ColorRgb;
|
|
58
|
+
static calculateOpacity(luminance: number, targetContrast: number): number;
|
|
59
|
+
static clamp(v: number, min: number, max: number): number;
|
|
60
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var b = (l, t, n) => t in l ? d(l, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : l[t] = n;
|
|
3
|
+
var f = (l, t, n) => (b(l, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
const s = class s {
|
|
5
|
+
/**
|
|
6
|
+
* https://stackoverflow.com/a/54070620/6758968
|
|
7
|
+
* r, g, b in [0, 255]
|
|
8
|
+
* @returns h in [0,360) and s, v in [0,1]
|
|
9
|
+
*/
|
|
10
|
+
static rgbToHsv(t, n, e) {
|
|
11
|
+
t /= 255, n /= 255, e /= 255;
|
|
12
|
+
const r = Math.max(t, n, e), o = r - Math.min(t, n, e), i = o && (r === t ? (n - e) / o : r == n ? 2 + (e - t) / o : 4 + (t - n) / o);
|
|
13
|
+
return [60 * (i < 0 ? i + 6 : i), r && o / r, r];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* https://stackoverflow.com/a/54024653/6758968
|
|
17
|
+
* @param h [0, 360]
|
|
18
|
+
* @param s [0, 1]
|
|
19
|
+
* @param v [0, 1]
|
|
20
|
+
* @returns r, g, b in [0, 255]
|
|
21
|
+
*/
|
|
22
|
+
static hsvToRgb(t, n, e) {
|
|
23
|
+
const r = (o, i = (o + t / 60) % 6) => Math.round((e - e * n * Math.max(Math.min(i, 4 - i, 1), 0)) * 255);
|
|
24
|
+
return [r(5), r(3), r(1)];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @returns h [0, 360], s [0, 100], l [0, 100], a [0, 1]
|
|
28
|
+
*/
|
|
29
|
+
static rgbaToHsla(t, n, e, r = 1) {
|
|
30
|
+
t /= 255, n /= 255, e /= 255;
|
|
31
|
+
const o = Math.max(t, n, e), i = Math.min(t, n, e);
|
|
32
|
+
let a = 0, c;
|
|
33
|
+
const u = (o + i) / 2;
|
|
34
|
+
if (o === i)
|
|
35
|
+
a = c = 0;
|
|
36
|
+
else {
|
|
37
|
+
const g = o - i;
|
|
38
|
+
switch (c = u > 0.5 ? g / (2 - o - i) : g / (o + i), o) {
|
|
39
|
+
case t:
|
|
40
|
+
a = (n - e) / g + (n < e ? 6 : 0);
|
|
41
|
+
break;
|
|
42
|
+
case n:
|
|
43
|
+
a = (e - t) / g + 2;
|
|
44
|
+
break;
|
|
45
|
+
case e:
|
|
46
|
+
a = (t - n) / g + 4;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
a /= 6;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
h: a * 360,
|
|
53
|
+
s: c * 100,
|
|
54
|
+
l: u * 100,
|
|
55
|
+
a: r
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
// * https://stackoverflow.com/a/9493060/6758968
|
|
59
|
+
/**
|
|
60
|
+
* Converts an HSL color value to RGB. Conversion formula
|
|
61
|
+
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
|
|
62
|
+
*
|
|
63
|
+
* @param {number} h The hue [0, 360]
|
|
64
|
+
* @param {number} s The saturation [0, 1]
|
|
65
|
+
* @param {number} l The lightness [0, 1]
|
|
66
|
+
* @return {Array} The RGB representation [0, 255]
|
|
67
|
+
*/
|
|
68
|
+
static hslaToRgba(t, n, e, r) {
|
|
69
|
+
t /= 360, n /= 100, e /= 100;
|
|
70
|
+
let o, i, a;
|
|
71
|
+
if (n === 0)
|
|
72
|
+
o = i = a = e;
|
|
73
|
+
else {
|
|
74
|
+
const c = function(m, T, h) {
|
|
75
|
+
return h < 0 && (h += 1), h > 1 && (h -= 1), h < 0.16666666666666666 ? m + (T - m) * 6 * h : h < 0.5 ? T : h < 0.6666666666666666 ? m + (T - m) * (0.6666666666666666 - h) * 6 : m;
|
|
76
|
+
}, u = e < 0.5 ? e * (1 + n) : e + n - e * n, g = 2 * e - u;
|
|
77
|
+
o = c(g, u, t + 1 / 3), i = c(g, u, t), a = c(g, u, t - 1 / 3);
|
|
78
|
+
}
|
|
79
|
+
return [o, i, a, r].map((c) => Math.round(c * 255));
|
|
80
|
+
}
|
|
81
|
+
static hslaStringToRgba(t) {
|
|
82
|
+
const n = t.slice(5, -1).split(", "), e = Number(n.pop()), r = n.map((o) => o.endsWith("%") ? +o.slice(0, -1) : +o);
|
|
83
|
+
return s.hslaToRgba(r[0], r[1], r[2], e);
|
|
84
|
+
}
|
|
85
|
+
static hexaToRgba(t) {
|
|
86
|
+
const n = [], e = t[0] === "#" ? 1 : 0;
|
|
87
|
+
if (t.length === 5 + e && (t = (e ? "#" : "") + "0" + t.slice(e)), t.length === 3 + e)
|
|
88
|
+
for (let r = e; r < t.length; ++r)
|
|
89
|
+
n.push(parseInt(t[r] + t[r], 16));
|
|
90
|
+
else if (t.length === 4 + e) {
|
|
91
|
+
for (let r = e; r < t.length - 1; ++r)
|
|
92
|
+
n.push(parseInt(t[r] + t[r], 16));
|
|
93
|
+
n.push(parseInt(t[t.length - 1], 16));
|
|
94
|
+
} else
|
|
95
|
+
for (let r = e; r < t.length; r += 2)
|
|
96
|
+
n.push(parseInt(t.slice(r, r + 2), 16));
|
|
97
|
+
return n;
|
|
98
|
+
}
|
|
99
|
+
static hexToRgb(t) {
|
|
100
|
+
return s.hexaToRgba(t.slice(0, 7));
|
|
101
|
+
}
|
|
102
|
+
static hexaToHsla(t) {
|
|
103
|
+
const n = s.hexaToRgba(t);
|
|
104
|
+
return s.rgbaToHsla(n[0], n[1], n[2], n[3]);
|
|
105
|
+
}
|
|
106
|
+
static rgbaToHexa(t) {
|
|
107
|
+
return "#" + t.map((n) => ("0" + n.toString(16)).slice(-2)).join("");
|
|
108
|
+
}
|
|
109
|
+
static hslaStringToHexa(t) {
|
|
110
|
+
return s.rgbaToHexa(s.hslaStringToRgba(t));
|
|
111
|
+
}
|
|
112
|
+
static hslaStringToHex(t) {
|
|
113
|
+
return s.hslaStringToHexa(t).slice(0, -2);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* @param weight [0, 1]
|
|
117
|
+
*/
|
|
118
|
+
static mixColors(t, n, e) {
|
|
119
|
+
const r = new Array(3);
|
|
120
|
+
for (let o = 0; o < 3; ++o) {
|
|
121
|
+
const i = t[o], a = n[o];
|
|
122
|
+
r[o] = Math.floor(a + (i - a) * e);
|
|
123
|
+
}
|
|
124
|
+
return r;
|
|
125
|
+
}
|
|
126
|
+
static computePerceivedBrightness(t) {
|
|
127
|
+
return (t[0] * 0.2126 + t[1] * 0.7152 + t[2] * 0.0722) / 255;
|
|
128
|
+
}
|
|
129
|
+
static getAverageColor(t, n) {
|
|
130
|
+
return t.map((e, r) => Math.round((e + n[r]) / 2));
|
|
131
|
+
}
|
|
132
|
+
static getAccentColor(t, n, e) {
|
|
133
|
+
const r = s.rgbToHsv(...n), o = s.rgbToHsv(...e), i = Math.min(1.5 * r[1] / t[1], 1);
|
|
134
|
+
return r[0] = Math.min(360, o[0] - r[0] + t[0]), r[1] = Math.min(1, o[1] * t[1] / r[1]), r[2] = Math.min(1, (o[2] / r[2] + i - 1) * t[2] / i), r[2] < 0.3 ? e : s.hsvToRgb(...r);
|
|
135
|
+
}
|
|
136
|
+
static changeColorAccent(t, n, e, r) {
|
|
137
|
+
const o = s.rgbToHsv(...e);
|
|
138
|
+
if (Math.min(Math.abs(o[0] - t[0]), Math.abs(o[0] - t[0] - 360)) > 30)
|
|
139
|
+
return e;
|
|
140
|
+
const a = t[1] ? Math.min(1.5 * o[1] / t[1], 1) : 0;
|
|
141
|
+
o[0] = Math.min(360, o[0] + n[0] - t[0]), o[1] = t[1] ? Math.min(1, o[1] * n[1] / t[1]) : 0, o[2] = t[2] ? Math.min(1, o[2] * (1 - a + a * n[2] / t[2])) : 0;
|
|
142
|
+
let c = s.hsvToRgb(...o);
|
|
143
|
+
const u = s.computePerceivedBrightness(e), g = s.computePerceivedBrightness(c);
|
|
144
|
+
if (r ? u > g : u < g) {
|
|
145
|
+
const T = 0.4 * u / g + 0.6;
|
|
146
|
+
c = s.changeBrightness(c, T);
|
|
147
|
+
}
|
|
148
|
+
return c;
|
|
149
|
+
}
|
|
150
|
+
static changeBrightness(t, n) {
|
|
151
|
+
return t.map((e) => s.clamp(Math.round(e * n), 0, 255));
|
|
152
|
+
}
|
|
153
|
+
static getHexColorFromTelegramColor(t) {
|
|
154
|
+
const n = (t < 0 ? 16777215 + t : t).toString(16);
|
|
155
|
+
return "#" + (n.length >= 6 ? n : "0".repeat(6 - n.length) + n);
|
|
156
|
+
}
|
|
157
|
+
static getRgbColorFromTelegramColor(t) {
|
|
158
|
+
return s.hexToRgb(s.getHexColorFromTelegramColor(t));
|
|
159
|
+
}
|
|
160
|
+
static getColorsFromWallPaper(t) {
|
|
161
|
+
return t.settings ? [
|
|
162
|
+
t.settings.background_color,
|
|
163
|
+
t.settings.second_background_color,
|
|
164
|
+
t.settings.third_background_color,
|
|
165
|
+
t.settings.fourth_background_color
|
|
166
|
+
].filter(Boolean).map(s.getHexColorFromTelegramColor).join(",") : "";
|
|
167
|
+
}
|
|
168
|
+
static rgbaToRgb(t, n) {
|
|
169
|
+
const e = t[3];
|
|
170
|
+
return t.slice(0, 3).map((r, o) => s.clamp(Math.round((e * (r / 255) + e * (n[o] / 255)) * 255), 0, 255));
|
|
171
|
+
}
|
|
172
|
+
static calculateLuminance(t) {
|
|
173
|
+
const [n, e, r] = t;
|
|
174
|
+
return 0.2126 * n / 255 + 0.7152 * e / 255 + 0.0722 * r / 255;
|
|
175
|
+
}
|
|
176
|
+
static getTextColor(t) {
|
|
177
|
+
return t > 0.5 ? [0, 0, 0] : [255, 255, 255];
|
|
178
|
+
}
|
|
179
|
+
static calculateOpacity(t, n) {
|
|
180
|
+
const e = t > 0.5 ? 0 : 1, r = (t - e + n) / n;
|
|
181
|
+
return +Math.max(0.5, Math.min(0.64, r)).toFixed(2);
|
|
182
|
+
}
|
|
183
|
+
static clamp(t, n, e) {
|
|
184
|
+
return Math.min(e, Math.max(n, t));
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
/*Проверить свои методы и возможно исключить т.к. функционал возможно повторяется */
|
|
188
|
+
f(s, "componentToHex", (t) => {
|
|
189
|
+
var n = t.toString(16);
|
|
190
|
+
return n.length == 1 ? "0" + n : n;
|
|
191
|
+
}), f(s, "getNumberRGB", (t) => {
|
|
192
|
+
let n = t.match(/\d+/gi);
|
|
193
|
+
return n != null && n.length ? n.map((e) => Number(e)) : n || [255, 255, 255];
|
|
194
|
+
}), f(s, "rgbToHex", (t, n, e) => "#" + s.componentToHex(t) + s.componentToHex(n) + s.componentToHex(e));
|
|
195
|
+
let p = s;
|
|
196
|
+
export {
|
|
197
|
+
p as Color
|
|
198
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export declare class DateProcessing {
|
|
2
|
+
static getActiveColorClassInDiffDate: (date1: any, date2: any, activeClass: any) => string;
|
|
3
|
+
static getClassByDifferenceDay: (date: any, colorsConfig: {
|
|
4
|
+
className: string;
|
|
5
|
+
diffDay: number;
|
|
6
|
+
}[]) => string;
|
|
7
|
+
static getMinMaxDate: (date: string, minDate: string, maxDate: string) => {
|
|
8
|
+
minMaxMonth: string;
|
|
9
|
+
minDate: string;
|
|
10
|
+
maxDate: string;
|
|
11
|
+
};
|
|
12
|
+
static splitDateFromTime: (dateTime: string) => string[];
|
|
13
|
+
static getCorrectDateAndTime: (dateTime: any) => [date: string, time: string];
|
|
14
|
+
static reverseDate: (datePPR: any) => string;
|
|
15
|
+
static correctionDataISO8601: (date: string) => string;
|
|
16
|
+
static isDateDMY: (date: string) => boolean;
|
|
17
|
+
static isDateISO8601: (date: string) => boolean;
|
|
18
|
+
static correctionDateAndRemoveYear: (datePPR: string, options?: {
|
|
19
|
+
isYear: boolean;
|
|
20
|
+
}) => string;
|
|
21
|
+
static correctionDateWithOutCurrentYear: (date: string, options?: {
|
|
22
|
+
shortYear: boolean;
|
|
23
|
+
}) => string;
|
|
24
|
+
static correctionShortYear: (date: string) => string;
|
|
25
|
+
static correctionDate: (date: string, options?: Partial<Record<'isRemoveYear' | 'shortYear' | 'withOutCurrentYear', boolean>>) => string;
|
|
26
|
+
static hasDateLessPeriod: (date: string, period: string, option?: {
|
|
27
|
+
dateMinMax: '<=' | '>=' | '<' | '>';
|
|
28
|
+
}) => boolean | undefined;
|
|
29
|
+
static hasDateLessPeriodV2: (date1: string, date2: string, period: string, option?: {
|
|
30
|
+
dateMinMax: '<=' | '>=' | '<' | '>';
|
|
31
|
+
}) => {
|
|
32
|
+
one: boolean | undefined;
|
|
33
|
+
two: boolean | undefined;
|
|
34
|
+
};
|
|
35
|
+
static hasDateLessInNumber: (date1: string, date2: string, number?: number) => number | boolean;
|
|
36
|
+
static correctionCurrentYear: (periods: any, Year?: number) => any;
|
|
37
|
+
static correctionCurrentDate: (date: any) => string;
|
|
38
|
+
static getMinMaxDateV2: (date: string, obMinMaxDate: any) => void;
|
|
39
|
+
static getChunkFromDate: (date: string, getChunk: 'day' | 'month' | 'year', option?: {
|
|
40
|
+
isBeforeZero: boolean;
|
|
41
|
+
}) => string;
|
|
42
|
+
static convertMonthNumberInName: (month: any) => string;
|
|
43
|
+
static MinMaxMountStr: (obMinMaxDate: any) => {
|
|
44
|
+
minMaxMonth: string;
|
|
45
|
+
};
|
|
46
|
+
static sortDataByAlphabet: (arrData: any) => void;
|
|
47
|
+
static getEndsWithArr: (arr: any[], countEnd: any) => any[];
|
|
48
|
+
static filterPeriodsRelativeCurrentDate: (periods: string[]) => string[];
|
|
49
|
+
static getCollectionPeriodsFullDate: (collectionPeriodsDate: any, reqYear: any) => any;
|
|
50
|
+
static sortDataByDate: (data: any[], keyDate: string) => void;
|
|
51
|
+
static getNameKeyByNumber: (data: any) => string[];
|
|
52
|
+
static getDayOfWeek(date: any): string | null;
|
|
53
|
+
static cropSecond: (time: any) => any;
|
|
54
|
+
static getCurrentDate: () => string;
|
|
55
|
+
static getRenderDate: (date: string, option?: {
|
|
56
|
+
withOutCurrentYear: boolean;
|
|
57
|
+
}) => string;
|
|
58
|
+
}
|
|
59
|
+
export declare const currentYear: number;
|
|
60
|
+
export declare const currentMonthDay: string;
|
|
61
|
+
export declare const currentFullDate: string;
|
|
62
|
+
export declare let yearRange: string;
|
|
63
|
+
export declare const randomNumber: () => number;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
var Y = Object.defineProperty;
|
|
2
|
+
var N = (l, e, r) => e in l ? Y(l, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : l[e] = r;
|
|
3
|
+
var n = (l, e, r) => (N(l, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
+
const t = class t {
|
|
5
|
+
static getDayOfWeek(e) {
|
|
6
|
+
let r = t.correctionDataISO8601(e);
|
|
7
|
+
const a = new Date(r).getDay();
|
|
8
|
+
return isNaN(a) ? null : ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"][a];
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
n(t, "getActiveColorClassInDiffDate", (e, r, a) => {
|
|
12
|
+
let s = "";
|
|
13
|
+
return e && r && t.hasDateLessPeriod(e, r) && (s = a), s;
|
|
14
|
+
}), n(t, "getClassByDifferenceDay", (e, r) => {
|
|
15
|
+
let a = "", s = r.sort((c, u) => c.diffDay - u.diffDay);
|
|
16
|
+
for (let c = 0; c < s.length; c++) {
|
|
17
|
+
let u = s[c], m = t.hasDateLessInNumber(e, o);
|
|
18
|
+
if (u.diffDay < m) {
|
|
19
|
+
a = u.className;
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return a;
|
|
24
|
+
}), n(t, "getMinMaxDate", (e, r, a) => {
|
|
25
|
+
let s = {
|
|
26
|
+
minDate: "",
|
|
27
|
+
maxDate: "",
|
|
28
|
+
minMaxMonth: ""
|
|
29
|
+
};
|
|
30
|
+
return /^\d{2}\.\d{2}\.\d{4}$/.test(e) || /^\d{2}\.\d{2}$/.test(e) ? (!r && !a ? (s.minDate = e, s.maxDate = e) : r ? a ? r && a && (s.minDate = t.hasDateLessPeriod(e, r, { dateMinMax: "<=" }) ? e : r, s.maxDate = t.hasDateLessPeriod(e, a, { dateMinMax: ">=" }) ? e : a) : (s.minDate = t.hasDateLessPeriod(e, r, { dateMinMax: "<=" }) ? e : r, s.maxDate = e) : (s.minDate = e, s.maxDate = t.hasDateLessPeriod(e, a, { dateMinMax: ">=" }) ? e : a), { ...s, ...t.MinMaxMountStr(s) }) : (console.error('функция getMinMaxDate >> формат дат не соответствует формату: "дд.мм.гггг"'), { minDate: r, maxDate: a, ...t.MinMaxMountStr(s) });
|
|
31
|
+
}), n(t, "splitDateFromTime", (e) => {
|
|
32
|
+
const r = e.includes("T");
|
|
33
|
+
return e.split(r ? "T" : " ");
|
|
34
|
+
}), n(t, "getCorrectDateAndTime", (e) => {
|
|
35
|
+
let r = e.match(/\D/), a, s;
|
|
36
|
+
r && r[0] === ":" ? [a, s] = t.splitDateFromTime(e) : [s, a] = t.splitDateFromTime(e), s = t.correctionDateAndRemoveYear(s, { isYear: !0 });
|
|
37
|
+
let c = a.split(":");
|
|
38
|
+
return c.length === 3 && (c.length = 2, a = c.join(":")), [s, a];
|
|
39
|
+
}), n(t, "reverseDate", (e) => {
|
|
40
|
+
let [r, a] = t.splitDateFromTime(e);
|
|
41
|
+
return r.split(".").reverse().join("-");
|
|
42
|
+
}), n(t, "correctionDataISO8601", (e) => {
|
|
43
|
+
let r = "";
|
|
44
|
+
if (t.isDateDMY(e))
|
|
45
|
+
r = t.reverseDate(e);
|
|
46
|
+
else if (t.isDateISO8601(e))
|
|
47
|
+
r = e;
|
|
48
|
+
else
|
|
49
|
+
throw new Error(`функция correctionDataISO8601 >> date не корректна: ${e}. Требуется один из форматов: дд.мм.гггг | дд.мм.гггг мм:чч | гггг-мм-дд `);
|
|
50
|
+
return r;
|
|
51
|
+
}), n(t, "isDateDMY", (e) => !!(/^\d{2}\.\d{2}\.\d{4}$/.test(e) || /^\d{2}\.\d{2}\.\d{4}\s\d{2}:\d{2}$/.test(e))), n(t, "isDateISO8601", (e) => !!(/^\d{4}-\d{2}-\d{2}$/.test(e) || /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(e))), n(t, "correctionDateAndRemoveYear", (e, r = { isYear: !1 }) => {
|
|
52
|
+
e = t.correctionDataISO8601(e);
|
|
53
|
+
let a = e.split("-").reverse(), s = a;
|
|
54
|
+
return r.isYear || (s = a.slice(0, 2)), s.join(".");
|
|
55
|
+
}), n(t, "correctionDateWithOutCurrentYear", (e, r) => {
|
|
56
|
+
e = t.correctionDataISO8601(e);
|
|
57
|
+
const a = +t.getChunkFromDate(e, "year") === i;
|
|
58
|
+
return a ? t.correctionDateAndRemoveYear(e, { isYear: !a }) : r != null && r.shortYear ? t.correctionShortYear(e) : t.correctionDateAndRemoveYear(e, { isYear: !0 });
|
|
59
|
+
}), n(t, "correctionShortYear", (e) => {
|
|
60
|
+
let r = t.splitDateFromTime(e)[0].split("-").reverse(), a = r.splice(-1);
|
|
61
|
+
return `${r.join(".")}.${a[0].slice(2)}`;
|
|
62
|
+
}), n(t, "correctionDate", (e, r) => (e = t.correctionDataISO8601(e), r != null && r.isRemoveYear ? t.correctionDateAndRemoveYear(e) : r != null && r.shortYear ? r != null && r.withOutCurrentYear ? t.correctionDateWithOutCurrentYear(e, { shortYear: !0 }) : t.correctionShortYear(e) : r != null && r.withOutCurrentYear ? t.correctionDateWithOutCurrentYear(e) : t.correctionDateAndRemoveYear(e, { isYear: !0 }))), n(t, "hasDateLessPeriod", (e, r, a) => {
|
|
63
|
+
if (e = t.correctionDataISO8601(e), r = t.correctionDataISO8601(r), !a || a && !a.dateMinMax || (a == null ? void 0 : a.dateMinMax) === "<=")
|
|
64
|
+
return Math.floor(Number(new Date(e))) <= Math.floor(Number(new Date(r)));
|
|
65
|
+
if (a && (a == null ? void 0 : a.dateMinMax) === ">=")
|
|
66
|
+
return Math.floor(Number(new Date(e))) >= Math.floor(Number(new Date(r)));
|
|
67
|
+
if (a && (a == null ? void 0 : a.dateMinMax) === "<")
|
|
68
|
+
return Math.floor(Number(new Date(e))) < Math.floor(Number(new Date(r)));
|
|
69
|
+
if (a && (a == null ? void 0 : a.dateMinMax) === ">")
|
|
70
|
+
return Math.floor(Number(new Date(e))) > Math.floor(Number(new Date(r)));
|
|
71
|
+
}), n(t, "hasDateLessPeriodV2", (e, r, a, s) => ({
|
|
72
|
+
one: t.hasDateLessPeriod(e, a, s),
|
|
73
|
+
two: t.hasDateLessPeriod(r, a, s)
|
|
74
|
+
})), n(t, "hasDateLessInNumber", (e, r, a) => {
|
|
75
|
+
const s = new Date(t.correctionDataISO8601(e)), c = new Date(t.correctionDataISO8601(r)), u = 1e3 * 60 * 60 * 24, m = c.getTime() - s.getTime(), D = Math.round(m / u);
|
|
76
|
+
return a ? a <= D : D;
|
|
77
|
+
}), n(t, "correctionCurrentYear", (e, r) => {
|
|
78
|
+
const a = /* @__PURE__ */ new Date(), s = r || a.getFullYear();
|
|
79
|
+
return e.map((c) => t.hasDateLessPeriod(`${s}-${c}`, a.toJSON().split("T")[0], { dateMinMax: ">" }) ? `${s - 1}-${c}` : `${s}-${c}`);
|
|
80
|
+
}), n(t, "correctionCurrentDate", (e) => ((/* @__PURE__ */ new Date()).getFullYear(), t.correctionDate(e, { isRemoveYear: !0, shortYear: !0 }))), n(t, "getMinMaxDateV2", (e, r) => {
|
|
81
|
+
e = e.split(" ")[0], t.isDateDMY(e) && (!r.minDate && !r.maxDate ? (r.minDate = e, r.maxDate = e) : r.minDate ? r.maxDate ? r.minDate && r.maxDate && (r.minDate = t.hasDateLessPeriod(e, r.minDate, { dateMinMax: "<=" }) ? e : r.minDate, r.maxDate = t.hasDateLessPeriod(e, r.maxDate, { dateMinMax: ">=" }) ? e : r.maxDate) : (r.minDate = t.hasDateLessPeriod(e, r.minDate, { dateMinMax: "<=" }) ? e : r.minDate, r.maxDate = e) : (r.minDate = e, r.maxDate = t.hasDateLessPeriod(e, r.maxDate, { dateMinMax: ">=" }) ? e : r.maxDate)), r.minMaxMonth = t.MinMaxMountStr(r).minMaxMonth;
|
|
82
|
+
}), n(t, "getChunkFromDate", (e, r, a) => {
|
|
83
|
+
e = t.correctionDataISO8601(e);
|
|
84
|
+
const s = e.split("-");
|
|
85
|
+
switch (r) {
|
|
86
|
+
case "day":
|
|
87
|
+
return a != null && a.isBeforeZero ? s[2] : s[0].slice(-1);
|
|
88
|
+
case "month":
|
|
89
|
+
return a != null && a.isBeforeZero ? s[1] : s[1].slice(-1);
|
|
90
|
+
case "year":
|
|
91
|
+
return s[0];
|
|
92
|
+
}
|
|
93
|
+
}), n(t, "convertMonthNumberInName", (e) => e ? ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"][Number(e) - 1] : "----"), n(t, "MinMaxMountStr", (e) => ({
|
|
94
|
+
minMaxMonth: t.convertMonthNumberInName(t.getChunkFromDate(e.minDate, "month", { isBeforeZero: !1 })) + " - " + t.convertMonthNumberInName(t.getChunkFromDate(e.maxDate, "month", { isBeforeZero: !1 }))
|
|
95
|
+
})), n(t, "sortDataByAlphabet", (e) => {
|
|
96
|
+
e.sort((r, a) => a.name.trim() < r.name.trim() ? 1 : -1);
|
|
97
|
+
}), n(t, "getEndsWithArr", (e, r) => e.slice(-r)), n(t, "filterPeriodsRelativeCurrentDate", (e) => e.filter((r) => t.hasDateLessPeriod(r, o))), n(t, "getCollectionPeriodsFullDate", (e, r) => e.map((a) => `${r}-${a}`)), n(t, "sortDataByDate", (e, r) => {
|
|
98
|
+
e.sort((a, s) => t.hasDateLessPeriod(s[r], a[r]) ? 1 : -1);
|
|
99
|
+
}), n(t, "getNameKeyByNumber", (e) => {
|
|
100
|
+
let r = [];
|
|
101
|
+
for (let a = 0; a < e.length; a++)
|
|
102
|
+
for (let [s, c] of Object.entries(e[a]))
|
|
103
|
+
typeof c == "number" && (!s.length || !r.some((u) => u === s)) && r.push(s);
|
|
104
|
+
return r;
|
|
105
|
+
}), n(t, "cropSecond", (e) => e.replace(/:\w+$/, "")), n(t, "getCurrentDate", () => {
|
|
106
|
+
const e = /* @__PURE__ */ new Date(), r = e.getFullYear(), a = e.toJSON().split("T")[0].slice(5);
|
|
107
|
+
return `${r}-${a}`;
|
|
108
|
+
}), n(t, "getRenderDate", (e, r = { withOutCurrentYear: !1 }) => {
|
|
109
|
+
const a = t.getCurrentDate();
|
|
110
|
+
if (e === a)
|
|
111
|
+
return "Сегодня";
|
|
112
|
+
const s = t.hasDateLessInNumber(e, a);
|
|
113
|
+
if (s === 1)
|
|
114
|
+
return "Вчера";
|
|
115
|
+
if (s === 2)
|
|
116
|
+
return "Позавчера";
|
|
117
|
+
console.dir(e);
|
|
118
|
+
const c = t.correctionDate(e, { shortYear: !0, withOutCurrentYear: r.withOutCurrentYear });
|
|
119
|
+
return console.dir(c), c;
|
|
120
|
+
});
|
|
121
|
+
let f = t;
|
|
122
|
+
window.DateProcessing = f;
|
|
123
|
+
const h = /* @__PURE__ */ new Date(), i = h.getFullYear(), C = h.toJSON().split("T")[0].slice(5), o = `${i}-${C}`;
|
|
124
|
+
let w = `${i} - ${i + 1}`;
|
|
125
|
+
const S = () => Math.floor(Math.random() * h.getTime());
|
|
126
|
+
export {
|
|
127
|
+
f as DateProcessing,
|
|
128
|
+
o as currentFullDate,
|
|
129
|
+
C as currentMonthDay,
|
|
130
|
+
i as currentYear,
|
|
131
|
+
S as randomNumber,
|
|
132
|
+
w as yearRange
|
|
133
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface StartActionEveryConfigI {
|
|
2
|
+
interval: number;
|
|
3
|
+
cutoffTime?: number;
|
|
4
|
+
countAction?: number;
|
|
5
|
+
watchIdInterval?(id: number | null): void;
|
|
6
|
+
controlAction?(control: {
|
|
7
|
+
stop(): void;
|
|
8
|
+
getIsActiveEvent(): boolean;
|
|
9
|
+
}): void;
|
|
10
|
+
}
|
|
11
|
+
type Callback = () => boolean;
|
|
12
|
+
type StartActionEveryType = (cb: Callback, config: StartActionEveryConfigI) => Promise<{
|
|
13
|
+
status: boolean;
|
|
14
|
+
msg: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare class DelaysPromise {
|
|
17
|
+
startActionEvery: StartActionEveryType;
|
|
18
|
+
oneOf: (promiseWatch: any, potentialCaseCB: any, { second }: {
|
|
19
|
+
second: any;
|
|
20
|
+
}) => void;
|
|
21
|
+
oneOfPromise: (promiseWatch: any, cbPotentialReject: any, { second }: {
|
|
22
|
+
second: any;
|
|
23
|
+
}) => Promise<unknown>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var A = Object.defineProperty;
|
|
2
|
+
var p = (o, e, t) => e in o ? A(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var i = (o, e, t) => (p(o, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
class d {
|
|
5
|
+
constructor() {
|
|
6
|
+
i(this, "startActionEvery", (e, t = { interval: 5e3 }) => {
|
|
7
|
+
const r = (s) => {
|
|
8
|
+
typeof (t == null ? void 0 : t.watchIdInterval) == "function" && (t == null || t.watchIdInterval(s));
|
|
9
|
+
}, a = (s) => {
|
|
10
|
+
typeof (t == null ? void 0 : t.controlAction) == "function" && (t == null || t.controlAction(s));
|
|
11
|
+
};
|
|
12
|
+
return new Promise((s, l) => {
|
|
13
|
+
let v = 0, n = 0;
|
|
14
|
+
const u = {
|
|
15
|
+
isActive: !0
|
|
16
|
+
}, I = setInterval(
|
|
17
|
+
() => {
|
|
18
|
+
if (v += t.interval, n += 1, t != null && t.cutoffTime && v > t.cutoffTime || t != null && t.countAction && (t == null ? void 0 : t.countAction) < n) {
|
|
19
|
+
u.isActive = !1, clearInterval(I), r(null), l({ status: !1, msg: Error("Время загрузки истекло") });
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
e() && (u.isActive = !1, clearInterval(I), r(null), s({ status: !0, msg: "cb вернул true" }));
|
|
23
|
+
},
|
|
24
|
+
t.interval < 200 ? 200 : t.interval
|
|
25
|
+
);
|
|
26
|
+
r(I), a({
|
|
27
|
+
getIsActiveEvent: () => u.isActive,
|
|
28
|
+
stop: () => {
|
|
29
|
+
const m = "Ручное завершение startActionEvery";
|
|
30
|
+
console.dir(`controlAction (stop): ${m}`), u.isActive = !1, clearInterval(I), r(null), s({ status: !0, msg: m });
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
i(this, "oneOf", (e, t, { second: r }) => {
|
|
36
|
+
let a = 1;
|
|
37
|
+
e().then(() => {
|
|
38
|
+
a === 1 && (a = 0);
|
|
39
|
+
});
|
|
40
|
+
let s = setInterval(() => {
|
|
41
|
+
console.dir("setInterval в oneOf"), a === 1 && t(), clearInterval(s);
|
|
42
|
+
}, r * 1e3);
|
|
43
|
+
});
|
|
44
|
+
i(this, "oneOfPromise", (e, t, { second: r }) => new Promise((a, s) => {
|
|
45
|
+
let l = 1;
|
|
46
|
+
e().then((n) => {
|
|
47
|
+
console.log("DelaysPromise.oneOfPromise (promiseWatch ==> data)", n), l === 1 && (l = 0, a(n));
|
|
48
|
+
}).catch((n) => {
|
|
49
|
+
l === 1 && (l = 0, s(n));
|
|
50
|
+
});
|
|
51
|
+
let v = setInterval(() => {
|
|
52
|
+
if (console.log("DelaysPromise.oneOfPromise (interval ==> potentialCaseCB)"), l === 1) {
|
|
53
|
+
if (l = 0, typeof t == "function") {
|
|
54
|
+
s({ status: !1, msg: "", ...t() });
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
s({ status: !1, msg: "oneOfPromise reject" });
|
|
58
|
+
}
|
|
59
|
+
clearInterval(v);
|
|
60
|
+
}, r * 1e3);
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
d as DelaysPromise
|
|
66
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class DownloadFile {
|
|
2
|
+
private static startSrt;
|
|
3
|
+
private static applications;
|
|
4
|
+
private static getDataApplication;
|
|
5
|
+
static convertBase64To(attachment: Record<'name' | 'base64', string> & {
|
|
6
|
+
format: keyof typeof DownloadFile.applications;
|
|
7
|
+
}): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var m = (e, t, a) => t in e ? d(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
+
var n = (e, t, a) => (m(e, typeof t != "symbol" ? t + "" : t, a), a);
|
|
4
|
+
const s = class s {
|
|
5
|
+
static getDataApplication(t) {
|
|
6
|
+
const { applications: a } = s;
|
|
7
|
+
return a[t] ? a[t] : a.pdf;
|
|
8
|
+
}
|
|
9
|
+
static convertBase64To(t) {
|
|
10
|
+
const { format: a, name: o, base64: i } = t, p = `${s.getDataApplication(a)}base64,${i}`, c = document.createElement("a"), l = `${o}.${a}`;
|
|
11
|
+
c.href = p, c.download = l, c.click();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
n(s, "startSrt", "data:application/"), n(s, "applications", {
|
|
15
|
+
xls: `${s.startSrt}vnd.ms-excel;`,
|
|
16
|
+
xlsx: `${s.startSrt}vnd.openxmlformats-officedocument.spreadsheetml.sheet;`,
|
|
17
|
+
pdf: `${s.startSrt}pdf;`,
|
|
18
|
+
csv: `${s.startSrt}vnd.ms-excel;`
|
|
19
|
+
});
|
|
20
|
+
let r = s;
|
|
21
|
+
export {
|
|
22
|
+
r as DownloadFile
|
|
23
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var r = (i, t, e) => t in i ? a(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var s = (i, t, e) => (r(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
class c {
|
|
5
|
+
}
|
|
6
|
+
s(c, "filter", (t, e) => t.filter((l) => !e.includes(l))), s(c, "getItemsID", (t) => t.map((e) => e.id));
|
|
7
|
+
export {
|
|
8
|
+
c as Lodash
|
|
9
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class s {
|
|
2
|
+
static getOnlyTheStringNumbers(r) {
|
|
3
|
+
return r.split("").filter((e) => !Number.isNaN(Number.parseInt(e))).join("");
|
|
4
|
+
}
|
|
5
|
+
static isNumber(r) {
|
|
6
|
+
try {
|
|
7
|
+
if (r.length > 1)
|
|
8
|
+
throw new Error("Передали < 1 значения");
|
|
9
|
+
return !Number.isNaN(Number.parseInt(r));
|
|
10
|
+
} catch (e) {
|
|
11
|
+
console.error(e);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
s as Numbers
|
|
17
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var p = (i, t, e) => t in i ? c(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var m = (i, t, e) => (p(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
const s = class s {
|
|
5
|
+
};
|
|
6
|
+
m(s, "items", []), m(s, "push", ({ action: t, reject: e }) => {
|
|
7
|
+
s.items.some((o) => o.action === t) || s.items.push({ action: t, reject: e });
|
|
8
|
+
}), m(s, "setResponse", (t) => {
|
|
9
|
+
for (let e = 0; e < s.items.length; e++) {
|
|
10
|
+
const a = s.items[e];
|
|
11
|
+
if (t.action === a.action) {
|
|
12
|
+
a.reject(t.mess);
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
let l = s;
|
|
18
|
+
export {
|
|
19
|
+
l as ProcessingWS
|
|
20
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ConnectOptions_P, EventNameType, SubscriberType } from './deps/WsApi';
|
|
2
|
+
|
|
3
|
+
interface WatchI {
|
|
4
|
+
watchTimeOffReConnect(info: {
|
|
5
|
+
status: boolean;
|
|
6
|
+
msg: string;
|
|
7
|
+
}): void;
|
|
8
|
+
watchReConnect(status: boolean): void;
|
|
9
|
+
}
|
|
10
|
+
export declare class SocketApi {
|
|
11
|
+
private static wsApi;
|
|
12
|
+
private static watch;
|
|
13
|
+
static state: {
|
|
14
|
+
isDisconnect: boolean;
|
|
15
|
+
initConnect: boolean;
|
|
16
|
+
isReConnect: boolean;
|
|
17
|
+
};
|
|
18
|
+
private static saveID;
|
|
19
|
+
private static stateDefault;
|
|
20
|
+
static on<T>(eventName: EventNameType, cb: SubscriberType<T>): () => void;
|
|
21
|
+
static off<T>(eventName: EventNameType, cb: SubscriberType<T>): void;
|
|
22
|
+
static setOptions: (option?: ConnectOptions_P) => void;
|
|
23
|
+
static close(): void;
|
|
24
|
+
static disconnect(): void;
|
|
25
|
+
static send<ResType>(data: object): Promise<ResType>;
|
|
26
|
+
static connect(): void;
|
|
27
|
+
static stopReConnect(): void;
|
|
28
|
+
static resetState(): void;
|
|
29
|
+
static getTimeRequest(): void;
|
|
30
|
+
static getEndReq: () => any[];
|
|
31
|
+
static watchReConnect(cb: WatchI["watchReConnect"]): void;
|
|
32
|
+
static watchTimeOffReConnect(cb: WatchI["watchTimeOffReConnect"]): void;
|
|
33
|
+
private static copyState;
|
|
34
|
+
private static resetSocket;
|
|
35
|
+
private static createConnect;
|
|
36
|
+
static socketReConnect: () => void;
|
|
37
|
+
private static setInfoConnect;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var u = (n, e, s) => e in n ? p(n, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[e] = s;
|
|
3
|
+
var a = (n, e, s) => (u(n, typeof e != "symbol" ? e + "" : e, s), s);
|
|
4
|
+
import { WsApi as C } from "./deps/WsApi/WsApi.js";
|
|
5
|
+
const R = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
6
|
+
function A(n) {
|
|
7
|
+
return R.test(n);
|
|
8
|
+
}
|
|
9
|
+
function o() {
|
|
10
|
+
var n = URL.createObjectURL(new Blob()), e = n.toString();
|
|
11
|
+
return URL.revokeObjectURL(n), e.split(/[:\/]/g).pop().toLowerCase();
|
|
12
|
+
}
|
|
13
|
+
o.valid = A;
|
|
14
|
+
class d {
|
|
15
|
+
watchTimeOffReConnect(e) {
|
|
16
|
+
}
|
|
17
|
+
watchReConnect(e) {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const t = class t {
|
|
21
|
+
static on(e, s) {
|
|
22
|
+
return t.wsApi.on(e, s);
|
|
23
|
+
}
|
|
24
|
+
static off(e, s) {
|
|
25
|
+
t.wsApi.off(e, s);
|
|
26
|
+
}
|
|
27
|
+
static close() {
|
|
28
|
+
t.resetSocket(), t.wsApi.setStatus("close");
|
|
29
|
+
}
|
|
30
|
+
static disconnect() {
|
|
31
|
+
console.trace(), t.state.isDisconnect || (t.state.isDisconnect = !0, console.log("DISCONNECT WS"), t.wsApi.internet.removeWatcherInternet(), t.wsApi.setStatus("disconnect"), t.resetSocket(), t.resetState(), t.wsApi.resetState());
|
|
32
|
+
}
|
|
33
|
+
static send(e) {
|
|
34
|
+
return new Promise((s, r) => {
|
|
35
|
+
var i;
|
|
36
|
+
console.log("send: ", e);
|
|
37
|
+
let { action: w, ...v } = e;
|
|
38
|
+
if (!t.wsApi.state.ws || t.wsApi.state.ws.readyState !== 1) {
|
|
39
|
+
t.wsApi.state.arrSaveReq.some((f) => f.action === e.action) || (t.wsApi.state.arrSaveReq.push(e), console.log("сохранили запрос в arrSaveReq: ", t.wsApi.state.arrSaveReq));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const l = o();
|
|
43
|
+
t.wsApi.totalInfoReqPromise.push({ action: w, reqId: l, resolve: s, reject: r }), (i = t.wsApi.state.ws) == null || i.send(JSON.stringify(e)), t.wsApi.state.arrSaveReq.length && !t.wsApi.state.isRequestArrSaveReq && (t.wsApi.state.isRequestArrSaveReq = !0);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
static connect() {
|
|
47
|
+
t.createConnect();
|
|
48
|
+
}
|
|
49
|
+
static stopReConnect() {
|
|
50
|
+
console.dir("функция stop не присвоена к stopReConnect");
|
|
51
|
+
}
|
|
52
|
+
static resetState() {
|
|
53
|
+
t.state = t.copyState(t.stateDefault);
|
|
54
|
+
}
|
|
55
|
+
static getTimeRequest() {
|
|
56
|
+
}
|
|
57
|
+
/*------------------------------------------------------------------------------------------------------*/
|
|
58
|
+
static watchReConnect(e) {
|
|
59
|
+
t.watch.watchReConnect = e;
|
|
60
|
+
}
|
|
61
|
+
static watchTimeOffReConnect(e) {
|
|
62
|
+
t.watch.watchTimeOffReConnect = e;
|
|
63
|
+
}
|
|
64
|
+
/*------------------------------------------------------------------------------------------------------*/
|
|
65
|
+
static copyState(e) {
|
|
66
|
+
return JSON.parse(JSON.stringify(e));
|
|
67
|
+
}
|
|
68
|
+
static resetSocket() {
|
|
69
|
+
var e;
|
|
70
|
+
(e = t.wsApi.state.ws) == null || e.close(), t.wsApi.removeEvents();
|
|
71
|
+
}
|
|
72
|
+
static createConnect() {
|
|
73
|
+
console.dir("CONNECT WS"), t.resetSocket(), t.state.isDisconnect = !1, t.wsApi.state.ws = new WebSocket(t.wsApi.state.url), t.wsApi.setStatus("pending"), t.wsApi.addEvents();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
a(t, "wsApi", new C()), a(t, "watch", new d()), a(t, "state", {
|
|
77
|
+
isDisconnect: !0,
|
|
78
|
+
initConnect: !1,
|
|
79
|
+
isReConnect: !1
|
|
80
|
+
}), a(t, "saveID", {
|
|
81
|
+
idConnect: null,
|
|
82
|
+
checkConnect: null
|
|
83
|
+
}), a(t, "stateDefault", t.copyState(t.state)), a(t, "setOptions", (e = t.wsApi.configWs) => {
|
|
84
|
+
t.state.initConnect || (t.wsApi.configWs = e, t.wsApi.internet.addWatcherInternet());
|
|
85
|
+
}), a(t, "getEndReq", () => t.wsApi.state.arrSaveReq), a(t, "socketReConnect", () => {
|
|
86
|
+
t.saveID.idConnect ? (console.groupCollapsed("Процесс idConnect уже запущен"), console.log("SocketApi.saveID: ", t.saveID), console.groupEnd()) : (t.state.isReConnect = !0, t.watch.watchReConnect(!0), t.createConnect(), t.wsApi.startActionEvery(
|
|
87
|
+
() => t.wsApi.state.statusConnect === "ready" ? !0 : (t.createConnect(), !1),
|
|
88
|
+
{
|
|
89
|
+
interval: t.wsApi.configWs.timeReConnect,
|
|
90
|
+
countAction: 5,
|
|
91
|
+
watchIdInterval: (e) => {
|
|
92
|
+
t.saveID.idConnect = e;
|
|
93
|
+
},
|
|
94
|
+
controlAction: ({ stop: e, getIsActiveEvent: s }) => {
|
|
95
|
+
console.dir("Вызван controlAction"), t.stopReConnect = () => {
|
|
96
|
+
e();
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
).then(t.setInfoConnect).catch(t.setInfoConnect));
|
|
101
|
+
}), a(t, "setInfoConnect", (e) => {
|
|
102
|
+
e.status || t.close(), t.watch.watchTimeOffReConnect(e), t.watch.watchReConnect(!1), t.state.isReConnect = !1;
|
|
103
|
+
});
|
|
104
|
+
let c = t;
|
|
105
|
+
window.SocketApi = c;
|
|
106
|
+
export {
|
|
107
|
+
c as SocketApi
|
|
108
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var e = (n, o, t) => o in n ? i(n, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[o] = t;
|
|
3
|
+
var s = (n, o, t) => (e(n, typeof o != "symbol" ? o + "" : o, t), t);
|
|
4
|
+
class l {
|
|
5
|
+
constructor() {
|
|
6
|
+
s(this, "options", {
|
|
7
|
+
stop: !1
|
|
8
|
+
});
|
|
9
|
+
s(this, "setConditionReConnect", (o) => {
|
|
10
|
+
console.log("Переданные параметры (setConditionReConnect)", o), console.log("this.options", this.options), this.options = { ...this.options, ...o };
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
l as ConfigInfoConnect
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var r = (n, e, t) => e in n ? s(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var i = (n, e, t) => (r(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
class h {
|
|
5
|
+
constructor() {
|
|
6
|
+
i(this, "isOnline", window.navigator.onLine);
|
|
7
|
+
i(this, "isWatcher", !1);
|
|
8
|
+
}
|
|
9
|
+
watchIsOffline() {
|
|
10
|
+
this.isOnline = !1;
|
|
11
|
+
}
|
|
12
|
+
watchIsOnline() {
|
|
13
|
+
this.isOnline = !0;
|
|
14
|
+
}
|
|
15
|
+
addWatcherInternet() {
|
|
16
|
+
this.isWatcher || (console.dir("Установка событий (online, offline) InternetWatcher.addWatcherInternet"), this.isWatcher = !0, window.addEventListener("offline", this.watchIsOffline), window.addEventListener("online", this.watchIsOnline));
|
|
17
|
+
}
|
|
18
|
+
removeWatcherInternet() {
|
|
19
|
+
this.isWatcher && (console.dir("Удаление событий (online, offline) InternetWatcher.addWatcherInternet"), window.removeEventListener("offline", this.watchIsOffline), window.removeEventListener("online", this.watchIsOnline), this.isOnline = !1, this.isWatcher = !1);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
h as InternetWatcher
|
|
24
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { InternetWatcher } from '../InternetWatcher/InternetWatcher';
|
|
2
|
+
import { ConnectOptions_P, EventNameType, StatusConnectWsAPI, SubscriberType, WsApiStateDefaultI, WsApiStateSaveDefaultI } from './types.d';
|
|
3
|
+
import { DelaysPromise } from '../../../Delay';
|
|
4
|
+
|
|
5
|
+
export declare class WsApi extends DelaysPromise {
|
|
6
|
+
configWs: ConnectOptions_P;
|
|
7
|
+
internet: InternetWatcher;
|
|
8
|
+
state: WsApiStateDefaultI & WsApiStateSaveDefaultI;
|
|
9
|
+
totalInfoReqPromise: {
|
|
10
|
+
action: string;
|
|
11
|
+
reqId: string;
|
|
12
|
+
resolve: any;
|
|
13
|
+
reject: any;
|
|
14
|
+
}[];
|
|
15
|
+
private stateDefault;
|
|
16
|
+
setStatus: (status: StatusConnectWsAPI) => void;
|
|
17
|
+
removeEvents: () => void;
|
|
18
|
+
addEvents: () => void;
|
|
19
|
+
openHandler: () => void;
|
|
20
|
+
closeHandler: () => void;
|
|
21
|
+
on<T>(eventName: EventNameType, cb: SubscriberType<T>): () => void;
|
|
22
|
+
off<T>(eventName: EventNameType, cb: SubscriberType<T>): void;
|
|
23
|
+
msgHandler: (e: any) => void;
|
|
24
|
+
errHandler: (err: any) => void;
|
|
25
|
+
private copyState;
|
|
26
|
+
resetState(): void;
|
|
27
|
+
private sendInformationToTheEvent;
|
|
28
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var c = (n, a, e) => a in n ? l(n, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[a] = e;
|
|
3
|
+
var r = (n, a, e) => (c(n, typeof a != "symbol" ? a + "" : a, e), e);
|
|
4
|
+
import { DelaysPromise as d } from "../../../Delay.js";
|
|
5
|
+
import { InternetWatcher as v } from "../InternetWatcher/InternetWatcher.js";
|
|
6
|
+
class E extends d {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
r(this, "configWs", {
|
|
10
|
+
timeReConnect: 5e3
|
|
11
|
+
});
|
|
12
|
+
r(this, "internet", new v());
|
|
13
|
+
r(this, "state", {
|
|
14
|
+
statusConnect: "disconnect",
|
|
15
|
+
ws: null,
|
|
16
|
+
url: process.env.REACT_APP_URL_WS,
|
|
17
|
+
isRequestArrSaveReq: !1,
|
|
18
|
+
arrSaveReq: [],
|
|
19
|
+
subscribersEvents: {
|
|
20
|
+
msg: [],
|
|
21
|
+
status: []
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
// saveState: WsApiStateSaveDefaultI = {
|
|
25
|
+
// };
|
|
26
|
+
r(this, "totalInfoReqPromise", []);
|
|
27
|
+
r(this, "stateDefault", this.copyState(this.state));
|
|
28
|
+
r(this, "setStatus", (e) => {
|
|
29
|
+
this.sendInformationToTheEvent("status", e), this.state.statusConnect = e;
|
|
30
|
+
});
|
|
31
|
+
r(this, "removeEvents", () => {
|
|
32
|
+
var e, t, s, i;
|
|
33
|
+
(e = this.state.ws) == null || e.removeEventListener("open", this.openHandler), (t = this.state.ws) == null || t.removeEventListener("close", this.closeHandler), (s = this.state.ws) == null || s.removeEventListener("message", this.msgHandler), (i = this.state.ws) == null || i.removeEventListener("error", this.errHandler);
|
|
34
|
+
});
|
|
35
|
+
r(this, "addEvents", () => {
|
|
36
|
+
var e, t, s, i;
|
|
37
|
+
(e = this.state.ws) == null || e.addEventListener("open", this.openHandler), (t = this.state.ws) == null || t.addEventListener("close", this.closeHandler), (s = this.state.ws) == null || s.addEventListener("message", this.msgHandler), (i = this.state.ws) == null || i.addEventListener("error", this.errHandler);
|
|
38
|
+
});
|
|
39
|
+
r(this, "openHandler", () => {
|
|
40
|
+
console.log("this >> open"), this.setStatus("ready");
|
|
41
|
+
});
|
|
42
|
+
r(this, "closeHandler", () => {
|
|
43
|
+
console.log("this >> close"), this.setStatus("close");
|
|
44
|
+
});
|
|
45
|
+
r(this, "msgHandler", (e) => {
|
|
46
|
+
let t = JSON.parse(e.data ? e.data : "{}");
|
|
47
|
+
if ("action" in t && this.state.arrSaveReq.length) {
|
|
48
|
+
let s = this.state.arrSaveReq.findIndex((i) => i.action === t.action);
|
|
49
|
+
~s && this.state.arrSaveReq.splice(s, 1);
|
|
50
|
+
}
|
|
51
|
+
!this.state.arrSaveReq.length && this.state.isRequestArrSaveReq && (this.state.isRequestArrSaveReq = !1);
|
|
52
|
+
try {
|
|
53
|
+
let { action: s } = t, i = [];
|
|
54
|
+
for (let h = 0; h < this.totalInfoReqPromise.length; h++) {
|
|
55
|
+
const o = this.totalInfoReqPromise[h];
|
|
56
|
+
o.action !== s ? i.push(o) : o.resolve && o.resolve(t);
|
|
57
|
+
}
|
|
58
|
+
this.totalInfoReqPromise = i, this.sendInformationToTheEvent("msg", t);
|
|
59
|
+
} catch {
|
|
60
|
+
this.sendInformationToTheEvent("msg", JSON.parse("{}"));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
r(this, "errHandler", (e) => {
|
|
64
|
+
console.log("this >> err"), this.setStatus("error");
|
|
65
|
+
});
|
|
66
|
+
r(this, "sendInformationToTheEvent", (e, t) => {
|
|
67
|
+
var s;
|
|
68
|
+
(s = this.state.subscribersEvents[e]) == null || s.forEach((i) => i(t));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
on(e, t) {
|
|
72
|
+
return this.state.subscribersEvents[e].push(t), () => {
|
|
73
|
+
this.state.subscribersEvents[e] = this.state.subscribersEvents[e].filter((s) => s !== t);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
off(e, t) {
|
|
77
|
+
this.state.subscribersEvents[e] = this.state.subscribersEvents[e].filter((s) => s !== t);
|
|
78
|
+
}
|
|
79
|
+
copyState(e) {
|
|
80
|
+
return JSON.parse(JSON.stringify(e));
|
|
81
|
+
}
|
|
82
|
+
resetState() {
|
|
83
|
+
this.state = this.copyState(this.stateDefault);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
E as WsApi
|
|
88
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class Utils {
|
|
2
|
+
static events(status: 'add' | 'remove', who: any, entriesEvents: any, msg?: string): Promise<unknown>;
|
|
3
|
+
static sortDataByAlphabet: (arrData: any[], sortKey: any) => void;
|
|
4
|
+
static sortDataByDate: (data: any[], keyDate: string) => void;
|
|
5
|
+
static sortDataByDateAndTime: (data: any[], keyDate: string) => void;
|
|
6
|
+
private static splitDateFromTime;
|
|
7
|
+
static reverseDate: (datePPR: any) => string;
|
|
8
|
+
static correctionDataISO8601: (date: string) => string;
|
|
9
|
+
static hasDateLessPeriod: (date: string, period: string, option?: {
|
|
10
|
+
dateMinMax: '<=' | '>=' | '<' | '>';
|
|
11
|
+
}) => boolean | undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var v = (n, t, e) => t in n ? d(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var s = (n, t, e) => (v(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
const a = class a {
|
|
5
|
+
static events(t, e, r, D = "") {
|
|
6
|
+
return console.log(`##########--------<{ ${t === "add" ? "Создаём" : "Удаляем"} пачку ивентов ${D}}>---------#########`), new Promise((M, u) => {
|
|
7
|
+
let f = 0;
|
|
8
|
+
for (let [l, c] of r)
|
|
9
|
+
f++, t === "add" ? e.addEventListener ? e.addEventListener(l, c) : e.on ? e.on(l, c) : console.log("Utils.events:>> ", 'Отсутствует метод "addEventListener"') : e.removeEventListener ? e.removeEventListener(l, c) : e.off ? e.off(l, c) : console.log("Utils.events:>> ", 'Отсутствует метод "removeEventListener"'), f === r.length && M("");
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
s(a, "sortDataByAlphabet", (t, e) => {
|
|
14
|
+
t.sort((r, D) => D[e].trim() < r[e].trim() ? 1 : -1);
|
|
15
|
+
}), s(a, "sortDataByDate", (t, e) => {
|
|
16
|
+
t.sort((r, D) => a.hasDateLessPeriod(D[e], r[e]) ? 1 : -1);
|
|
17
|
+
}), s(a, "sortDataByDateAndTime", (t, e) => {
|
|
18
|
+
}), s(a, "splitDateFromTime", (t) => t.split(" ")), s(a, "reverseDate", (t) => {
|
|
19
|
+
let [e, r] = a.splitDateFromTime(t);
|
|
20
|
+
return e.split(".").reverse().join("-");
|
|
21
|
+
}), s(a, "correctionDataISO8601", (t) => {
|
|
22
|
+
let e = "";
|
|
23
|
+
if (/^\d{2}\.\d{2}\.\d{4}$/.test(t) || /^\d{2}\.\d{2}\.\d{4}\s\d{2}:\d{2}$/.test(t))
|
|
24
|
+
e = a.reverseDate(t);
|
|
25
|
+
else if (/^\d{4}-\d{2}-\d{2}$/.test(t))
|
|
26
|
+
e = t;
|
|
27
|
+
else
|
|
28
|
+
throw new Error(`функция correctionDataISO8601 >> date не корректна: ${t}. Требуется один из форматов: дд.мм.гггг | дд.мм.гггг мм:чч | гггг-мм-дд `);
|
|
29
|
+
return e;
|
|
30
|
+
}), s(a, "hasDateLessPeriod", (t, e, r) => {
|
|
31
|
+
if (t = a.correctionDataISO8601(t), e = a.correctionDataISO8601(e), !r || r && !r.dateMinMax || (r == null ? void 0 : r.dateMinMax) === "<=")
|
|
32
|
+
return Math.floor(Number(new Date(t))) <= Math.floor(Number(new Date(e)));
|
|
33
|
+
if (r && (r == null ? void 0 : r.dateMinMax) === ">=")
|
|
34
|
+
return Math.floor(Number(new Date(t))) >= Math.floor(Number(new Date(e)));
|
|
35
|
+
if (r && (r == null ? void 0 : r.dateMinMax) === "<")
|
|
36
|
+
return Math.floor(Number(new Date(t))) < Math.floor(Number(new Date(e)));
|
|
37
|
+
if (r && (r == null ? void 0 : r.dateMinMax) === ">")
|
|
38
|
+
return Math.floor(Number(new Date(t))) > Math.floor(Number(new Date(e)));
|
|
39
|
+
});
|
|
40
|
+
let m = a;
|
|
41
|
+
export {
|
|
42
|
+
m as Utils
|
|
43
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './classes/Color';
|
|
2
|
+
export * from './classes/ControlAppBySocket';
|
|
3
|
+
export * from './classes/DateProcessing';
|
|
4
|
+
export * from './classes/Delay';
|
|
5
|
+
export * from './classes/DownloadFile';
|
|
6
|
+
export * from './classes/Lodash';
|
|
7
|
+
export * from './classes/Numbers';
|
|
8
|
+
export * from './classes/ProcessingWS';
|
|
9
|
+
export * from './classes/Utils';
|
|
10
|
+
export * from './classes/SocketApi/SocketApi';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Color as e } from "./classes/Color.js";
|
|
2
|
+
import { ControlAppBySocket as m } from "./classes/ControlAppBySocket.js";
|
|
3
|
+
import { DateProcessing as a, currentFullDate as f, currentMonthDay as n, currentYear as x, randomNumber as s, yearRange as l } from "./classes/DateProcessing.js";
|
|
4
|
+
import { DelaysPromise as i } from "./classes/Delay.js";
|
|
5
|
+
import { DownloadFile as D } from "./classes/DownloadFile.js";
|
|
6
|
+
import { Lodash as d } from "./classes/Lodash.js";
|
|
7
|
+
import { Numbers as P } from "./classes/Numbers.js";
|
|
8
|
+
import { ProcessingWS as b } from "./classes/ProcessingWS.js";
|
|
9
|
+
import { Utils as k } from "./classes/Utils.js";
|
|
10
|
+
import { SocketApi as C } from "./classes/SocketApi/SocketApi.js";
|
|
11
|
+
export {
|
|
12
|
+
e as Color,
|
|
13
|
+
m as ControlAppBySocket,
|
|
14
|
+
a as DateProcessing,
|
|
15
|
+
i as DelaysPromise,
|
|
16
|
+
D as DownloadFile,
|
|
17
|
+
d as Lodash,
|
|
18
|
+
P as Numbers,
|
|
19
|
+
b as ProcessingWS,
|
|
20
|
+
C as SocketApi,
|
|
21
|
+
k as Utils,
|
|
22
|
+
f as currentFullDate,
|
|
23
|
+
n as currentMonthDay,
|
|
24
|
+
x as currentYear,
|
|
25
|
+
s as randomNumber,
|
|
26
|
+
l as yearRange
|
|
27
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dev-classes",
|
|
3
|
+
"private": false,
|
|
4
|
+
"author": "SinGlEBW",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/SinGlEBW/dev-classes.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"version": "1.0.1",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"module": "./dist/index.js",
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"directory": "dist"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"dev-classes"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"start": "vite",
|
|
26
|
+
"build": "tsc && vite build",
|
|
27
|
+
"preview": "vite preview",
|
|
28
|
+
"publish": "git add . && git cm -m update && git push && npm publish"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^20.12.7",
|
|
32
|
+
"glob": "^10.3.12",
|
|
33
|
+
"typescript": "^5.2.2",
|
|
34
|
+
"vite": "^5.1.6",
|
|
35
|
+
"vite-plugin-dts": "^3.8.3",
|
|
36
|
+
"vite-plugin-lib-inject-css": "^2.0.1"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"uuid4": "^2.0.3"
|
|
40
|
+
}
|
|
41
|
+
}
|