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
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @typedef {Object} PluginDefinition
|
|
10
10
|
* @property {string} name - The unique identifier for the plugin.
|
|
11
11
|
* @property {string[]} [dependencies] - Array of plugin names required before applying this one.
|
|
12
|
-
* @property {
|
|
12
|
+
* @property {(Base: TBase, classes: AppliedPluginClasses) => TExtended} apply - Function that receives the base class and returns the extended class.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -18,8 +18,6 @@
|
|
|
18
18
|
* @template {T|NewTinyClass} oldT
|
|
19
19
|
*/
|
|
20
20
|
class TinyClassManager {
|
|
21
|
-
/** @typedef {[...oldT[], T]} AppliedPluginClasses */
|
|
22
|
-
|
|
23
21
|
/**
|
|
24
22
|
* @type {Set<string>}
|
|
25
23
|
* Tracks the names of successfully applied plugins to prevent duplication and check dependencies.
|
|
@@ -36,7 +34,7 @@ class TinyClassManager {
|
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
/**
|
|
39
|
-
* @type {
|
|
37
|
+
* @type {[...oldT[], T]}
|
|
40
38
|
* Tracks the classes of successfully applied plugins to prevent duplication and check dependencies.
|
|
41
39
|
*/
|
|
42
40
|
// @ts-ignore
|
|
@@ -44,7 +42,7 @@ class TinyClassManager {
|
|
|
44
42
|
|
|
45
43
|
/**
|
|
46
44
|
* Gets the list of plugin classes currently applied to this instance.
|
|
47
|
-
* @returns {
|
|
45
|
+
* @returns {[...oldT[], T]} Array of applied plugin classes.
|
|
48
46
|
*/
|
|
49
47
|
get appliedPluginClasses() {
|
|
50
48
|
if (this.#used) throw new Error(`[TinyClassManager] Cannot get a consumed manager instance.`);
|
|
@@ -140,7 +138,7 @@ class TinyClassManager {
|
|
|
140
138
|
* Applies a plugin to the class chain using a definition object.
|
|
141
139
|
* @deprecated Use {@link insert} instead.
|
|
142
140
|
* @template {NewTinyClass} R
|
|
143
|
-
* @param {PluginDefinition<T, R,
|
|
141
|
+
* @param {PluginDefinition<T, R, [...oldT[], T]>} plugin - The plugin module to be integrated.
|
|
144
142
|
* @returns {TinyClassManager<R, T | oldT>} A new manager instance holding the extended class chain.
|
|
145
143
|
* @throws {Error} Throws if instance is already consumed, plugin is duplicate, or dependencies are missing.
|
|
146
144
|
*/
|
|
@@ -164,7 +162,7 @@ class TinyClassManager {
|
|
|
164
162
|
* Inserts a plugin directly by passing its apply function.
|
|
165
163
|
* It reads `_tinyDepName` and `_tinyDeps` statically from the returned class.
|
|
166
164
|
* @template {NewTinyClass} R
|
|
167
|
-
* @param {
|
|
165
|
+
* @param {(ClassItem: T, classes: [...oldT[], T]) => R} applyFn - Function that receives the base class and returns the extended class.
|
|
168
166
|
* @returns {TinyClassManager<R, T | oldT>} A new manager instance holding the extended class chain.
|
|
169
167
|
* @throws {Error} Throws if static properties are missing, instance is consumed, or validation fails.
|
|
170
168
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/** @typedef {new (...args: any[]) => any} NewTinyClass */
|
|
2
2
|
export type NewTinyClass = new (...args: any[]) => any;
|
|
3
3
|
export type PluginDefinition<TBase extends NewTinyClass, TExtended extends NewTinyClass, AppliedPluginClasses extends NewTinyClass[]> = {
|
|
4
4
|
/**
|
|
@@ -8,13 +8,12 @@ export type PluginDefinition<TBase extends NewTinyClass, TExtended extends NewTi
|
|
|
8
8
|
/**
|
|
9
9
|
* - Array of plugin names required before applying this one.
|
|
10
10
|
*/
|
|
11
|
-
dependencies?: string[]
|
|
11
|
+
dependencies?: string[];
|
|
12
12
|
/**
|
|
13
13
|
* - Function that receives the base class and returns the extended class.
|
|
14
14
|
*/
|
|
15
|
-
apply: (
|
|
15
|
+
apply: (Base: TBase, classes: AppliedPluginClasses) => TExtended;
|
|
16
16
|
};
|
|
17
|
-
/** @typedef {new (...args: any[]) => any} NewTinyClass */
|
|
18
17
|
/**
|
|
19
18
|
* @template {NewTinyClass} TBase
|
|
20
19
|
* @template {NewTinyClass} TExtended
|
|
@@ -22,7 +21,7 @@ export type PluginDefinition<TBase extends NewTinyClass, TExtended extends NewTi
|
|
|
22
21
|
* @typedef {Object} PluginDefinition
|
|
23
22
|
* @property {string} name - The unique identifier for the plugin.
|
|
24
23
|
* @property {string[]} [dependencies] - Array of plugin names required before applying this one.
|
|
25
|
-
* @property {
|
|
24
|
+
* @property {(Base: TBase, classes: AppliedPluginClasses) => TExtended} apply - Function that receives the base class and returns the extended class.
|
|
26
25
|
*/
|
|
27
26
|
/**
|
|
28
27
|
* Manages the composition of a base class with multiple optional plugins (Mixins).
|
|
@@ -30,12 +29,7 @@ export type PluginDefinition<TBase extends NewTinyClass, TExtended extends NewTi
|
|
|
30
29
|
* @template {T|NewTinyClass} oldT
|
|
31
30
|
*/
|
|
32
31
|
declare class TinyClassManager<T extends NewTinyClass, oldT extends T | NewTinyClass> {
|
|
33
|
-
|
|
34
|
-
* Initializes the manager with a core class.
|
|
35
|
-
* @param {T} coreClass - The foundational class to be extended.
|
|
36
|
-
* @param {oldT[]} [oldClasses=[]]
|
|
37
|
-
*/
|
|
38
|
-
constructor(coreClass: T, oldClasses?: oldT[]);
|
|
32
|
+
#private;
|
|
39
33
|
/**
|
|
40
34
|
* Gets the list of plugins currently applied to this instance.
|
|
41
35
|
* @returns {string[]} Array of applied plugin names.
|
|
@@ -43,7 +37,7 @@ declare class TinyClassManager<T extends NewTinyClass, oldT extends T | NewTinyC
|
|
|
43
37
|
get appliedPlugins(): string[];
|
|
44
38
|
/**
|
|
45
39
|
* Gets the list of plugin classes currently applied to this instance.
|
|
46
|
-
* @returns {
|
|
40
|
+
* @returns {[...oldT[], T]} Array of applied plugin classes.
|
|
47
41
|
*/
|
|
48
42
|
get appliedPluginClasses(): [...oldT[], T];
|
|
49
43
|
/**
|
|
@@ -59,11 +53,17 @@ declare class TinyClassManager<T extends NewTinyClass, oldT extends T | NewTinyC
|
|
|
59
53
|
* Protects the instance from being consumed or reused after transition.
|
|
60
54
|
*/
|
|
61
55
|
get used(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Initializes the manager with a core class.
|
|
58
|
+
* @param {T} coreClass - The foundational class to be extended.
|
|
59
|
+
* @param {oldT[]} [oldClasses=[]]
|
|
60
|
+
*/
|
|
61
|
+
constructor(coreClass: T, oldClasses?: oldT[]);
|
|
62
62
|
/**
|
|
63
63
|
* Applies a plugin to the class chain using a definition object.
|
|
64
64
|
* @deprecated Use {@link insert} instead.
|
|
65
65
|
* @template {NewTinyClass} R
|
|
66
|
-
* @param {PluginDefinition<T, R,
|
|
66
|
+
* @param {PluginDefinition<T, R, [...oldT[], T]>} plugin - The plugin module to be integrated.
|
|
67
67
|
* @returns {TinyClassManager<R, T | oldT>} A new manager instance holding the extended class chain.
|
|
68
68
|
* @throws {Error} Throws if instance is already consumed, plugin is duplicate, or dependencies are missing.
|
|
69
69
|
*/
|
|
@@ -72,17 +72,17 @@ declare class TinyClassManager<T extends NewTinyClass, oldT extends T | NewTinyC
|
|
|
72
72
|
* Inserts a plugin directly by passing its apply function.
|
|
73
73
|
* It reads `_tinyDepName` and `_tinyDeps` statically from the returned class.
|
|
74
74
|
* @template {NewTinyClass} R
|
|
75
|
-
* @param {
|
|
75
|
+
* @param {(ClassItem: T, classes: [...oldT[], T]) => R} applyFn - Function that receives the base class and returns the extended class.
|
|
76
76
|
* @returns {TinyClassManager<R, T | oldT>} A new manager instance holding the extended class chain.
|
|
77
77
|
* @throws {Error} Throws if static properties are missing, instance is consumed, or validation fails.
|
|
78
78
|
*/
|
|
79
|
-
insert<R extends NewTinyClass>(applyFn: (
|
|
79
|
+
insert<R extends NewTinyClass>(applyFn: (ClassItem: T, classes: [...oldT[], T]) => R): TinyClassManager<R, T | oldT>;
|
|
80
80
|
/**
|
|
81
81
|
* Finalizes the composition and returns the fully built class.
|
|
82
82
|
* @returns {T} The final class representing the last extended version in the chain.
|
|
83
83
|
* @throws {Error} Throws if the manager instance has already been used or finalized.
|
|
84
84
|
*/
|
|
85
85
|
build(): T;
|
|
86
|
-
#private;
|
|
87
86
|
}
|
|
87
|
+
export default TinyClassManager;
|
|
88
88
|
//# sourceMappingURL=TinyClassManager.d.mts.map
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @typedef {Object} PluginDefinition
|
|
7
7
|
* @property {string} name - The unique identifier for the plugin.
|
|
8
8
|
* @property {string[]} [dependencies] - Array of plugin names required before applying this one.
|
|
9
|
-
* @property {
|
|
9
|
+
* @property {(Base: TBase, classes: AppliedPluginClasses) => TExtended} apply - Function that receives the base class and returns the extended class.
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
12
12
|
* Manages the composition of a base class with multiple optional plugins (Mixins).
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* @template {T|NewTinyClass} oldT
|
|
15
15
|
*/
|
|
16
16
|
class TinyClassManager {
|
|
17
|
-
/** @typedef {[...oldT[], T]} AppliedPluginClasses */
|
|
18
17
|
/**
|
|
19
18
|
* @type {Set<string>}
|
|
20
19
|
* Tracks the names of successfully applied plugins to prevent duplication and check dependencies.
|
|
@@ -30,14 +29,14 @@ class TinyClassManager {
|
|
|
30
29
|
return [...this.#appliedPlugins];
|
|
31
30
|
}
|
|
32
31
|
/**
|
|
33
|
-
* @type {
|
|
32
|
+
* @type {[...oldT[], T]}
|
|
34
33
|
* Tracks the classes of successfully applied plugins to prevent duplication and check dependencies.
|
|
35
34
|
*/
|
|
36
35
|
// @ts-ignore
|
|
37
36
|
#appliedPluginClasses = [];
|
|
38
37
|
/**
|
|
39
38
|
* Gets the list of plugin classes currently applied to this instance.
|
|
40
|
-
* @returns {
|
|
39
|
+
* @returns {[...oldT[], T]} Array of applied plugin classes.
|
|
41
40
|
*/
|
|
42
41
|
get appliedPluginClasses() {
|
|
43
42
|
if (this.#used)
|
|
@@ -120,7 +119,7 @@ class TinyClassManager {
|
|
|
120
119
|
* Applies a plugin to the class chain using a definition object.
|
|
121
120
|
* @deprecated Use {@link insert} instead.
|
|
122
121
|
* @template {NewTinyClass} R
|
|
123
|
-
* @param {PluginDefinition<T, R,
|
|
122
|
+
* @param {PluginDefinition<T, R, [...oldT[], T]>} plugin - The plugin module to be integrated.
|
|
124
123
|
* @returns {TinyClassManager<R, T | oldT>} A new manager instance holding the extended class chain.
|
|
125
124
|
* @throws {Error} Throws if instance is already consumed, plugin is duplicate, or dependencies are missing.
|
|
126
125
|
*/
|
|
@@ -141,7 +140,7 @@ class TinyClassManager {
|
|
|
141
140
|
* Inserts a plugin directly by passing its apply function.
|
|
142
141
|
* It reads `_tinyDepName` and `_tinyDeps` statically from the returned class.
|
|
143
142
|
* @template {NewTinyClass} R
|
|
144
|
-
* @param {
|
|
143
|
+
* @param {(ClassItem: T, classes: [...oldT[], T]) => R} applyFn - Function that receives the base class and returns the extended class.
|
|
145
144
|
* @returns {TinyClassManager<R, T | oldT>} A new manager instance holding the extended class chain.
|
|
146
145
|
* @throws {Error} Throws if static properties are missing, instance is consumed, or validation fails.
|
|
147
146
|
*/
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
export default TinyClipboard;
|
|
2
1
|
/**
|
|
3
2
|
* Utility class to handle clipboard operations for text and blob data.
|
|
4
3
|
* Supports modern Clipboard API, custom platform, and legacy execCommand fallback.
|
|
5
4
|
*/
|
|
6
5
|
declare class TinyClipboard {
|
|
6
|
+
#private;
|
|
7
|
+
/**
|
|
8
|
+
* Constructs a new TinyClipboard instance.
|
|
9
|
+
* Automatically detects and configures available clipboard APIs.
|
|
10
|
+
*/
|
|
11
|
+
constructor();
|
|
7
12
|
/**
|
|
8
13
|
* Override the default text copy behavior.
|
|
9
14
|
* This allows you to provide your own clipboard implementation or
|
|
@@ -102,7 +107,7 @@ declare class TinyClipboard {
|
|
|
102
107
|
* @param {string|null} [mimeFormat=null] - The MIME type or prefix to match.
|
|
103
108
|
* @returns {Promise<Array<Blob|string>>} A promise resolving with matching data array.
|
|
104
109
|
*/
|
|
105
|
-
readAllData(type?:
|
|
110
|
+
readAllData(type?: 'text' | 'custom' | null, mimeFormat?: string | null): Promise<Array<Blob | string>>;
|
|
106
111
|
/**
|
|
107
112
|
* Read clipboard data at a specific index or all if null.
|
|
108
113
|
*
|
|
@@ -152,6 +157,6 @@ declare class TinyClipboard {
|
|
|
152
157
|
* @returns {((blob: Blob) => Promise<void>) | null} The current blob copy function or null if unavailable.
|
|
153
158
|
*/
|
|
154
159
|
getCopyBlobFunc(): ((blob: Blob) => Promise<void>) | null;
|
|
155
|
-
#private;
|
|
156
160
|
}
|
|
161
|
+
export default TinyClipboard;
|
|
157
162
|
//# sourceMappingURL=TinyClipboard.d.mts.map
|
|
@@ -1,32 +1,19 @@
|
|
|
1
|
-
export default TinyColorConverter;
|
|
2
1
|
/**
|
|
3
2
|
* Represents a color in RGBA format.
|
|
4
3
|
* Each element must be a number between 0 and 255.
|
|
5
4
|
* The fourth value represents the alpha (transparency) channel.
|
|
5
|
+
*
|
|
6
|
+
* @typedef {number[]} RgbaColor
|
|
7
|
+
* @property {number} 0 - Red component (0–255)
|
|
8
|
+
* @property {number} 1 - Green component (0–255)
|
|
9
|
+
* @property {number} 2 - Blue component (0–255)
|
|
10
|
+
* @property {number} 3 - Alpha component (0–255)
|
|
6
11
|
*/
|
|
7
12
|
export type RgbaColor = number[];
|
|
8
|
-
/**
|
|
9
|
-
* Represents a color in RGB format.
|
|
10
|
-
* Each element must be a number between 0 and 255.
|
|
11
|
-
*/
|
|
12
13
|
export type RgbColor = number[];
|
|
13
|
-
/**
|
|
14
|
-
* Represents a color in HSLA format.
|
|
15
|
-
* The fourth value represents the alpha (transparency) channel.
|
|
16
|
-
*/
|
|
17
14
|
export type HslaColor = number[];
|
|
18
|
-
/**
|
|
19
|
-
* Represents a color in HSL format.
|
|
20
|
-
*/
|
|
21
15
|
export type HslColor = number[];
|
|
22
|
-
/**
|
|
23
|
-
* Represents a hex color.
|
|
24
|
-
*/
|
|
25
16
|
export type HexColor = string;
|
|
26
|
-
/**
|
|
27
|
-
* A union type representing various accepted color formats.
|
|
28
|
-
* Can be a hex color string, a numeric value, or an array-based RGB/RGBA representation.
|
|
29
|
-
*/
|
|
30
17
|
export type ColorTypes = HexColor | number | RgbColor | RgbaColor;
|
|
31
18
|
export type RgbaResult = {
|
|
32
19
|
/**
|
|
@@ -80,17 +67,6 @@ export type HslResult = {
|
|
|
80
67
|
*/
|
|
81
68
|
l: number;
|
|
82
69
|
};
|
|
83
|
-
/**
|
|
84
|
-
* Represents a color in RGBA format.
|
|
85
|
-
* Each element must be a number between 0 and 255.
|
|
86
|
-
* The fourth value represents the alpha (transparency) channel.
|
|
87
|
-
*
|
|
88
|
-
* @typedef {number[]} RgbaColor
|
|
89
|
-
* @property {number} 0 - Red component (0–255)
|
|
90
|
-
* @property {number} 1 - Green component (0–255)
|
|
91
|
-
* @property {number} 2 - Blue component (0–255)
|
|
92
|
-
* @property {number} 3 - Alpha component (0–255)
|
|
93
|
-
*/
|
|
94
70
|
/**
|
|
95
71
|
* Represents a color in RGB format.
|
|
96
72
|
* Each element must be a number between 0 and 255.
|
|
@@ -156,6 +132,7 @@ export type HslResult = {
|
|
|
156
132
|
* A class that allows converting colors between all common formats.
|
|
157
133
|
*/
|
|
158
134
|
declare class TinyColorConverter {
|
|
135
|
+
#private;
|
|
159
136
|
/**
|
|
160
137
|
* Generates a smooth gradient of colors based on sine wave patterns.
|
|
161
138
|
*
|
|
@@ -392,6 +369,6 @@ declare class TinyColorConverter {
|
|
|
392
369
|
* @returns {ColorTypes}
|
|
393
370
|
*/
|
|
394
371
|
getOriginal(): ColorTypes;
|
|
395
|
-
#private;
|
|
396
372
|
}
|
|
373
|
+
export default TinyColorConverter;
|
|
397
374
|
//# sourceMappingURL=TinyColorConverter.d.mts.map
|