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,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* A function that encodes a value into a serializable JSON-compatible format.
|
|
4
|
-
*/
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
5
2
|
export type EncodeFn = (value: any, encodeSpecialJson: encodeSpecialJson) => any;
|
|
6
|
-
/**
|
|
7
|
-
* An object that defines how to check and decode a specific serialized type.
|
|
8
|
-
*/
|
|
9
3
|
export type DecodeFn = {
|
|
10
4
|
/**
|
|
11
5
|
* - Checks if the value matches the custom encoded structure.
|
|
@@ -16,25 +10,8 @@ export type DecodeFn = {
|
|
|
16
10
|
*/
|
|
17
11
|
decode: (value: any, decodeSpecialJson: decodeSpecialJson) => any;
|
|
18
12
|
};
|
|
19
|
-
/**
|
|
20
|
-
* Encodes extended JSON-compatible structures recursively.
|
|
21
|
-
*/
|
|
22
13
|
export type encodeSpecialJson = (value: any) => any;
|
|
23
|
-
/**
|
|
24
|
-
* Decodes extended JSON-compatible structures recursively.
|
|
25
|
-
*/
|
|
26
14
|
export type decodeSpecialJson = (value: any) => any;
|
|
27
|
-
/**
|
|
28
|
-
* Represents a value that can be safely stored and restored using JSON in `localStorage`,
|
|
29
|
-
* including structures like arrays, plain objects, Map and Set.
|
|
30
|
-
*
|
|
31
|
-
* - `Record<string|number|symbol, any>` → plain object (e.g., `{ key: value }`)
|
|
32
|
-
* - `any[]` → array of any JSON-serializable values
|
|
33
|
-
* - `Map<string|number|symbol, any>` → converted to `{ __map__: true, data: [[k, v], ...] }`
|
|
34
|
-
* - `Set<any>` → converted to `{ __set__: true, data: [v1, v2, ...] }`
|
|
35
|
-
*
|
|
36
|
-
* These conversions allow complex structures to be restored after JSON serialization.
|
|
37
|
-
*/
|
|
38
15
|
export type LocalStorageJsonValue = (Record<string | number | symbol, any> | any[] | Map<string | number | symbol, any> | Set<any>);
|
|
39
16
|
/**
|
|
40
17
|
* A function that encodes a value into a serializable JSON-compatible format.
|
|
@@ -100,7 +77,8 @@ export type LocalStorageJsonValue = (Record<string | number | symbol, any> | any
|
|
|
100
77
|
*
|
|
101
78
|
* This class is suitable for applications that require structured persistence in the browser.
|
|
102
79
|
*/
|
|
103
|
-
declare class TinyLocalStorage extends EventEmitter
|
|
80
|
+
declare class TinyLocalStorage extends EventEmitter {
|
|
81
|
+
#private;
|
|
104
82
|
/**
|
|
105
83
|
* Checks whether a JSON-serializable type is already registered.
|
|
106
84
|
*
|
|
@@ -128,8 +106,12 @@ declare class TinyLocalStorage extends EventEmitter<any> {
|
|
|
128
106
|
* @throws {Error} Throws an error if the type is frozen and cannot be unregistered.
|
|
129
107
|
*/
|
|
130
108
|
static deleteJsonType(type: any): boolean;
|
|
131
|
-
|
|
132
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Gets the current destruction status of the instance.
|
|
111
|
+
*
|
|
112
|
+
* @returns {boolean} True if the instance is destroyed, false otherwise.
|
|
113
|
+
*/
|
|
114
|
+
get destroyed(): boolean;
|
|
133
115
|
/**
|
|
134
116
|
* Initializes the TinyLocalStorage instance and sets up cross-tab sync.
|
|
135
117
|
*
|
|
@@ -137,12 +119,6 @@ declare class TinyLocalStorage extends EventEmitter<any> {
|
|
|
137
119
|
* @param {string} [dbName] - Unique database name.
|
|
138
120
|
*/
|
|
139
121
|
constructor(dbName?: string);
|
|
140
|
-
/**
|
|
141
|
-
* Gets the current destruction status of the instance.
|
|
142
|
-
*
|
|
143
|
-
* @returns {boolean} True if the instance is destroyed, false otherwise.
|
|
144
|
-
*/
|
|
145
|
-
get destroyed(): boolean;
|
|
146
122
|
/**
|
|
147
123
|
* Updates the version of the storage and triggers migration if needed.
|
|
148
124
|
*
|
|
@@ -195,7 +171,7 @@ declare class TinyLocalStorage extends EventEmitter<any> {
|
|
|
195
171
|
* @param {'array'|'obj'|'map'|'set'|'null'} [defaultData] - Default fallback format if value is invalid.
|
|
196
172
|
* @returns {LocalStorageJsonValue|null} The parsed object or fallback.
|
|
197
173
|
*/
|
|
198
|
-
getJson(name: string, defaultData?:
|
|
174
|
+
getJson(name: string, defaultData?: 'array' | 'obj' | 'map' | 'set' | 'null'): LocalStorageJsonValue | null;
|
|
199
175
|
/**
|
|
200
176
|
* Stores a Date in localStorage.
|
|
201
177
|
* @param {string} name
|
|
@@ -322,7 +298,6 @@ declare class TinyLocalStorage extends EventEmitter<any> {
|
|
|
322
298
|
* Destroys the storage instance by removing the storage event listener.
|
|
323
299
|
*/
|
|
324
300
|
destroy(): void;
|
|
325
|
-
#private;
|
|
326
301
|
}
|
|
327
|
-
|
|
302
|
+
export default TinyLocalStorage;
|
|
328
303
|
//# sourceMappingURL=TinyLocalStorage.d.mts.map
|
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Performs defuzzification using the Centroid (Center of Gravity) method.
|
|
3
|
+
* @param {Object.<string, number>} fuzzyOutput - Results from rule evaluation.
|
|
4
|
+
* @param {FuzzySet[]} outputSets - The sets defining the output range.
|
|
5
|
+
* @param {number} [step=0.5] - Resolution of the integral approximation.
|
|
6
|
+
* @returns {number} The crisp output value.
|
|
7
|
+
*/
|
|
8
|
+
export declare const defuzzifyCentroid: (fuzzyOutput: Record<string, number>, outputSets: FuzzySet[], step?: number) => number;
|
|
9
|
+
/**
|
|
10
|
+
* Utility to calculate fuzzy membership using a trapezoidal shape safely.
|
|
11
|
+
* @param {number} value - The input value to check.
|
|
12
|
+
* @param {number} a - Start of the rise.
|
|
13
|
+
* @param {number} b - End of the rise (start of plateau).
|
|
14
|
+
* @param {number} c - Start of the fall (end of plateau).
|
|
15
|
+
* @param {number} d - End of the fall.
|
|
16
|
+
* @param {boolean} [optimize=false] - Optimizes performance by skipping math for absolute bounds.
|
|
17
|
+
* @returns {number} Degree of membership [0, 1].
|
|
18
|
+
*/
|
|
19
|
+
export declare const trapezoid: (value: number, a: number, b: number, c: number, d: number, optimize?: boolean) => number;
|
|
5
20
|
/**
|
|
6
21
|
* Represents a single Membership Function (Trapezoidal).
|
|
7
22
|
*/
|
|
8
|
-
|
|
23
|
+
declare class FuzzySet {
|
|
24
|
+
#private;
|
|
9
25
|
/**
|
|
10
26
|
* Utility to calculate fuzzy membership using a trapezoidal shape.
|
|
11
27
|
* @param {number} value - The input value to check.
|
|
@@ -17,6 +33,18 @@ export class FuzzySet {
|
|
|
17
33
|
* @returns {number} Degree of membership [0, 1].
|
|
18
34
|
*/
|
|
19
35
|
static trapezoid(value: number, a: number, b: number, c: number, d: number, optimize?: boolean): number;
|
|
36
|
+
get name(): string;
|
|
37
|
+
set name(value: string);
|
|
38
|
+
get a(): number;
|
|
39
|
+
set a(value: number);
|
|
40
|
+
get b(): number;
|
|
41
|
+
set b(value: number);
|
|
42
|
+
get c(): number;
|
|
43
|
+
set c(value: number);
|
|
44
|
+
get d(): number;
|
|
45
|
+
set d(value: number);
|
|
46
|
+
get optimize(): boolean;
|
|
47
|
+
set optimize(value: boolean);
|
|
20
48
|
/**
|
|
21
49
|
* @param {string} name - Name of the set (e.g., "Hot").
|
|
22
50
|
* @param {number} a - Left foot.
|
|
@@ -26,30 +54,18 @@ export class FuzzySet {
|
|
|
26
54
|
* @param {boolean} [optimize=false] - Enables performance optimization.
|
|
27
55
|
*/
|
|
28
56
|
constructor(name: string, a: number, b: number, c: number, d: number, optimize?: boolean);
|
|
29
|
-
set name(value: string);
|
|
30
|
-
get name(): string;
|
|
31
|
-
set a(value: number);
|
|
32
|
-
get a(): number;
|
|
33
|
-
set b(value: number);
|
|
34
|
-
get b(): number;
|
|
35
|
-
set c(value: number);
|
|
36
|
-
get c(): number;
|
|
37
|
-
set d(value: number);
|
|
38
|
-
get d(): number;
|
|
39
|
-
set optimize(value: boolean);
|
|
40
|
-
get optimize(): boolean;
|
|
41
57
|
/**
|
|
42
58
|
* Calculates the membership degree.
|
|
43
59
|
* @param {number} x - Crisp input.
|
|
44
60
|
* @returns {number}
|
|
45
61
|
*/
|
|
46
62
|
calculate(x: number): number;
|
|
47
|
-
#private;
|
|
48
63
|
}
|
|
49
64
|
/**
|
|
50
65
|
* The Inference Engine handles linguistic variables and defuzzification.
|
|
51
66
|
*/
|
|
52
|
-
|
|
67
|
+
declare class MamdaniInferenceSystem {
|
|
68
|
+
#private;
|
|
53
69
|
/**
|
|
54
70
|
* Registers a linguistic variable and its sets.
|
|
55
71
|
* @param {string} name - Variable name (e.g., "temperature").
|
|
@@ -80,9 +96,7 @@ export class MamdaniInferenceSystem {
|
|
|
80
96
|
* @param {number} value
|
|
81
97
|
* @returns {Object.<string, number>}
|
|
82
98
|
*/
|
|
83
|
-
fuzzify(varName: string, value: number):
|
|
84
|
-
[x: string]: number;
|
|
85
|
-
};
|
|
86
|
-
#private;
|
|
99
|
+
fuzzify(varName: string, value: number): Record<string, number>;
|
|
87
100
|
}
|
|
101
|
+
export { FuzzySet, MamdaniInferenceSystem };
|
|
88
102
|
//# sourceMappingURL=TinyMamdaniInferenceSystem.d.mts.map
|
|
@@ -7,9 +7,10 @@ var utils = require('./utils.cjs');
|
|
|
7
7
|
const checkDestroy = utils.createCheckDestroyed('TinyMediaPlayer');
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* @typedef {import('../basics/mediaContent.mjs').
|
|
10
|
+
* @typedef {import('../basics/mediaContent.mjs').PictureDataType} PictureDataType
|
|
11
|
+
* @typedef {import('../basics/mediaContent.mjs').MediaContent<PictureDataType>} MediaContent
|
|
11
12
|
* @typedef {import('../basics/mediaContent.mjs').MediaContentBase} MediaContentBase
|
|
12
|
-
* @typedef {import('../basics/mediaContent.mjs').MediaContentMetadata} MediaContentMetadata
|
|
13
|
+
* @typedef {import('../basics/mediaContent.mjs').MediaContentMetadata<PictureDataType>} MediaContentMetadata
|
|
13
14
|
* @typedef {import('../basics/mediaContent.mjs').ParseMediaContentMetadata} ParseMediaContentMetadata
|
|
14
15
|
* @typedef {import('../basics/mediaContent.mjs').LoadingMediaProgress} LoadingMediaProgress
|
|
15
16
|
* @typedef {import('../basics/mediaContent.mjs').MediaLoadingErrorData} MediaLoadingErrorData
|
|
@@ -17,6 +18,7 @@ const checkDestroy = utils.createCheckDestroyed('TinyMediaPlayer');
|
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
20
|
/**
|
|
21
|
+
* The loop configuration modes.
|
|
20
22
|
* @typedef {'NONE' | 'TRACK' | 'PLAYLIST'} LoopModeType
|
|
21
23
|
*/
|
|
22
24
|
|
|
@@ -673,7 +675,7 @@ class TinyMediaPlayer extends events.EventEmitter {
|
|
|
673
675
|
|
|
674
676
|
/**
|
|
675
677
|
* Searches the playlist for tracks matching a string query or a custom evaluation function.
|
|
676
|
-
* @param {string |
|
|
678
|
+
* @param {string | ((content: MediaContent) => boolean)} query - The search string (checked against title, artist, album) or a callback returning a boolean.
|
|
677
679
|
* @returns {SearchResult[]} An array containing the matched tracks and their corresponding indices.
|
|
678
680
|
* @throws {TypeError} If the query is neither a string nor a function.
|
|
679
681
|
*/
|
|
@@ -1,28 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
10
|
-
|
|
11
|
-
* Configuration options for initializing the UniversalMediaPlayer.
|
|
12
|
-
*/
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
export type PictureDataType = import('../basics/mediaContent.mjs').PictureDataType;
|
|
3
|
+
export type MediaContent = import('../basics/mediaContent.mjs').MediaContent<PictureDataType>;
|
|
4
|
+
export type MediaContentBase = import('../basics/mediaContent.mjs').MediaContentBase;
|
|
5
|
+
export type MediaContentMetadata = import('../basics/mediaContent.mjs').MediaContentMetadata<PictureDataType>;
|
|
6
|
+
export type ParseMediaContentMetadata = import('../basics/mediaContent.mjs').ParseMediaContentMetadata;
|
|
7
|
+
export type LoadingMediaProgress = import('../basics/mediaContent.mjs').LoadingMediaProgress;
|
|
8
|
+
export type MediaLoadingErrorData = import('../basics/mediaContent.mjs').MediaLoadingErrorData;
|
|
9
|
+
export type UnknownArtistGetter = import('../basics/mediaContent.mjs').UnknownArtistGetter;
|
|
10
|
+
export type LoopModeType = 'NONE' | 'TRACK' | 'PLAYLIST';
|
|
13
11
|
export type TinyMediaPlayerOptions = {
|
|
14
12
|
/**
|
|
15
13
|
* - Whether to automatically save the volume in localStorage.
|
|
16
14
|
*/
|
|
17
|
-
persistVolume?: boolean
|
|
15
|
+
persistVolume?: boolean;
|
|
18
16
|
/**
|
|
19
17
|
* - The specific key name used for localStorage cache.
|
|
20
18
|
*/
|
|
21
|
-
volumeStorageKey?: string
|
|
19
|
+
volumeStorageKey?: string;
|
|
22
20
|
};
|
|
23
21
|
/**
|
|
24
|
-
*
|
|
22
|
+
* @typedef {import('../basics/mediaContent.mjs').PictureDataType} PictureDataType
|
|
23
|
+
* @typedef {import('../basics/mediaContent.mjs').MediaContent<PictureDataType>} MediaContent
|
|
24
|
+
* @typedef {import('../basics/mediaContent.mjs').MediaContentBase} MediaContentBase
|
|
25
|
+
* @typedef {import('../basics/mediaContent.mjs').MediaContentMetadata<PictureDataType>} MediaContentMetadata
|
|
26
|
+
* @typedef {import('../basics/mediaContent.mjs').ParseMediaContentMetadata} ParseMediaContentMetadata
|
|
27
|
+
* @typedef {import('../basics/mediaContent.mjs').LoadingMediaProgress} LoadingMediaProgress
|
|
28
|
+
* @typedef {import('../basics/mediaContent.mjs').MediaLoadingErrorData} MediaLoadingErrorData
|
|
29
|
+
* @typedef {import('../basics/mediaContent.mjs').UnknownArtistGetter} UnknownArtistGetter
|
|
25
30
|
*/
|
|
31
|
+
/**
|
|
32
|
+
* The loop configuration modes.
|
|
33
|
+
* @typedef {'NONE' | 'TRACK' | 'PLAYLIST'} LoopModeType
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Configuration options for initializing the UniversalMediaPlayer.
|
|
37
|
+
* @typedef {Object} TinyMediaPlayerOptions
|
|
38
|
+
* @property {boolean} [persistVolume=false] - Whether to automatically save the volume in localStorage.
|
|
39
|
+
* @property {string} [volumeStorageKey='universal_media_player_volume'] - The specific key name used for localStorage cache.
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* Interface definition for a Media Provider Adapter.
|
|
43
|
+
* All specific API wrappers must extend and implement this class.
|
|
44
|
+
* @abstract
|
|
45
|
+
*/
|
|
46
|
+
declare class BaseMediaAdapter {
|
|
47
|
+
constructor();
|
|
48
|
+
/**
|
|
49
|
+
* Determines if this adapter can play the provided content.
|
|
50
|
+
* @param {MediaContent} content - The media content to evaluate.
|
|
51
|
+
* @returns {boolean} True if the adapter can handle the content, false otherwise.
|
|
52
|
+
*/
|
|
53
|
+
canHandle(content: MediaContent): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Starts or resumes playback of the provided content.
|
|
56
|
+
* @param {MediaContent} content - The media content to play.
|
|
57
|
+
* @returns {Promise<void>}
|
|
58
|
+
*/
|
|
59
|
+
play(content: MediaContent): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Pauses the current playback.
|
|
62
|
+
* @returns {Promise<void>}
|
|
63
|
+
*/
|
|
64
|
+
pause(): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Stops the playback completely and resets the internal platform state.
|
|
67
|
+
* @returns {Promise<void>}
|
|
68
|
+
*/
|
|
69
|
+
stop(): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Seeks to a specific time in the media timeline.
|
|
72
|
+
* @param {number} timeMs - The target time in milliseconds.
|
|
73
|
+
* @returns {Promise<void>}
|
|
74
|
+
*/
|
|
75
|
+
seek(timeMs: number): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Retrieves the current playback time from the underlying API.
|
|
78
|
+
* @returns {number} The current time in milliseconds.
|
|
79
|
+
*/
|
|
80
|
+
getCurrentTime(): number;
|
|
81
|
+
/**
|
|
82
|
+
* Sets the playback volume for the underlying API.
|
|
83
|
+
* @param {number} volume - The volume level from 0.0 to 1.0.
|
|
84
|
+
* @returns {void}
|
|
85
|
+
*/
|
|
86
|
+
setVolume(volume: number): void;
|
|
87
|
+
}
|
|
26
88
|
export type SearchResult = {
|
|
27
89
|
/**
|
|
28
90
|
* - The matched media content.
|
|
@@ -42,24 +104,20 @@ export type SearchResult = {
|
|
|
42
104
|
/**
|
|
43
105
|
* A universal media player manager capable of orchestrating multiple API adapters.
|
|
44
106
|
*/
|
|
45
|
-
declare class TinyMediaPlayer extends EventEmitter
|
|
107
|
+
declare class TinyMediaPlayer extends EventEmitter {
|
|
108
|
+
#private;
|
|
46
109
|
static BaseMediaAdapter: typeof BaseMediaAdapter;
|
|
47
110
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
111
|
+
* Gets the current value used to represent unknown artists.
|
|
112
|
+
* @returns {UnknownArtistGetter}
|
|
50
113
|
*/
|
|
51
|
-
static
|
|
114
|
+
static get unknownArtist(): UnknownArtistGetter;
|
|
52
115
|
/**
|
|
53
116
|
* Sets the value used to represent unknown artists.
|
|
54
117
|
* @param {UnknownArtistGetter} value - A string or a function that returns a string.
|
|
55
118
|
* @throws {TypeError} If the value is neither a string nor a function.
|
|
56
119
|
*/
|
|
57
120
|
static set unknownArtist(value: UnknownArtistGetter);
|
|
58
|
-
/**
|
|
59
|
-
* Gets the current value used to represent unknown artists.
|
|
60
|
-
* @returns {UnknownArtistGetter}
|
|
61
|
-
*/
|
|
62
|
-
static get unknownArtist(): UnknownArtistGetter;
|
|
63
121
|
/**
|
|
64
122
|
* A Static Factory Method that prepares a MediaContent object by
|
|
65
123
|
* extracting metadata from an audio source.
|
|
@@ -81,14 +139,14 @@ declare class TinyMediaPlayer extends EventEmitter<any> {
|
|
|
81
139
|
id?: string;
|
|
82
140
|
weight?: number;
|
|
83
141
|
}, parseFile?: ParseMediaContentMetadata, callbacks?: {
|
|
84
|
-
onProgress?: (
|
|
85
|
-
onError?: (
|
|
142
|
+
onProgress?: (progress: LoadingMediaProgress) => void;
|
|
143
|
+
onError?: (error: MediaLoadingErrorData) => void;
|
|
86
144
|
}): Promise<MediaContent>;
|
|
145
|
+
get destroyed(): boolean;
|
|
87
146
|
/**
|
|
88
147
|
* @param {TinyMediaPlayerOptions} [options={}] - Configuration parameters for the player.
|
|
89
148
|
*/
|
|
90
149
|
constructor(options?: TinyMediaPlayerOptions);
|
|
91
|
-
get destroyed(): boolean;
|
|
92
150
|
/**
|
|
93
151
|
* Calculates a random index based on the weighted probability of each track,
|
|
94
152
|
* strictly excluding the currently active track to prevent immediate repetition.
|
|
@@ -96,59 +154,59 @@ declare class TinyMediaPlayer extends EventEmitter<any> {
|
|
|
96
154
|
* @private
|
|
97
155
|
*/
|
|
98
156
|
private _getWeightedRandomIndex;
|
|
157
|
+
/** @returns {MediaContent[]} A shallow copy of the current playlist. */
|
|
158
|
+
get playlist(): MediaContent[];
|
|
99
159
|
/**
|
|
100
160
|
* @param {MediaContent[]} value - The new playlist array.
|
|
101
161
|
* @throws {TypeError} If the value is not an array.
|
|
102
162
|
*/
|
|
103
163
|
set playlist(value: MediaContent[]);
|
|
104
|
-
/** @returns {
|
|
105
|
-
get
|
|
164
|
+
/** @returns {number} The current active index in the playlist. */
|
|
165
|
+
get currentIndex(): number;
|
|
106
166
|
/**
|
|
107
167
|
* @param {number} value - The index to set as current.
|
|
108
168
|
* @throws {TypeError} If the value is not a number.
|
|
109
169
|
* @throws {RangeError} If the index is out of the playlist bounds (unless -1 for empty).
|
|
110
170
|
*/
|
|
111
171
|
set currentIndex(value: number);
|
|
112
|
-
/** @returns {
|
|
113
|
-
get
|
|
172
|
+
/** @returns {LoopModeType} The current loop configuration. */
|
|
173
|
+
get loopMode(): LoopModeType;
|
|
114
174
|
/**
|
|
115
175
|
* @param {LoopModeType} value - The desired loop mode.
|
|
116
176
|
* @throws {TypeError} If the value is not a valid LoopModeType.
|
|
117
177
|
*/
|
|
118
178
|
set loopMode(value: LoopModeType);
|
|
119
|
-
/** @returns {
|
|
120
|
-
get
|
|
179
|
+
/** @returns {boolean} The current random mode status. */
|
|
180
|
+
get isRandom(): boolean;
|
|
121
181
|
/**
|
|
122
182
|
* @param {boolean} value - True to enable random playback, false otherwise.
|
|
123
183
|
* @throws {TypeError} If the value is not a boolean.
|
|
124
184
|
*/
|
|
125
185
|
set isRandom(value: boolean);
|
|
126
|
-
/** @returns {boolean} The current random mode status. */
|
|
127
|
-
get isRandom(): boolean;
|
|
128
186
|
/** @returns {boolean} True if media is actively playing. */
|
|
129
187
|
get isPlaying(): boolean;
|
|
188
|
+
/** @returns {number} The current volume level (0.0 to 1.0). */
|
|
189
|
+
get volume(): number;
|
|
130
190
|
/**
|
|
131
191
|
* @param {number} value - The volume level to set.
|
|
132
192
|
* @throws {TypeError} If the value is not a number.
|
|
133
193
|
* @throws {RangeError} If the value is outside the 0.0 to 1.0 range.
|
|
134
194
|
*/
|
|
135
195
|
set volume(value: number);
|
|
136
|
-
/** @returns {
|
|
137
|
-
get
|
|
196
|
+
/** @returns {boolean} Whether the volume cache is currently enabled. */
|
|
197
|
+
get persistVolume(): boolean;
|
|
138
198
|
/**
|
|
139
199
|
* @param {boolean} value - True to save volume dynamically to localStorage.
|
|
140
200
|
* @throws {TypeError} If the value is not a boolean.
|
|
141
201
|
*/
|
|
142
202
|
set persistVolume(value: boolean);
|
|
143
|
-
/** @returns {
|
|
144
|
-
get
|
|
203
|
+
/** @returns {string} The localStorage key used for volume caching. */
|
|
204
|
+
get volumeStorageKey(): string;
|
|
145
205
|
/**
|
|
146
206
|
* @param {string} value - The custom storage key string.
|
|
147
207
|
* @throws {TypeError} If the value is not a string or is empty.
|
|
148
208
|
*/
|
|
149
209
|
set volumeStorageKey(value: string);
|
|
150
|
-
/** @returns {string} The localStorage key used for volume caching. */
|
|
151
|
-
get volumeStorageKey(): string;
|
|
152
210
|
/**
|
|
153
211
|
* Registers a new media API adapter.
|
|
154
212
|
* @param {string} id - Unique identifier for the platform (e.g., 'youtube', 'spotify').
|
|
@@ -188,11 +246,11 @@ declare class TinyMediaPlayer extends EventEmitter<any> {
|
|
|
188
246
|
removeTrack(index: number): Promise<void>;
|
|
189
247
|
/**
|
|
190
248
|
* Searches the playlist for tracks matching a string query or a custom evaluation function.
|
|
191
|
-
* @param {string |
|
|
249
|
+
* @param {string | ((content: MediaContent) => boolean)} query - The search string (checked against title, artist, album) or a callback returning a boolean.
|
|
192
250
|
* @returns {SearchResult[]} An array containing the matched tracks and their corresponding indices.
|
|
193
251
|
* @throws {TypeError} If the query is neither a string nor a function.
|
|
194
252
|
*/
|
|
195
|
-
searchTrack(query: string | ((
|
|
253
|
+
searchTrack(query: string | ((content: MediaContent) => boolean)): SearchResult[];
|
|
196
254
|
/**
|
|
197
255
|
* Clears the entire playlist and stops playback.
|
|
198
256
|
*/
|
|
@@ -246,71 +304,6 @@ declare class TinyMediaPlayer extends EventEmitter<any> {
|
|
|
246
304
|
* @returns {Promise<void>} A promise that resolves when the destruction sequence is complete.
|
|
247
305
|
*/
|
|
248
306
|
destroy(): Promise<void>;
|
|
249
|
-
#private;
|
|
250
|
-
}
|
|
251
|
-
import { EventEmitter } from 'events';
|
|
252
|
-
/**
|
|
253
|
-
* @typedef {import('../basics/mediaContent.mjs').MediaContent} MediaContent
|
|
254
|
-
* @typedef {import('../basics/mediaContent.mjs').MediaContentBase} MediaContentBase
|
|
255
|
-
* @typedef {import('../basics/mediaContent.mjs').MediaContentMetadata} MediaContentMetadata
|
|
256
|
-
* @typedef {import('../basics/mediaContent.mjs').ParseMediaContentMetadata} ParseMediaContentMetadata
|
|
257
|
-
* @typedef {import('../basics/mediaContent.mjs').LoadingMediaProgress} LoadingMediaProgress
|
|
258
|
-
* @typedef {import('../basics/mediaContent.mjs').MediaLoadingErrorData} MediaLoadingErrorData
|
|
259
|
-
* @typedef {import('../basics/mediaContent.mjs').UnknownArtistGetter} UnknownArtistGetter
|
|
260
|
-
*/
|
|
261
|
-
/**
|
|
262
|
-
* @typedef {'NONE' | 'TRACK' | 'PLAYLIST'} LoopModeType
|
|
263
|
-
*/
|
|
264
|
-
/**
|
|
265
|
-
* Configuration options for initializing the UniversalMediaPlayer.
|
|
266
|
-
* @typedef {Object} TinyMediaPlayerOptions
|
|
267
|
-
* @property {boolean} [persistVolume=false] - Whether to automatically save the volume in localStorage.
|
|
268
|
-
* @property {string} [volumeStorageKey='universal_media_player_volume'] - The specific key name used for localStorage cache.
|
|
269
|
-
*/
|
|
270
|
-
/**
|
|
271
|
-
* Interface definition for a Media Provider Adapter.
|
|
272
|
-
* All specific API wrappers must extend and implement this class.
|
|
273
|
-
* @abstract
|
|
274
|
-
*/
|
|
275
|
-
declare class BaseMediaAdapter {
|
|
276
|
-
/**
|
|
277
|
-
* Determines if this adapter can play the provided content.
|
|
278
|
-
* @param {MediaContent} content - The media content to evaluate.
|
|
279
|
-
* @returns {boolean} True if the adapter can handle the content, false otherwise.
|
|
280
|
-
*/
|
|
281
|
-
canHandle(content: MediaContent): boolean;
|
|
282
|
-
/**
|
|
283
|
-
* Starts or resumes playback of the provided content.
|
|
284
|
-
* @param {MediaContent} content - The media content to play.
|
|
285
|
-
* @returns {Promise<void>}
|
|
286
|
-
*/
|
|
287
|
-
play(content: MediaContent): Promise<void>;
|
|
288
|
-
/**
|
|
289
|
-
* Pauses the current playback.
|
|
290
|
-
* @returns {Promise<void>}
|
|
291
|
-
*/
|
|
292
|
-
pause(): Promise<void>;
|
|
293
|
-
/**
|
|
294
|
-
* Stops the playback completely and resets the internal platform state.
|
|
295
|
-
* @returns {Promise<void>}
|
|
296
|
-
*/
|
|
297
|
-
stop(): Promise<void>;
|
|
298
|
-
/**
|
|
299
|
-
* Seeks to a specific time in the media timeline.
|
|
300
|
-
* @param {number} timeMs - The target time in milliseconds.
|
|
301
|
-
* @returns {Promise<void>}
|
|
302
|
-
*/
|
|
303
|
-
seek(timeMs: number): Promise<void>;
|
|
304
|
-
/**
|
|
305
|
-
* Retrieves the current playback time from the underlying API.
|
|
306
|
-
* @returns {number} The current time in milliseconds.
|
|
307
|
-
*/
|
|
308
|
-
getCurrentTime(): number;
|
|
309
|
-
/**
|
|
310
|
-
* Sets the playback volume for the underlying API.
|
|
311
|
-
* @param {number} volume - The volume level from 0.0 to 1.0.
|
|
312
|
-
* @returns {void}
|
|
313
|
-
*/
|
|
314
|
-
setVolume(volume: number): void;
|
|
315
307
|
}
|
|
308
|
+
export default TinyMediaPlayer;
|
|
316
309
|
//# sourceMappingURL=TinyMediaPlayer.d.mts.map
|
|
@@ -3,15 +3,17 @@ import { getMediaContentBase, getMediaContentMetadata, parseMediaMetadata, valMe
|
|
|
3
3
|
import { createCheckDestroyed } from './utils.mjs';
|
|
4
4
|
const checkDestroy = createCheckDestroyed('TinyMediaPlayer');
|
|
5
5
|
/**
|
|
6
|
-
* @typedef {import('../basics/mediaContent.mjs').
|
|
6
|
+
* @typedef {import('../basics/mediaContent.mjs').PictureDataType} PictureDataType
|
|
7
|
+
* @typedef {import('../basics/mediaContent.mjs').MediaContent<PictureDataType>} MediaContent
|
|
7
8
|
* @typedef {import('../basics/mediaContent.mjs').MediaContentBase} MediaContentBase
|
|
8
|
-
* @typedef {import('../basics/mediaContent.mjs').MediaContentMetadata} MediaContentMetadata
|
|
9
|
+
* @typedef {import('../basics/mediaContent.mjs').MediaContentMetadata<PictureDataType>} MediaContentMetadata
|
|
9
10
|
* @typedef {import('../basics/mediaContent.mjs').ParseMediaContentMetadata} ParseMediaContentMetadata
|
|
10
11
|
* @typedef {import('../basics/mediaContent.mjs').LoadingMediaProgress} LoadingMediaProgress
|
|
11
12
|
* @typedef {import('../basics/mediaContent.mjs').MediaLoadingErrorData} MediaLoadingErrorData
|
|
12
13
|
* @typedef {import('../basics/mediaContent.mjs').UnknownArtistGetter} UnknownArtistGetter
|
|
13
14
|
*/
|
|
14
15
|
/**
|
|
16
|
+
* The loop configuration modes.
|
|
15
17
|
* @typedef {'NONE' | 'TRACK' | 'PLAYLIST'} LoopModeType
|
|
16
18
|
*/
|
|
17
19
|
/**
|
|
@@ -600,7 +602,7 @@ class TinyMediaPlayer extends EventEmitter {
|
|
|
600
602
|
}
|
|
601
603
|
/**
|
|
602
604
|
* Searches the playlist for tracks matching a string query or a custom evaluation function.
|
|
603
|
-
* @param {string |
|
|
605
|
+
* @param {string | ((content: MediaContent) => boolean)} query - The search string (checked against title, artist, album) or a callback returning a boolean.
|
|
604
606
|
* @returns {SearchResult[]} An array containing the matched tracks and their corresponding indices.
|
|
605
607
|
* @throws {TypeError} If the query is neither a string nor a function.
|
|
606
608
|
*/
|