tiny-essentials 1.28.1 → 1.28.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/changelog/1/28/2.md +43 -0
- package/dist/_/numbers.d.mts +91 -16
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyMediaPlayer.min.js +1 -1
- package/dist/v1/TinyRadioFm.min.js +1 -1
- package/dist/v1/basics/array.d.mts +14 -14
- package/dist/v1/basics/clock.cjs +15 -15
- package/dist/v1/basics/clock.d.mts +21 -21
- package/dist/v1/basics/clock.mjs +15 -15
- package/dist/v1/basics/collision.d.mts +245 -104
- package/dist/v1/basics/deprecated/html.d.mts +33 -33
- package/dist/v1/basics/extendObjType/Buffer.d.mts +1 -1
- package/dist/v1/basics/fullScreen.d.mts +47 -7
- package/dist/v1/basics/html.d.mts +52 -61
- package/dist/v1/basics/index.d.mts +11 -67
- package/dist/v1/basics/mediaContent.cjs +65 -23
- package/dist/v1/basics/mediaContent.d.mts +144 -73
- package/dist/v1/basics/mediaContent.mjs +65 -23
- package/dist/v1/basics/objChecker.d.mts +2 -2
- package/dist/v1/basics/objFilter.cjs +31 -7
- package/dist/v1/basics/objFilter.d.mts +10 -13
- package/dist/v1/basics/objFilter.mjs +31 -7
- package/dist/v1/basics/simpleMath.d.mts +21 -21
- package/dist/v1/basics/text.d.mts +34 -46
- package/dist/v1/build/ColorSafeStringify.d.mts +1 -1
- package/dist/v1/build/TinyAdvancedRaffle.d.mts +1 -1
- package/dist/v1/build/TinyAfterScrollWatcher.d.mts +1 -1
- package/dist/v1/build/TinyAnalogClock.d.mts +1 -1
- package/dist/v1/build/TinyArrayComparator.d.mts +1 -1
- package/dist/v1/build/TinyArrayPaginator.d.mts +1 -1
- package/dist/v1/build/TinyClassManager.d.mts +1 -1
- package/dist/v1/build/TinyClipboard.d.mts +1 -1
- package/dist/v1/build/TinyColorConverter.d.mts +1 -1
- package/dist/v1/build/TinyColorValidator.d.mts +1 -1
- package/dist/v1/build/TinyCookieConsent.d.mts +1 -1
- package/dist/v1/build/TinyDayNightCycle.d.mts +1 -1
- package/dist/v1/build/TinyDomReadyManager.d.mts +1 -1
- package/dist/v1/build/TinyDragDropDetector.d.mts +1 -1
- package/dist/v1/build/TinyDragger.d.mts +1 -1
- package/dist/v1/build/TinyElementObserver.d.mts +1 -1
- package/dist/v1/build/TinyGamepad.d.mts +1 -1
- package/dist/v1/build/TinyHtml.d.mts +1 -1
- package/dist/v1/build/TinyI18.d.mts +1 -1
- package/dist/v1/build/TinyIframeEvents.d.mts +1 -1
- package/dist/v1/build/TinyInventory.d.mts +1 -1
- package/dist/v1/build/TinyInventoryTrader.d.mts +1 -1
- package/dist/v1/build/TinyLevelUp.d.mts +1 -1
- package/dist/v1/build/TinyLoadingScreen.d.mts +1 -1
- package/dist/v1/build/TinyLocalStorage.d.mts +1 -1
- package/dist/v1/build/TinyMediaPlayer.d.mts +1 -1
- package/dist/v1/build/TinyNeedBar.d.mts +1 -1
- package/dist/v1/build/TinyNewWinEvents.d.mts +1 -1
- package/dist/v1/build/TinyNotifications.d.mts +1 -1
- package/dist/v1/build/TinyNotifyCenter.d.mts +1 -1
- package/dist/v1/build/TinyPromiseQueue.d.mts +1 -1
- package/dist/v1/build/TinyRadioFm.d.mts +1 -1
- package/dist/v1/build/TinyRateLimiter.d.mts +1 -1
- package/dist/v1/build/TinySimpleDice.d.mts +1 -1
- package/dist/v1/build/TinySmartScroller.d.mts +1 -1
- package/dist/v1/build/TinyTextDiffer.d.mts +1 -1
- package/dist/v1/build/TinyTextRangeEditor.d.mts +1 -1
- package/dist/v1/build/TinyTextarea.d.mts +1 -1
- package/dist/v1/build/TinyTimeout.d.mts +1 -1
- package/dist/v1/build/TinyToastNotify.d.mts +1 -1
- package/dist/v1/build/TinyUploadClicker.d.mts +1 -1
- package/dist/v1/build/UltraRandomMsgGen.d.mts +1 -1
- package/dist/v1/fileManager/asyncFuncs.d.mts +13 -13
- package/dist/v1/fileManager/index.d.mts +3 -29
- package/dist/v1/fileManager/normalFuncs.d.mts +22 -22
- package/dist/v1/index.d.mts +53 -139
- package/dist/v1/libs/ColorSafeStringify.d.mts +3 -12
- package/dist/v1/libs/TinyAdvancedRaffle.d.mts +60 -103
- package/dist/v1/libs/TinyAfterScrollWatcher.d.mts +11 -18
- package/dist/v1/libs/TinyAnalogClock.d.mts +8 -11
- package/dist/v1/libs/TinyArrayComparator.d.mts +14 -20
- package/dist/v1/libs/TinyArrayPaginator.d.mts +22 -26
- package/dist/v1/libs/TinyClassManager/TinyPluginInliner.d.mts +8 -8
- package/dist/v1/libs/TinyClassManager.cjs +5 -7
- package/dist/v1/libs/TinyClassManager.d.mts +16 -16
- package/dist/v1/libs/TinyClassManager.mjs +5 -6
- package/dist/v1/libs/TinyClipboard.d.mts +8 -3
- package/dist/v1/libs/TinyColorConverter.d.mts +8 -31
- package/dist/v1/libs/TinyColorValidator.d.mts +145 -184
- package/dist/v1/libs/TinyCookieConsent.d.mts +17 -17
- package/dist/v1/libs/TinyDayNightCycle.d.mts +85 -110
- package/dist/v1/libs/TinyDomReadyManager.d.mts +8 -16
- package/dist/v1/libs/TinyDragDropDetector.d.mts +30 -30
- package/dist/v1/libs/TinyDragger.d.mts +82 -81
- package/dist/v1/libs/TinyElementObserver.d.mts +25 -28
- package/dist/v1/libs/TinyGamepad.cjs +0 -1
- package/dist/v1/libs/TinyGamepad.d.mts +50 -122
- package/dist/v1/libs/TinyGamepad.mjs +0 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.cjs +2 -25
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.d.mts +19 -25
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.mjs +3 -27
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.cjs +2 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.d.mts +55 -55
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.mjs +2 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlCanvas.d.mts +6 -6
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.cjs +8 -4
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.d.mts +19 -21
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.mjs +7 -4
- package/dist/v1/libs/TinyHtml/TinyHtmlEmbed.d.mts +8 -8
- package/dist/v1/libs/TinyHtml/TinyHtmlForm.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/TinyHtmlIcon.d.mts +5 -6
- package/dist/v1/libs/TinyHtml/TinyHtmlIframe.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.cjs +0 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.d.mts +22 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.mjs +1 -27
- package/dist/v1/libs/TinyHtml/TinyHtmlInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/TinyHtmlLink.d.mts +23 -23
- package/dist/v1/libs/TinyHtml/TinyHtmlMedia.d.mts +26 -26
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.cjs +4 -30
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.d.mts +20 -26
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.mjs +5 -32
- package/dist/v1/libs/TinyHtml/TinyHtmlSelect.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/TinyHtmlStyle.d.mts +8 -8
- package/dist/v1/libs/TinyHtml/TinyHtmlTemplate.d.mts +26 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.cjs +14 -15
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.d.mts +32 -32
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.mjs +15 -15
- package/dist/v1/libs/TinyHtml/index.d.mts +102 -45
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.cjs +11 -9
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.d.mts +21 -21
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.mjs +11 -9
- package/dist/v1/libs/TinyHtml/input/TinyHtmlFileInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.cjs +4 -4
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.d.mts +17 -13
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.mjs +4 -4
- package/dist/v1/libs/TinyHtml/input/TinyHtmlImageInput.d.mts +21 -21
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.cjs +5 -4
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.mjs +5 -4
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.d.mts +10 -10
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.cjs +5 -4
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.mjs +5 -4
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.d.mts +15 -11
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.cjs +49 -21
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.d.mts +34 -20
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.mjs +45 -20
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.cjs +48 -25
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.d.mts +27 -21
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.mjs +40 -27
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/number/TinyHtmlNumberInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/number/TinyHtmlRangeInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlEmailInput.d.mts +25 -21
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlPasswordInput.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlSearchInput.d.mts +33 -29
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTelInput.d.mts +22 -22
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTextInput.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlUrlInput.d.mts +31 -27
- package/dist/v1/libs/TinyHtml/media/TinyHtmlAudio.d.mts +35 -11
- package/dist/v1/libs/TinyHtml/media/TinyHtmlObject.d.mts +10 -10
- package/dist/v1/libs/TinyHtml/media/TinyHtmlSource.d.mts +12 -12
- package/dist/v1/libs/TinyHtml/media/TinyHtmlVideo.d.mts +35 -27
- package/dist/v1/libs/TinyHtml.cjs +3 -4
- package/dist/v1/libs/TinyHtml.d.mts +1503 -1731
- package/dist/v1/libs/TinyHtml.mjs +3 -4
- package/dist/v1/libs/TinyI18.d.mts +23 -61
- package/dist/v1/libs/TinyIframeEvents.cjs +1 -1
- package/dist/v1/libs/TinyIframeEvents.d.mts +29 -38
- package/dist/v1/libs/TinyIframeEvents.mjs +1 -1
- package/dist/v1/libs/TinyInventory.d.mts +78 -141
- package/dist/v1/libs/TinyInventoryTrader.d.mts +19 -22
- package/dist/v1/libs/TinyLevelUp.d.mts +10 -13
- package/dist/v1/libs/TinyLoadingScreen.d.mts +21 -31
- package/dist/v1/libs/TinyLocalStorage.d.mts +11 -36
- package/dist/v1/libs/TinyMamdaniInferenceSystem.d.mts +37 -23
- package/dist/v1/libs/TinyMediaPlayer.cjs +5 -3
- package/dist/v1/libs/TinyMediaPlayer.d.mts +102 -109
- package/dist/v1/libs/TinyMediaPlayer.mjs +5 -3
- package/dist/v1/libs/TinyNeedBar.d.mts +25 -37
- package/dist/v1/libs/TinyNewWinEvents.d.mts +29 -32
- package/dist/v1/libs/TinyNotifications.d.mts +6 -6
- package/dist/v1/libs/TinyNotifyCenter.d.mts +15 -21
- package/dist/v1/libs/TinyPromiseQueue.d.mts +11 -11
- package/dist/v1/libs/TinyRadioFm.cjs +32 -12
- package/dist/v1/libs/TinyRadioFm.d.mts +44 -80
- package/dist/v1/libs/TinyRadioFm.mjs +29 -12
- package/dist/v1/libs/TinyRateLimiter.d.mts +26 -39
- package/dist/v1/libs/TinySimpleDice.d.mts +17 -36
- package/dist/v1/libs/TinySmartScroller.d.mts +50 -60
- package/dist/v1/libs/TinyTextDiffer.d.mts +11 -14
- package/dist/v1/libs/TinyTextRangeEditor.d.mts +8 -8
- package/dist/v1/libs/TinyTextarea.d.mts +31 -31
- package/dist/v1/libs/TinyTimeout.d.mts +14 -14
- package/dist/v1/libs/TinyToastNotify.cjs +1 -1
- package/dist/v1/libs/TinyToastNotify.d.mts +15 -23
- package/dist/v1/libs/TinyToastNotify.mjs +1 -1
- package/dist/v1/libs/TinyUploadClicker.d.mts +38 -14
- package/dist/v1/libs/UltraRandomMsgGen.d.mts +44 -84
- package/dist/v1/libs/utils.d.mts +5 -1
- package/package.json +2 -2
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { countObj, isJsonObject } from './objChecker.mjs';
|
|
2
|
+
export { countObj, isJsonObject };
|
|
3
|
+
export type ExtendObjType = Object<string, (val: any) => any>;
|
|
4
|
+
export type ExtendObjTypeArray = Array<[string, (val: any) => any]>;
|
|
1
5
|
/** @typedef {Object.<string, (val: any) => *>} ExtendObjType */
|
|
2
6
|
/** @typedef {Array<[string, (val: any) => *]>} ExtendObjTypeArray */
|
|
3
7
|
/**
|
|
@@ -22,7 +26,7 @@
|
|
|
22
26
|
* ['beta', val => Array.isArray(val)]
|
|
23
27
|
* ]);
|
|
24
28
|
*/
|
|
25
|
-
export function extendObjType(newItems: ExtendObjType | ExtendObjTypeArray, index?: number): string[];
|
|
29
|
+
export declare function extendObjType(newItems: ExtendObjType | ExtendObjTypeArray, index?: number): string[];
|
|
26
30
|
/**
|
|
27
31
|
* Reorders the typeValidator.order array according to a custom new order.
|
|
28
32
|
* All values in the new order must already exist in the current order.
|
|
@@ -36,14 +40,14 @@ export function extendObjType(newItems: ExtendObjType | ExtendObjTypeArray, inde
|
|
|
36
40
|
* 'string', 'number', 'array', 'object'
|
|
37
41
|
* ]);
|
|
38
42
|
*/
|
|
39
|
-
export function reorderObjTypeOrder(newOrder: string[]): boolean;
|
|
43
|
+
export declare function reorderObjTypeOrder(newOrder: string[]): boolean;
|
|
40
44
|
/**
|
|
41
45
|
* Returns a cloned version of the `typeValidator.order` array.
|
|
42
46
|
* The cloned array will not be affected by future changes to the original `order`.
|
|
43
47
|
*
|
|
44
48
|
* @returns {string[]} - A new array with the same values as `typeValidator.order`.
|
|
45
49
|
*/
|
|
46
|
-
export function cloneObjTypeOrder(): string[];
|
|
50
|
+
export declare function cloneObjTypeOrder(): string[];
|
|
47
51
|
/**
|
|
48
52
|
* Checks the type of a given object or returns its type as a string.
|
|
49
53
|
*
|
|
@@ -58,14 +62,14 @@ export function cloneObjTypeOrder(): string[];
|
|
|
58
62
|
* objType('hello'); // "string"
|
|
59
63
|
* objType(undefined); // null
|
|
60
64
|
*/
|
|
61
|
-
export function objType(obj: any, type?: string): boolean | string | null;
|
|
65
|
+
export declare function objType(obj: any, type?: string): boolean | string | null;
|
|
62
66
|
/**
|
|
63
67
|
* Checks the type of a given object and returns the validation value if a known type is detected.
|
|
64
68
|
*
|
|
65
69
|
* @param {*} obj - The object to check or identify.
|
|
66
70
|
* @returns {{ valid:*; type: string | null }} - Returns the type result.
|
|
67
71
|
*/
|
|
68
|
-
export function checkObj(obj: any): {
|
|
72
|
+
export declare function checkObj(obj: any): {
|
|
69
73
|
valid: any;
|
|
70
74
|
type: string | null;
|
|
71
75
|
};
|
|
@@ -73,14 +77,7 @@ export function checkObj(obj: any): {
|
|
|
73
77
|
* Creates a clone of the functions from the `typeValidator` object.
|
|
74
78
|
* It returns a new object where the keys are the same and the values are the cloned functions.
|
|
75
79
|
*/
|
|
76
|
-
export function getCheckObj(): {
|
|
80
|
+
export declare function getCheckObj(): {
|
|
77
81
|
[k: string]: any;
|
|
78
82
|
};
|
|
79
|
-
export type ExtendObjType = {
|
|
80
|
-
[x: string]: (val: any) => any;
|
|
81
|
-
};
|
|
82
|
-
export type ExtendObjTypeArray = Array<[string, (val: any) => any]>;
|
|
83
|
-
import { countObj } from './objChecker.mjs';
|
|
84
|
-
import { isJsonObject } from './objChecker.mjs';
|
|
85
|
-
export { countObj, isJsonObject };
|
|
86
83
|
//# sourceMappingURL=objFilter.d.mts.map
|
|
@@ -246,7 +246,10 @@ extendObjType([
|
|
|
246
246
|
],
|
|
247
247
|
[
|
|
248
248
|
'array',
|
|
249
|
-
/**
|
|
249
|
+
/**
|
|
250
|
+
* @template {any} Value
|
|
251
|
+
* @param {*} val @returns {val is Value[]}
|
|
252
|
+
*/
|
|
250
253
|
(val) => Array.isArray(val),
|
|
251
254
|
],
|
|
252
255
|
]);
|
|
@@ -272,27 +275,44 @@ extendObjType([
|
|
|
272
275
|
],
|
|
273
276
|
[
|
|
274
277
|
'map',
|
|
275
|
-
/**
|
|
278
|
+
/**
|
|
279
|
+
* @template {any} Key
|
|
280
|
+
* @template {any} Value
|
|
281
|
+
* @param {*} val @returns {val is Map<Key, Value>}
|
|
282
|
+
*/
|
|
276
283
|
(val) => val instanceof Map,
|
|
277
284
|
],
|
|
278
285
|
[
|
|
279
286
|
'set',
|
|
280
|
-
/**
|
|
287
|
+
/**
|
|
288
|
+
* @template {any} Value
|
|
289
|
+
* @param {*} val @returns {val is Set<Value>}
|
|
290
|
+
*/
|
|
281
291
|
(val) => val instanceof Set,
|
|
282
292
|
],
|
|
283
293
|
[
|
|
284
294
|
'weakmap',
|
|
285
|
-
/**
|
|
295
|
+
/**
|
|
296
|
+
* @template {WeakKey} Key
|
|
297
|
+
* @template {any} Value
|
|
298
|
+
* @param {*} val @returns {val is WeakMap<Key, Value>}
|
|
299
|
+
*/
|
|
286
300
|
(val) => val instanceof WeakMap,
|
|
287
301
|
],
|
|
288
302
|
[
|
|
289
303
|
'weakset',
|
|
290
|
-
/**
|
|
304
|
+
/**
|
|
305
|
+
* @template {WeakKey} Value
|
|
306
|
+
* @param {*} val @returns {val is WeakSet<Value>}
|
|
307
|
+
*/
|
|
291
308
|
(val) => val instanceof WeakSet,
|
|
292
309
|
],
|
|
293
310
|
[
|
|
294
311
|
'promise',
|
|
295
|
-
/**
|
|
312
|
+
/**
|
|
313
|
+
* @template {any} Value
|
|
314
|
+
* @param {*} val @returns {val is Promise<Value>}
|
|
315
|
+
*/
|
|
296
316
|
(val) => val instanceof Promise,
|
|
297
317
|
],
|
|
298
318
|
]);
|
|
@@ -308,7 +328,11 @@ if (isBrowser) {
|
|
|
308
328
|
extendObjType([
|
|
309
329
|
[
|
|
310
330
|
'object',
|
|
311
|
-
/**
|
|
331
|
+
/**
|
|
332
|
+
* @template {string | number | symbol} Key
|
|
333
|
+
* @template {any} Value
|
|
334
|
+
* @param {*} val @returns {val is Record<Key, Value>}
|
|
335
|
+
*/
|
|
312
336
|
(val) => isJsonObject(val),
|
|
313
337
|
],
|
|
314
338
|
]);
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* // Inverse proportion:
|
|
34
34
|
* ruleOfThree.execute(2, 6, 3, true); // → 4
|
|
35
35
|
*/
|
|
36
|
-
export function ruleOfThree(val1: number, val2: number, val3: number, inverse?: boolean): number;
|
|
36
|
+
export declare function ruleOfThree(val1: number, val2: number, val3: number, inverse?: boolean): number;
|
|
37
37
|
/**
|
|
38
38
|
* Calculates the actual value that corresponds to a percentage of a base number.
|
|
39
39
|
* Unlike `getPercentage`, which tells how much something represents in percent,
|
|
@@ -46,7 +46,7 @@ export function ruleOfThree(val1: number, val2: number, val3: number, inverse?:
|
|
|
46
46
|
* @example
|
|
47
47
|
* getSimplePerc(200, 15); // 30
|
|
48
48
|
*/
|
|
49
|
-
export function getSimplePerc(price: number, percentage: number): number;
|
|
49
|
+
export declare function getSimplePerc(price: number, percentage: number): number;
|
|
50
50
|
/**
|
|
51
51
|
* Calculates how much percent a partial value represents of the total value.
|
|
52
52
|
*
|
|
@@ -57,7 +57,7 @@ export function getSimplePerc(price: number, percentage: number): number;
|
|
|
57
57
|
* @example
|
|
58
58
|
* getPercentage(5, 100); // 5
|
|
59
59
|
*/
|
|
60
|
-
export function getPercentage(part: number, total: number): number;
|
|
60
|
+
export declare function getPercentage(part: number, total: number): number;
|
|
61
61
|
/**
|
|
62
62
|
* Calculates the age based on the given date.
|
|
63
63
|
*
|
|
@@ -65,7 +65,17 @@ export function getPercentage(part: number, total: number): number;
|
|
|
65
65
|
* @param {Date|null} [now=null] - The Date object representing the current date. Defaults to the current date and time if not provided.
|
|
66
66
|
* @returns {number|null} The age in years, or null if `timeData` is not provided or invalid.
|
|
67
67
|
*/
|
|
68
|
-
export function getAge(timeData?: number | string | Date, now?: Date | null): number | null;
|
|
68
|
+
export declare function getAge(timeData?: number | string | Date, now?: Date | null): number | null;
|
|
69
|
+
export type FormattedByteResult = {
|
|
70
|
+
/**
|
|
71
|
+
* - The resulting unit (e.g., 'MB', 'GB') or null if input is invalid.
|
|
72
|
+
*/
|
|
73
|
+
unit: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* - The numerical value in the chosen unit, or null if input is invalid.
|
|
76
|
+
*/
|
|
77
|
+
value: number | null;
|
|
78
|
+
};
|
|
69
79
|
/**
|
|
70
80
|
* @typedef {Object} FormattedByteResult
|
|
71
81
|
* @property {string|null} unit - The resulting unit (e.g., 'MB', 'GB') or null if input is invalid.
|
|
@@ -87,7 +97,7 @@ export function getAge(timeData?: number | string | Date, now?: Date | null): nu
|
|
|
87
97
|
* formatBytes(1073741824, 2, 'MB');
|
|
88
98
|
* // → { unit: 'MB', value: 1024 }
|
|
89
99
|
*/
|
|
90
|
-
export function formatBytes(bytes: number, decimals?: number | null, maxUnit?:
|
|
100
|
+
export declare function formatBytes(bytes: number, decimals?: number | null, maxUnit?: 'Bytes' | 'KB' | 'MB' | 'GB' | 'TB' | 'PB' | 'EB' | 'ZB' | 'YB' | null): FormattedByteResult;
|
|
91
101
|
/**
|
|
92
102
|
* Generates a Fibonacci-like sequence as an array of vectors.
|
|
93
103
|
*
|
|
@@ -107,10 +117,10 @@ export function formatBytes(bytes: number, decimals?: number | null, maxUnit?: "
|
|
|
107
117
|
*
|
|
108
118
|
* @beta
|
|
109
119
|
*/
|
|
110
|
-
export function genFibonacciSeq({ baseValues, length, combiner, }?: {
|
|
111
|
-
baseValues?: number[]
|
|
112
|
-
length?: number
|
|
113
|
-
combiner?: (
|
|
120
|
+
export declare function genFibonacciSeq({ baseValues, length, combiner, }?: {
|
|
121
|
+
baseValues?: number[];
|
|
122
|
+
length?: number;
|
|
123
|
+
combiner?: (a: number, b: number, index: number) => number;
|
|
114
124
|
}): number[];
|
|
115
125
|
/**
|
|
116
126
|
* Calculates the unit price of a coin or token based on the market capitalization and circulating supply.
|
|
@@ -122,7 +132,7 @@ export function genFibonacciSeq({ baseValues, length, combiner, }?: {
|
|
|
122
132
|
* @param {number} circulatingSupply - The number of coins/tokens currently in circulation.
|
|
123
133
|
* @returns {number} The calculated price per unit of the asset.
|
|
124
134
|
*/
|
|
125
|
-
export function calculateMarketcap(originalMarketCap: number, circulatingSupply: number): number;
|
|
135
|
+
export declare function calculateMarketcap(originalMarketCap: number, circulatingSupply: number): number;
|
|
126
136
|
/**
|
|
127
137
|
* Calculates the new price of a coin when the market cap changes.
|
|
128
138
|
* @param {number} originalMarketCap - The original market cap.
|
|
@@ -134,19 +144,9 @@ export function calculateMarketcap(originalMarketCap: number, circulatingSupply:
|
|
|
134
144
|
* priceChangePercent: number
|
|
135
145
|
* }}
|
|
136
146
|
*/
|
|
137
|
-
export function compareMarketcap(originalMarketCap: number, circulatingSupply: number, newMarketCap: number): {
|
|
147
|
+
export declare function compareMarketcap(originalMarketCap: number, circulatingSupply: number, newMarketCap: number): {
|
|
138
148
|
originalPrice: number;
|
|
139
149
|
newPrice: number;
|
|
140
150
|
priceChangePercent: number;
|
|
141
151
|
};
|
|
142
|
-
export type FormattedByteResult = {
|
|
143
|
-
/**
|
|
144
|
-
* - The resulting unit (e.g., 'MB', 'GB') or null if input is invalid.
|
|
145
|
-
*/
|
|
146
|
-
unit: string | null;
|
|
147
|
-
/**
|
|
148
|
-
* - The numerical value in the chosen unit, or null if input is invalid.
|
|
149
|
-
*/
|
|
150
|
-
value: number | null;
|
|
151
|
-
};
|
|
152
152
|
//# sourceMappingURL=simpleMath.d.mts.map
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* return await getUserNameFromMention(mention);
|
|
13
13
|
* });
|
|
14
14
|
*/
|
|
15
|
-
export function asyncReplace(str: string, regex: RegExp, asyncFn: Function): Promise<string>;
|
|
15
|
+
export declare function asyncReplace(str: string, regex: RegExp, asyncFn: Function): Promise<string>;
|
|
16
16
|
/**
|
|
17
17
|
* Converts a string to title case where the first letter of each word is capitalized.
|
|
18
18
|
* All other letters are converted to lowercase.
|
|
@@ -22,7 +22,7 @@ export function asyncReplace(str: string, regex: RegExp, asyncFn: Function): Pro
|
|
|
22
22
|
* @param {string} str - The string to be converted to title case.
|
|
23
23
|
* @returns {string} The string converted to title case.
|
|
24
24
|
*/
|
|
25
|
-
export function toTitleCase(str: string): string;
|
|
25
|
+
export declare function toTitleCase(str: string): string;
|
|
26
26
|
/**
|
|
27
27
|
* Converts a string to title case where the first letter of each word is capitalized,
|
|
28
28
|
* but the first letter of the entire string is left lowercase.
|
|
@@ -32,7 +32,7 @@ export function toTitleCase(str: string): string;
|
|
|
32
32
|
* @param {string} str - The string to be converted to title case with the first letter in lowercase.
|
|
33
33
|
* @returns {string} The string converted to title case with the first letter in lowercase.
|
|
34
34
|
*/
|
|
35
|
-
export function toTitleCaseLowerFirst(str: string): string;
|
|
35
|
+
export declare function toTitleCaseLowerFirst(str: string): string;
|
|
36
36
|
/**
|
|
37
37
|
* Enables a keyboard shortcut to toggle a CSS class on the document body.
|
|
38
38
|
*
|
|
@@ -66,9 +66,9 @@ export function toTitleCaseLowerFirst(str: string): string;
|
|
|
66
66
|
* @param {string} [config.className='detect-made-by-ai'] - The CSS class to toggle on the `<body>` element.
|
|
67
67
|
* @returns {(this: Document, ev: KeyboardEvent) => any} The event handler attached to `document`.
|
|
68
68
|
*/
|
|
69
|
-
export function addAiMarkerShortcut({ key, className }?: {
|
|
70
|
-
key?: string
|
|
71
|
-
className?: string
|
|
69
|
+
export declare function addAiMarkerShortcut({ key, className }?: {
|
|
70
|
+
key?: string;
|
|
71
|
+
className?: string;
|
|
72
72
|
}): (this: Document, ev: KeyboardEvent) => any;
|
|
73
73
|
/**
|
|
74
74
|
* Trims a text string to a specified character limit, attempting to avoid cutting words in half.
|
|
@@ -85,7 +85,31 @@ export function addAiMarkerShortcut({ key, className }?: {
|
|
|
85
85
|
* @throws {TypeError} - Throws if `limit` is not a positive integer.
|
|
86
86
|
* @throws {TypeError} - Throws if `safeCutZone` is not a number between 0 and 1 (inclusive).
|
|
87
87
|
*/
|
|
88
|
-
export function safeTextTrim(text: string, limit: number, safeCutZone?: number): string;
|
|
88
|
+
export declare function safeTextTrim(text: string, limit: number, safeCutZone?: number): string;
|
|
89
|
+
export type DiffStringsModifiedValue<CompareValue extends Record<string, any>> = {
|
|
90
|
+
/**
|
|
91
|
+
* - The value before the modification.
|
|
92
|
+
*/
|
|
93
|
+
old: CompareValue[keyof CompareValue];
|
|
94
|
+
/**
|
|
95
|
+
* - The new value after the modification.
|
|
96
|
+
*/
|
|
97
|
+
new: CompareValue[keyof CompareValue];
|
|
98
|
+
};
|
|
99
|
+
export type DiffStringsData<CompareValue extends Record<string, any>> = {
|
|
100
|
+
/**
|
|
101
|
+
* - Properties that only exist in the new object.
|
|
102
|
+
*/
|
|
103
|
+
added: Partial<CompareValue>;
|
|
104
|
+
/**
|
|
105
|
+
* - Properties that only existed in the old object.
|
|
106
|
+
*/
|
|
107
|
+
removed: Partial<CompareValue>;
|
|
108
|
+
/**
|
|
109
|
+
* - Properties that changed, containing their old and new values.
|
|
110
|
+
*/
|
|
111
|
+
modified: Partial<Record<keyof CompareValue, DiffStringsModifiedValue<CompareValue>>>;
|
|
112
|
+
};
|
|
89
113
|
/**
|
|
90
114
|
* @template {Record<string, any>} CompareValue
|
|
91
115
|
* @typedef {Object} DiffStringsModifiedValue
|
|
@@ -107,20 +131,7 @@ export function safeTextTrim(text: string, limit: number, safeCutZone?: number):
|
|
|
107
131
|
* @param {CompareValue2} newStrings - The new object for comparison.
|
|
108
132
|
* @returns {DiffStringsData<CompareValue1 & CompareValue2>} An object containing what was added, removed, and modified.
|
|
109
133
|
*/
|
|
110
|
-
export function diffObjList<
|
|
111
|
-
/**
|
|
112
|
-
* @template {Record<string, any>} CompareValue
|
|
113
|
-
* @typedef {Object} DiffStringsModifiedValue
|
|
114
|
-
* @property {CompareValue[keyof CompareValue]} old - The value before the modification.
|
|
115
|
-
* @property {CompareValue[keyof CompareValue]} new - The new value after the modification.
|
|
116
|
-
*/
|
|
117
|
-
/**
|
|
118
|
-
* @template {Record<string, any>} CompareValue
|
|
119
|
-
* @typedef {Object} DiffStringsData
|
|
120
|
-
* @property {Partial<CompareValue>} added - Properties that only exist in the new object.
|
|
121
|
-
* @property {Partial<CompareValue>} removed - Properties that only existed in the old object.
|
|
122
|
-
* @property {Partial<Record<keyof CompareValue, DiffStringsModifiedValue<CompareValue>>>} modified - Properties that changed, containing their old and new values.
|
|
123
|
-
*/
|
|
134
|
+
export declare function diffObjList<CompareValue1 extends Record<string, any>, CompareValue2 extends Record<string, any>>(oldStrings: CompareValue1, newStrings: CompareValue2): DiffStringsData<CompareValue1 & CompareValue2>;
|
|
124
135
|
/**
|
|
125
136
|
* Diff two objects.
|
|
126
137
|
* @template {Record<string, any>} CompareValue1
|
|
@@ -128,30 +139,7 @@ export function diffObjList<CompareValue1_1 extends Record<string, any>, Compare
|
|
|
128
139
|
* @param {CompareValue1} oldStrings - The original/old object for comparison.
|
|
129
140
|
* @param {CompareValue2} newStrings - The new object for comparison.
|
|
130
141
|
* @returns {DiffStringsData<CompareValue1 & CompareValue2>} An object containing what was added, removed, and modified.
|
|
142
|
+
* @deprecated Function rename! Use {@link diffObjList} instead.
|
|
131
143
|
*/
|
|
132
|
-
export
|
|
133
|
-
export type DiffStringsModifiedValue<CompareValue extends Record<string, any>> = {
|
|
134
|
-
/**
|
|
135
|
-
* - The value before the modification.
|
|
136
|
-
*/
|
|
137
|
-
old: CompareValue[keyof CompareValue];
|
|
138
|
-
/**
|
|
139
|
-
* - The new value after the modification.
|
|
140
|
-
*/
|
|
141
|
-
new: CompareValue[keyof CompareValue];
|
|
142
|
-
};
|
|
143
|
-
export type DiffStringsData<CompareValue extends Record<string, any>> = {
|
|
144
|
-
/**
|
|
145
|
-
* - Properties that only exist in the new object.
|
|
146
|
-
*/
|
|
147
|
-
added: Partial<CompareValue>;
|
|
148
|
-
/**
|
|
149
|
-
* - Properties that only existed in the old object.
|
|
150
|
-
*/
|
|
151
|
-
removed: Partial<CompareValue>;
|
|
152
|
-
/**
|
|
153
|
-
* - Properties that changed, containing their old and new values.
|
|
154
|
-
*/
|
|
155
|
-
modified: Partial<Record<keyof CompareValue, DiffStringsModifiedValue<CompareValue>>>;
|
|
156
|
-
};
|
|
144
|
+
export declare const diffStrings: typeof diffObjList;
|
|
157
145
|
//# sourceMappingURL=text.d.mts.map
|