tiny-essentials 1.28.1 → 1.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog/1/28/2.md +43 -0
- package/dist/_/numbers.d.mts +91 -16
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyMediaPlayer.min.js +1 -1
- package/dist/v1/TinyRadioFm.min.js +1 -1
- package/dist/v1/basics/array.d.mts +14 -14
- package/dist/v1/basics/clock.cjs +15 -15
- package/dist/v1/basics/clock.d.mts +21 -21
- package/dist/v1/basics/clock.mjs +15 -15
- package/dist/v1/basics/collision.d.mts +245 -104
- package/dist/v1/basics/deprecated/html.d.mts +33 -33
- package/dist/v1/basics/extendObjType/Buffer.d.mts +1 -1
- package/dist/v1/basics/fullScreen.d.mts +47 -7
- package/dist/v1/basics/html.d.mts +52 -61
- package/dist/v1/basics/index.d.mts +11 -67
- package/dist/v1/basics/mediaContent.cjs +65 -23
- package/dist/v1/basics/mediaContent.d.mts +144 -73
- package/dist/v1/basics/mediaContent.mjs +65 -23
- package/dist/v1/basics/objChecker.d.mts +2 -2
- package/dist/v1/basics/objFilter.cjs +31 -7
- package/dist/v1/basics/objFilter.d.mts +10 -13
- package/dist/v1/basics/objFilter.mjs +31 -7
- package/dist/v1/basics/simpleMath.d.mts +21 -21
- package/dist/v1/basics/text.d.mts +34 -46
- package/dist/v1/build/ColorSafeStringify.d.mts +1 -1
- package/dist/v1/build/TinyAdvancedRaffle.d.mts +1 -1
- package/dist/v1/build/TinyAfterScrollWatcher.d.mts +1 -1
- package/dist/v1/build/TinyAnalogClock.d.mts +1 -1
- package/dist/v1/build/TinyArrayComparator.d.mts +1 -1
- package/dist/v1/build/TinyArrayPaginator.d.mts +1 -1
- package/dist/v1/build/TinyClassManager.d.mts +1 -1
- package/dist/v1/build/TinyClipboard.d.mts +1 -1
- package/dist/v1/build/TinyColorConverter.d.mts +1 -1
- package/dist/v1/build/TinyColorValidator.d.mts +1 -1
- package/dist/v1/build/TinyCookieConsent.d.mts +1 -1
- package/dist/v1/build/TinyDayNightCycle.d.mts +1 -1
- package/dist/v1/build/TinyDomReadyManager.d.mts +1 -1
- package/dist/v1/build/TinyDragDropDetector.d.mts +1 -1
- package/dist/v1/build/TinyDragger.d.mts +1 -1
- package/dist/v1/build/TinyElementObserver.d.mts +1 -1
- package/dist/v1/build/TinyGamepad.d.mts +1 -1
- package/dist/v1/build/TinyHtml.d.mts +1 -1
- package/dist/v1/build/TinyI18.d.mts +1 -1
- package/dist/v1/build/TinyIframeEvents.d.mts +1 -1
- package/dist/v1/build/TinyInventory.d.mts +1 -1
- package/dist/v1/build/TinyInventoryTrader.d.mts +1 -1
- package/dist/v1/build/TinyLevelUp.d.mts +1 -1
- package/dist/v1/build/TinyLoadingScreen.d.mts +1 -1
- package/dist/v1/build/TinyLocalStorage.d.mts +1 -1
- package/dist/v1/build/TinyMediaPlayer.d.mts +1 -1
- package/dist/v1/build/TinyNeedBar.d.mts +1 -1
- package/dist/v1/build/TinyNewWinEvents.d.mts +1 -1
- package/dist/v1/build/TinyNotifications.d.mts +1 -1
- package/dist/v1/build/TinyNotifyCenter.d.mts +1 -1
- package/dist/v1/build/TinyPromiseQueue.d.mts +1 -1
- package/dist/v1/build/TinyRadioFm.d.mts +1 -1
- package/dist/v1/build/TinyRateLimiter.d.mts +1 -1
- package/dist/v1/build/TinySimpleDice.d.mts +1 -1
- package/dist/v1/build/TinySmartScroller.d.mts +1 -1
- package/dist/v1/build/TinyTextDiffer.d.mts +1 -1
- package/dist/v1/build/TinyTextRangeEditor.d.mts +1 -1
- package/dist/v1/build/TinyTextarea.d.mts +1 -1
- package/dist/v1/build/TinyTimeout.d.mts +1 -1
- package/dist/v1/build/TinyToastNotify.d.mts +1 -1
- package/dist/v1/build/TinyUploadClicker.d.mts +1 -1
- package/dist/v1/build/UltraRandomMsgGen.d.mts +1 -1
- package/dist/v1/fileManager/asyncFuncs.d.mts +13 -13
- package/dist/v1/fileManager/index.d.mts +3 -29
- package/dist/v1/fileManager/normalFuncs.d.mts +22 -22
- package/dist/v1/index.d.mts +53 -139
- package/dist/v1/libs/ColorSafeStringify.d.mts +3 -12
- package/dist/v1/libs/TinyAdvancedRaffle.d.mts +60 -103
- package/dist/v1/libs/TinyAfterScrollWatcher.d.mts +11 -18
- package/dist/v1/libs/TinyAnalogClock.d.mts +8 -11
- package/dist/v1/libs/TinyArrayComparator.d.mts +14 -20
- package/dist/v1/libs/TinyArrayPaginator.d.mts +22 -26
- package/dist/v1/libs/TinyClassManager/TinyPluginInliner.d.mts +8 -8
- package/dist/v1/libs/TinyClassManager.cjs +5 -7
- package/dist/v1/libs/TinyClassManager.d.mts +16 -16
- package/dist/v1/libs/TinyClassManager.mjs +5 -6
- package/dist/v1/libs/TinyClipboard.d.mts +8 -3
- package/dist/v1/libs/TinyColorConverter.d.mts +8 -31
- package/dist/v1/libs/TinyColorValidator.d.mts +145 -184
- package/dist/v1/libs/TinyCookieConsent.d.mts +17 -17
- package/dist/v1/libs/TinyDayNightCycle.d.mts +85 -110
- package/dist/v1/libs/TinyDomReadyManager.d.mts +8 -16
- package/dist/v1/libs/TinyDragDropDetector.d.mts +30 -30
- package/dist/v1/libs/TinyDragger.d.mts +82 -81
- package/dist/v1/libs/TinyElementObserver.d.mts +25 -28
- package/dist/v1/libs/TinyGamepad.cjs +0 -1
- package/dist/v1/libs/TinyGamepad.d.mts +50 -122
- package/dist/v1/libs/TinyGamepad.mjs +0 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.cjs +2 -25
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.d.mts +19 -25
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.mjs +3 -27
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.cjs +2 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.d.mts +55 -55
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.mjs +2 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlCanvas.d.mts +6 -6
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.cjs +8 -4
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.d.mts +19 -21
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.mjs +7 -4
- package/dist/v1/libs/TinyHtml/TinyHtmlEmbed.d.mts +8 -8
- package/dist/v1/libs/TinyHtml/TinyHtmlForm.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/TinyHtmlIcon.d.mts +5 -6
- package/dist/v1/libs/TinyHtml/TinyHtmlIframe.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.cjs +0 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.d.mts +22 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.mjs +1 -27
- package/dist/v1/libs/TinyHtml/TinyHtmlInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/TinyHtmlLink.d.mts +23 -23
- package/dist/v1/libs/TinyHtml/TinyHtmlMedia.d.mts +26 -26
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.cjs +4 -30
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.d.mts +20 -26
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.mjs +5 -32
- package/dist/v1/libs/TinyHtml/TinyHtmlSelect.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/TinyHtmlStyle.d.mts +8 -8
- package/dist/v1/libs/TinyHtml/TinyHtmlTemplate.d.mts +26 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.cjs +14 -15
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.d.mts +32 -32
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.mjs +15 -15
- package/dist/v1/libs/TinyHtml/index.d.mts +102 -45
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.cjs +11 -9
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.d.mts +21 -21
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.mjs +11 -9
- package/dist/v1/libs/TinyHtml/input/TinyHtmlFileInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.cjs +4 -4
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.d.mts +17 -13
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.mjs +4 -4
- package/dist/v1/libs/TinyHtml/input/TinyHtmlImageInput.d.mts +21 -21
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.cjs +5 -4
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.mjs +5 -4
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.d.mts +10 -10
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.cjs +5 -4
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.mjs +5 -4
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.d.mts +15 -11
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.cjs +49 -21
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.d.mts +34 -20
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.mjs +45 -20
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.cjs +48 -25
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.d.mts +27 -21
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.mjs +40 -27
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/number/TinyHtmlNumberInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/number/TinyHtmlRangeInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlEmailInput.d.mts +25 -21
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlPasswordInput.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlSearchInput.d.mts +33 -29
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTelInput.d.mts +22 -22
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTextInput.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlUrlInput.d.mts +31 -27
- package/dist/v1/libs/TinyHtml/media/TinyHtmlAudio.d.mts +35 -11
- package/dist/v1/libs/TinyHtml/media/TinyHtmlObject.d.mts +10 -10
- package/dist/v1/libs/TinyHtml/media/TinyHtmlSource.d.mts +12 -12
- package/dist/v1/libs/TinyHtml/media/TinyHtmlVideo.d.mts +35 -27
- package/dist/v1/libs/TinyHtml.cjs +3 -4
- package/dist/v1/libs/TinyHtml.d.mts +1503 -1731
- package/dist/v1/libs/TinyHtml.mjs +3 -4
- package/dist/v1/libs/TinyI18.d.mts +23 -61
- package/dist/v1/libs/TinyIframeEvents.cjs +1 -1
- package/dist/v1/libs/TinyIframeEvents.d.mts +29 -38
- package/dist/v1/libs/TinyIframeEvents.mjs +1 -1
- package/dist/v1/libs/TinyInventory.d.mts +78 -141
- package/dist/v1/libs/TinyInventoryTrader.d.mts +19 -22
- package/dist/v1/libs/TinyLevelUp.d.mts +10 -13
- package/dist/v1/libs/TinyLoadingScreen.d.mts +21 -31
- package/dist/v1/libs/TinyLocalStorage.d.mts +11 -36
- package/dist/v1/libs/TinyMamdaniInferenceSystem.d.mts +37 -23
- package/dist/v1/libs/TinyMediaPlayer.cjs +5 -3
- package/dist/v1/libs/TinyMediaPlayer.d.mts +102 -109
- package/dist/v1/libs/TinyMediaPlayer.mjs +5 -3
- package/dist/v1/libs/TinyNeedBar.d.mts +25 -37
- package/dist/v1/libs/TinyNewWinEvents.d.mts +29 -32
- package/dist/v1/libs/TinyNotifications.d.mts +6 -6
- package/dist/v1/libs/TinyNotifyCenter.d.mts +15 -21
- package/dist/v1/libs/TinyPromiseQueue.d.mts +11 -11
- package/dist/v1/libs/TinyRadioFm.cjs +32 -12
- package/dist/v1/libs/TinyRadioFm.d.mts +44 -80
- package/dist/v1/libs/TinyRadioFm.mjs +29 -12
- package/dist/v1/libs/TinyRateLimiter.d.mts +26 -39
- package/dist/v1/libs/TinySimpleDice.d.mts +17 -36
- package/dist/v1/libs/TinySmartScroller.d.mts +50 -60
- package/dist/v1/libs/TinyTextDiffer.d.mts +11 -14
- package/dist/v1/libs/TinyTextRangeEditor.d.mts +8 -8
- package/dist/v1/libs/TinyTextarea.d.mts +31 -31
- package/dist/v1/libs/TinyTimeout.d.mts +14 -14
- package/dist/v1/libs/TinyToastNotify.cjs +1 -1
- package/dist/v1/libs/TinyToastNotify.d.mts +15 -23
- package/dist/v1/libs/TinyToastNotify.mjs +1 -1
- package/dist/v1/libs/TinyUploadClicker.d.mts +38 -14
- package/dist/v1/libs/UltraRandomMsgGen.d.mts +44 -84
- package/dist/v1/libs/utils.d.mts +5 -1
- package/package.json +2 -2
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
export default TinyDayNightCycle;
|
|
2
|
-
/**
|
|
3
|
-
* Represents a mapping of weather type names to their selected values.
|
|
4
|
-
* Each key is the name of a weather type, and the value is either:
|
|
5
|
-
* - a string containing the selected weather configuration name, or
|
|
6
|
-
* - `null` if no selection has been made.
|
|
7
|
-
*/
|
|
8
1
|
export type SelectedWeather = Record<string, string | null>;
|
|
9
|
-
/**
|
|
10
|
-
* Callback used to dynamically calculate weather probabilities.
|
|
11
|
-
*/
|
|
12
2
|
export type WeatherCallback = (configs: {
|
|
13
3
|
hour: number;
|
|
14
4
|
minute: number;
|
|
@@ -17,9 +7,6 @@ export type WeatherCallback = (configs: {
|
|
|
17
7
|
season: string;
|
|
18
8
|
weather: SelectedWeather;
|
|
19
9
|
}) => number;
|
|
20
|
-
/**
|
|
21
|
-
* Represents the complete set of weather configurations.
|
|
22
|
-
*/
|
|
23
10
|
export type WeatherCfgs = {
|
|
24
11
|
/**
|
|
25
12
|
* - Default weather configuration applied when no specific condition matches.
|
|
@@ -42,18 +29,8 @@ export type WeatherCfgs = {
|
|
|
42
29
|
*/
|
|
43
30
|
seasons: Record<string, WeatherCfg>;
|
|
44
31
|
};
|
|
45
|
-
/**
|
|
46
|
-
* A weather configuration object mapping weather types to probability weights
|
|
47
|
-
* or dynamic WeatherCallback functions.
|
|
48
|
-
*/
|
|
49
32
|
export type WeatherCfg = Record<string, number | WeatherCallback>;
|
|
50
|
-
/**
|
|
51
|
-
* Weather data with resolved numeric probability values.
|
|
52
|
-
*/
|
|
53
33
|
export type WeatherData = Record<string, number>;
|
|
54
|
-
/**
|
|
55
|
-
* Represents the data for a moon's current phase.
|
|
56
|
-
*/
|
|
57
34
|
export type MoonData = {
|
|
58
35
|
/**
|
|
59
36
|
* - The name of the moon.
|
|
@@ -72,9 +49,6 @@ export type MoonData = {
|
|
|
72
49
|
*/
|
|
73
50
|
cycleLength: number;
|
|
74
51
|
};
|
|
75
|
-
/**
|
|
76
|
-
* Represents the raw data structure for a moon's cycle.
|
|
77
|
-
*/
|
|
78
52
|
export type MoonRaw = {
|
|
79
53
|
/**
|
|
80
54
|
* - The name of the moon.
|
|
@@ -91,7 +65,7 @@ export type MoonRaw = {
|
|
|
91
65
|
/**
|
|
92
66
|
* - Optional list of names for each phase in the cycle.
|
|
93
67
|
*/
|
|
94
|
-
phaseNames?: string[]
|
|
68
|
+
phaseNames?: string[];
|
|
95
69
|
};
|
|
96
70
|
/**
|
|
97
71
|
* Represents a mapping of weather type names to their selected values.
|
|
@@ -175,23 +149,17 @@ export type MoonRaw = {
|
|
|
175
149
|
* Time and date calculations are independent from the real world and can run at any speed.
|
|
176
150
|
*/
|
|
177
151
|
declare class TinyDayNightCycle {
|
|
178
|
-
|
|
179
|
-
* @param {number} dayStart - Hour of the day start (0-23)
|
|
180
|
-
* @param {number} nightStart - Hour of the night start (0-23)
|
|
181
|
-
*/
|
|
182
|
-
constructor(dayStart?: number, nightStart?: number);
|
|
183
|
-
/**
|
|
184
|
-
* Sets the number of in-game seconds representing a full day.
|
|
185
|
-
* Keeps the proportion based on the current `hourSize` and `minuteSize` if `autoSizeAdjuste` is enabled.
|
|
186
|
-
* @param {number} value - Positive finite number representing seconds in a full day.
|
|
187
|
-
* @throws {Error} If `value` is not a positive finite number.
|
|
188
|
-
*/
|
|
189
|
-
set daySize(value: number);
|
|
152
|
+
#private;
|
|
190
153
|
/**
|
|
191
154
|
* Gets the number of in-game seconds representing a full day.
|
|
192
155
|
* @returns {number}
|
|
193
156
|
*/
|
|
194
157
|
get daySize(): number;
|
|
158
|
+
/**
|
|
159
|
+
* Gets whether automatic size adjustment is enabled.
|
|
160
|
+
* @returns {boolean}
|
|
161
|
+
*/
|
|
162
|
+
get autoSizeAdjuste(): boolean;
|
|
195
163
|
/**
|
|
196
164
|
* Sets whether automatic size adjustment is enabled.
|
|
197
165
|
* @param {boolean} value - `true` to keep the proportional relation between day, hour, and minute sizes; `false` to disable auto-adjustment.
|
|
@@ -199,10 +167,17 @@ declare class TinyDayNightCycle {
|
|
|
199
167
|
*/
|
|
200
168
|
set autoSizeAdjuste(value: boolean);
|
|
201
169
|
/**
|
|
202
|
-
*
|
|
203
|
-
*
|
|
170
|
+
* Sets the number of in-game seconds representing a full day.
|
|
171
|
+
* Keeps the proportion based on the current `hourSize` and `minuteSize` if `autoSizeAdjuste` is enabled.
|
|
172
|
+
* @param {number} value - Positive finite number representing seconds in a full day.
|
|
173
|
+
* @throws {Error} If `value` is not a positive finite number.
|
|
204
174
|
*/
|
|
205
|
-
|
|
175
|
+
set daySize(value: number);
|
|
176
|
+
/**
|
|
177
|
+
* Gets the number of in-game seconds representing a full hour.
|
|
178
|
+
* @returns {number}
|
|
179
|
+
*/
|
|
180
|
+
get hourSize(): number;
|
|
206
181
|
/**
|
|
207
182
|
* Sets the number of in-game seconds representing a full hour.
|
|
208
183
|
* Keeps the proportion based on the current `daySize` and `minuteSize` if `autoSizeAdjuste` is enabled.
|
|
@@ -211,10 +186,10 @@ declare class TinyDayNightCycle {
|
|
|
211
186
|
*/
|
|
212
187
|
set hourSize(value: number);
|
|
213
188
|
/**
|
|
214
|
-
* Gets the number of in-game seconds representing a full
|
|
189
|
+
* Gets the number of in-game seconds representing a full minute.
|
|
215
190
|
* @returns {number}
|
|
216
191
|
*/
|
|
217
|
-
get
|
|
192
|
+
get minuteSize(): number;
|
|
218
193
|
/**
|
|
219
194
|
* Sets the number of in-game seconds representing a full minute.
|
|
220
195
|
* Keeps the proportion based on the current `daySize` and `hourSize` if `autoSizeAdjuste` is enabled.
|
|
@@ -222,16 +197,16 @@ declare class TinyDayNightCycle {
|
|
|
222
197
|
* @throws {Error} If `value` is not a positive finite number.
|
|
223
198
|
*/
|
|
224
199
|
set minuteSize(value: number);
|
|
225
|
-
/**
|
|
226
|
-
* Gets the number of in-game seconds representing a full minute.
|
|
227
|
-
* @returns {number}
|
|
228
|
-
*/
|
|
229
|
-
get minuteSize(): number;
|
|
230
200
|
/**
|
|
231
201
|
* Indicates whether this instance has been destroyed.
|
|
232
202
|
* @type {boolean}
|
|
233
203
|
*/
|
|
234
204
|
get isDestroyed(): boolean;
|
|
205
|
+
/**
|
|
206
|
+
* Gets the current time in seconds since midnight.
|
|
207
|
+
* @returns {number} Current seconds (0 to 86399).
|
|
208
|
+
*/
|
|
209
|
+
get currentSeconds(): number;
|
|
235
210
|
/**
|
|
236
211
|
* Sets the current time in seconds since midnight.
|
|
237
212
|
* Also updates the currentMinutes property accordingly.
|
|
@@ -241,10 +216,10 @@ declare class TinyDayNightCycle {
|
|
|
241
216
|
*/
|
|
242
217
|
set currentSeconds(value: number);
|
|
243
218
|
/**
|
|
244
|
-
* Gets the current time in
|
|
245
|
-
* @returns {number} Current
|
|
219
|
+
* Gets the current time in minutes since midnight.
|
|
220
|
+
* @returns {number} Current minutes (0 to 1439).
|
|
246
221
|
*/
|
|
247
|
-
get
|
|
222
|
+
get currentMinutes(): number;
|
|
248
223
|
/**
|
|
249
224
|
* Sets the current time in minutes since midnight.
|
|
250
225
|
* Also updates the currentSeconds property accordingly (seconds set to zero).
|
|
@@ -254,10 +229,11 @@ declare class TinyDayNightCycle {
|
|
|
254
229
|
*/
|
|
255
230
|
set currentMinutes(value: number);
|
|
256
231
|
/**
|
|
257
|
-
* Gets the current time in
|
|
258
|
-
*
|
|
232
|
+
* Gets the current time in hours since midnight.
|
|
233
|
+
* May be a decimal value (e.g., 14.5 = 14:30).
|
|
234
|
+
* @returns {number} Current hours (0 to less than 24).
|
|
259
235
|
*/
|
|
260
|
-
get
|
|
236
|
+
get currentHours(): number;
|
|
261
237
|
/**
|
|
262
238
|
* Sets the current time in hours since midnight.
|
|
263
239
|
* Accepts decimal numbers to specify partial hours.
|
|
@@ -267,12 +243,6 @@ declare class TinyDayNightCycle {
|
|
|
267
243
|
* @throws {RangeError} If the value is outside the valid range.
|
|
268
244
|
*/
|
|
269
245
|
set currentHours(value: number);
|
|
270
|
-
/**
|
|
271
|
-
* Gets the current time in hours since midnight.
|
|
272
|
-
* May be a decimal value (e.g., 14.5 = 14:30).
|
|
273
|
-
* @returns {number} Current hours (0 to less than 24).
|
|
274
|
-
*/
|
|
275
|
-
get currentHours(): number;
|
|
276
246
|
/**
|
|
277
247
|
* Returns all moons with their current phase details.
|
|
278
248
|
* @returns {MoonData[]} Array of moons including their name, current phase index, phase name, and cycle length.
|
|
@@ -283,30 +253,54 @@ declare class TinyDayNightCycle {
|
|
|
283
253
|
* @returns {string[]} Array of season names.
|
|
284
254
|
*/
|
|
285
255
|
get seasons(): string[];
|
|
256
|
+
/** @returns {number} Hour at which day starts (0-23). */
|
|
257
|
+
get dayStart(): number;
|
|
258
|
+
/** @returns {number} Hour at which night starts (0-23). */
|
|
259
|
+
get nightStart(): number;
|
|
260
|
+
/** @returns {SelectedWeather} Currently active weather types or nulls if none. */
|
|
261
|
+
get weather(): SelectedWeather;
|
|
262
|
+
/** @returns {string} Currently active season name. */
|
|
263
|
+
get currentSeason(): string;
|
|
264
|
+
/** @returns {number} Current day of the month. */
|
|
265
|
+
get currentDay(): number;
|
|
266
|
+
/** @returns {number} Current month number. */
|
|
267
|
+
get currentMonth(): number;
|
|
268
|
+
/** @returns {number} Current year count. */
|
|
269
|
+
get currentYear(): number;
|
|
270
|
+
/**
|
|
271
|
+
* Returns a shallow copy of the mapping of month numbers to days.
|
|
272
|
+
* Can be customized for non-standard calendar systems.
|
|
273
|
+
* @returns {number[]} Object mapping month number to days.
|
|
274
|
+
*/
|
|
275
|
+
get monthDays(): number[];
|
|
276
|
+
/**
|
|
277
|
+
* Returns the configured range of weather durations in minutes.
|
|
278
|
+
* @returns {{min: number, max: number}} Object with min and max weather duration.
|
|
279
|
+
*/
|
|
280
|
+
get weatherDuration(): {
|
|
281
|
+
min: number;
|
|
282
|
+
max: number;
|
|
283
|
+
};
|
|
284
|
+
/** @returns {number} Minutes left until current weather expires. */
|
|
285
|
+
get weatherTimeLeft(): number;
|
|
286
286
|
/**
|
|
287
287
|
* Sets the hour at which day starts.
|
|
288
288
|
* @param {number} value Hour (0-23).
|
|
289
289
|
* @throws {TypeError} If value is not a number.
|
|
290
290
|
*/
|
|
291
291
|
set dayStart(value: number);
|
|
292
|
-
/** @returns {number} Hour at which day starts (0-23). */
|
|
293
|
-
get dayStart(): number;
|
|
294
292
|
/**
|
|
295
293
|
* Sets the hour at which night starts.
|
|
296
294
|
* @param {number} value Hour (0-23).
|
|
297
295
|
* @throws {TypeError} If value is not a number.
|
|
298
296
|
*/
|
|
299
297
|
set nightStart(value: number);
|
|
300
|
-
/** @returns {number} Hour at which night starts (0-23). */
|
|
301
|
-
get nightStart(): number;
|
|
302
298
|
/**
|
|
303
299
|
* Sets the current weather type.
|
|
304
300
|
* @param {SelectedWeather} value Weather type strings or nulls for no weather.
|
|
305
301
|
* @throws {TypeError} If value is not a string or null.
|
|
306
302
|
*/
|
|
307
303
|
set weather(value: SelectedWeather);
|
|
308
|
-
/** @returns {SelectedWeather} Currently active weather types or nulls if none. */
|
|
309
|
-
get weather(): SelectedWeather;
|
|
310
304
|
/**
|
|
311
305
|
* Sets the current season.
|
|
312
306
|
* Must be one of the configured seasons.
|
|
@@ -314,44 +308,30 @@ declare class TinyDayNightCycle {
|
|
|
314
308
|
* @throws {TypeError} If value is not a string or not a configured season.
|
|
315
309
|
*/
|
|
316
310
|
set currentSeason(value: string);
|
|
317
|
-
/** @returns {string} Currently active season name. */
|
|
318
|
-
get currentSeason(): string;
|
|
319
311
|
/**
|
|
320
312
|
* Sets the current day of the month.
|
|
321
313
|
* @param {number} value Day number.
|
|
322
314
|
* @throws {TypeError} If value is not a number.
|
|
323
315
|
*/
|
|
324
316
|
set currentDay(value: number);
|
|
325
|
-
/** @returns {number} Current day of the month. */
|
|
326
|
-
get currentDay(): number;
|
|
327
317
|
/**
|
|
328
318
|
* Sets the current month.
|
|
329
319
|
* @param {number} value Month number.
|
|
330
320
|
* @throws {TypeError} If value is not a number.
|
|
331
321
|
*/
|
|
332
322
|
set currentMonth(value: number);
|
|
333
|
-
/** @returns {number} Current month number. */
|
|
334
|
-
get currentMonth(): number;
|
|
335
323
|
/**
|
|
336
324
|
* Sets the current year.
|
|
337
325
|
* @param {number} value Year count.
|
|
338
326
|
* @throws {TypeError} If value is not a number.
|
|
339
327
|
*/
|
|
340
328
|
set currentYear(value: number);
|
|
341
|
-
/** @returns {number} Current year count. */
|
|
342
|
-
get currentYear(): number;
|
|
343
329
|
/**
|
|
344
330
|
* Sets a custom configuration for the number of days in each month.
|
|
345
331
|
* This allows for non-standard calendar systems.
|
|
346
332
|
* @param {number[]} value - An object where keys are month numbers and values are the number of days.
|
|
347
333
|
*/
|
|
348
334
|
set monthDays(value: number[]);
|
|
349
|
-
/**
|
|
350
|
-
* Returns a shallow copy of the mapping of month numbers to days.
|
|
351
|
-
* Can be customized for non-standard calendar systems.
|
|
352
|
-
* @returns {number[]} Object mapping month number to days.
|
|
353
|
-
*/
|
|
354
|
-
get monthDays(): number[];
|
|
355
335
|
/**
|
|
356
336
|
* Sets the weather duration range in minutes.
|
|
357
337
|
* @param {{min: number, max: number}} value Object with min and max durations.
|
|
@@ -361,22 +341,18 @@ declare class TinyDayNightCycle {
|
|
|
361
341
|
min: number;
|
|
362
342
|
max: number;
|
|
363
343
|
});
|
|
364
|
-
/**
|
|
365
|
-
* Returns the configured range of weather durations in minutes.
|
|
366
|
-
* @returns {{min: number, max: number}} Object with min and max weather duration.
|
|
367
|
-
*/
|
|
368
|
-
get weatherDuration(): {
|
|
369
|
-
min: number;
|
|
370
|
-
max: number;
|
|
371
|
-
};
|
|
372
344
|
/**
|
|
373
345
|
* Sets the remaining time for current weather in minutes.
|
|
374
346
|
* @param {number} value Minutes remaining.
|
|
375
347
|
* @throws {TypeError} If value is not a number.
|
|
376
348
|
*/
|
|
377
349
|
set weatherTimeLeft(value: number);
|
|
378
|
-
/**
|
|
379
|
-
|
|
350
|
+
/**
|
|
351
|
+
* Returns the entire weather configuration object.
|
|
352
|
+
* Includes default, day, night, hours, and seasons settings.
|
|
353
|
+
* @returns {WeatherCfgs} Deep copy of the weather configuration.
|
|
354
|
+
*/
|
|
355
|
+
get weatherConfig(): WeatherCfgs;
|
|
380
356
|
/**
|
|
381
357
|
* Sets the entire weather configuration object.
|
|
382
358
|
* Accepts default, day, night, hours, and seasons settings.
|
|
@@ -385,11 +361,10 @@ declare class TinyDayNightCycle {
|
|
|
385
361
|
*/
|
|
386
362
|
set weatherConfig(config: WeatherCfgs);
|
|
387
363
|
/**
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
* @returns {WeatherCfgs} Deep copy of the weather configuration.
|
|
364
|
+
* @param {number} dayStart - Hour of the day start (0-23)
|
|
365
|
+
* @param {number} nightStart - Hour of the night start (0-23)
|
|
391
366
|
*/
|
|
392
|
-
|
|
367
|
+
constructor(dayStart?: number, nightStart?: number);
|
|
393
368
|
/** --------------------- SEASON SYSTEM --------------------- */
|
|
394
369
|
/**
|
|
395
370
|
* Adds or updates a season with the provided numeric values.
|
|
@@ -432,9 +407,9 @@ declare class TinyDayNightCycle {
|
|
|
432
407
|
* @param {number} [settings.second=0] - 0 to 59
|
|
433
408
|
*/
|
|
434
409
|
setTime({ hour, minute, second }: {
|
|
435
|
-
hour?: number
|
|
436
|
-
minute?: number
|
|
437
|
-
second?: number
|
|
410
|
+
hour?: number;
|
|
411
|
+
minute?: number;
|
|
412
|
+
second?: number;
|
|
438
413
|
}): void;
|
|
439
414
|
/**
|
|
440
415
|
* Adds time to the current clock.
|
|
@@ -444,9 +419,9 @@ declare class TinyDayNightCycle {
|
|
|
444
419
|
* @param {number} [settings.seconds=0]
|
|
445
420
|
*/
|
|
446
421
|
addTime({ hours, minutes, seconds }: {
|
|
447
|
-
hours?: number
|
|
448
|
-
minutes?: number
|
|
449
|
-
seconds?: number
|
|
422
|
+
hours?: number;
|
|
423
|
+
minutes?: number;
|
|
424
|
+
seconds?: number;
|
|
450
425
|
}): void;
|
|
451
426
|
/**
|
|
452
427
|
* Returns the current time as both an object and a formatted string,
|
|
@@ -464,9 +439,9 @@ declare class TinyDayNightCycle {
|
|
|
464
439
|
* }} An object containing the hour, minute, second, and the formatted time string.
|
|
465
440
|
*/
|
|
466
441
|
getTime({ withSeconds, hourSize, minuteSize }?: {
|
|
467
|
-
hourSize?: number
|
|
468
|
-
minuteSize?: number
|
|
469
|
-
withSeconds?: boolean
|
|
442
|
+
hourSize?: number;
|
|
443
|
+
minuteSize?: number;
|
|
444
|
+
withSeconds?: boolean;
|
|
470
445
|
}): {
|
|
471
446
|
hour: number;
|
|
472
447
|
minute: number;
|
|
@@ -519,7 +494,7 @@ declare class TinyDayNightCycle {
|
|
|
519
494
|
* @param {'minutes'|'seconds'|'hours'} unit - The unit to return.
|
|
520
495
|
* @returns {number} Time until target hour, in the specified unit.
|
|
521
496
|
*/
|
|
522
|
-
timeUntil(targetHour: number, unit:
|
|
497
|
+
timeUntil(targetHour: number, unit: 'minutes' | 'seconds' | 'hours'): number;
|
|
523
498
|
/**
|
|
524
499
|
* Instantly sets the current time to the start of the specified phase.
|
|
525
500
|
* @param {"day"|"night"} phase - The phase to set the time to.
|
|
@@ -571,9 +546,9 @@ declare class TinyDayNightCycle {
|
|
|
571
546
|
* @param {number|null} [settings.duration=null] - Duration in minutes. If null, a random duration is used.
|
|
572
547
|
*/
|
|
573
548
|
forceWeather({ where, type, duration }: {
|
|
574
|
-
where?: string
|
|
549
|
+
where?: string;
|
|
575
550
|
type: string | null;
|
|
576
|
-
duration?: number | null
|
|
551
|
+
duration?: number | null;
|
|
577
552
|
}): void;
|
|
578
553
|
/**
|
|
579
554
|
* Chooses a new weather type based on configured probabilities.
|
|
@@ -590,8 +565,8 @@ declare class TinyDayNightCycle {
|
|
|
590
565
|
* @returns {string|null} - The selected weather type, or null if none selected.
|
|
591
566
|
*/
|
|
592
567
|
chooseNewWeather({ customWeather, where }?: {
|
|
593
|
-
where?: string
|
|
594
|
-
customWeather?: WeatherCfg
|
|
568
|
+
where?: string;
|
|
569
|
+
customWeather?: WeatherCfg;
|
|
595
570
|
}): string | null;
|
|
596
571
|
/**
|
|
597
572
|
* Returns a random integer between min and max, inclusive.
|
|
@@ -663,6 +638,6 @@ declare class TinyDayNightCycle {
|
|
|
663
638
|
* Once destroyed, any further method calls should throw an error or be ignored.
|
|
664
639
|
*/
|
|
665
640
|
destroy(): void;
|
|
666
|
-
#private;
|
|
667
641
|
}
|
|
642
|
+
export default TinyDayNightCycle;
|
|
668
643
|
//# sourceMappingURL=TinyDayNightCycle.d.mts.map
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
export default TinyDomReadyManager;
|
|
2
1
|
/**
|
|
3
2
|
* A basic function that performs a task when the system is ready.
|
|
4
3
|
* Used for handlers in the readiness queue.
|
|
4
|
+
*
|
|
5
|
+
* @typedef {() => void} Fn
|
|
5
6
|
*/
|
|
6
7
|
export type Fn = () => void;
|
|
7
|
-
/**
|
|
8
|
-
* A function that determines whether a specific handler should be executed.
|
|
9
|
-
* Should return `true` to allow execution, or `false` to skip the handler.
|
|
10
|
-
*/
|
|
11
8
|
export type FnFilter = () => boolean;
|
|
12
9
|
export type Handler = {
|
|
13
10
|
/**
|
|
@@ -31,12 +28,6 @@ export type Handler = {
|
|
|
31
28
|
*/
|
|
32
29
|
domOnly: boolean;
|
|
33
30
|
};
|
|
34
|
-
/**
|
|
35
|
-
* A basic function that performs a task when the system is ready.
|
|
36
|
-
* Used for handlers in the readiness queue.
|
|
37
|
-
*
|
|
38
|
-
* @typedef {() => void} Fn
|
|
39
|
-
*/
|
|
40
31
|
/**
|
|
41
32
|
* A function that determines whether a specific handler should be executed.
|
|
42
33
|
* Should return `true` to allow execution, or `false` to skip the handler.
|
|
@@ -52,6 +43,7 @@ export type Handler = {
|
|
|
52
43
|
* @property {boolean} domOnly - Whether to run as soon as DOM is ready (before full readiness).
|
|
53
44
|
*/
|
|
54
45
|
declare class TinyDomReadyManager {
|
|
46
|
+
#private;
|
|
55
47
|
/**
|
|
56
48
|
* Marks the system as DOM-ready and runs DOM-only handlers.
|
|
57
49
|
* @private
|
|
@@ -79,10 +71,10 @@ declare class TinyDomReadyManager {
|
|
|
79
71
|
* @throws {TypeError} If fn is not a function.
|
|
80
72
|
*/
|
|
81
73
|
onReady(fn: Fn, { once, priority, filter, domOnly }?: {
|
|
82
|
-
once?: boolean
|
|
83
|
-
priority?: number
|
|
84
|
-
filter?: FnFilter | null
|
|
85
|
-
domOnly?: boolean
|
|
74
|
+
once?: boolean;
|
|
75
|
+
priority?: number;
|
|
76
|
+
filter?: FnFilter | null;
|
|
77
|
+
domOnly?: boolean;
|
|
86
78
|
}): void;
|
|
87
79
|
/**
|
|
88
80
|
* Returns whether the system is fully ready (DOM + Promises).
|
|
@@ -95,6 +87,6 @@ declare class TinyDomReadyManager {
|
|
|
95
87
|
* @returns {boolean}
|
|
96
88
|
*/
|
|
97
89
|
isDomReady(): boolean;
|
|
98
|
-
#private;
|
|
99
90
|
}
|
|
91
|
+
export default TinyDomReadyManager;
|
|
100
92
|
//# sourceMappingURL=TinyDomReadyManager.d.mts.map
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
export default TinyDragDropDetector;
|
|
2
1
|
export type DragAndDropOptions = {
|
|
3
2
|
/**
|
|
4
3
|
* - CSS class applied to the target element while files are being dragged over it.
|
|
5
4
|
*/
|
|
6
|
-
hoverClass?: string
|
|
5
|
+
hoverClass?: string;
|
|
7
6
|
/**
|
|
8
7
|
* - Callback function executed when files are dropped onto the target.
|
|
9
8
|
*/
|
|
10
|
-
onDrop?: (
|
|
9
|
+
onDrop?: (files: FileList, event: DragEvent) => void;
|
|
11
10
|
/**
|
|
12
11
|
* - Optional callback triggered when dragging enters the target area.
|
|
13
12
|
*/
|
|
14
|
-
onEnter?: (
|
|
13
|
+
onEnter?: (event: DragEvent) => void;
|
|
15
14
|
/**
|
|
16
15
|
* - Optional callback triggered when dragging leaves the target area.
|
|
17
16
|
*/
|
|
18
|
-
onLeave?: (
|
|
17
|
+
onLeave?: (event: DragEvent) => void;
|
|
19
18
|
};
|
|
20
19
|
/**
|
|
21
20
|
* @typedef {Object} DragAndDropOptions
|
|
@@ -34,6 +33,13 @@ export type DragAndDropOptions = {
|
|
|
34
33
|
* @template {HTMLElement} HTMLTarget
|
|
35
34
|
*/
|
|
36
35
|
declare class TinyDragDropDetector<HTMLTarget extends HTMLElement> {
|
|
36
|
+
#private;
|
|
37
|
+
/**
|
|
38
|
+
* Gets the current destruction status of the instance.
|
|
39
|
+
*
|
|
40
|
+
* @returns {boolean} True if the instance is destroyed, false otherwise.
|
|
41
|
+
*/
|
|
42
|
+
get destroyed(): boolean;
|
|
37
43
|
/**
|
|
38
44
|
* Creates a new instance of TinyDragDropDetector to handle drag-and-drop file detection.
|
|
39
45
|
*
|
|
@@ -47,11 +53,25 @@ declare class TinyDragDropDetector<HTMLTarget extends HTMLElement> {
|
|
|
47
53
|
*/
|
|
48
54
|
constructor(target: HTMLTarget, options: DragAndDropOptions);
|
|
49
55
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* @returns {boolean} True if the instance is destroyed, false otherwise.
|
|
56
|
+
* Returns the current target DOM element where the listeners are attached.
|
|
57
|
+
* @returns {HTMLTarget}
|
|
53
58
|
*/
|
|
54
|
-
|
|
59
|
+
getTarget(): HTMLTarget;
|
|
60
|
+
/**
|
|
61
|
+
* Returns the CSS class applied during drag hover.
|
|
62
|
+
* @returns {string}
|
|
63
|
+
*/
|
|
64
|
+
getHoverClass(): string;
|
|
65
|
+
/**
|
|
66
|
+
* Returns whether a drag operation is currently active over the target.
|
|
67
|
+
* @returns {boolean}
|
|
68
|
+
*/
|
|
69
|
+
isDragging(): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Returns whether the event listeners are currently bound to the target.
|
|
72
|
+
* @returns {boolean}
|
|
73
|
+
*/
|
|
74
|
+
bound(): boolean;
|
|
55
75
|
/**
|
|
56
76
|
* Handles the `dragenter` event.
|
|
57
77
|
* Adds the hover CSS class and triggers the `onEnter` callback if provided.
|
|
@@ -84,32 +104,12 @@ declare class TinyDragDropDetector<HTMLTarget extends HTMLElement> {
|
|
|
84
104
|
* @returns {void}
|
|
85
105
|
*/
|
|
86
106
|
private _handleDrop;
|
|
87
|
-
/**
|
|
88
|
-
* Returns the current target DOM element where the listeners are attached.
|
|
89
|
-
* @returns {HTMLTarget}
|
|
90
|
-
*/
|
|
91
|
-
getTarget(): HTMLTarget;
|
|
92
|
-
/**
|
|
93
|
-
* Returns the CSS class applied during drag hover.
|
|
94
|
-
* @returns {string}
|
|
95
|
-
*/
|
|
96
|
-
getHoverClass(): string;
|
|
97
|
-
/**
|
|
98
|
-
* Returns whether a drag operation is currently active over the target.
|
|
99
|
-
* @returns {boolean}
|
|
100
|
-
*/
|
|
101
|
-
isDragging(): boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Returns whether the event listeners are currently bound to the target.
|
|
104
|
-
* @returns {boolean}
|
|
105
|
-
*/
|
|
106
|
-
bound(): boolean;
|
|
107
107
|
/**
|
|
108
108
|
* Destroys the detector instance, unbinding all event listeners and cleaning up.
|
|
109
109
|
* Should be called when the detector is no longer needed to avoid memory leaks.
|
|
110
110
|
* @returns {void}
|
|
111
111
|
*/
|
|
112
112
|
destroy(): void;
|
|
113
|
-
#private;
|
|
114
113
|
}
|
|
114
|
+
export default TinyDragDropDetector;
|
|
115
115
|
//# sourceMappingURL=TinyDragDropDetector.d.mts.map
|