@zuzjs/core 0.3.1 → 0.3.2
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/index.cjs +2 -0
- package/dist/index.d.cts +165 -0
- package/dist/index.d.ts +165 -0
- package/dist/index.js +1 -0
- package/package.json +43 -58
- package/dist/cjs/colors.d.ts +0 -24
- package/dist/cjs/colors.js +0 -26
- package/dist/cjs/events.d.ts +0 -37
- package/dist/cjs/events.js +0 -82
- package/dist/cjs/index.d.ts +0 -52
- package/dist/cjs/index.js +0 -381
- package/dist/cjs/regexps.d.ts +0 -3
- package/dist/cjs/regexps.js +0 -6
- package/dist/cjs/types.d.ts +0 -28
- package/dist/cjs/types.js +0 -5
- package/dist/cjs/withGlobals.d.ts +0 -41
- package/dist/cjs/withGlobals.js +0 -177
- package/dist/esm/colors.d.ts +0 -24
- package/dist/esm/colors.js +0 -26
- package/dist/esm/events.d.ts +0 -37
- package/dist/esm/events.js +0 -82
- package/dist/esm/index.d.ts +0 -52
- package/dist/esm/index.js +0 -381
- package/dist/esm/regexps.d.ts +0 -3
- package/dist/esm/regexps.js +0 -6
- package/dist/esm/types.d.ts +0 -28
- package/dist/esm/types.js +0 -5
- package/dist/esm/withGlobals.d.ts +0 -41
- package/dist/esm/withGlobals.js +0 -177
- package/dist/tsconfig.esm.tsbuildinfo +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/cjs/withGlobals.js
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import ipRegex from 'ip-regex';
|
|
2
|
-
class withGlobals {
|
|
3
|
-
_;
|
|
4
|
-
constructor(value) {
|
|
5
|
-
this._ = value;
|
|
6
|
-
}
|
|
7
|
-
isIP() {
|
|
8
|
-
return this.isIPv4() || this.isIPv6();
|
|
9
|
-
}
|
|
10
|
-
isIPv4() {
|
|
11
|
-
return ipRegex.v4({ exact: true }).test(this._);
|
|
12
|
-
}
|
|
13
|
-
isIPv6() {
|
|
14
|
-
return ipRegex.v6({ exact: true }).test(this._);
|
|
15
|
-
}
|
|
16
|
-
isTypeof(v) {
|
|
17
|
-
return typeof this._ === typeof v;
|
|
18
|
-
}
|
|
19
|
-
isFunction() {
|
|
20
|
-
return typeof this._ === "function";
|
|
21
|
-
}
|
|
22
|
-
isArray() {
|
|
23
|
-
return Array.isArray(this._);
|
|
24
|
-
}
|
|
25
|
-
isNull() {
|
|
26
|
-
return this._ === null;
|
|
27
|
-
}
|
|
28
|
-
isString() {
|
|
29
|
-
return typeof this._ === "string";
|
|
30
|
-
}
|
|
31
|
-
isNumber() {
|
|
32
|
-
return /^[+-]?\d+(\.\d+)?$/.test(this._);
|
|
33
|
-
}
|
|
34
|
-
isObject() {
|
|
35
|
-
return typeof this._ === "object" && !Array.isArray(this._) && this._ !== null;
|
|
36
|
-
}
|
|
37
|
-
isEmpty() {
|
|
38
|
-
if (Array.isArray(this._))
|
|
39
|
-
return this._.length === 0;
|
|
40
|
-
if (typeof this._ === "object" && this._ !== null)
|
|
41
|
-
return Object.keys(this._).length === 0;
|
|
42
|
-
return this._ === "" || String(this._).length === 0;
|
|
43
|
-
}
|
|
44
|
-
isEmail() {
|
|
45
|
-
return typeof this._ === "string" && /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(this._);
|
|
46
|
-
}
|
|
47
|
-
isUrl() {
|
|
48
|
-
return typeof this._ === "string" && /^(https?:\/\/)?(www\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/[^\s]*)?$/.test(this._);
|
|
49
|
-
}
|
|
50
|
-
toLowerCase() {
|
|
51
|
-
this._ = typeof this._ === "string" ? this._.toLowerCase() : String(this._).toLowerCase();
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Performs a deep equality check for arrays and objects, otherwise a strict equality check.
|
|
56
|
-
* @param v The value to compare against.
|
|
57
|
-
* @returns {boolean} True if the values are equal, false otherwise.
|
|
58
|
-
*/
|
|
59
|
-
equals(v) {
|
|
60
|
-
const a = this._;
|
|
61
|
-
const b = v;
|
|
62
|
-
// Helper function for deep equality
|
|
63
|
-
const deepEqual = (val1, val2) => {
|
|
64
|
-
// If both are strictly equal, they are equal (handles primitives, null, undefined)
|
|
65
|
-
if (val1 === val2) {
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
// If one is null or not an object, and they are not strictly equal, they are not equal
|
|
69
|
-
if (val1 === null || typeof val1 !== 'object' ||
|
|
70
|
-
val2 === null || typeof val2 !== 'object') {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
// Check if both are arrays
|
|
74
|
-
if (Array.isArray(val1) && Array.isArray(val2)) {
|
|
75
|
-
if (val1.length !== val2.length) {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
for (let i = 0; i < val1.length; i++) {
|
|
79
|
-
if (!deepEqual(val1[i], val2[i])) {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
// Check if both are objects (and not arrays, handled above)
|
|
86
|
-
if (this.isObjectValue(val1) && this.isObjectValue(val2)) {
|
|
87
|
-
const keys1 = Object.keys(val1);
|
|
88
|
-
const keys2 = Object.keys(val2);
|
|
89
|
-
if (keys1.length !== keys2.length) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
for (const key of keys1) {
|
|
93
|
-
if (!keys2.includes(key) || !deepEqual(val1[key], val2[key])) {
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
// If types don't match (e.g., one is array, one is object) or other complex types not handled
|
|
100
|
-
return false;
|
|
101
|
-
};
|
|
102
|
-
// Helper to check if a value is a plain object (not null and not an array)
|
|
103
|
-
const isObjectValue = (val) => typeof val === 'object' && val !== null && !Array.isArray(val);
|
|
104
|
-
this.isObjectValue = isObjectValue; // Temporarily add to context for deepEqual to access
|
|
105
|
-
// Main logic for the equals method
|
|
106
|
-
if (Array.isArray(a) && Array.isArray(b)) {
|
|
107
|
-
return deepEqual(a, b);
|
|
108
|
-
}
|
|
109
|
-
if (isObjectValue(a) && isObjectValue(b)) {
|
|
110
|
-
return deepEqual(a, b);
|
|
111
|
-
}
|
|
112
|
-
// For all other types, use strict equality
|
|
113
|
-
return a === b;
|
|
114
|
-
}
|
|
115
|
-
// Helper method to determine if a value is a plain object (not null and not an array)
|
|
116
|
-
// This is added as a class method for better encapsulation and reusability if needed elsewhere.
|
|
117
|
-
isObjectValue(val) {
|
|
118
|
-
return typeof val === 'object' && val !== null && !Array.isArray(val);
|
|
119
|
-
}
|
|
120
|
-
ucfirst() {
|
|
121
|
-
this._ = typeof this._ === "string" ? this._.charAt(0).toUpperCase() + this._.slice(1) : this._;
|
|
122
|
-
return this;
|
|
123
|
-
}
|
|
124
|
-
formatString(v, ...vv) {
|
|
125
|
-
if (typeof this._ !== "string")
|
|
126
|
-
this._ = "";
|
|
127
|
-
const values = [v, ...vv];
|
|
128
|
-
this._ = this._.replace(/%(\d+)/g, (inp, index) => values[Number(index)]?.toString() || `%${index}`);
|
|
129
|
-
return this;
|
|
130
|
-
}
|
|
131
|
-
camelCase() {
|
|
132
|
-
this._ = typeof this._ === "string"
|
|
133
|
-
? this._
|
|
134
|
-
.split(/[^a-zA-Z0-9]+/)
|
|
135
|
-
.map((word, index) => index === 0 ? word : word.charAt(0).toUpperCase() + word.slice(1))
|
|
136
|
-
.join("")
|
|
137
|
-
: this._;
|
|
138
|
-
return this;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Sorts the keys of the internal object in ascending or descending order.
|
|
142
|
-
* If the internal value is not an object, it remains unchanged.
|
|
143
|
-
* @param order The sort order: 'asc' for ascending (default), 'desc' for descending.
|
|
144
|
-
* @returns {this} The current instance for chaining.
|
|
145
|
-
*/
|
|
146
|
-
sort(order = 'asc') {
|
|
147
|
-
if (!this.isObject()) {
|
|
148
|
-
console.warn("sortKeys can only be applied to objects. Current value is not an object.");
|
|
149
|
-
return this;
|
|
150
|
-
}
|
|
151
|
-
const obj = this._;
|
|
152
|
-
const sortedKeys = Object.keys(obj).sort((a, b) => {
|
|
153
|
-
if (order === 'desc') {
|
|
154
|
-
return b.localeCompare(a);
|
|
155
|
-
}
|
|
156
|
-
return a.localeCompare(b);
|
|
157
|
-
});
|
|
158
|
-
const sortedObject = {};
|
|
159
|
-
for (const key of sortedKeys) {
|
|
160
|
-
sortedObject[key] = obj[key];
|
|
161
|
-
}
|
|
162
|
-
this._ = sortedObject;
|
|
163
|
-
return this;
|
|
164
|
-
}
|
|
165
|
-
value() { return this._; }
|
|
166
|
-
valueOf() { return this._; }
|
|
167
|
-
toString() { return String(this._); }
|
|
168
|
-
[Symbol.toPrimitive](hint) {
|
|
169
|
-
if (hint === "number")
|
|
170
|
-
return Number(this._);
|
|
171
|
-
if (hint === "boolean")
|
|
172
|
-
return Boolean(this._);
|
|
173
|
-
return String(this._);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
const _ = (value) => new withGlobals(value);
|
|
177
|
-
export default _;
|
package/dist/esm/colors.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An array of color names.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* This array contains a list of color names that can be used in CSS or other color-related operations.
|
|
6
|
-
*/
|
|
7
|
-
export declare const colorNames: string[];
|
|
8
|
-
/**
|
|
9
|
-
* colorPalatter contains colors and their corresponding shades.
|
|
10
|
-
*/
|
|
11
|
-
export declare const colorPalette: {
|
|
12
|
-
green: {
|
|
13
|
-
50: string;
|
|
14
|
-
100: string;
|
|
15
|
-
200: string;
|
|
16
|
-
300: string;
|
|
17
|
-
400: string;
|
|
18
|
-
500: string;
|
|
19
|
-
600: string;
|
|
20
|
-
700: string;
|
|
21
|
-
800: string;
|
|
22
|
-
900: string;
|
|
23
|
-
};
|
|
24
|
-
};
|
package/dist/esm/colors.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An array of color names.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* This array contains a list of color names that can be used in CSS or other color-related operations.
|
|
6
|
-
*/
|
|
7
|
-
export const colorNames = [
|
|
8
|
-
'aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', 'beige', 'bisque', 'black', 'blanchedalmond', 'blue', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'fuchsia', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'gray', 'green', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'lime', 'limegreen', 'linen', 'magenta', 'maroon', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'navy', 'oldlace', 'olive', 'olivedrab', 'orange', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'purple', 'rebeccapurple', 'red', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'silver', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'teal', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'white', 'whitesmoke', 'yellow', 'yellowgreen'
|
|
9
|
-
];
|
|
10
|
-
/**
|
|
11
|
-
* colorPalatter contains colors and their corresponding shades.
|
|
12
|
-
*/
|
|
13
|
-
export const colorPalette = {
|
|
14
|
-
green: {
|
|
15
|
-
50: '#e8f5e9',
|
|
16
|
-
100: '#c8e6c9',
|
|
17
|
-
200: '#a5d6a7',
|
|
18
|
-
300: '#81c784',
|
|
19
|
-
400: '#66bb6a',
|
|
20
|
-
500: '#4caf50',
|
|
21
|
-
600: '#43a047',
|
|
22
|
-
700: '#388e3c',
|
|
23
|
-
800: '#2e7d32',
|
|
24
|
-
900: '#1b5e20',
|
|
25
|
-
},
|
|
26
|
-
};
|
package/dist/esm/events.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { EventListener } from "./types";
|
|
2
|
-
export interface Event {
|
|
3
|
-
event: String | Symbol;
|
|
4
|
-
listeners: Array<EventListener>;
|
|
5
|
-
}
|
|
6
|
-
declare class Events {
|
|
7
|
-
_events: Event[];
|
|
8
|
-
constructor();
|
|
9
|
-
/**
|
|
10
|
-
* Registers an event listener.
|
|
11
|
-
* @param event The name of the event.
|
|
12
|
-
* @param fun The callback function.
|
|
13
|
-
* @param context Optional context (this) for the callback.
|
|
14
|
-
* @returns A function to unsubscribe this specific listener.
|
|
15
|
-
*/
|
|
16
|
-
on(event: String | Symbol, fun: (...args: any[]) => void, context?: any): () => void;
|
|
17
|
-
/**
|
|
18
|
-
* Removes event listeners matching a specific event and function.
|
|
19
|
-
* Note: This removes *all* listeners for the event that use the exact same function reference.
|
|
20
|
-
* It's often more reliable to use the unsubscribe function returned by 'on'.
|
|
21
|
-
* @param event The name of the event.
|
|
22
|
-
* @param fun The callback function to remove.
|
|
23
|
-
*/
|
|
24
|
-
off(event: String | Symbol, fun: (...args: any[]) => void): void;
|
|
25
|
-
/**
|
|
26
|
-
* Emits an event, calling all registered listeners.
|
|
27
|
-
* @param event The name of the event.
|
|
28
|
-
* @param args Arguments to pass to the listeners.
|
|
29
|
-
*/
|
|
30
|
-
emit(event: String | Symbol, ...args: any[]): void;
|
|
31
|
-
/**
|
|
32
|
-
* Removes all listeners for a specific event.
|
|
33
|
-
* @param event The name of the event.
|
|
34
|
-
*/
|
|
35
|
-
removeAllListeners(event: String | Symbol): void;
|
|
36
|
-
}
|
|
37
|
-
export default Events;
|
package/dist/esm/events.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
class Events {
|
|
2
|
-
_events;
|
|
3
|
-
constructor() {
|
|
4
|
-
this._events = [];
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Registers an event listener.
|
|
8
|
-
* @param event The name of the event.
|
|
9
|
-
* @param fun The callback function.
|
|
10
|
-
* @param context Optional context (this) for the callback.
|
|
11
|
-
* @returns A function to unsubscribe this specific listener.
|
|
12
|
-
*/
|
|
13
|
-
on(event, fun, context) {
|
|
14
|
-
const evt = this._events.find(x => x.event === event);
|
|
15
|
-
const id = Symbol('listener_id'); // Give each listener a unique ID
|
|
16
|
-
const listener = {
|
|
17
|
-
fun: fun, // Store original function
|
|
18
|
-
context: context,
|
|
19
|
-
id: id,
|
|
20
|
-
};
|
|
21
|
-
if (!evt) {
|
|
22
|
-
this._events.push({ event: event, listeners: [listener] });
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
evt.listeners.push(listener);
|
|
26
|
-
}
|
|
27
|
-
// Return an unsubscribe function
|
|
28
|
-
return () => {
|
|
29
|
-
const currentEvt = this._events.find(x => x.event === event);
|
|
30
|
-
if (currentEvt) {
|
|
31
|
-
currentEvt.listeners = currentEvt.listeners.filter(l => l.id !== id);
|
|
32
|
-
if (currentEvt.listeners.length === 0) {
|
|
33
|
-
this._events = this._events.filter(e => e.event !== event);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Removes event listeners matching a specific event and function.
|
|
40
|
-
* Note: This removes *all* listeners for the event that use the exact same function reference.
|
|
41
|
-
* It's often more reliable to use the unsubscribe function returned by 'on'.
|
|
42
|
-
* @param event The name of the event.
|
|
43
|
-
* @param fun The callback function to remove.
|
|
44
|
-
*/
|
|
45
|
-
off(event, fun) {
|
|
46
|
-
const evt = this._events.find(x => x.event === event);
|
|
47
|
-
if (evt) {
|
|
48
|
-
// Filter out listeners where the 'fun' property matches the provided function.
|
|
49
|
-
evt.listeners = evt.listeners.filter(listener => listener.fun !== fun);
|
|
50
|
-
// Optional: If no listeners remain for this event, remove the event entry.
|
|
51
|
-
if (evt.listeners.length === 0) {
|
|
52
|
-
this._events = this._events.filter(e => e.event !== event);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Emits an event, calling all registered listeners.
|
|
58
|
-
* @param event The name of the event.
|
|
59
|
-
* @param args Arguments to pass to the listeners.
|
|
60
|
-
*/
|
|
61
|
-
emit(event, ...args) {
|
|
62
|
-
const evt = this._events.find(x => x.event === event);
|
|
63
|
-
if (evt) {
|
|
64
|
-
[...evt.listeners].forEach(({ fun, context }) => {
|
|
65
|
-
try {
|
|
66
|
-
fun.apply(context, args);
|
|
67
|
-
}
|
|
68
|
-
catch (e) {
|
|
69
|
-
console.error(`Error during event '${String(event)}' emission:`, e);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Removes all listeners for a specific event.
|
|
76
|
-
* @param event The name of the event.
|
|
77
|
-
*/
|
|
78
|
-
removeAllListeners(event) {
|
|
79
|
-
this._events = this._events.filter(e => e.event !== event);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
export default Events;
|
package/dist/esm/index.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { AxiosProgressEvent, AxiosRequestConfig, CancelTokenSource } from "axios";
|
|
2
|
-
import { RefObject } from "react";
|
|
3
|
-
import { FormatNumberParams, sortOptions } from "./types.js";
|
|
4
|
-
export { default as PubSub } from "./events.js";
|
|
5
|
-
export { CancelTokenSource, AxiosProgressEvent as UploadProgressEvent };
|
|
6
|
-
export * from "./types.js";
|
|
7
|
-
export declare const __SALT: string;
|
|
8
|
-
export { default as "_" } from "./withGlobals.js";
|
|
9
|
-
export declare const numberInRange: (min: number, max: number) => number;
|
|
10
|
-
export declare const toHash: (n: number, len?: number, SALT?: string | null) => string;
|
|
11
|
-
export declare const fromHash: (str: string, SALT?: string | null) => number;
|
|
12
|
-
export declare const MD5: (str: string) => string;
|
|
13
|
-
export declare const uuid: (len: number) => string;
|
|
14
|
-
export declare const ucfirst: (o: any) => string;
|
|
15
|
-
export declare const urldecode: (str: string) => string;
|
|
16
|
-
export declare const urlencode: (str: string) => string;
|
|
17
|
-
export declare const pluralize: (word: string, count: number) => string;
|
|
18
|
-
export declare const isHexColor: (color: string) => boolean;
|
|
19
|
-
export declare const isRgbaColor: (color: string) => boolean;
|
|
20
|
-
export declare const isHslColor: (color: string) => boolean;
|
|
21
|
-
export declare const isColorName: (color: string) => boolean;
|
|
22
|
-
export declare const isColor: (color: string) => boolean;
|
|
23
|
-
export declare const hexToRgba: (hex: string, alpha?: number) => string;
|
|
24
|
-
export declare const removeDuplicates: <T>(array: T[]) => T[];
|
|
25
|
-
export declare const getCancelToken: () => CancelTokenSource;
|
|
26
|
-
export declare const withCredentials: (include: boolean) => boolean;
|
|
27
|
-
export declare const withPost: <T>(uri: string, data: any, // 'dynamic' usually maps to 'any' or 'Record<string, any>'
|
|
28
|
-
timeout?: number, ignoreKind?: boolean, headers?: AxiosRequestConfig["headers"], onProgress?: (ev: AxiosProgressEvent) => void) => Promise<T>;
|
|
29
|
-
export declare const withGet: <T>(uri: string, timeout?: number, ignoreKind?: boolean, headers?: AxiosRequestConfig["headers"]) => Promise<T>;
|
|
30
|
-
export declare const withTime: (fun: (...args: any[]) => any) => {
|
|
31
|
-
result: any;
|
|
32
|
-
executionTime: number;
|
|
33
|
-
};
|
|
34
|
-
export declare const time: (stamp?: number, format?: string) => string;
|
|
35
|
-
export declare const timeSince: (stamp: number) => string;
|
|
36
|
-
export declare const arrayRand: (arr: any[]) => any;
|
|
37
|
-
export declare const formatNumber: ({ number, locale, style, decimal, forceDecimal, currency }: FormatNumberParams) => string;
|
|
38
|
-
export declare const formatSize: (bytes: number | string) => string;
|
|
39
|
-
export declare const copyToClipboard: (text: string) => Promise<unknown>;
|
|
40
|
-
export declare const natsort: (options?: sortOptions) => (a: string | number, b: string | number) => number;
|
|
41
|
-
export declare const camelCase: (str: string, ucf?: boolean) => string;
|
|
42
|
-
export declare const camelCaseToDash: (str: string) => string;
|
|
43
|
-
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
44
|
-
export declare const slugify: (text: string, separator?: string) => string;
|
|
45
|
-
export declare const animateCSSVar: (ref: RefObject<HTMLElement>, variable: string, to: number, { lerpFactor, threshold, multiplier, }?: {
|
|
46
|
-
lerpFactor?: number;
|
|
47
|
-
threshold?: number;
|
|
48
|
-
multiplier?: number;
|
|
49
|
-
}) => void;
|
|
50
|
-
export declare const sleep: (ms: number) => Promise<any>;
|
|
51
|
-
export declare const enumToKeys: <T extends Record<string, any>>(obj: T) => Array<keyof T>;
|
|
52
|
-
export declare const exists: (path: string) => Promise<boolean>;
|