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,15 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Defines the available normalization strategies for probability weight calculations.
|
|
4
|
-
*/
|
|
5
|
-
export type Normalization = "relative" | "softmax";
|
|
6
|
-
/**
|
|
7
|
-
* Generates a pseudo-random number between 0 (inclusive) and 1 (exclusive).
|
|
8
|
-
*/
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
export type Normalization = 'relative' | 'softmax';
|
|
9
3
|
export type RngGenerator = () => number;
|
|
10
|
-
/**
|
|
11
|
-
* Represents a temporary weight modifier that is applied for a limited number of draws.
|
|
12
|
-
*/
|
|
13
4
|
export type TempModifier = {
|
|
14
5
|
/**
|
|
15
6
|
* - Function that modifies the item weights.
|
|
@@ -20,9 +11,6 @@ export type TempModifier = {
|
|
|
20
11
|
*/
|
|
21
12
|
uses: number;
|
|
22
13
|
};
|
|
23
|
-
/**
|
|
24
|
-
* Represents the core data structure for an item in the raffle system.
|
|
25
|
-
*/
|
|
26
14
|
export type ItemDataTemplate<TGroups extends Set<string> | string[]> = {
|
|
27
15
|
/**
|
|
28
16
|
* - Unique identifier for the item.
|
|
@@ -49,9 +37,6 @@ export type ItemDataTemplate<TGroups extends Set<string> | string[]> = {
|
|
|
49
37
|
*/
|
|
50
38
|
meta: ItemMetadata;
|
|
51
39
|
};
|
|
52
|
-
/**
|
|
53
|
-
* Represents the serialized state of the raffle system for export or persistence.
|
|
54
|
-
*/
|
|
55
40
|
export type ExportedJson = {
|
|
56
41
|
/**
|
|
57
42
|
* - Array of item objects in their exported form.
|
|
@@ -74,39 +59,20 @@ export type ExportedJson = {
|
|
|
74
59
|
*/
|
|
75
60
|
seed: number | null;
|
|
76
61
|
};
|
|
77
|
-
/**
|
|
78
|
-
* A concrete version of ItemDataTemplate where groups is Set<string>.
|
|
79
|
-
*/
|
|
80
62
|
export type ItemData = ItemDataTemplate<Set<string>>;
|
|
81
|
-
/**
|
|
82
|
-
* A concrete version of ItemDataTemplate where groups is string[].
|
|
83
|
-
*/
|
|
84
63
|
export type ItemDataGetter = ItemDataTemplate<string[]>;
|
|
85
|
-
/**
|
|
86
|
-
* Arbitrary key-value metadata container for additional item information.
|
|
87
|
-
* Keys can be strings, numbers, or symbols.
|
|
88
|
-
*/
|
|
89
64
|
export type ItemMetadata = Record<string | number | symbol, any>;
|
|
90
|
-
/**
|
|
91
|
-
* Context object passed to weight modification functions during draw calculations.
|
|
92
|
-
*/
|
|
93
65
|
export type ComputeEffectiveWeightsContext = {
|
|
94
66
|
/**
|
|
95
67
|
* - Metadata of the current raffle state or item.
|
|
96
68
|
*/
|
|
97
|
-
metadata?: ItemMetadata
|
|
69
|
+
metadata?: ItemMetadata;
|
|
98
70
|
/**
|
|
99
71
|
* - History of previously drawn items.
|
|
100
72
|
*/
|
|
101
|
-
previousDraws?: DrawOne[]
|
|
73
|
+
previousDraws?: DrawOne[];
|
|
102
74
|
};
|
|
103
|
-
/**
|
|
104
|
-
* Maps each item ID to its computed effective weight.
|
|
105
|
-
*/
|
|
106
75
|
export type Weights = Map<string, number>;
|
|
107
|
-
/**
|
|
108
|
-
* Pity system configuration and current state.
|
|
109
|
-
*/
|
|
110
76
|
export type Pity = {
|
|
111
77
|
/**
|
|
112
78
|
* - Number of draws without a win before pity starts applying.
|
|
@@ -129,13 +95,7 @@ export type Pity = {
|
|
|
129
95
|
*/
|
|
130
96
|
currentAdd: number;
|
|
131
97
|
};
|
|
132
|
-
/**
|
|
133
|
-
* Function used to modify or override computed weights before a draw.
|
|
134
|
-
*/
|
|
135
98
|
export type WeightsCallback = (weights: Weights, context: ComputeEffectiveWeightsContext) => Weights | null;
|
|
136
|
-
/**
|
|
137
|
-
* Represents the result of a single draw.
|
|
138
|
-
*/
|
|
139
99
|
export type DrawOne = {
|
|
140
100
|
/**
|
|
141
101
|
* - Item ID.
|
|
@@ -154,9 +114,6 @@ export type DrawOne = {
|
|
|
154
114
|
*/
|
|
155
115
|
prob: number;
|
|
156
116
|
};
|
|
157
|
-
/**
|
|
158
|
-
* Generic event handler function for message or signal reception.
|
|
159
|
-
*/
|
|
160
117
|
export type handler = (payload: any, event: any) => any;
|
|
161
118
|
/**
|
|
162
119
|
* Defines the available normalization strategies for probability weight calculations.
|
|
@@ -260,19 +217,8 @@ export type handler = (payload: any, event: any) => any;
|
|
|
260
217
|
*
|
|
261
218
|
* @class
|
|
262
219
|
*/
|
|
263
|
-
declare class TinyAdvancedRaffle extends EventEmitter
|
|
264
|
-
|
|
265
|
-
* Creates a new AdvancedRaffle instance.
|
|
266
|
-
* @param {Object} [opts] - Optional configuration.
|
|
267
|
-
* @param {RngGenerator|null} [opts.rng=null] - Custom RNG function. If null, an internal seeded RNG is used when a seed is provided.
|
|
268
|
-
* @param {number|null} [opts.seed=null] - Optional seed for deterministic results.
|
|
269
|
-
* @param {Normalization} [opts.normalization='relative'] - Probability normalization mode.
|
|
270
|
-
*/
|
|
271
|
-
constructor(opts?: {
|
|
272
|
-
rng?: RngGenerator | null | undefined;
|
|
273
|
-
seed?: number | null | undefined;
|
|
274
|
-
normalization?: Normalization | undefined;
|
|
275
|
-
});
|
|
220
|
+
declare class TinyAdvancedRaffle extends EventEmitter {
|
|
221
|
+
#private;
|
|
276
222
|
/**
|
|
277
223
|
* Indicates whether this instance has been destroyed.
|
|
278
224
|
* @type {boolean}
|
|
@@ -289,6 +235,11 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
289
235
|
* @returns {number} Total count of items.
|
|
290
236
|
*/
|
|
291
237
|
get size(): number;
|
|
238
|
+
/**
|
|
239
|
+
* Gets the current probability normalization strategy.
|
|
240
|
+
* @returns {Normalization} Current normalization mode.
|
|
241
|
+
*/
|
|
242
|
+
get normalization(): Normalization;
|
|
292
243
|
/**
|
|
293
244
|
* Sets the probability normalization strategy.
|
|
294
245
|
* @param {Normalization} value - Accepted values: `'relative'` or `'softmax'`.
|
|
@@ -296,10 +247,10 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
296
247
|
*/
|
|
297
248
|
set normalization(value: Normalization);
|
|
298
249
|
/**
|
|
299
|
-
* Gets the current
|
|
300
|
-
* @returns {
|
|
250
|
+
* Gets the current RNG seed value, if any.
|
|
251
|
+
* @returns {number|null} Current seed or `null` if RNG is not seeded.
|
|
301
252
|
*/
|
|
302
|
-
get
|
|
253
|
+
get seed(): number | null;
|
|
303
254
|
/**
|
|
304
255
|
* Sets the RNG seed for deterministic randomization.
|
|
305
256
|
* @param {number|null} value - Finite number or `null` to disable seeding.
|
|
@@ -307,10 +258,10 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
307
258
|
*/
|
|
308
259
|
set seed(value: number | null);
|
|
309
260
|
/**
|
|
310
|
-
* Gets
|
|
311
|
-
* @returns {
|
|
261
|
+
* Gets all global weight modifier callbacks.
|
|
262
|
+
* @returns {WeightsCallback[]} Array of registered global modifier functions.
|
|
312
263
|
*/
|
|
313
|
-
get
|
|
264
|
+
get globalModifiers(): WeightsCallback[];
|
|
314
265
|
/**
|
|
315
266
|
* Replaces all global weight modifier callbacks.
|
|
316
267
|
* @param {WeightsCallback[]} value - Array of modifier functions.
|
|
@@ -318,10 +269,10 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
318
269
|
*/
|
|
319
270
|
set globalModifiers(value: WeightsCallback[]);
|
|
320
271
|
/**
|
|
321
|
-
* Gets all
|
|
322
|
-
* @returns {
|
|
272
|
+
* Gets all temporary modifiers with usage counters.
|
|
273
|
+
* @returns {TempModifier[]} Array of temporary modifier entries.
|
|
323
274
|
*/
|
|
324
|
-
get
|
|
275
|
+
get temporaryModifiers(): TempModifier[];
|
|
325
276
|
/**
|
|
326
277
|
* Replaces all temporary modifiers.
|
|
327
278
|
* @param {TempModifier[]} value - Each object must have a function and a positive integer usage count.
|
|
@@ -329,10 +280,10 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
329
280
|
*/
|
|
330
281
|
set temporaryModifiers(value: TempModifier[]);
|
|
331
282
|
/**
|
|
332
|
-
* Gets all
|
|
333
|
-
* @returns {
|
|
283
|
+
* Gets all conditional rule callbacks.
|
|
284
|
+
* @returns {WeightsCallback[]} Array of conditional rule functions.
|
|
334
285
|
*/
|
|
335
|
-
get
|
|
286
|
+
get conditionalRules(): WeightsCallback[];
|
|
336
287
|
/**
|
|
337
288
|
* Replaces all conditional rule callbacks.
|
|
338
289
|
* @param {WeightsCallback[]} value - Array of functions.
|
|
@@ -340,10 +291,10 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
340
291
|
*/
|
|
341
292
|
set conditionalRules(value: WeightsCallback[]);
|
|
342
293
|
/**
|
|
343
|
-
* Gets all
|
|
344
|
-
* @returns {
|
|
294
|
+
* Gets a shallow copy of all configured pity systems.
|
|
295
|
+
* @returns {Record<string, Pity>} Object keyed by system name.
|
|
345
296
|
*/
|
|
346
|
-
get
|
|
297
|
+
get pitySystems(): Record<string, Pity>;
|
|
347
298
|
/**
|
|
348
299
|
* Replaces all pity systems.
|
|
349
300
|
* @param {Map<string, Pity>} value - Map of pity systems with numeric fields.
|
|
@@ -351,10 +302,10 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
351
302
|
*/
|
|
352
303
|
set pitySystems(value: Map<string, Pity>);
|
|
353
304
|
/**
|
|
354
|
-
* Gets a
|
|
355
|
-
* @returns {
|
|
305
|
+
* Gets a copy of all exclusion IDs.
|
|
306
|
+
* @returns {string[]} Array of item IDs excluded from draws.
|
|
356
307
|
*/
|
|
357
|
-
get
|
|
308
|
+
get exclusions(): string[];
|
|
358
309
|
/**
|
|
359
310
|
* Replaces all exclusion IDs.
|
|
360
311
|
* @param {Set<string>} value - Set of excluded item IDs.
|
|
@@ -362,10 +313,10 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
362
313
|
*/
|
|
363
314
|
set exclusions(value: Set<string>);
|
|
364
315
|
/**
|
|
365
|
-
* Gets
|
|
366
|
-
* @returns {string[]}
|
|
316
|
+
* Gets all group definitions.
|
|
317
|
+
* @returns {Record<string, string[]>} Object where each key is a group name and value is an array of item IDs.
|
|
367
318
|
*/
|
|
368
|
-
get
|
|
319
|
+
get groups(): Record<string, string[]>;
|
|
369
320
|
/**
|
|
370
321
|
* Replaces all group definitions.
|
|
371
322
|
* @param {Map<string, Set<string>>} value - Map of group names to item ID sets.
|
|
@@ -373,10 +324,10 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
373
324
|
*/
|
|
374
325
|
set groups(value: Map<string, Set<string>>);
|
|
375
326
|
/**
|
|
376
|
-
* Gets
|
|
377
|
-
* @returns {
|
|
327
|
+
* Gets the current RNG function.
|
|
328
|
+
* @returns {RngGenerator} Function returning a floating-point number in [0, 1).
|
|
378
329
|
*/
|
|
379
|
-
get
|
|
330
|
+
get rng(): RngGenerator;
|
|
380
331
|
/**
|
|
381
332
|
* Sets the RNG function.
|
|
382
333
|
* @param {RngGenerator} value - Function returning a number between 0 and 1.
|
|
@@ -384,10 +335,10 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
384
335
|
*/
|
|
385
336
|
set rng(value: RngGenerator);
|
|
386
337
|
/**
|
|
387
|
-
* Gets
|
|
388
|
-
* @returns {
|
|
338
|
+
* Gets all item definitions with group names expanded to arrays.
|
|
339
|
+
* @returns {Record<string, ItemDataGetter>} Object keyed by item ID.
|
|
389
340
|
*/
|
|
390
|
-
get
|
|
341
|
+
get items(): Record<string, ItemDataGetter>;
|
|
391
342
|
/**
|
|
392
343
|
* Replaces all items (**and CLEAR OLD LIST**).
|
|
393
344
|
* @param {Map<string, ItemData>} value - Map of item IDs to definitions.
|
|
@@ -395,10 +346,17 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
395
346
|
*/
|
|
396
347
|
set items(value: Map<string, ItemData>);
|
|
397
348
|
/**
|
|
398
|
-
*
|
|
399
|
-
* @
|
|
349
|
+
* Creates a new AdvancedRaffle instance.
|
|
350
|
+
* @param {Object} [opts] - Optional configuration.
|
|
351
|
+
* @param {RngGenerator|null} [opts.rng=null] - Custom RNG function. If null, an internal seeded RNG is used when a seed is provided.
|
|
352
|
+
* @param {number|null} [opts.seed=null] - Optional seed for deterministic results.
|
|
353
|
+
* @param {Normalization} [opts.normalization='relative'] - Probability normalization mode.
|
|
400
354
|
*/
|
|
401
|
-
|
|
355
|
+
constructor(opts?: {
|
|
356
|
+
rng?: RngGenerator | null;
|
|
357
|
+
seed?: number | null;
|
|
358
|
+
normalization?: Normalization;
|
|
359
|
+
});
|
|
402
360
|
/**
|
|
403
361
|
* Check if an item exists in the system.
|
|
404
362
|
* @param {string} itemId - Item ID to check.
|
|
@@ -418,10 +376,10 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
418
376
|
* @throws {TypeError} If any parameter has an invalid type.
|
|
419
377
|
*/
|
|
420
378
|
addItem(id: string, opts?: {
|
|
421
|
-
weight?: number
|
|
422
|
-
label?: string
|
|
423
|
-
meta?: ItemMetadata
|
|
424
|
-
groups?: string[] | Set<string
|
|
379
|
+
weight?: number;
|
|
380
|
+
label?: string;
|
|
381
|
+
meta?: ItemMetadata;
|
|
382
|
+
groups?: string[] | Set<string>;
|
|
425
383
|
}): ItemData;
|
|
426
384
|
/**
|
|
427
385
|
* Remove an item from the system.
|
|
@@ -542,7 +500,7 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
542
500
|
configurePity(itemId: string, cfg: {
|
|
543
501
|
threshold: number;
|
|
544
502
|
increment: number;
|
|
545
|
-
cap?: number
|
|
503
|
+
cap?: number;
|
|
546
504
|
}): void;
|
|
547
505
|
/**
|
|
548
506
|
* Reset pity counters for a given item.
|
|
@@ -650,8 +608,8 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
650
608
|
* @throws {TypeError} If `opts` is not an object.
|
|
651
609
|
*/
|
|
652
610
|
drawOne(opts?: {
|
|
653
|
-
previousDraws?: DrawOne[]
|
|
654
|
-
metadata?: ItemMetadata
|
|
611
|
+
previousDraws?: DrawOne[];
|
|
612
|
+
metadata?: ItemMetadata;
|
|
655
613
|
}): DrawOne | null;
|
|
656
614
|
/**
|
|
657
615
|
* Internal helper to decrement usage counts of temporary modifiers,
|
|
@@ -673,10 +631,10 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
673
631
|
* @throws {TypeError} If `opts` is not an object.
|
|
674
632
|
*/
|
|
675
633
|
drawMany(count?: number, opts?: {
|
|
676
|
-
metadata?: ItemMetadata
|
|
677
|
-
withReplacement?: boolean
|
|
678
|
-
ensureUnique?: boolean
|
|
679
|
-
previousDraws?: DrawOne[]
|
|
634
|
+
metadata?: ItemMetadata;
|
|
635
|
+
withReplacement?: boolean;
|
|
636
|
+
ensureUnique?: boolean;
|
|
637
|
+
previousDraws?: DrawOne[];
|
|
680
638
|
}): DrawOne[];
|
|
681
639
|
/**
|
|
682
640
|
* Export the current configuration to a JSON-serializable object.
|
|
@@ -717,7 +675,6 @@ declare class TinyAdvancedRaffle extends EventEmitter<any> {
|
|
|
717
675
|
* Once destroyed, any further method calls will throw errors.
|
|
718
676
|
*/
|
|
719
677
|
destroy(): void;
|
|
720
|
-
#private;
|
|
721
678
|
}
|
|
722
|
-
|
|
679
|
+
export default TinyAdvancedRaffle;
|
|
723
680
|
//# sourceMappingURL=TinyAdvancedRaffle.d.mts.map
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
export default TinyAfterScrollWatcher;
|
|
2
|
-
/**
|
|
3
|
-
* - Function with no arguments and no return value
|
|
4
|
-
*/
|
|
5
1
|
export type FnData = (() => void);
|
|
6
|
-
/**
|
|
7
|
-
* A function that handles a scroll event.
|
|
8
|
-
* It receives a standard `Event` object when a scroll occurs.
|
|
9
|
-
*/
|
|
10
2
|
export type OnScrollFunc = (ev: Event) => void;
|
|
11
3
|
/**
|
|
12
4
|
* @typedef {(() => void)} FnData - Function with no arguments and no return value
|
|
@@ -23,6 +15,11 @@ export type OnScrollFunc = (ev: Event) => void;
|
|
|
23
15
|
* @template {Element|Window} ScrollElement
|
|
24
16
|
*/
|
|
25
17
|
declare class TinyAfterScrollWatcher<ScrollElement extends Element | Window> {
|
|
18
|
+
#private;
|
|
19
|
+
lastScrollTime: number | undefined;
|
|
20
|
+
get scrollTarget(): ScrollElement;
|
|
21
|
+
get afterScrollQueueSize(): number;
|
|
22
|
+
get destroyed(): boolean;
|
|
26
23
|
/**
|
|
27
24
|
* @param {ScrollElement} scrollTarget - The element or window to track scrolling on
|
|
28
25
|
* @param {number} [inactivityTime=100] - Time in milliseconds to wait after scroll ends before executing the queue
|
|
@@ -30,13 +27,15 @@ declare class TinyAfterScrollWatcher<ScrollElement extends Element | Window> {
|
|
|
30
27
|
* @throws {TypeError} If inactivityTime is not a positive number
|
|
31
28
|
*/
|
|
32
29
|
constructor(scrollTarget: ScrollElement, inactivityTime?: number);
|
|
33
|
-
get scrollTarget(): ScrollElement;
|
|
34
|
-
get afterScrollQueueSize(): number;
|
|
35
|
-
get destroyed(): boolean;
|
|
36
30
|
/**
|
|
37
31
|
* @private
|
|
38
32
|
*/
|
|
39
33
|
private _checkTimer;
|
|
34
|
+
/**
|
|
35
|
+
* Gets the current inactivity time in milliseconds.
|
|
36
|
+
* @returns {number}
|
|
37
|
+
*/
|
|
38
|
+
get inactivityTime(): number;
|
|
40
39
|
/**
|
|
41
40
|
* Sets a new inactivity time.
|
|
42
41
|
* Must be a positive number (in milliseconds).
|
|
@@ -44,11 +43,6 @@ declare class TinyAfterScrollWatcher<ScrollElement extends Element | Window> {
|
|
|
44
43
|
* @throws {Error} If value is not a positive number
|
|
45
44
|
*/
|
|
46
45
|
set inactivityTime(value: number);
|
|
47
|
-
/**
|
|
48
|
-
* Gets the current inactivity time in milliseconds.
|
|
49
|
-
* @returns {number}
|
|
50
|
-
*/
|
|
51
|
-
get inactivityTime(): number;
|
|
52
46
|
/**
|
|
53
47
|
* Adds a function to be executed after scroll has stopped.
|
|
54
48
|
* The scroll is considered "stopped" after the configured inactivity time.
|
|
@@ -57,7 +51,6 @@ declare class TinyAfterScrollWatcher<ScrollElement extends Element | Window> {
|
|
|
57
51
|
* @throws {TypeError} If the argument is not a function.
|
|
58
52
|
*/
|
|
59
53
|
doAfterScroll(fn: () => void): void;
|
|
60
|
-
lastScrollTime: number | undefined;
|
|
61
54
|
/**
|
|
62
55
|
* Registers a function to run once after scrolling has stopped,
|
|
63
56
|
* before any afterScrollQueue functions.
|
|
@@ -91,6 +84,6 @@ declare class TinyAfterScrollWatcher<ScrollElement extends Element | Window> {
|
|
|
91
84
|
* Destroys the watcher by removing internal listeners and clearing data.
|
|
92
85
|
*/
|
|
93
86
|
destroy(): void;
|
|
94
|
-
#private;
|
|
95
87
|
}
|
|
88
|
+
export default TinyAfterScrollWatcher;
|
|
96
89
|
//# sourceMappingURL=TinyAfterScrollWatcher.d.mts.map
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export default TinyAnalogClock;
|
|
2
|
-
/**
|
|
3
|
-
* Configuration object for the Analog Clock.
|
|
4
|
-
*/
|
|
5
1
|
export type ClockConfig = {
|
|
6
2
|
/**
|
|
7
3
|
* - The background color of the clock face (e.g., '#ffffff', 'rgb(0,0,0)').
|
|
@@ -104,12 +100,7 @@ export type ClockConfig = {
|
|
|
104
100
|
* @property {number} phM - Minute tick height as a percentage of clock size (0.0 to 1.0).
|
|
105
101
|
*/
|
|
106
102
|
declare class TinyAnalogClock {
|
|
107
|
-
|
|
108
|
-
* Creates an instance of TinyAnalogClock.
|
|
109
|
-
* Initializes the DOM structure and starts the animation loop.
|
|
110
|
-
* @param {Partial<ClockConfig>} [options] - Optional configuration overrides.
|
|
111
|
-
*/
|
|
112
|
-
constructor(options?: Partial<ClockConfig>);
|
|
103
|
+
#private;
|
|
113
104
|
/**
|
|
114
105
|
* Gets the current destruction status of the instance.
|
|
115
106
|
*
|
|
@@ -122,6 +113,12 @@ declare class TinyAnalogClock {
|
|
|
122
113
|
* @private
|
|
123
114
|
*/
|
|
124
115
|
private _getDate;
|
|
116
|
+
/**
|
|
117
|
+
* Creates an instance of TinyAnalogClock.
|
|
118
|
+
* Initializes the DOM structure and starts the animation loop.
|
|
119
|
+
* @param {Partial<ClockConfig>} [options] - Optional configuration overrides.
|
|
120
|
+
*/
|
|
121
|
+
constructor(options?: Partial<ClockConfig>);
|
|
125
122
|
/**
|
|
126
123
|
* Applies the current configuration to the DOM elements (colors, sizes, visibility).
|
|
127
124
|
* @private
|
|
@@ -343,6 +340,6 @@ declare class TinyAnalogClock {
|
|
|
343
340
|
* @returns {void}
|
|
344
341
|
*/
|
|
345
342
|
destroy(): void;
|
|
346
|
-
#private;
|
|
347
343
|
}
|
|
344
|
+
export default TinyAnalogClock;
|
|
348
345
|
//# sourceMappingURL=TinyAnalogClock.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export default TinyArrayComparator;
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* @fileoverview Array comparison utility.
|
|
3
|
+
* @module TinyArrayComparator
|
|
4
4
|
*/
|
|
5
|
-
export type InternalState<ArrayItem extends
|
|
5
|
+
export type InternalState<ArrayItem extends any> = {
|
|
6
6
|
/**
|
|
7
7
|
* - A map storing the hash as the key and the original item as the value.
|
|
8
8
|
*/
|
|
@@ -12,17 +12,10 @@ export type InternalState<ArrayItem extends unknown> = {
|
|
|
12
12
|
*/
|
|
13
13
|
affectedItems: AffectedItems<ArrayItem>;
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
* The final array that collects added or deleted items.
|
|
17
|
-
*/
|
|
18
|
-
export type AffectedItems<ArrayItem extends unknown> = Array<{
|
|
15
|
+
export type AffectedItems<ArrayItem extends any> = Array<{
|
|
19
16
|
item: ArrayItem;
|
|
20
|
-
status:
|
|
17
|
+
status: 'added' | 'deleted';
|
|
21
18
|
}>;
|
|
22
|
-
/**
|
|
23
|
-
* @fileoverview Array comparison utility.
|
|
24
|
-
* @module TinyArrayComparator
|
|
25
|
-
*/
|
|
26
19
|
/**
|
|
27
20
|
* @template {any} ArrayItem
|
|
28
21
|
* @typedef {Object} InternalState
|
|
@@ -39,7 +32,8 @@ export type AffectedItems<ArrayItem extends unknown> = Array<{
|
|
|
39
32
|
* Compares two arrays efficiently by hashing their items to detect additions and deletions.
|
|
40
33
|
* @template {any} ArrayItem
|
|
41
34
|
*/
|
|
42
|
-
declare class TinyArrayComparator<ArrayItem extends
|
|
35
|
+
declare class TinyArrayComparator<ArrayItem extends any> {
|
|
36
|
+
#private;
|
|
43
37
|
/**
|
|
44
38
|
* Generates a simple 32-bit integer hash converted to a base36 string.
|
|
45
39
|
* @param {any} item - The item to be hashed (can be an object, array, string, or number).
|
|
@@ -47,10 +41,10 @@ declare class TinyArrayComparator<ArrayItem extends unknown> {
|
|
|
47
41
|
*/
|
|
48
42
|
static generateHash(item: any): string;
|
|
49
43
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @
|
|
44
|
+
* Gets the current base array used for comparisons.
|
|
45
|
+
* @returns {ArrayItem[]} The current initial state of the array.
|
|
52
46
|
*/
|
|
53
|
-
|
|
47
|
+
get oldArray(): ArrayItem[];
|
|
54
48
|
/**
|
|
55
49
|
* Sets a new base array for future comparisons.
|
|
56
50
|
* @param {ArrayItem[]} oldArray - The initial state of the array.
|
|
@@ -58,10 +52,10 @@ declare class TinyArrayComparator<ArrayItem extends unknown> {
|
|
|
58
52
|
*/
|
|
59
53
|
set oldArray(oldArray: ArrayItem[]);
|
|
60
54
|
/**
|
|
61
|
-
*
|
|
62
|
-
* @
|
|
55
|
+
* Initializes the comparator with an optional base array.
|
|
56
|
+
* @param {ArrayItem[]} [oldArray] - The initial state of the array to be stored.
|
|
63
57
|
*/
|
|
64
|
-
|
|
58
|
+
constructor(oldArray?: ArrayItem[]);
|
|
65
59
|
/**
|
|
66
60
|
* Proxy to generates a hash converted to a string.
|
|
67
61
|
* @param {ArrayItem} item - The item to be hashed (can be an object, array, string, or number).
|
|
@@ -77,6 +71,6 @@ declare class TinyArrayComparator<ArrayItem extends unknown> {
|
|
|
77
71
|
* @throws {TypeError} Throws an error if the provided value is not an array.
|
|
78
72
|
*/
|
|
79
73
|
compare(newArray: ArrayItem[]): AffectedItems<ArrayItem>;
|
|
80
|
-
#private;
|
|
81
74
|
}
|
|
75
|
+
export default TinyArrayComparator;
|
|
82
76
|
//# sourceMappingURL=TinyArrayComparator.d.mts.map
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
export default TinyArrayPaginator;
|
|
2
1
|
/**
|
|
3
2
|
* A predicate function used to determine whether an item should be included in the filtered results.
|
|
4
3
|
* Works similarly to the callback function of `Array.prototype.filter`.
|
|
4
|
+
*
|
|
5
|
+
* @template {any} ArrayItem
|
|
6
|
+
* @callback GetFilter
|
|
7
|
+
* @param {ArrayItem} value - The current element being processed in the array.
|
|
8
|
+
* @param {number} index - The index of the current element within the array.
|
|
9
|
+
* @param {ArrayItem[]} array - The full array being processed.
|
|
10
|
+
* @returns {boolean} Returns `true` to include the element in the results, or `false` to exclude it.
|
|
5
11
|
*/
|
|
6
|
-
export type GetFilter<ArrayItem extends
|
|
7
|
-
export type GetterResult<ArrayItem extends
|
|
12
|
+
export type GetFilter<ArrayItem extends any> = (value: ArrayItem, index: number, array: ArrayItem[]) => boolean;
|
|
13
|
+
export type GetterResult<ArrayItem extends any> = {
|
|
8
14
|
/**
|
|
9
15
|
* - The subset of items for the requested page.
|
|
10
16
|
*/
|
|
@@ -34,17 +40,6 @@ export type GetterResult<ArrayItem extends unknown> = {
|
|
|
34
40
|
*/
|
|
35
41
|
hasNext: boolean;
|
|
36
42
|
};
|
|
37
|
-
/**
|
|
38
|
-
* A predicate function used to determine whether an item should be included in the filtered results.
|
|
39
|
-
* Works similarly to the callback function of `Array.prototype.filter`.
|
|
40
|
-
*
|
|
41
|
-
* @template {any} ArrayItem
|
|
42
|
-
* @callback GetFilter
|
|
43
|
-
* @param {ArrayItem} value - The current element being processed in the array.
|
|
44
|
-
* @param {number} index - The index of the current element within the array.
|
|
45
|
-
* @param {ArrayItem[]} array - The full array being processed.
|
|
46
|
-
* @returns {boolean} Returns `true` to include the element in the results, or `false` to exclude it.
|
|
47
|
-
*/
|
|
48
43
|
/**
|
|
49
44
|
* @template {any} ArrayItem
|
|
50
45
|
* @typedef {Object} GetterResult
|
|
@@ -62,29 +57,30 @@ export type GetterResult<ArrayItem extends unknown> = {
|
|
|
62
57
|
* while keeping the source array safe from direct modifications.
|
|
63
58
|
* @template {any} ArrayItem
|
|
64
59
|
*/
|
|
65
|
-
declare class TinyArrayPaginator<ArrayItem extends
|
|
60
|
+
declare class TinyArrayPaginator<ArrayItem extends any> {
|
|
61
|
+
#private;
|
|
66
62
|
/**
|
|
67
|
-
*
|
|
68
|
-
* @
|
|
69
|
-
* @throws {TypeError} If the provided data is not an array.
|
|
63
|
+
* Gets current stored array.
|
|
64
|
+
* @returns {ArrayItem[]|Set<ArrayItem>}
|
|
70
65
|
*/
|
|
71
|
-
|
|
66
|
+
get data(): ArrayItem[] | Set<ArrayItem>;
|
|
72
67
|
/**
|
|
73
68
|
* Replaces the current data array.
|
|
74
69
|
* @param {ArrayItem[]|Set<ArrayItem>} value - The new array to be used as the data source.
|
|
75
70
|
* @throws {TypeError} If the provided value is not an array.
|
|
76
71
|
*/
|
|
77
72
|
set data(value: ArrayItem[] | Set<ArrayItem>);
|
|
78
|
-
/**
|
|
79
|
-
* Gets current stored array.
|
|
80
|
-
* @returns {ArrayItem[]|Set<ArrayItem>}
|
|
81
|
-
*/
|
|
82
|
-
get data(): ArrayItem[] | Set<ArrayItem>;
|
|
83
73
|
/**
|
|
84
74
|
* Gets the total number of items in the current data array.
|
|
85
75
|
* @returns {number} Total number of stored items.
|
|
86
76
|
*/
|
|
87
77
|
get size(): number;
|
|
78
|
+
/**
|
|
79
|
+
* Creates a new paginator instance for the given data array.
|
|
80
|
+
* @param {ArrayItem[]|Set<ArrayItem>} data - The array to be paginated.
|
|
81
|
+
* @throws {TypeError} If the provided data is not an array.
|
|
82
|
+
*/
|
|
83
|
+
constructor(data: ArrayItem[] | Set<ArrayItem>);
|
|
88
84
|
/**
|
|
89
85
|
* Filters data according to a search query and returns paginated results.
|
|
90
86
|
* @param {Object} settings
|
|
@@ -98,8 +94,8 @@ declare class TinyArrayPaginator<ArrayItem extends unknown> {
|
|
|
98
94
|
get({ page, perPage, filter }: {
|
|
99
95
|
page: number;
|
|
100
96
|
perPage: number;
|
|
101
|
-
filter?: Record<string,
|
|
97
|
+
filter?: Record<string, ArrayItem | RegExp> | GetFilter<ArrayItem>;
|
|
102
98
|
}): GetterResult<ArrayItem>;
|
|
103
|
-
#private;
|
|
104
99
|
}
|
|
100
|
+
export default TinyArrayPaginator;
|
|
105
101
|
//# sourceMappingURL=TinyArrayPaginator.d.mts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export default TinyPluginInliner;
|
|
2
1
|
export type RootReplacement = {
|
|
3
2
|
/**
|
|
4
3
|
* - The directory name to replace (e.g., 'src').
|
|
@@ -25,7 +24,7 @@ export type InlinerConfig = {
|
|
|
25
24
|
/**
|
|
26
25
|
* - Optional customization to remap project import roots.
|
|
27
26
|
*/
|
|
28
|
-
rootReplacement?: RootReplacement
|
|
27
|
+
rootReplacement?: RootReplacement;
|
|
29
28
|
};
|
|
30
29
|
/**
|
|
31
30
|
* @typedef {Object} RootReplacement
|
|
@@ -40,12 +39,6 @@ export type InlinerConfig = {
|
|
|
40
39
|
* @property {RootReplacement} [rootReplacement] - Optional customization to remap project import roots.
|
|
41
40
|
*/
|
|
42
41
|
declare class TinyPluginInliner {
|
|
43
|
-
/**
|
|
44
|
-
* Creates an instance of the TinyPluginInliner.
|
|
45
|
-
*
|
|
46
|
-
* @param {InlinerConfig} config - The configuration object for the build process.
|
|
47
|
-
*/
|
|
48
|
-
constructor(config: InlinerConfig);
|
|
49
42
|
config: InlinerConfig;
|
|
50
43
|
entryFile: string;
|
|
51
44
|
outDir: string;
|
|
@@ -53,6 +46,12 @@ declare class TinyPluginInliner {
|
|
|
53
46
|
entryDir: string;
|
|
54
47
|
hoistedImports: Set<any>;
|
|
55
48
|
hoistedTypedefs: Set<any>;
|
|
49
|
+
/**
|
|
50
|
+
* Creates an instance of the TinyPluginInliner.
|
|
51
|
+
*
|
|
52
|
+
* @param {InlinerConfig} config - The configuration object for the build process.
|
|
53
|
+
*/
|
|
54
|
+
constructor(config: InlinerConfig);
|
|
56
55
|
/**
|
|
57
56
|
* Rewrites all import paths (both standard and inside JSDocs) in a given code string.
|
|
58
57
|
* Handles local path root replacements and NPM package absolute path conversion.
|
|
@@ -89,4 +88,5 @@ declare class TinyPluginInliner {
|
|
|
89
88
|
*/
|
|
90
89
|
build(): Promise<void>;
|
|
91
90
|
}
|
|
91
|
+
export default TinyPluginInliner;
|
|
92
92
|
//# sourceMappingURL=TinyPluginInliner.d.mts.map
|