tiny-essentials 1.28.0 → 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/1.md +23 -0
- package/changelog/1/28/2.md +43 -0
- package/dist/_/numbers.d.mts +91 -16
- package/dist/v1/TinyAdvancedRaffle.min.js +1 -1
- package/dist/v1/TinyAfterScrollWatcher.min.js +1 -1
- package/dist/v1/TinyAnalogClock.min.js +1 -1
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyDayNightCycle.min.js +1 -1
- package/dist/v1/TinyDragDropDetector.min.js +1 -1
- package/dist/v1/TinyDragger.min.js +1 -1
- package/dist/v1/TinyElementObserver.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyGamepad.min.js +1 -1
- package/dist/v1/TinyHtml.min.js +1 -1
- package/dist/v1/TinyI18.min.js +1 -1
- package/dist/v1/TinyIframeEvents.min.js +1 -1
- package/dist/v1/TinyLocalStorage.min.js +1 -1
- package/dist/v1/TinyMediaPlayer.min.js +1 -1
- package/dist/v1/TinyNewWinEvents.min.js +1 -1
- package/dist/v1/TinyNotifyCenter.min.js +1 -1
- package/dist/v1/TinyRadioFm.min.js +1 -1
- package/dist/v1/TinyRateLimiter.min.js +1 -1
- package/dist/v1/TinySmartScroller.min.js +1 -1
- package/dist/v1/TinyTextDiffer.min.js +1 -1
- package/dist/v1/TinyTextarea.min.js +1 -1
- package/dist/v1/TinyTimeout.min.js +1 -1
- package/dist/v1/TinyToastNotify.min.js +1 -1
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/UltraRandomMsgGen.min.js +1 -1
- package/dist/v1/basics/array.cjs +57 -9
- package/dist/v1/basics/array.d.mts +28 -12
- package/dist/v1/basics/array.mjs +51 -9
- package/dist/v1/basics/clock.cjs +94 -42
- package/dist/v1/basics/clock.d.mts +22 -22
- package/dist/v1/basics/clock.mjs +91 -54
- package/dist/v1/basics/collision.d.mts +245 -104
- package/dist/v1/basics/deprecated/html.cjs +246 -0
- package/dist/v1/basics/deprecated/html.d.mts +63 -0
- package/dist/v1/basics/deprecated/html.mjs +190 -0
- package/dist/v1/basics/extendObjType/Buffer.d.mts +1 -1
- package/dist/v1/basics/fullScreen.d.mts +47 -7
- package/dist/v1/basics/html.cjs +149 -130
- package/dist/v1/basics/html.d.mts +69 -113
- package/dist/v1/basics/html.mjs +113 -105
- package/dist/v1/basics/index.cjs +2 -0
- package/dist/v1/basics/index.d.mts +11 -65
- package/dist/v1/basics/index.mjs +3 -3
- package/dist/v1/basics/mediaContent.cjs +116 -32
- package/dist/v1/basics/mediaContent.d.mts +143 -159
- package/dist/v1/basics/mediaContent.mjs +105 -33
- package/dist/v1/basics/objChecker.cjs +7 -5
- package/dist/v1/basics/objChecker.d.mts +5 -4
- package/dist/v1/basics/objChecker.mjs +6 -6
- package/dist/v1/basics/objFilter.cjs +71 -14
- package/dist/v1/basics/objFilter.d.mts +16 -19
- package/dist/v1/basics/objFilter.mjs +63 -14
- package/dist/v1/basics/simpleMath.cjs +81 -25
- package/dist/v1/basics/simpleMath.d.mts +22 -22
- package/dist/v1/basics/simpleMath.mjs +70 -27
- package/dist/v1/basics/text.cjs +76 -31
- package/dist/v1/basics/text.d.mts +64 -14
- package/dist/v1/basics/text.mjs +62 -31
- 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.cjs +4 -0
- package/dist/v1/index.d.mts +54 -137
- package/dist/v1/index.mjs +4 -3
- package/dist/v1/libs/ColorSafeStringify.d.mts +3 -12
- package/dist/v1/libs/TinyAdvancedRaffle.cjs +64 -50
- package/dist/v1/libs/TinyAdvancedRaffle.d.mts +64 -116
- package/dist/v1/libs/TinyAdvancedRaffle.mjs +62 -49
- package/dist/v1/libs/TinyAfterScrollWatcher.cjs +17 -1
- package/dist/v1/libs/TinyAfterScrollWatcher.d.mts +15 -19
- package/dist/v1/libs/TinyAfterScrollWatcher.mjs +15 -1
- package/dist/v1/libs/TinyAnalogClock.cjs +60 -0
- package/dist/v1/libs/TinyAnalogClock.d.mts +12 -9
- package/dist/v1/libs/TinyAnalogClock.mjs +57 -0
- 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.cjs +2 -0
- package/dist/v1/libs/TinyClipboard.d.mts +12 -5
- package/dist/v1/libs/TinyClipboard.mjs +2 -0
- package/dist/v1/libs/TinyColorConverter.cjs +1 -0
- package/dist/v1/libs/TinyColorConverter.d.mts +10 -32
- package/dist/v1/libs/TinyColorConverter.mjs +1 -0
- package/dist/v1/libs/TinyColorValidator.d.mts +145 -184
- package/dist/v1/libs/TinyCookieConsent.d.mts +17 -17
- package/dist/v1/libs/TinyDayNightCycle.cjs +67 -42
- package/dist/v1/libs/TinyDayNightCycle.d.mts +87 -117
- package/dist/v1/libs/TinyDayNightCycle.mjs +65 -41
- package/dist/v1/libs/TinyDomReadyManager.d.mts +8 -16
- package/dist/v1/libs/TinyDragDropDetector.cjs +25 -0
- package/dist/v1/libs/TinyDragDropDetector.d.mts +32 -26
- package/dist/v1/libs/TinyDragDropDetector.mjs +22 -0
- package/dist/v1/libs/TinyDragger.cjs +46 -19
- package/dist/v1/libs/TinyDragger.d.mts +82 -81
- package/dist/v1/libs/TinyDragger.mjs +45 -18
- package/dist/v1/libs/TinyElementObserver.cjs +39 -0
- package/dist/v1/libs/TinyElementObserver.d.mts +28 -25
- package/dist/v1/libs/TinyElementObserver.mjs +36 -0
- package/dist/v1/libs/TinyGamepad.cjs +131 -2
- package/dist/v1/libs/TinyGamepad.d.mts +50 -122
- package/dist/v1/libs/TinyGamepad.mjs +129 -2
- 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 +4 -5
- package/dist/v1/libs/TinyHtml.d.mts +1503 -1731
- package/dist/v1/libs/TinyHtml.mjs +5 -6
- package/dist/v1/libs/TinyI18.cjs +61 -0
- package/dist/v1/libs/TinyI18.d.mts +34 -58
- package/dist/v1/libs/TinyI18.mjs +55 -0
- package/dist/v1/libs/TinyIframeEvents.cjs +19 -2
- package/dist/v1/libs/TinyIframeEvents.d.mts +29 -38
- package/dist/v1/libs/TinyIframeEvents.mjs +19 -2
- 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.cjs +48 -0
- package/dist/v1/libs/TinyLocalStorage.d.mts +11 -30
- package/dist/v1/libs/TinyLocalStorage.mjs +45 -0
- package/dist/v1/libs/TinyMamdaniInferenceSystem.d.mts +37 -23
- package/dist/v1/libs/TinyMediaPlayer.cjs +77 -3
- package/dist/v1/libs/TinyMediaPlayer.d.mts +109 -106
- package/dist/v1/libs/TinyMediaPlayer.mjs +71 -3
- package/dist/v1/libs/TinyNeedBar.d.mts +25 -37
- package/dist/v1/libs/TinyNewWinEvents.cjs +29 -0
- package/dist/v1/libs/TinyNewWinEvents.d.mts +32 -29
- package/dist/v1/libs/TinyNewWinEvents.mjs +26 -0
- package/dist/v1/libs/TinyNotifications.d.mts +6 -6
- package/dist/v1/libs/TinyNotifyCenter.cjs +36 -0
- package/dist/v1/libs/TinyNotifyCenter.d.mts +15 -15
- package/dist/v1/libs/TinyNotifyCenter.mjs +32 -0
- package/dist/v1/libs/TinyPromiseQueue.d.mts +11 -11
- package/dist/v1/libs/TinyRadioFm.cjs +70 -12
- package/dist/v1/libs/TinyRadioFm.d.mts +45 -80
- package/dist/v1/libs/TinyRadioFm.mjs +64 -12
- package/dist/v1/libs/TinyRateLimiter.cjs +52 -0
- package/dist/v1/libs/TinyRateLimiter.d.mts +29 -36
- package/dist/v1/libs/TinyRateLimiter.mjs +48 -0
- package/dist/v1/libs/TinySimpleDice.d.mts +17 -36
- package/dist/v1/libs/TinySmartScroller.cjs +52 -3
- package/dist/v1/libs/TinySmartScroller.d.mts +62 -70
- package/dist/v1/libs/TinySmartScroller.mjs +51 -5
- package/dist/v1/libs/TinyTextDiffer.cjs +19 -18
- package/dist/v1/libs/TinyTextDiffer.d.mts +11 -13
- package/dist/v1/libs/TinyTextDiffer.mjs +16 -17
- package/dist/v1/libs/TinyTextRangeEditor.d.mts +8 -8
- package/dist/v1/libs/TinyTextarea.cjs +19 -0
- package/dist/v1/libs/TinyTextarea.d.mts +34 -28
- package/dist/v1/libs/TinyTextarea.mjs +17 -0
- package/dist/v1/libs/TinyTimeout.cjs +11 -1
- package/dist/v1/libs/TinyTimeout.d.mts +14 -14
- package/dist/v1/libs/TinyTimeout.mjs +9 -1
- package/dist/v1/libs/TinyToastNotify.cjs +36 -1
- package/dist/v1/libs/TinyToastNotify.d.mts +15 -17
- package/dist/v1/libs/TinyToastNotify.mjs +32 -1
- package/dist/v1/libs/TinyUploadClicker.cjs +19 -0
- package/dist/v1/libs/TinyUploadClicker.d.mts +38 -8
- package/dist/v1/libs/TinyUploadClicker.mjs +17 -0
- package/dist/v1/libs/UltraRandomMsgGen.cjs +148 -35
- package/dist/v1/libs/UltraRandomMsgGen.d.mts +52 -78
- package/dist/v1/libs/UltraRandomMsgGen.mjs +133 -34
- package/dist/v1/libs/utils.cjs +21 -0
- package/dist/v1/libs/utils.d.mts +6 -0
- package/dist/v1/libs/utils.mjs +16 -0
- package/docs/v1/README.md +1 -0
- package/docs/v1/basics/array.md +2 -2
- package/docs/v1/basics/deprecated/html.md +17 -0
- package/docs/v1/basics/fullScreen.md +1 -1
- package/docs/v1/basics/html.md +12 -26
- package/docs/v1/basics/mediaContent.md +1 -1
- package/docs/v1/basics/objChecker.md +1 -1
- package/docs/v1/basics/text.md +2 -2
- package/docs/v1/fileManager/main.md +1 -1
- package/docs/v1/libs/ColorSafeStringify.md +1 -1
- package/docs/v1/libs/TinyAfterScrollWatcher.md +1 -1
- package/docs/v1/libs/TinyAnalogClock.md +1 -1
- package/docs/v1/libs/TinyArrayComparator.md +1 -1
- package/docs/v1/libs/TinyArrayPaginator.md +1 -1
- package/docs/v1/libs/TinyClassManager/TinyPluginInliner.md +2 -2
- package/docs/v1/libs/TinyClassManager.md +1 -1
- package/docs/v1/libs/TinyClipboard.md +1 -1
- package/docs/v1/libs/TinyCookieConsent.md +1 -1
- package/docs/v1/libs/TinyDomReadyManager.md +1 -1
- package/docs/v1/libs/TinyDragDropDetector.md +1 -1
- package/docs/v1/libs/TinyDragger.md +1 -1
- package/docs/v1/libs/TinyElementObserver.md +1 -1
- package/docs/v1/libs/TinyHtml.md +1 -1
- package/docs/v1/libs/TinyIframeEvents.md +2 -2
- package/docs/v1/libs/TinyLevelUp.md +1 -1
- package/docs/v1/libs/TinyLoadingScreen.md +1 -1
- package/docs/v1/libs/TinyNewWinEvents.md +2 -2
- package/docs/v1/libs/TinyNotifications.md +1 -1
- package/docs/v1/libs/TinyPromiseQueue.md +2 -2
- package/docs/v1/libs/TinyTextDiffer.md +1 -1
- package/docs/v1/libs/TinyTextarea.md +1 -1
- package/package.json +11 -2
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Calculates the time duration between the current time and a given time offset.
|
|
3
3
|
*
|
|
4
4
|
* @param {Date} timeData - The target time as a Date object.
|
|
5
|
-
* @param {
|
|
5
|
+
* @param {'asMilliseconds'|'asSeconds'|'asMinutes'|'asHours'|'asDays'} [durationType='asSeconds'] - The type of duration to return.
|
|
6
6
|
* @param {Date|null} [now=null] - The current time as a Date object. Defaults to the current date and time if not provided.
|
|
7
7
|
* @returns {number|null} The calculated duration in the specified unit, or `null` if `timeData` is not provided.
|
|
8
8
|
*/
|
|
9
|
-
export function getTimeDuration(timeData?: Date, durationType?:
|
|
9
|
+
export declare function getTimeDuration(timeData?: Date, durationType?: 'asMilliseconds' | 'asSeconds' | 'asMinutes' | 'asHours' | 'asDays', now?: Date | null): number | null;
|
|
10
10
|
/**
|
|
11
11
|
* Formats a custom timer string based on total seconds and a detail level.
|
|
12
12
|
* Includes proper reallocation of lower units into higher ones, ensuring consistent hierarchy.
|
|
@@ -16,7 +16,7 @@ export function getTimeDuration(timeData?: Date, durationType?: string, now?: Da
|
|
|
16
16
|
* @param {string} [format='{time}'] - Output template with placeholders like {years}, {months}, {days}, {hours}, {minutes}, {seconds}, {time}, {total}.
|
|
17
17
|
* @returns {string} The formatted timer string.
|
|
18
18
|
*/
|
|
19
|
-
export function formatCustomTimer(totalSeconds: number, level?:
|
|
19
|
+
export declare function formatCustomTimer(totalSeconds: number, level?: 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'years', format?: string): string;
|
|
20
20
|
/**
|
|
21
21
|
* Formats a duration (in seconds) into a timer string showing only hours, minutes, and seconds.
|
|
22
22
|
*
|
|
@@ -25,7 +25,7 @@ export function formatCustomTimer(totalSeconds: number, level?: "seconds" | "min
|
|
|
25
25
|
* @param {number} seconds - The total number of seconds to format.
|
|
26
26
|
* @returns {string} The formatted timer string in "HH:MM:SS" format.
|
|
27
27
|
*/
|
|
28
|
-
export function formatTimer(seconds: number): string;
|
|
28
|
+
export declare function formatTimer(seconds: number): string;
|
|
29
29
|
/**
|
|
30
30
|
* Formats a duration (in seconds) into a timer string including days, hours, minutes, and seconds.
|
|
31
31
|
*
|
|
@@ -34,31 +34,31 @@ export function formatTimer(seconds: number): string;
|
|
|
34
34
|
* @param {number} seconds - The total number of seconds to format.
|
|
35
35
|
* @returns {string} The formatted timer string in "Xd HH:MM:SS" format.
|
|
36
36
|
*/
|
|
37
|
-
export function formatDayTimer(seconds: number): string;
|
|
37
|
+
export declare function formatDayTimer(seconds: number): string;
|
|
38
38
|
/**
|
|
39
39
|
* Breaks down a duration in milliseconds into its time components.
|
|
40
40
|
*
|
|
41
41
|
* @param {number} totalMs - The total duration in milliseconds.
|
|
42
42
|
* @param {'milliseconds'|'seconds'|'minutes'|'hours'|'days'|'months'|'years'} [level='milliseconds'] - The highest level to calculate and display.
|
|
43
43
|
* @returns {{
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
44
|
+
* years: number,
|
|
45
|
+
* months: number,
|
|
46
|
+
* days: number,
|
|
47
|
+
* hours: number,
|
|
48
|
+
* minutes: number,
|
|
49
|
+
* seconds: number,
|
|
50
|
+
* milliseconds: number,
|
|
51
|
+
* total: number
|
|
52
52
|
* }}
|
|
53
53
|
*/
|
|
54
|
-
export function breakdownDuration(totalMs: number, level?:
|
|
55
|
-
years: number
|
|
56
|
-
months: number
|
|
57
|
-
days: number
|
|
58
|
-
hours: number
|
|
59
|
-
minutes: number
|
|
60
|
-
seconds: number
|
|
61
|
-
milliseconds: number
|
|
62
|
-
total: number
|
|
54
|
+
export declare function breakdownDuration(totalMs: number, level?: 'milliseconds' | 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'years'): {
|
|
55
|
+
years: number;
|
|
56
|
+
months: number;
|
|
57
|
+
days: number;
|
|
58
|
+
hours: number;
|
|
59
|
+
minutes: number;
|
|
60
|
+
seconds: number;
|
|
61
|
+
milliseconds: number;
|
|
62
|
+
total: number;
|
|
63
63
|
};
|
|
64
64
|
//# sourceMappingURL=clock.d.mts.map
|
package/dist/v1/basics/clock.mjs
CHANGED
|
@@ -2,31 +2,41 @@
|
|
|
2
2
|
* Calculates the time duration between the current time and a given time offset.
|
|
3
3
|
*
|
|
4
4
|
* @param {Date} timeData - The target time as a Date object.
|
|
5
|
-
* @param {
|
|
5
|
+
* @param {'asMilliseconds'|'asSeconds'|'asMinutes'|'asHours'|'asDays'} [durationType='asSeconds'] - The type of duration to return.
|
|
6
6
|
* @param {Date|null} [now=null] - The current time as a Date object. Defaults to the current date and time if not provided.
|
|
7
7
|
* @returns {number|null} The calculated duration in the specified unit, or `null` if `timeData` is not provided.
|
|
8
8
|
*/
|
|
9
9
|
export function getTimeDuration(timeData = new Date(), durationType = 'asSeconds', now = null) {
|
|
10
|
-
if (timeData instanceof Date) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
if (!(timeData instanceof Date)) {
|
|
11
|
+
throw new TypeError("The 'timeData' argument must be an instance of Date.");
|
|
12
|
+
}
|
|
13
|
+
if (typeof durationType !== 'string') {
|
|
14
|
+
throw new TypeError("The 'durationType' argument must be a string.");
|
|
15
|
+
}
|
|
16
|
+
const validDurationTypes = ['asMilliseconds', 'asSeconds', 'asMinutes', 'asHours', 'asDays'];
|
|
17
|
+
if (!validDurationTypes.includes(durationType)) {
|
|
18
|
+
throw new RangeError(`The 'durationType' must be one of: ${validDurationTypes.join(', ')}.`);
|
|
19
|
+
}
|
|
20
|
+
if (now !== null && !(now instanceof Date)) {
|
|
21
|
+
throw new TypeError("The 'now' argument must be an instance of Date or null.");
|
|
22
|
+
}
|
|
23
|
+
const currentTime = now instanceof Date ? now : new Date();
|
|
24
|
+
/** @type {number} */
|
|
25
|
+
const diffMs = timeData.getTime() - currentTime.getTime();
|
|
26
|
+
switch (durationType) {
|
|
27
|
+
case 'asMilliseconds':
|
|
28
|
+
return diffMs;
|
|
29
|
+
case 'asSeconds':
|
|
30
|
+
return diffMs / 1000;
|
|
31
|
+
case 'asMinutes':
|
|
32
|
+
return diffMs / (1000 * 60);
|
|
33
|
+
case 'asHours':
|
|
34
|
+
return diffMs / (1000 * 60 * 60);
|
|
35
|
+
case 'asDays':
|
|
36
|
+
return diffMs / (1000 * 60 * 60 * 24);
|
|
37
|
+
default:
|
|
38
|
+
return diffMs / 1000; // default to seconds
|
|
28
39
|
}
|
|
29
|
-
return null;
|
|
30
40
|
}
|
|
31
41
|
/**
|
|
32
42
|
* Formats a custom timer string based on total seconds and a detail level.
|
|
@@ -38,8 +48,20 @@ export function getTimeDuration(timeData = new Date(), durationType = 'asSeconds
|
|
|
38
48
|
* @returns {string} The formatted timer string.
|
|
39
49
|
*/
|
|
40
50
|
export function formatCustomTimer(totalSeconds, level = 'seconds', format = '{time}') {
|
|
41
|
-
totalSeconds
|
|
51
|
+
if (typeof totalSeconds !== 'number' || Number.isNaN(totalSeconds)) {
|
|
52
|
+
throw new TypeError("The 'totalSeconds' argument must be a valid number.");
|
|
53
|
+
}
|
|
54
|
+
if (typeof level !== 'string') {
|
|
55
|
+
throw new TypeError("The 'level' argument must be a string.");
|
|
56
|
+
}
|
|
42
57
|
const levels = ['seconds', 'minutes', 'hours', 'days', 'months', 'years'];
|
|
58
|
+
if (!levels.includes(level)) {
|
|
59
|
+
throw new RangeError(`The 'level' must be one of: ${levels.join(', ')}.`);
|
|
60
|
+
}
|
|
61
|
+
if (typeof format !== 'string') {
|
|
62
|
+
throw new TypeError("The 'format' argument must be a string.");
|
|
63
|
+
}
|
|
64
|
+
totalSeconds = Math.max(0, Math.floor(totalSeconds));
|
|
43
65
|
const index = levels.indexOf(level);
|
|
44
66
|
const include = {
|
|
45
67
|
years: index >= 5,
|
|
@@ -51,13 +73,13 @@ export function formatCustomTimer(totalSeconds, level = 'seconds', format = '{ti
|
|
|
51
73
|
};
|
|
52
74
|
/**
|
|
53
75
|
* @type {{
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
76
|
+
* years: number,
|
|
77
|
+
* months: number,
|
|
78
|
+
* days: number,
|
|
79
|
+
* hours: number,
|
|
80
|
+
* minutes: number,
|
|
81
|
+
* seconds: number,
|
|
82
|
+
* total: number
|
|
61
83
|
* }}
|
|
62
84
|
*/
|
|
63
85
|
const parts = {
|
|
@@ -109,14 +131,14 @@ export function formatCustomTimer(totalSeconds, level = 'seconds', format = '{ti
|
|
|
109
131
|
parts.seconds = remaining;
|
|
110
132
|
}
|
|
111
133
|
// Calculate total
|
|
112
|
-
const totalMap = {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
};
|
|
134
|
+
/** const totalMap = {
|
|
135
|
+
seconds: include.seconds ? totalSeconds : NaN,
|
|
136
|
+
minutes: include.minutes ? totalSeconds / 60 : NaN,
|
|
137
|
+
hours: include.hours ? totalSeconds / 3600 : NaN,
|
|
138
|
+
days: include.days ? totalSeconds / 86400 : NaN,
|
|
139
|
+
months: include.months ? parts.years * 12 + parts.months + (parts.days || 0) / 30 : NaN,
|
|
140
|
+
years: include.years ? parts.years + (parts.months || 0) / 12 + (parts.days || 0) / 365 : NaN,
|
|
141
|
+
}; */
|
|
120
142
|
parts.total = +totalSeconds.toFixed(2).replace(/\.00$/, '');
|
|
121
143
|
/**
|
|
122
144
|
* Pads a number to ensure it is at least two digits long, using leading zeros if necessary.
|
|
@@ -155,6 +177,9 @@ export function formatCustomTimer(totalSeconds, level = 'seconds', format = '{ti
|
|
|
155
177
|
* @returns {string} The formatted timer string in "HH:MM:SS" format.
|
|
156
178
|
*/
|
|
157
179
|
export function formatTimer(seconds) {
|
|
180
|
+
if (typeof seconds !== 'number' || Number.isNaN(seconds)) {
|
|
181
|
+
throw new TypeError("The 'seconds' argument must be a valid number.");
|
|
182
|
+
}
|
|
158
183
|
return formatCustomTimer(seconds, 'hours', '{hours}:{minutes}:{seconds}');
|
|
159
184
|
}
|
|
160
185
|
/**
|
|
@@ -166,6 +191,9 @@ export function formatTimer(seconds) {
|
|
|
166
191
|
* @returns {string} The formatted timer string in "Xd HH:MM:SS" format.
|
|
167
192
|
*/
|
|
168
193
|
export function formatDayTimer(seconds) {
|
|
194
|
+
if (typeof seconds !== 'number' || Number.isNaN(seconds)) {
|
|
195
|
+
throw new TypeError("The 'seconds' argument must be a valid number.");
|
|
196
|
+
}
|
|
169
197
|
return formatCustomTimer(seconds, 'days', '{days}d {hours}:{minutes}:{seconds}');
|
|
170
198
|
}
|
|
171
199
|
/**
|
|
@@ -174,19 +202,28 @@ export function formatDayTimer(seconds) {
|
|
|
174
202
|
* @param {number} totalMs - The total duration in milliseconds.
|
|
175
203
|
* @param {'milliseconds'|'seconds'|'minutes'|'hours'|'days'|'months'|'years'} [level='milliseconds'] - The highest level to calculate and display.
|
|
176
204
|
* @returns {{
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
205
|
+
* years: number,
|
|
206
|
+
* months: number,
|
|
207
|
+
* days: number,
|
|
208
|
+
* hours: number,
|
|
209
|
+
* minutes: number,
|
|
210
|
+
* seconds: number,
|
|
211
|
+
* milliseconds: number,
|
|
212
|
+
* total: number
|
|
185
213
|
* }}
|
|
186
214
|
*/
|
|
187
215
|
export function breakdownDuration(totalMs, level = 'milliseconds') {
|
|
188
|
-
totalMs
|
|
216
|
+
if (typeof totalMs !== 'number' || Number.isNaN(totalMs)) {
|
|
217
|
+
throw new TypeError("The 'totalMs' argument must be a valid number.");
|
|
218
|
+
}
|
|
219
|
+
if (typeof level !== 'string') {
|
|
220
|
+
throw new TypeError("The 'level' argument must be a string.");
|
|
221
|
+
}
|
|
189
222
|
const levels = ['milliseconds', 'seconds', 'minutes', 'hours', 'days', 'months', 'years'];
|
|
223
|
+
if (!levels.includes(level)) {
|
|
224
|
+
throw new RangeError(`The 'level' must be one of: ${levels.join(', ')}.`);
|
|
225
|
+
}
|
|
226
|
+
totalMs = Math.max(0, Math.floor(totalMs));
|
|
190
227
|
const index = levels.indexOf(level);
|
|
191
228
|
const include = {
|
|
192
229
|
years: index >= 6,
|
|
@@ -251,15 +288,15 @@ export function breakdownDuration(totalMs, level = 'milliseconds') {
|
|
|
251
288
|
parts.milliseconds = remaining;
|
|
252
289
|
}
|
|
253
290
|
// Totals
|
|
254
|
-
const totalMap = {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
};
|
|
291
|
+
/** const totalMap = {
|
|
292
|
+
milliseconds: include.milliseconds ? totalMs : NaN,
|
|
293
|
+
seconds: include.seconds ? totalMs / 1000 : NaN,
|
|
294
|
+
minutes: include.minutes ? totalMs / 60000 : NaN,
|
|
295
|
+
hours: include.hours ? totalMs / 3600000 : NaN,
|
|
296
|
+
days: include.days ? totalMs / 86400000 : NaN,
|
|
297
|
+
months: include.months ? parts.years * 12 + parts.months + (parts.days || 0) / 30 : NaN,
|
|
298
|
+
years: include.years ? parts.years + (parts.months || 0) / 12 + (parts.days || 0) / 365 : NaN,
|
|
299
|
+
}; */
|
|
263
300
|
parts.total = +totalMs;
|
|
264
301
|
return parts;
|
|
265
302
|
}
|