tiny-essentials 1.28.1 → 1.28.3
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/changelog/1/28/3.md +9 -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.cjs +2 -0
- package/dist/v1/basics/index.d.mts +11 -67
- package/dist/v1/basics/index.mjs +2 -2
- 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 +50 -16
- package/dist/v1/basics/objFilter.d.mts +34 -13
- package/dist/v1/basics/objFilter.mjs +48 -16
- 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.cjs +2 -0
- package/dist/v1/index.d.mts +53 -139
- package/dist/v1/index.mjs +2 -2
- 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/docs/v1/basics/deprecated/objFilter.md +14 -0
- package/docs/v1/basics/objFilter.md +31 -17
- package/package.json +2 -2
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} TickResult
|
|
3
|
+
* @property {number} prevValue - Infinite value before applying decay.
|
|
4
|
+
* @property {number} removedTotal - Total amount removed this tick.
|
|
5
|
+
* @property {number} removedPercent - Percentage of max removed this tick.
|
|
6
|
+
* @property {number} currentPercent - Current percentage relative to max.
|
|
7
|
+
* @property {number} remainingValue - Current clamped value (≥ 0).
|
|
8
|
+
* @property {number} infiniteRemaining - Current infinite value (can be negative).
|
|
9
|
+
*/
|
|
2
10
|
export type TickResult = {
|
|
3
11
|
/**
|
|
4
12
|
* - Infinite value before applying decay.
|
|
@@ -25,12 +33,6 @@ export type TickResult = {
|
|
|
25
33
|
*/
|
|
26
34
|
infiniteRemaining: number;
|
|
27
35
|
};
|
|
28
|
-
/**
|
|
29
|
-
* Represents a decay factor applied to the need bar.
|
|
30
|
-
*
|
|
31
|
-
* - `amount`: base value reduced per tick.
|
|
32
|
-
* - `multiplier`: multiplier applied to the amount.
|
|
33
|
-
*/
|
|
34
36
|
export type BarFactor = {
|
|
35
37
|
/**
|
|
36
38
|
* - Base reduction value per tick.
|
|
@@ -41,12 +43,6 @@ export type BarFactor = {
|
|
|
41
43
|
*/
|
|
42
44
|
multiplier: number;
|
|
43
45
|
};
|
|
44
|
-
/**
|
|
45
|
-
* Represents the serialized state of a TinyNeedBar instance.
|
|
46
|
-
*
|
|
47
|
-
* This object is typically produced by {@link TinyNeedBar#toJSON} and
|
|
48
|
-
* can be used to recreate an instance via {@link TinyNeedBar.fromJSON}.
|
|
49
|
-
*/
|
|
50
46
|
export type SerializedData = {
|
|
51
47
|
/**
|
|
52
48
|
* - Maximum value of the bar at the moment of serialization.
|
|
@@ -65,15 +61,6 @@ export type SerializedData = {
|
|
|
65
61
|
*/
|
|
66
62
|
factors: Record<string, BarFactor>;
|
|
67
63
|
};
|
|
68
|
-
/**
|
|
69
|
-
* @typedef {Object} TickResult
|
|
70
|
-
* @property {number} prevValue - Infinite value before applying decay.
|
|
71
|
-
* @property {number} removedTotal - Total amount removed this tick.
|
|
72
|
-
* @property {number} removedPercent - Percentage of max removed this tick.
|
|
73
|
-
* @property {number} currentPercent - Current percentage relative to max.
|
|
74
|
-
* @property {number} remainingValue - Current clamped value (≥ 0).
|
|
75
|
-
* @property {number} infiniteRemaining - Current infinite value (can be negative).
|
|
76
|
-
*/
|
|
77
64
|
/**
|
|
78
65
|
* Represents a decay factor applied to the need bar.
|
|
79
66
|
*
|
|
@@ -108,20 +95,7 @@ export type SerializedData = {
|
|
|
108
95
|
* - `infiniteValue` → can decrease infinitely into negative numbers.
|
|
109
96
|
*/
|
|
110
97
|
declare class TinyNeedBar {
|
|
111
|
-
|
|
112
|
-
* Restores a need bar from a serialized object.
|
|
113
|
-
* @param {SerializedData} data
|
|
114
|
-
* @returns {TinyNeedBar}
|
|
115
|
-
*/
|
|
116
|
-
static fromJSON(data: SerializedData): TinyNeedBar;
|
|
117
|
-
/**
|
|
118
|
-
* Creates a new need bar instance.
|
|
119
|
-
*
|
|
120
|
-
* @param {number} [maxValue=100] - Maximum value of the bar.
|
|
121
|
-
* @param {number} [baseDecay=1] - Base amount reduced each tick.
|
|
122
|
-
* @param {number} [baseDecayMulti=1] - Multiplier applied to the base decay.
|
|
123
|
-
*/
|
|
124
|
-
constructor(maxValue?: number, baseDecay?: number, baseDecayMulti?: number);
|
|
98
|
+
#private;
|
|
125
99
|
/**
|
|
126
100
|
* Returns a snapshot of all currently active factors.
|
|
127
101
|
* Each factor is returned as a plain object to prevent direct mutation of the internal map.
|
|
@@ -169,6 +143,14 @@ declare class TinyNeedBar {
|
|
|
169
143
|
* @returns {number} Current infinite value.
|
|
170
144
|
*/
|
|
171
145
|
get infiniteValue(): number;
|
|
146
|
+
/**
|
|
147
|
+
* Creates a new need bar instance.
|
|
148
|
+
*
|
|
149
|
+
* @param {number} [maxValue=100] - Maximum value of the bar.
|
|
150
|
+
* @param {number} [baseDecay=1] - Base amount reduced each tick.
|
|
151
|
+
* @param {number} [baseDecayMulti=1] - Multiplier applied to the base decay.
|
|
152
|
+
*/
|
|
153
|
+
constructor(maxValue?: number, baseDecay?: number, baseDecayMulti?: number);
|
|
172
154
|
/**
|
|
173
155
|
* Retrieves a specific factor by its key.
|
|
174
156
|
*
|
|
@@ -225,6 +207,12 @@ declare class TinyNeedBar {
|
|
|
225
207
|
* @returns {SerializedData}
|
|
226
208
|
*/
|
|
227
209
|
toJSON(): SerializedData;
|
|
210
|
+
/**
|
|
211
|
+
* Restores a need bar from a serialized object.
|
|
212
|
+
* @param {SerializedData} data
|
|
213
|
+
* @returns {TinyNeedBar}
|
|
214
|
+
*/
|
|
215
|
+
static fromJSON(data: SerializedData): TinyNeedBar;
|
|
228
216
|
/**
|
|
229
217
|
* Creates a deep clone of this need bar.
|
|
230
218
|
* @returns {TinyNeedBar}
|
|
@@ -234,6 +222,6 @@ declare class TinyNeedBar {
|
|
|
234
222
|
* Clear the factors map, clearing all factor data.
|
|
235
223
|
*/
|
|
236
224
|
clearFactors(): void;
|
|
237
|
-
#private;
|
|
238
225
|
}
|
|
226
|
+
export default TinyNeedBar;
|
|
239
227
|
//# sourceMappingURL=TinyNeedBar.d.mts.map
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* A function to handle incoming event payloads.
|
|
4
|
-
*/
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
5
2
|
export type handler = (payload: any, event: MessageEvent<any>) => any;
|
|
6
3
|
/**
|
|
7
4
|
* @callback handler
|
|
@@ -18,32 +15,20 @@ export type handler = (payload: any, event: MessageEvent<any>) => any;
|
|
|
18
15
|
*
|
|
19
16
|
* @class
|
|
20
17
|
*/
|
|
21
|
-
declare class TinyNewWinEvents extends EventEmitter
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
* @param {Object} [settings={}] Configuration object.
|
|
26
|
-
* @param {string} [settings.targetOrigin] Origin to enforce in postMessage.
|
|
27
|
-
* @param {string} [settings.url] URL string to open.
|
|
28
|
-
* @param {string} [settings.name] Window name (required if opening a new window).
|
|
29
|
-
* @param {string} [settings.features] Features string for `window.open`.
|
|
30
|
-
*
|
|
31
|
-
* @throws {Error} If `name` is "_blank", which is not allowed.
|
|
32
|
-
* @throws {TypeError} If `targetOrigin`, `url`, or `features` are not strings (when provided).
|
|
33
|
-
* @throws {Error} If the window reference is invalid or already being tracked.
|
|
34
|
-
*/
|
|
35
|
-
constructor({ targetOrigin, url, name, features }?: {
|
|
36
|
-
targetOrigin?: string | undefined;
|
|
37
|
-
url?: string | undefined;
|
|
38
|
-
name?: string | undefined;
|
|
39
|
-
features?: string | undefined;
|
|
40
|
-
});
|
|
18
|
+
declare class TinyNewWinEvents extends EventEmitter {
|
|
19
|
+
#private;
|
|
20
|
+
_handleMessage: (event: MessageEvent) => void;
|
|
41
21
|
/**
|
|
42
22
|
* Gets the current destruction status of the instance.
|
|
43
23
|
*
|
|
44
24
|
* @returns {boolean} True if the instance is destroyed, false otherwise.
|
|
45
25
|
*/
|
|
46
26
|
get destroyed(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the internal handshake event name.
|
|
29
|
+
* @returns {string}
|
|
30
|
+
*/
|
|
31
|
+
get readyEventName(): string;
|
|
47
32
|
/**
|
|
48
33
|
* Sets the internal handshake event name.
|
|
49
34
|
* @param {string} name
|
|
@@ -51,10 +36,10 @@ declare class TinyNewWinEvents extends EventEmitter<any> {
|
|
|
51
36
|
*/
|
|
52
37
|
set readyEventName(name: string);
|
|
53
38
|
/**
|
|
54
|
-
* Gets the internal
|
|
39
|
+
* Gets the internal route event name.
|
|
55
40
|
* @returns {string}
|
|
56
41
|
*/
|
|
57
|
-
get
|
|
42
|
+
get routeEventName(): string;
|
|
58
43
|
/**
|
|
59
44
|
* Sets the internal route event name.
|
|
60
45
|
* @param {string} name
|
|
@@ -62,11 +47,24 @@ declare class TinyNewWinEvents extends EventEmitter<any> {
|
|
|
62
47
|
*/
|
|
63
48
|
set routeEventName(name: string);
|
|
64
49
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
50
|
+
* Initializes a TinyNewWinEvents instance for communication.
|
|
51
|
+
*
|
|
52
|
+
* @param {Object} [settings={}] Configuration object.
|
|
53
|
+
* @param {string} [settings.targetOrigin] Origin to enforce in postMessage.
|
|
54
|
+
* @param {string} [settings.url] URL string to open.
|
|
55
|
+
* @param {string} [settings.name] Window name (required if opening a new window).
|
|
56
|
+
* @param {string} [settings.features] Features string for `window.open`.
|
|
57
|
+
*
|
|
58
|
+
* @throws {Error} If `name` is "_blank", which is not allowed.
|
|
59
|
+
* @throws {TypeError} If `targetOrigin`, `url`, or `features` are not strings (when provided).
|
|
60
|
+
* @throws {Error} If the window reference is invalid or already being tracked.
|
|
67
61
|
*/
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
constructor({ targetOrigin, url, name, features }?: {
|
|
63
|
+
targetOrigin?: string;
|
|
64
|
+
url?: string;
|
|
65
|
+
name?: string;
|
|
66
|
+
features?: string;
|
|
67
|
+
});
|
|
70
68
|
/**
|
|
71
69
|
* Returns the internal window reference.
|
|
72
70
|
*
|
|
@@ -122,7 +120,6 @@ declare class TinyNewWinEvents extends EventEmitter<any> {
|
|
|
122
120
|
* @returns {void}
|
|
123
121
|
*/
|
|
124
122
|
destroy(): void;
|
|
125
|
-
#private;
|
|
126
123
|
}
|
|
127
|
-
|
|
124
|
+
export default TinyNewWinEvents;
|
|
128
125
|
//# sourceMappingURL=TinyNewWinEvents.d.mts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export default TinyNotifications;
|
|
2
1
|
/**
|
|
3
2
|
* A utility class to manage browser notifications with sound and custom behavior.
|
|
4
3
|
* Useful for triggering system notifications with optional sound, avatar icon, body truncation, and click actions.
|
|
@@ -6,6 +5,7 @@ export default TinyNotifications;
|
|
|
6
5
|
* @class
|
|
7
6
|
*/
|
|
8
7
|
declare class TinyNotifications {
|
|
8
|
+
#private;
|
|
9
9
|
/**
|
|
10
10
|
* Constructs a new instance of TinyNotifications.
|
|
11
11
|
*
|
|
@@ -17,10 +17,10 @@ declare class TinyNotifications {
|
|
|
17
17
|
* @throws {TypeError} If any of the parameters are of an invalid type.
|
|
18
18
|
*/
|
|
19
19
|
constructor({ audio, defaultIcon, bodyLimit, defaultOnClick, }?: {
|
|
20
|
-
audio?: string | HTMLAudioElement | null
|
|
21
|
-
defaultIcon?: string | null
|
|
22
|
-
bodyLimit?: number
|
|
23
|
-
defaultOnClick?: (
|
|
20
|
+
audio?: string | HTMLAudioElement | null;
|
|
21
|
+
defaultIcon?: string | null;
|
|
22
|
+
bodyLimit?: number;
|
|
23
|
+
defaultOnClick?: (this: Notification, evt: Event) => any;
|
|
24
24
|
});
|
|
25
25
|
/**
|
|
26
26
|
* Requests permission from the user to show notifications.
|
|
@@ -101,6 +101,6 @@ declare class TinyNotifications {
|
|
|
101
101
|
* @throws {TypeError} If the value is not a function.
|
|
102
102
|
*/
|
|
103
103
|
setDefaultOnClick(value: (this: Notification, evt: Event) => any): void;
|
|
104
|
-
#private;
|
|
105
104
|
}
|
|
105
|
+
export default TinyNotifications;
|
|
106
106
|
//# sourceMappingURL=TinyNotifications.d.mts.map
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
export default TinyNotifyCenter;
|
|
2
|
-
/**
|
|
3
|
-
* Represents a single notification entry.
|
|
4
|
-
*
|
|
5
|
-
* A notification can be provided as a simple string (treated as a plain message),
|
|
6
|
-
* or as an object with additional data such as a title, an avatar image, and a click handler.
|
|
7
|
-
*/
|
|
8
1
|
export type NotifyData = string | {
|
|
9
2
|
title?: string;
|
|
10
3
|
message: string;
|
|
@@ -42,6 +35,7 @@ export type NotifyData = string | {
|
|
|
42
35
|
* @class
|
|
43
36
|
*/
|
|
44
37
|
declare class TinyNotifyCenter {
|
|
38
|
+
#private;
|
|
45
39
|
/**
|
|
46
40
|
* Returns the full HTML structure for the notification system as a string.
|
|
47
41
|
*
|
|
@@ -72,7 +66,13 @@ declare class TinyNotifyCenter {
|
|
|
72
66
|
* @param {'beforebegin'|'afterbegin'|'beforeend'|'afterend'} [where='afterbegin']
|
|
73
67
|
* The position relative to `document.body` where the HTML should be inserted.
|
|
74
68
|
*/
|
|
75
|
-
static insertTemplate(where?:
|
|
69
|
+
static insertTemplate(where?: 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend'): void;
|
|
70
|
+
/**
|
|
71
|
+
* Gets the current destruction status of the instance.
|
|
72
|
+
*
|
|
73
|
+
* @returns {boolean} True if the instance is destroyed, false otherwise.
|
|
74
|
+
*/
|
|
75
|
+
get destroyed(): boolean;
|
|
76
76
|
/**
|
|
77
77
|
* Options for configuring the NotificationCenter instance.
|
|
78
78
|
*
|
|
@@ -86,17 +86,11 @@ declare class TinyNotifyCenter {
|
|
|
86
86
|
* @param {HTMLElement} [options.overlay=document.querySelector('.notify-overlay')] - The overlay element that covers the screen when the center is visible.
|
|
87
87
|
*/
|
|
88
88
|
constructor(options?: {
|
|
89
|
-
center?: HTMLElement
|
|
90
|
-
badge?: HTMLElement
|
|
91
|
-
button?: HTMLElement
|
|
92
|
-
overlay?: HTMLElement
|
|
89
|
+
center?: HTMLElement;
|
|
90
|
+
badge?: HTMLElement;
|
|
91
|
+
button?: HTMLElement;
|
|
92
|
+
overlay?: HTMLElement;
|
|
93
93
|
});
|
|
94
|
-
/**
|
|
95
|
-
* Gets the current destruction status of the instance.
|
|
96
|
-
*
|
|
97
|
-
* @returns {boolean} True if the instance is destroyed, false otherwise.
|
|
98
|
-
*/
|
|
99
|
-
get destroyed(): boolean;
|
|
100
94
|
/**
|
|
101
95
|
* Enable or disable automatic mark-as-read on close.
|
|
102
96
|
* @param {boolean} value
|
|
@@ -112,7 +106,7 @@ declare class TinyNotifyCenter {
|
|
|
112
106
|
* @param {number} index
|
|
113
107
|
* @returns {'text' | 'html' | null}
|
|
114
108
|
*/
|
|
115
|
-
getItemMode(index: number):
|
|
109
|
+
getItemMode(index: number): 'text' | 'html' | null;
|
|
116
110
|
/**
|
|
117
111
|
* Get a notify element by index.
|
|
118
112
|
* @param {number} index
|
|
@@ -136,7 +130,7 @@ declare class TinyNotifyCenter {
|
|
|
136
130
|
* @param {NotifyData} message - Notification content or a full object with title, avatar, and callback.
|
|
137
131
|
* @param {'text'|'html'} [mode='text'] - How to treat the message content.
|
|
138
132
|
*/
|
|
139
|
-
add(message: NotifyData, mode?:
|
|
133
|
+
add(message: NotifyData, mode?: 'text' | 'html'): void;
|
|
140
134
|
/**
|
|
141
135
|
* Remove a notify by index.
|
|
142
136
|
* @param {number} index
|
|
@@ -176,6 +170,6 @@ declare class TinyNotifyCenter {
|
|
|
176
170
|
* @returns {void}
|
|
177
171
|
*/
|
|
178
172
|
destroy(): void;
|
|
179
|
-
#private;
|
|
180
173
|
}
|
|
174
|
+
export default TinyNotifyCenter;
|
|
181
175
|
//# sourceMappingURL=TinyNotifyCenter.d.mts.map
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} QueuedTask
|
|
3
|
+
* @property {(...args: any[]) => Promise<any>|Promise<any>} task - The async task to execute.
|
|
4
|
+
* @property {(value: any) => any} resolve - The resolve function from the Promise.
|
|
5
|
+
* @property {(reason?: any) => any} reject - The reject function from the Promise.
|
|
6
|
+
* @property {string|undefined} [id] - Optional identifier for the task.
|
|
7
|
+
* @property {string|null|undefined} [marker] - Optional marker for the task.
|
|
8
|
+
* @property {number|null|undefined} [delay] - Optional delay (in ms) before the task is executed.
|
|
9
|
+
*/
|
|
2
10
|
export type QueuedTask = {
|
|
3
11
|
/**
|
|
4
12
|
* - The async task to execute.
|
|
@@ -25,15 +33,6 @@ export type QueuedTask = {
|
|
|
25
33
|
*/
|
|
26
34
|
delay?: number | null | undefined;
|
|
27
35
|
};
|
|
28
|
-
/**
|
|
29
|
-
* @typedef {Object} QueuedTask
|
|
30
|
-
* @property {(...args: any[]) => Promise<any>|Promise<any>} task - The async task to execute.
|
|
31
|
-
* @property {(value: any) => any} resolve - The resolve function from the Promise.
|
|
32
|
-
* @property {(reason?: any) => any} reject - The reject function from the Promise.
|
|
33
|
-
* @property {string|undefined} [id] - Optional identifier for the task.
|
|
34
|
-
* @property {string|null|undefined} [marker] - Optional marker for the task.
|
|
35
|
-
* @property {number|null|undefined} [delay] - Optional delay (in ms) before the task is executed.
|
|
36
|
-
*/
|
|
37
36
|
/**
|
|
38
37
|
* A queue system for managing and executing asynchronous tasks sequentially, one at a time.
|
|
39
38
|
*
|
|
@@ -43,6 +42,7 @@ export type QueuedTask = {
|
|
|
43
42
|
* @class
|
|
44
43
|
*/
|
|
45
44
|
declare class TinyPromiseQueue {
|
|
45
|
+
#private;
|
|
46
46
|
/**
|
|
47
47
|
* Returns whether the queue is currently processing a task.
|
|
48
48
|
*
|
|
@@ -105,6 +105,6 @@ declare class TinyPromiseQueue {
|
|
|
105
105
|
* @throws {Error} Throws if `id` is not a string.
|
|
106
106
|
*/
|
|
107
107
|
cancelTask(id: string): boolean;
|
|
108
|
-
#private;
|
|
109
108
|
}
|
|
109
|
+
export default TinyPromiseQueue;
|
|
110
110
|
//# sourceMappingURL=TinyPromiseQueue.d.mts.map
|
|
@@ -7,9 +7,10 @@ var utils = require('./utils.cjs');
|
|
|
7
7
|
const checkDestroy = utils.createCheckDestroyed('TinyRadioFm');
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
+
* @typedef {import('../basics/mediaContent.mjs').PictureDataType} PictureDataType
|
|
10
11
|
* @typedef {import('../basics/mediaContent.mjs').MediaContentBase} MediaContentBase
|
|
11
|
-
* @typedef {import('../basics/mediaContent.mjs').MediaContentMetadata} MediaContentMetadata
|
|
12
|
-
* @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
|
|
13
14
|
* @typedef {import('../basics/mediaContent.mjs').IPicture} IPicture
|
|
14
15
|
* @typedef {import('../basics/mediaContent.mjs').MediaNumber} MediaNumber
|
|
15
16
|
* @typedef {import('../basics/mediaContent.mjs').MediaLoadingError} MediaLoadingError
|
|
@@ -600,7 +601,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
600
601
|
|
|
601
602
|
/**
|
|
602
603
|
* Filter function to match items against the provided ID.
|
|
603
|
-
* @type {
|
|
604
|
+
* @type {(item: any) => boolean}
|
|
604
605
|
*/
|
|
605
606
|
const filterFn = (item) => item.id !== id && item.content?.id !== id;
|
|
606
607
|
|
|
@@ -726,10 +727,18 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
726
727
|
const newItem = structuredClone(item);
|
|
727
728
|
if (newItem.picture && Array.isArray(newItem.picture)) {
|
|
728
729
|
newItem.picture = await Promise.all(
|
|
729
|
-
newItem.picture.map(async (pic) =>
|
|
730
|
-
|
|
731
|
-
data
|
|
732
|
-
|
|
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
|
+
}),
|
|
733
742
|
);
|
|
734
743
|
}
|
|
735
744
|
return newItem;
|
|
@@ -826,7 +835,7 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
826
835
|
/**
|
|
827
836
|
* Mulberry32 Pseudo-Random Number Generator.
|
|
828
837
|
* @param {number} seed - The initialization seed.
|
|
829
|
-
* @returns {
|
|
838
|
+
* @returns {() => number} PRNG function returning a float between 0 and 1.
|
|
830
839
|
* @private
|
|
831
840
|
*/
|
|
832
841
|
_prng(seed) {
|
|
@@ -1340,10 +1349,21 @@ class TinyRadioFm extends events.EventEmitter {
|
|
|
1340
1349
|
return list.map((item) => {
|
|
1341
1350
|
const newItem = { ...item };
|
|
1342
1351
|
if (newItem.picture && Array.isArray(newItem.picture)) {
|
|
1343
|
-
newItem.picture = newItem.picture.map((pic) =>
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
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
|
+
});
|
|
1347
1367
|
}
|
|
1348
1368
|
return newItem;
|
|
1349
1369
|
});
|