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,15 @@
|
|
|
2
2
|
|
|
3
3
|
var events = require('events');
|
|
4
4
|
var mediaContent = require('../basics/mediaContent.cjs');
|
|
5
|
+
var utils = require('./utils.cjs');
|
|
6
|
+
|
|
7
|
+
const checkDestroy = utils.createCheckDestroyed('TinyRadioFm');
|
|
5
8
|
|
|
6
9
|
/**
|
|
10
|
+
* @typedef {import('../basics/mediaContent.mjs').PictureDataType} PictureDataType
|
|
7
11
|
* @typedef {import('../basics/mediaContent.mjs').MediaContentBase} MediaContentBase
|
|
8
|
-
* @typedef {import('../basics/mediaContent.mjs').MediaContentMetadata} MediaContentMetadata
|
|
9
|
-
* @typedef {import('../basics/mediaContent.mjs').MediaContent} MediaContent
|
|
12
|
+
* @typedef {import('../basics/mediaContent.mjs').MediaContentMetadata<PictureDataType>} MediaContentMetadata
|
|
13
|
+
* @typedef {import('../basics/mediaContent.mjs').MediaContent<PictureDataType>} MediaContent
|
|
10
14
|
* @typedef {import('../basics/mediaContent.mjs').IPicture} IPicture
|
|
11
15
|
* @typedef {import('../basics/mediaContent.mjs').MediaNumber} MediaNumber
|
|
12
16
|
* @typedef {import('../basics/mediaContent.mjs').MediaLoadingError} MediaLoadingError
|
|
@@ -179,11 +183,19 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
179
183
|
TinyRadioFm.#unknownArtist = value;
|
|
180
184
|
}
|
|
181
185
|
|
|
186
|
+
/** @type {boolean} */
|
|
187
|
+
#destroyed = false;
|
|
188
|
+
|
|
189
|
+
get destroyed() {
|
|
190
|
+
return this.#destroyed;
|
|
191
|
+
}
|
|
192
|
+
|
|
182
193
|
/**
|
|
183
194
|
* Gets the total count of all content items (music and voice) in the system.
|
|
184
195
|
* @returns {number}
|
|
185
196
|
*/
|
|
186
197
|
get size() {
|
|
198
|
+
checkDestroy(this.#destroyed);
|
|
187
199
|
return this.#musicList.length + this.#voiceList.length;
|
|
188
200
|
}
|
|
189
201
|
|
|
@@ -192,6 +204,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
192
204
|
* @returns {number}
|
|
193
205
|
*/
|
|
194
206
|
get musicSize() {
|
|
207
|
+
checkDestroy(this.#destroyed);
|
|
195
208
|
return this.#musicList.length;
|
|
196
209
|
}
|
|
197
210
|
|
|
@@ -200,6 +213,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
200
213
|
* @returns {number}
|
|
201
214
|
*/
|
|
202
215
|
get voiceSize() {
|
|
216
|
+
checkDestroy(this.#destroyed);
|
|
203
217
|
return this.#voiceList.length;
|
|
204
218
|
}
|
|
205
219
|
|
|
@@ -208,6 +222,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
208
222
|
* @returns {number}
|
|
209
223
|
*/
|
|
210
224
|
get customPosSize() {
|
|
225
|
+
checkDestroy(this.#destroyed);
|
|
211
226
|
return this.#customPositions.length;
|
|
212
227
|
}
|
|
213
228
|
|
|
@@ -216,6 +231,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
216
231
|
* @returns {number}
|
|
217
232
|
*/
|
|
218
233
|
get tasksSize() {
|
|
234
|
+
checkDestroy(this.#destroyed);
|
|
219
235
|
return this.#scheduledTasks.length;
|
|
220
236
|
}
|
|
221
237
|
|
|
@@ -224,6 +240,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
224
240
|
* @returns {number}
|
|
225
241
|
*/
|
|
226
242
|
get cycleCacheSize() {
|
|
243
|
+
checkDestroy(this.#destroyed);
|
|
227
244
|
return this.#cycleCache.size;
|
|
228
245
|
}
|
|
229
246
|
|
|
@@ -234,6 +251,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
234
251
|
* @returns {MediaContent[]}
|
|
235
252
|
*/
|
|
236
253
|
get musicList() {
|
|
254
|
+
checkDestroy(this.#destroyed);
|
|
237
255
|
return structuredClone(this.#musicList);
|
|
238
256
|
}
|
|
239
257
|
|
|
@@ -244,6 +262,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
244
262
|
* @returns {MediaContent[]}
|
|
245
263
|
*/
|
|
246
264
|
get voiceList() {
|
|
265
|
+
checkDestroy(this.#destroyed);
|
|
247
266
|
return structuredClone(this.#voiceList);
|
|
248
267
|
}
|
|
249
268
|
|
|
@@ -254,6 +273,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
254
273
|
* @returns {CustomPosition[]}
|
|
255
274
|
*/
|
|
256
275
|
get customPositions() {
|
|
276
|
+
checkDestroy(this.#destroyed);
|
|
257
277
|
return structuredClone(this.#customPositions);
|
|
258
278
|
}
|
|
259
279
|
|
|
@@ -264,6 +284,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
264
284
|
* @returns {ScheduledTask[]}
|
|
265
285
|
*/
|
|
266
286
|
get scheduledTasks() {
|
|
287
|
+
checkDestroy(this.#destroyed);
|
|
267
288
|
return structuredClone(this.#scheduledTasks);
|
|
268
289
|
}
|
|
269
290
|
|
|
@@ -272,6 +293,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
272
293
|
* @returns {MediaContent[]} A cloned object of the cache.
|
|
273
294
|
*/
|
|
274
295
|
get allList() {
|
|
296
|
+
checkDestroy(this.#destroyed);
|
|
275
297
|
return [...this.musicList, ...this.voiceList];
|
|
276
298
|
}
|
|
277
299
|
|
|
@@ -282,6 +304,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
282
304
|
* @returns {number}
|
|
283
305
|
*/
|
|
284
306
|
get seed() {
|
|
307
|
+
checkDestroy(this.#destroyed);
|
|
285
308
|
return this.#seed;
|
|
286
309
|
}
|
|
287
310
|
/**
|
|
@@ -289,6 +312,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
289
312
|
* @param {number} seed - The new seed.
|
|
290
313
|
*/
|
|
291
314
|
set seed(seed) {
|
|
315
|
+
checkDestroy(this.#destroyed);
|
|
292
316
|
if (typeof seed !== 'number') throw new TypeError('Seed must be a number.');
|
|
293
317
|
this.#seed = seed;
|
|
294
318
|
this.#cycleCache.clear();
|
|
@@ -302,6 +326,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
302
326
|
* @returns {number}
|
|
303
327
|
*/
|
|
304
328
|
get anchorDate() {
|
|
329
|
+
checkDestroy(this.#destroyed);
|
|
305
330
|
return this.#anchorDate;
|
|
306
331
|
}
|
|
307
332
|
|
|
@@ -325,6 +350,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
325
350
|
* @returns {RadioConfig}
|
|
326
351
|
*/
|
|
327
352
|
get config() {
|
|
353
|
+
checkDestroy(this.#destroyed);
|
|
328
354
|
return structuredClone(this.#config);
|
|
329
355
|
}
|
|
330
356
|
/**
|
|
@@ -333,6 +359,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
333
359
|
* @throws {TypeError|RangeError} If the new configuration is invalid.
|
|
334
360
|
*/
|
|
335
361
|
set config(config) {
|
|
362
|
+
checkDestroy(this.#destroyed);
|
|
336
363
|
// Validate the entire object before applying it
|
|
337
364
|
this.#validateConfig(config);
|
|
338
365
|
|
|
@@ -455,6 +482,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
455
482
|
* @throws {TypeError} If the type is invalid or the data lacks a valid ID and numerical duration.
|
|
456
483
|
*/
|
|
457
484
|
add(type, data, smartQueue = true) {
|
|
485
|
+
checkDestroy(this.#destroyed);
|
|
458
486
|
if (!['music', 'voice', 'custom'].includes(type)) {
|
|
459
487
|
throw new TypeError('Type must be "music", "voice", or "custom".');
|
|
460
488
|
}
|
|
@@ -491,6 +519,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
491
519
|
* @throws {TypeError} If arguments do not match the required types or action/type constraints.
|
|
492
520
|
*/
|
|
493
521
|
scheduleTask(timestamp, action, type, payload, smartQueue = true) {
|
|
522
|
+
checkDestroy(this.#destroyed);
|
|
494
523
|
if (typeof timestamp !== 'number' || isNaN(timestamp))
|
|
495
524
|
throw new TypeError('timestamp must be a valid number.');
|
|
496
525
|
if (!['add', 'remove', 'move'].includes(action))
|
|
@@ -560,6 +589,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
560
589
|
* @throws {TypeError} If the id is not a string.
|
|
561
590
|
*/
|
|
562
591
|
remove(id) {
|
|
592
|
+
checkDestroy(this.#destroyed);
|
|
563
593
|
if (typeof id !== 'string') throw new TypeError('id must be a string.');
|
|
564
594
|
|
|
565
595
|
// Revoke Blob URLs of items being removed to free memory
|
|
@@ -571,7 +601,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
571
601
|
|
|
572
602
|
/**
|
|
573
603
|
* Filter function to match items against the provided ID.
|
|
574
|
-
* @type {
|
|
604
|
+
* @type {(item: any) => boolean}
|
|
575
605
|
*/
|
|
576
606
|
const filterFn = (item) => item.id !== id && item.content?.id !== id;
|
|
577
607
|
|
|
@@ -605,6 +635,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
605
635
|
* @throws {TypeError|RangeError} If the provided values or the resulting state is invalid.
|
|
606
636
|
*/
|
|
607
637
|
setConfig(config) {
|
|
638
|
+
checkDestroy(this.#destroyed);
|
|
608
639
|
// First, validate the incoming partial object for basic type correctness
|
|
609
640
|
this.#validateConfig(config);
|
|
610
641
|
|
|
@@ -624,6 +655,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
624
655
|
* @returns {RadioEvent|null} The current active event, or null if empty.
|
|
625
656
|
*/
|
|
626
657
|
getCurrentEvent() {
|
|
658
|
+
checkDestroy(this.#destroyed);
|
|
627
659
|
const now = Date.now();
|
|
628
660
|
this.#syncRealTimeState(now);
|
|
629
661
|
return this.#getEventAtTime(now, now);
|
|
@@ -639,6 +671,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
639
671
|
* @throws {RangeError} If the limit exceeds the configured queryLimit or is <= 0.
|
|
640
672
|
*/
|
|
641
673
|
queryTimeline(targetDate, limit = 10) {
|
|
674
|
+
checkDestroy(this.#destroyed);
|
|
642
675
|
if (typeof limit !== 'number' || isNaN(limit)) {
|
|
643
676
|
throw new TypeError(`Invalid query limit value. Ensure it is a number.`);
|
|
644
677
|
}
|
|
@@ -677,6 +710,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
677
710
|
* @returns {CustomPosition[]} Shallow copy of custom positions array.
|
|
678
711
|
*/
|
|
679
712
|
searchCustomPositions() {
|
|
713
|
+
checkDestroy(this.#destroyed);
|
|
680
714
|
this.#syncRealTimeState(Date.now());
|
|
681
715
|
return [...this.#customPositions];
|
|
682
716
|
}
|
|
@@ -693,10 +727,18 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
693
727
|
const newItem = structuredClone(item);
|
|
694
728
|
if (newItem.picture && Array.isArray(newItem.picture)) {
|
|
695
729
|
newItem.picture = await Promise.all(
|
|
696
|
-
newItem.picture.map(async (pic) =>
|
|
697
|
-
|
|
698
|
-
data
|
|
699
|
-
|
|
730
|
+
newItem.picture.map(async (pic) => {
|
|
731
|
+
// Only performs the asynchronous conversion if it really is a Blob URL
|
|
732
|
+
if (typeof pic.data === 'string' && pic.data.startsWith('blob:')) {
|
|
733
|
+
return {
|
|
734
|
+
...pic,
|
|
735
|
+
data: await mediaContent.blobUrlToBase64(pic.data),
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// If it is a normal URL, skip the process and keep it as it is
|
|
740
|
+
return pic;
|
|
741
|
+
}),
|
|
700
742
|
);
|
|
701
743
|
}
|
|
702
744
|
return newItem;
|
|
@@ -726,6 +768,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
726
768
|
* @returns {Promise<string>} Stringified JSON state.
|
|
727
769
|
*/
|
|
728
770
|
async exportState() {
|
|
771
|
+
checkDestroy(this.#destroyed);
|
|
729
772
|
const processedMusic = await this._processListForExport(this.#musicList);
|
|
730
773
|
const processedVoice = await this._processListForExport(this.#voiceList);
|
|
731
774
|
|
|
@@ -770,6 +813,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
770
813
|
* @throws {TypeError} If json is not a valid string or object.
|
|
771
814
|
*/
|
|
772
815
|
importState(json) {
|
|
816
|
+
checkDestroy(this.#destroyed);
|
|
773
817
|
/** @type {TinyRadioFmImport} */
|
|
774
818
|
let data;
|
|
775
819
|
if (typeof json === 'string') {
|
|
@@ -791,7 +835,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
791
835
|
/**
|
|
792
836
|
* Mulberry32 Pseudo-Random Number Generator.
|
|
793
837
|
* @param {number} seed - The initialization seed.
|
|
794
|
-
* @returns {
|
|
838
|
+
* @returns {() => number} PRNG function returning a float between 0 and 1.
|
|
795
839
|
* @private
|
|
796
840
|
*/
|
|
797
841
|
_prng(seed) {
|
|
@@ -1305,10 +1349,21 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
1305
1349
|
return list.map((item) => {
|
|
1306
1350
|
const newItem = { ...item };
|
|
1307
1351
|
if (newItem.picture && Array.isArray(newItem.picture)) {
|
|
1308
|
-
newItem.picture = newItem.picture.map((pic) =>
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1352
|
+
newItem.picture = newItem.picture.map((pic) => {
|
|
1353
|
+
// Check whether the data is compatible with the Blob structure (Base64 or Binary)
|
|
1354
|
+
const isBase64 = typeof pic.data === 'string' && pic.data.startsWith('data:');
|
|
1355
|
+
const isUint8Array = pic.data instanceof Uint8Array;
|
|
1356
|
+
|
|
1357
|
+
if (isBase64 || isUint8Array) {
|
|
1358
|
+
return {
|
|
1359
|
+
...pic,
|
|
1360
|
+
data: mediaContent.convertToBlobUrl(pic.data, pic.format),
|
|
1361
|
+
};
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
// If it is a default web URL or local file, use the URL directly
|
|
1365
|
+
return pic;
|
|
1366
|
+
});
|
|
1312
1367
|
}
|
|
1313
1368
|
return newItem;
|
|
1314
1369
|
});
|
|
@@ -1347,6 +1402,8 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
1347
1402
|
* @param {boolean} [destroyThumbs=true]
|
|
1348
1403
|
*/
|
|
1349
1404
|
destroy(destroyThumbs = true) {
|
|
1405
|
+
if (this.#destroyed) return;
|
|
1406
|
+
|
|
1350
1407
|
if (destroyThumbs) {
|
|
1351
1408
|
this.#musicList.forEach((item) => mediaContent.revokeContentUrls(item));
|
|
1352
1409
|
this.#voiceList.forEach((item) => mediaContent.revokeContentUrls(item));
|
|
@@ -1371,6 +1428,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
1371
1428
|
this.#cycleCache.clear();
|
|
1372
1429
|
this.emit('destroyed', { timestamp: Date.now() });
|
|
1373
1430
|
this.removeAllListeners();
|
|
1431
|
+
this.#destroyed = true;
|
|
1374
1432
|
}
|
|
1375
1433
|
}
|
|
1376
1434
|
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
11
|
-
export type
|
|
12
|
-
|
|
13
|
-
* Represents a content item injected at a specific point in the absolute timeline.
|
|
14
|
-
*/
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
export type PictureDataType = import('../basics/mediaContent.mjs').PictureDataType;
|
|
3
|
+
export type MediaContentBase = import('../basics/mediaContent.mjs').MediaContentBase;
|
|
4
|
+
export type MediaContentMetadata = import('../basics/mediaContent.mjs').MediaContentMetadata<PictureDataType>;
|
|
5
|
+
export type MediaContent = import('../basics/mediaContent.mjs').MediaContent<PictureDataType>;
|
|
6
|
+
export type IPicture = import('../basics/mediaContent.mjs').IPicture;
|
|
7
|
+
export type MediaNumber = import('../basics/mediaContent.mjs').MediaNumber;
|
|
8
|
+
export type MediaLoadingError = import('../basics/mediaContent.mjs').MediaLoadingError;
|
|
9
|
+
export type MediaLoadingErrorData = import('../basics/mediaContent.mjs').MediaLoadingErrorData;
|
|
10
|
+
export type LoadingMediaProgress = import('../basics/mediaContent.mjs').LoadingMediaProgress;
|
|
11
|
+
export type ParseMediaContentMetadata = import('../basics/mediaContent.mjs').ParseMediaContentMetadata;
|
|
12
|
+
export type UnknownArtistGetter = import('../basics/mediaContent.mjs').UnknownArtistGetter;
|
|
15
13
|
export type CustomPosition = {
|
|
16
14
|
/**
|
|
17
15
|
* - The audio/music content.
|
|
@@ -26,9 +24,6 @@ export type CustomPosition = {
|
|
|
26
24
|
*/
|
|
27
25
|
originalTimestamp: number;
|
|
28
26
|
};
|
|
29
|
-
/**
|
|
30
|
-
* Data required to relocate an existing item within a playlist.
|
|
31
|
-
*/
|
|
32
27
|
export type ScheduledMovePayload = {
|
|
33
28
|
/**
|
|
34
29
|
* - Content ID to move.
|
|
@@ -39,13 +34,7 @@ export type ScheduledMovePayload = {
|
|
|
39
34
|
*/
|
|
40
35
|
newIndex: number;
|
|
41
36
|
};
|
|
42
|
-
/**
|
|
43
|
-
* A union type representing the various data formats a scheduled task payload can take.
|
|
44
|
-
*/
|
|
45
37
|
export type ScheduledTaskPayload = MediaContent | string | ScheduledMovePayload;
|
|
46
|
-
/**
|
|
47
|
-
* A scheduled instruction to modify the radio state at a specific point in time.
|
|
48
|
-
*/
|
|
49
38
|
export type ScheduledTask = {
|
|
50
39
|
/**
|
|
51
40
|
* - The absolute time to execute the action.
|
|
@@ -54,19 +43,16 @@ export type ScheduledTask = {
|
|
|
54
43
|
/**
|
|
55
44
|
* - The type of modification.
|
|
56
45
|
*/
|
|
57
|
-
action:
|
|
46
|
+
action: 'add' | 'remove' | 'move';
|
|
58
47
|
/**
|
|
59
48
|
* - Target playlist.
|
|
60
49
|
*/
|
|
61
|
-
type:
|
|
50
|
+
type: 'music' | 'voice';
|
|
62
51
|
/**
|
|
63
52
|
* - Data relative to the action.
|
|
64
53
|
*/
|
|
65
54
|
payload: ScheduledTaskPayload;
|
|
66
55
|
};
|
|
67
|
-
/**
|
|
68
|
-
* A standardized representation of an active or upcoming event in the radio timeline.
|
|
69
|
-
*/
|
|
70
56
|
export type RadioEvent = {
|
|
71
57
|
/**
|
|
72
58
|
* - Content ID.
|
|
@@ -113,13 +99,7 @@ export type RadioEvent = {
|
|
|
113
99
|
*/
|
|
114
100
|
isCustom: boolean;
|
|
115
101
|
};
|
|
116
|
-
|
|
117
|
-
* The available sequence logic modes for playlist playback.
|
|
118
|
-
*/
|
|
119
|
-
export type RadioModes = "playlist" | "random";
|
|
120
|
-
/**
|
|
121
|
-
* Global configuration settings for the radio engine behavior.
|
|
122
|
-
*/
|
|
102
|
+
export type RadioModes = 'playlist' | 'random';
|
|
123
103
|
export type RadioConfig = {
|
|
124
104
|
/**
|
|
125
105
|
* - Sequence mode for music.
|
|
@@ -158,16 +138,10 @@ export type RadioConfig = {
|
|
|
158
138
|
*/
|
|
159
139
|
voiceMaxConsecutive: number;
|
|
160
140
|
};
|
|
161
|
-
/**
|
|
162
|
-
* An extension of MediaContent that includes temporal boundaries within a generated cycle.
|
|
163
|
-
*/
|
|
164
141
|
export type CycleBlockData = MediaContent & {
|
|
165
142
|
cycleStart: number;
|
|
166
143
|
cycleEnd: number;
|
|
167
144
|
};
|
|
168
|
-
/**
|
|
169
|
-
* A structural block representing a single full iteration of the radio sequence.
|
|
170
|
-
*/
|
|
171
145
|
export type CycleBlock = {
|
|
172
146
|
/**
|
|
173
147
|
* - Items belonging to this cycle.
|
|
@@ -178,9 +152,6 @@ export type CycleBlock = {
|
|
|
178
152
|
*/
|
|
179
153
|
duration: number;
|
|
180
154
|
};
|
|
181
|
-
/**
|
|
182
|
-
* Information about the location of a specific cycle within the absolute timeline.
|
|
183
|
-
*/
|
|
184
155
|
export type CycleLocation = {
|
|
185
156
|
/**
|
|
186
157
|
* - The located cycle block.
|
|
@@ -195,9 +166,6 @@ export type CycleLocation = {
|
|
|
195
166
|
*/
|
|
196
167
|
loopIndex: number;
|
|
197
168
|
};
|
|
198
|
-
/**
|
|
199
|
-
* The complete state object used for exporting and importing the radio system.
|
|
200
|
-
*/
|
|
201
169
|
export type TinyRadioFmImport = {
|
|
202
170
|
/**
|
|
203
171
|
* - The music playlist.
|
|
@@ -229,9 +197,10 @@ export type TinyRadioFmImport = {
|
|
|
229
197
|
config: RadioConfig;
|
|
230
198
|
};
|
|
231
199
|
/**
|
|
200
|
+
* @typedef {import('../basics/mediaContent.mjs').PictureDataType} PictureDataType
|
|
232
201
|
* @typedef {import('../basics/mediaContent.mjs').MediaContentBase} MediaContentBase
|
|
233
|
-
* @typedef {import('../basics/mediaContent.mjs').MediaContentMetadata} MediaContentMetadata
|
|
234
|
-
* @typedef {import('../basics/mediaContent.mjs').MediaContent} MediaContent
|
|
202
|
+
* @typedef {import('../basics/mediaContent.mjs').MediaContentMetadata<PictureDataType>} MediaContentMetadata
|
|
203
|
+
* @typedef {import('../basics/mediaContent.mjs').MediaContent<PictureDataType>} MediaContent
|
|
235
204
|
* @typedef {import('../basics/mediaContent.mjs').IPicture} IPicture
|
|
236
205
|
* @typedef {import('../basics/mediaContent.mjs').MediaNumber} MediaNumber
|
|
237
206
|
* @typedef {import('../basics/mediaContent.mjs').MediaLoadingError} MediaLoadingError
|
|
@@ -329,7 +298,8 @@ export type TinyRadioFmImport = {
|
|
|
329
298
|
* A deterministic, seed-based radio management system with scheduled adaptations and weighted random generation.
|
|
330
299
|
* @beta
|
|
331
300
|
*/
|
|
332
|
-
declare class TinyRadioFm extends EventEmitter
|
|
301
|
+
declare class TinyRadioFm extends EventEmitter {
|
|
302
|
+
#private;
|
|
333
303
|
/**
|
|
334
304
|
* A Static Factory Method that prepares a MediaContent object by
|
|
335
305
|
* extracting metadata from an audio source.
|
|
@@ -351,32 +321,21 @@ declare class TinyRadioFm extends EventEmitter<any> {
|
|
|
351
321
|
id?: string;
|
|
352
322
|
weight?: number;
|
|
353
323
|
}, parseFile?: ParseMediaContentMetadata, callbacks?: {
|
|
354
|
-
onProgress?: (
|
|
355
|
-
onError?: (
|
|
324
|
+
onProgress?: (progress: LoadingMediaProgress) => void;
|
|
325
|
+
onError?: (error: MediaLoadingErrorData) => void;
|
|
356
326
|
}): Promise<MediaContent>;
|
|
357
327
|
/**
|
|
358
|
-
*
|
|
359
|
-
*
|
|
328
|
+
* Gets the current value used to represent unknown artists.
|
|
329
|
+
* @returns {UnknownArtistGetter}
|
|
360
330
|
*/
|
|
361
|
-
static
|
|
331
|
+
static get unknownArtist(): UnknownArtistGetter;
|
|
362
332
|
/**
|
|
363
333
|
* Sets the value used to represent unknown artists.
|
|
364
334
|
* @param {UnknownArtistGetter} value - A string or a function that returns a string.
|
|
365
335
|
* @throws {TypeError} If the value is neither a string nor a function.
|
|
366
336
|
*/
|
|
367
337
|
static set unknownArtist(value: UnknownArtistGetter);
|
|
368
|
-
|
|
369
|
-
* Gets the current value used to represent unknown artists.
|
|
370
|
-
* @returns {UnknownArtistGetter}
|
|
371
|
-
*/
|
|
372
|
-
static get unknownArtist(): UnknownArtistGetter;
|
|
373
|
-
/**
|
|
374
|
-
* Initializes the radio system.
|
|
375
|
-
* @param {TinyRadioFmImport|null} [initialData=null] - JSON object to hydrate the radio state.
|
|
376
|
-
* @param {number} [seed=0] - Initial seed for deterministic randomness.
|
|
377
|
-
* @throws {TypeError} If initialData is not an object or null, or if seed is not a number.
|
|
378
|
-
*/
|
|
379
|
-
constructor(initialData?: TinyRadioFmImport | null, seed?: number);
|
|
338
|
+
get destroyed(): boolean;
|
|
380
339
|
/**
|
|
381
340
|
* Gets the total count of all content items (music and voice) in the system.
|
|
382
341
|
* @returns {number}
|
|
@@ -432,21 +391,26 @@ declare class TinyRadioFm extends EventEmitter<any> {
|
|
|
432
391
|
* @returns {MediaContent[]} A cloned object of the cache.
|
|
433
392
|
*/
|
|
434
393
|
get allList(): MediaContent[];
|
|
435
|
-
/**
|
|
436
|
-
* Sets the core randomness seed and clears the current cycle cache.
|
|
437
|
-
* @param {number} seed - The new seed.
|
|
438
|
-
*/
|
|
439
|
-
set seed(seed: number);
|
|
440
394
|
/**
|
|
441
395
|
* Gets the current randomness seed.
|
|
442
396
|
* @returns {number}
|
|
443
397
|
*/
|
|
444
398
|
get seed(): number;
|
|
399
|
+
/**
|
|
400
|
+
* Sets the core randomness seed and clears the current cycle cache.
|
|
401
|
+
* @param {number} seed - The new seed.
|
|
402
|
+
*/
|
|
403
|
+
set seed(seed: number);
|
|
445
404
|
/**
|
|
446
405
|
* Gets the absolute timestamp used as the timeline anchor.
|
|
447
406
|
* @returns {number}
|
|
448
407
|
*/
|
|
449
408
|
get anchorDate(): number;
|
|
409
|
+
/**
|
|
410
|
+
* Gets a deep clone of the current radio configuration.
|
|
411
|
+
* @returns {RadioConfig}
|
|
412
|
+
*/
|
|
413
|
+
get config(): RadioConfig;
|
|
450
414
|
/**
|
|
451
415
|
* Performs a complete replacement of the configuration.
|
|
452
416
|
* @param {RadioConfig} config - The new full configuration object.
|
|
@@ -454,10 +418,12 @@ declare class TinyRadioFm extends EventEmitter<any> {
|
|
|
454
418
|
*/
|
|
455
419
|
set config(config: RadioConfig);
|
|
456
420
|
/**
|
|
457
|
-
*
|
|
458
|
-
* @
|
|
421
|
+
* Initializes the radio system.
|
|
422
|
+
* @param {TinyRadioFmImport|null} [initialData=null] - JSON object to hydrate the radio state.
|
|
423
|
+
* @param {number} [seed=0] - Initial seed for deterministic randomness.
|
|
424
|
+
* @throws {TypeError} If initialData is not an object or null, or if seed is not a number.
|
|
459
425
|
*/
|
|
460
|
-
|
|
426
|
+
constructor(initialData?: TinyRadioFmImport | null, seed?: number);
|
|
461
427
|
/**
|
|
462
428
|
* Adds new content instantly to the radio sequence.
|
|
463
429
|
* @param {'music'|'voice'|'custom'} type - The category of the content.
|
|
@@ -465,7 +431,7 @@ declare class TinyRadioFm extends EventEmitter<any> {
|
|
|
465
431
|
* @param {boolean} [smartQueue=true] - If true, delays insertion until the end of the content playing at that timestamp (only affects 'custom').
|
|
466
432
|
* @throws {TypeError} If the type is invalid or the data lacks a valid ID and numerical duration.
|
|
467
433
|
*/
|
|
468
|
-
add(type:
|
|
434
|
+
add(type: 'music' | 'voice' | 'custom', data: MediaContent & {
|
|
469
435
|
timestamp?: number;
|
|
470
436
|
}, smartQueue?: boolean): void;
|
|
471
437
|
/**
|
|
@@ -477,7 +443,7 @@ declare class TinyRadioFm extends EventEmitter<any> {
|
|
|
477
443
|
* @param {boolean} [smartQueue=true] - If true, delays the task execution until the end of the content playing at that timestamp.
|
|
478
444
|
* @throws {TypeError} If arguments do not match the required types or action/type constraints.
|
|
479
445
|
*/
|
|
480
|
-
scheduleTask(timestamp: number, action:
|
|
446
|
+
scheduleTask(timestamp: number, action: 'add' | 'remove' | 'move', type: 'music' | 'voice', payload: ScheduledTaskPayload, smartQueue?: boolean): void;
|
|
481
447
|
/**
|
|
482
448
|
* Removes content instantly by ID across all active lists, positions, and future tasks.
|
|
483
449
|
* @param {string} id - The unique identifier of the content.
|
|
@@ -537,7 +503,7 @@ declare class TinyRadioFm extends EventEmitter<any> {
|
|
|
537
503
|
/**
|
|
538
504
|
* Mulberry32 Pseudo-Random Number Generator.
|
|
539
505
|
* @param {number} seed - The initialization seed.
|
|
540
|
-
* @returns {
|
|
506
|
+
* @returns {() => number} PRNG function returning a float between 0 and 1.
|
|
541
507
|
* @private
|
|
542
508
|
*/
|
|
543
509
|
private _prng;
|
|
@@ -547,7 +513,6 @@ declare class TinyRadioFm extends EventEmitter<any> {
|
|
|
547
513
|
* @param {boolean} [destroyThumbs=true]
|
|
548
514
|
*/
|
|
549
515
|
destroy(destroyThumbs?: boolean): void;
|
|
550
|
-
#private;
|
|
551
516
|
}
|
|
552
|
-
|
|
517
|
+
export default TinyRadioFm;
|
|
553
518
|
//# sourceMappingURL=TinyRadioFm.d.mts.map
|