tiny-essentials 1.28.1 → 1.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog/1/28/2.md +43 -0
- package/changelog/1/28/3.md +9 -0
- package/dist/_/numbers.d.mts +91 -16
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyMediaPlayer.min.js +1 -1
- package/dist/v1/TinyRadioFm.min.js +1 -1
- package/dist/v1/basics/array.d.mts +14 -14
- package/dist/v1/basics/clock.cjs +15 -15
- package/dist/v1/basics/clock.d.mts +21 -21
- package/dist/v1/basics/clock.mjs +15 -15
- package/dist/v1/basics/collision.d.mts +245 -104
- package/dist/v1/basics/deprecated/html.d.mts +33 -33
- package/dist/v1/basics/extendObjType/Buffer.d.mts +1 -1
- package/dist/v1/basics/fullScreen.d.mts +47 -7
- package/dist/v1/basics/html.d.mts +52 -61
- package/dist/v1/basics/index.cjs +2 -0
- package/dist/v1/basics/index.d.mts +11 -67
- package/dist/v1/basics/index.mjs +2 -2
- package/dist/v1/basics/mediaContent.cjs +65 -23
- package/dist/v1/basics/mediaContent.d.mts +144 -73
- package/dist/v1/basics/mediaContent.mjs +65 -23
- package/dist/v1/basics/objChecker.d.mts +2 -2
- package/dist/v1/basics/objFilter.cjs +50 -16
- package/dist/v1/basics/objFilter.d.mts +34 -13
- package/dist/v1/basics/objFilter.mjs +48 -16
- package/dist/v1/basics/simpleMath.d.mts +21 -21
- package/dist/v1/basics/text.d.mts +34 -46
- package/dist/v1/build/ColorSafeStringify.d.mts +1 -1
- package/dist/v1/build/TinyAdvancedRaffle.d.mts +1 -1
- package/dist/v1/build/TinyAfterScrollWatcher.d.mts +1 -1
- package/dist/v1/build/TinyAnalogClock.d.mts +1 -1
- package/dist/v1/build/TinyArrayComparator.d.mts +1 -1
- package/dist/v1/build/TinyArrayPaginator.d.mts +1 -1
- package/dist/v1/build/TinyClassManager.d.mts +1 -1
- package/dist/v1/build/TinyClipboard.d.mts +1 -1
- package/dist/v1/build/TinyColorConverter.d.mts +1 -1
- package/dist/v1/build/TinyColorValidator.d.mts +1 -1
- package/dist/v1/build/TinyCookieConsent.d.mts +1 -1
- package/dist/v1/build/TinyDayNightCycle.d.mts +1 -1
- package/dist/v1/build/TinyDomReadyManager.d.mts +1 -1
- package/dist/v1/build/TinyDragDropDetector.d.mts +1 -1
- package/dist/v1/build/TinyDragger.d.mts +1 -1
- package/dist/v1/build/TinyElementObserver.d.mts +1 -1
- package/dist/v1/build/TinyGamepad.d.mts +1 -1
- package/dist/v1/build/TinyHtml.d.mts +1 -1
- package/dist/v1/build/TinyI18.d.mts +1 -1
- package/dist/v1/build/TinyIframeEvents.d.mts +1 -1
- package/dist/v1/build/TinyInventory.d.mts +1 -1
- package/dist/v1/build/TinyInventoryTrader.d.mts +1 -1
- package/dist/v1/build/TinyLevelUp.d.mts +1 -1
- package/dist/v1/build/TinyLoadingScreen.d.mts +1 -1
- package/dist/v1/build/TinyLocalStorage.d.mts +1 -1
- package/dist/v1/build/TinyMediaPlayer.d.mts +1 -1
- package/dist/v1/build/TinyNeedBar.d.mts +1 -1
- package/dist/v1/build/TinyNewWinEvents.d.mts +1 -1
- package/dist/v1/build/TinyNotifications.d.mts +1 -1
- package/dist/v1/build/TinyNotifyCenter.d.mts +1 -1
- package/dist/v1/build/TinyPromiseQueue.d.mts +1 -1
- package/dist/v1/build/TinyRadioFm.d.mts +1 -1
- package/dist/v1/build/TinyRateLimiter.d.mts +1 -1
- package/dist/v1/build/TinySimpleDice.d.mts +1 -1
- package/dist/v1/build/TinySmartScroller.d.mts +1 -1
- package/dist/v1/build/TinyTextDiffer.d.mts +1 -1
- package/dist/v1/build/TinyTextRangeEditor.d.mts +1 -1
- package/dist/v1/build/TinyTextarea.d.mts +1 -1
- package/dist/v1/build/TinyTimeout.d.mts +1 -1
- package/dist/v1/build/TinyToastNotify.d.mts +1 -1
- package/dist/v1/build/TinyUploadClicker.d.mts +1 -1
- package/dist/v1/build/UltraRandomMsgGen.d.mts +1 -1
- package/dist/v1/fileManager/asyncFuncs.d.mts +13 -13
- package/dist/v1/fileManager/index.d.mts +3 -29
- package/dist/v1/fileManager/normalFuncs.d.mts +22 -22
- package/dist/v1/index.cjs +2 -0
- package/dist/v1/index.d.mts +53 -139
- package/dist/v1/index.mjs +2 -2
- package/dist/v1/libs/ColorSafeStringify.d.mts +3 -12
- package/dist/v1/libs/TinyAdvancedRaffle.d.mts +60 -103
- package/dist/v1/libs/TinyAfterScrollWatcher.d.mts +11 -18
- package/dist/v1/libs/TinyAnalogClock.d.mts +8 -11
- package/dist/v1/libs/TinyArrayComparator.d.mts +14 -20
- package/dist/v1/libs/TinyArrayPaginator.d.mts +22 -26
- package/dist/v1/libs/TinyClassManager/TinyPluginInliner.d.mts +8 -8
- package/dist/v1/libs/TinyClassManager.cjs +5 -7
- package/dist/v1/libs/TinyClassManager.d.mts +16 -16
- package/dist/v1/libs/TinyClassManager.mjs +5 -6
- package/dist/v1/libs/TinyClipboard.d.mts +8 -3
- package/dist/v1/libs/TinyColorConverter.d.mts +8 -31
- package/dist/v1/libs/TinyColorValidator.d.mts +145 -184
- package/dist/v1/libs/TinyCookieConsent.d.mts +17 -17
- package/dist/v1/libs/TinyDayNightCycle.d.mts +85 -110
- package/dist/v1/libs/TinyDomReadyManager.d.mts +8 -16
- package/dist/v1/libs/TinyDragDropDetector.d.mts +30 -30
- package/dist/v1/libs/TinyDragger.d.mts +82 -81
- package/dist/v1/libs/TinyElementObserver.d.mts +25 -28
- package/dist/v1/libs/TinyGamepad.cjs +0 -1
- package/dist/v1/libs/TinyGamepad.d.mts +50 -122
- package/dist/v1/libs/TinyGamepad.mjs +0 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.cjs +2 -25
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.d.mts +19 -25
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.mjs +3 -27
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.cjs +2 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.d.mts +55 -55
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.mjs +2 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlCanvas.d.mts +6 -6
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.cjs +8 -4
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.d.mts +19 -21
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.mjs +7 -4
- package/dist/v1/libs/TinyHtml/TinyHtmlEmbed.d.mts +8 -8
- package/dist/v1/libs/TinyHtml/TinyHtmlForm.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/TinyHtmlIcon.d.mts +5 -6
- package/dist/v1/libs/TinyHtml/TinyHtmlIframe.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.cjs +0 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.d.mts +22 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.mjs +1 -27
- package/dist/v1/libs/TinyHtml/TinyHtmlInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/TinyHtmlLink.d.mts +23 -23
- package/dist/v1/libs/TinyHtml/TinyHtmlMedia.d.mts +26 -26
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.cjs +4 -30
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.d.mts +20 -26
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.mjs +5 -32
- package/dist/v1/libs/TinyHtml/TinyHtmlSelect.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/TinyHtmlStyle.d.mts +8 -8
- package/dist/v1/libs/TinyHtml/TinyHtmlTemplate.d.mts +26 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.cjs +14 -15
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.d.mts +32 -32
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.mjs +15 -15
- package/dist/v1/libs/TinyHtml/index.d.mts +102 -45
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.cjs +11 -9
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.d.mts +21 -21
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.mjs +11 -9
- package/dist/v1/libs/TinyHtml/input/TinyHtmlFileInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.cjs +4 -4
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.d.mts +17 -13
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.mjs +4 -4
- package/dist/v1/libs/TinyHtml/input/TinyHtmlImageInput.d.mts +21 -21
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.cjs +5 -4
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.mjs +5 -4
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.d.mts +10 -10
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.cjs +5 -4
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.mjs +5 -4
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.d.mts +15 -11
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.cjs +49 -21
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.d.mts +34 -20
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.mjs +45 -20
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.cjs +48 -25
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.d.mts +27 -21
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.mjs +40 -27
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/number/TinyHtmlNumberInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/number/TinyHtmlRangeInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlEmailInput.d.mts +25 -21
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlPasswordInput.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlSearchInput.d.mts +33 -29
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTelInput.d.mts +22 -22
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTextInput.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlUrlInput.d.mts +31 -27
- package/dist/v1/libs/TinyHtml/media/TinyHtmlAudio.d.mts +35 -11
- package/dist/v1/libs/TinyHtml/media/TinyHtmlObject.d.mts +10 -10
- package/dist/v1/libs/TinyHtml/media/TinyHtmlSource.d.mts +12 -12
- package/dist/v1/libs/TinyHtml/media/TinyHtmlVideo.d.mts +35 -27
- package/dist/v1/libs/TinyHtml.cjs +3 -4
- package/dist/v1/libs/TinyHtml.d.mts +1503 -1731
- package/dist/v1/libs/TinyHtml.mjs +3 -4
- package/dist/v1/libs/TinyI18.d.mts +23 -61
- package/dist/v1/libs/TinyIframeEvents.cjs +1 -1
- package/dist/v1/libs/TinyIframeEvents.d.mts +29 -38
- package/dist/v1/libs/TinyIframeEvents.mjs +1 -1
- package/dist/v1/libs/TinyInventory.d.mts +78 -141
- package/dist/v1/libs/TinyInventoryTrader.d.mts +19 -22
- package/dist/v1/libs/TinyLevelUp.d.mts +10 -13
- package/dist/v1/libs/TinyLoadingScreen.d.mts +21 -31
- package/dist/v1/libs/TinyLocalStorage.d.mts +11 -36
- package/dist/v1/libs/TinyMamdaniInferenceSystem.d.mts +37 -23
- package/dist/v1/libs/TinyMediaPlayer.cjs +5 -3
- package/dist/v1/libs/TinyMediaPlayer.d.mts +102 -109
- package/dist/v1/libs/TinyMediaPlayer.mjs +5 -3
- package/dist/v1/libs/TinyNeedBar.d.mts +25 -37
- package/dist/v1/libs/TinyNewWinEvents.d.mts +29 -32
- package/dist/v1/libs/TinyNotifications.d.mts +6 -6
- package/dist/v1/libs/TinyNotifyCenter.d.mts +15 -21
- package/dist/v1/libs/TinyPromiseQueue.d.mts +11 -11
- package/dist/v1/libs/TinyRadioFm.cjs +32 -12
- package/dist/v1/libs/TinyRadioFm.d.mts +44 -80
- package/dist/v1/libs/TinyRadioFm.mjs +29 -12
- package/dist/v1/libs/TinyRateLimiter.d.mts +26 -39
- package/dist/v1/libs/TinySimpleDice.d.mts +17 -36
- package/dist/v1/libs/TinySmartScroller.d.mts +50 -60
- package/dist/v1/libs/TinyTextDiffer.d.mts +11 -14
- package/dist/v1/libs/TinyTextRangeEditor.d.mts +8 -8
- package/dist/v1/libs/TinyTextarea.d.mts +31 -31
- package/dist/v1/libs/TinyTimeout.d.mts +14 -14
- package/dist/v1/libs/TinyToastNotify.cjs +1 -1
- package/dist/v1/libs/TinyToastNotify.d.mts +15 -23
- package/dist/v1/libs/TinyToastNotify.mjs +1 -1
- package/dist/v1/libs/TinyUploadClicker.d.mts +38 -14
- package/dist/v1/libs/UltraRandomMsgGen.d.mts +44 -84
- package/dist/v1/libs/utils.d.mts +5 -1
- package/docs/v1/basics/deprecated/objFilter.md +14 -0
- package/docs/v1/basics/objFilter.md +31 -17
- package/package.json +2 -2
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import TinyHtml from './TinyHtml.mjs';
|
|
2
|
+
import * as TinyCollision from '../basics/collision.mjs';
|
|
3
|
+
export type TouchDragEvent = (event: TouchEvent) => void;
|
|
2
4
|
export type VibrationPatterns = {
|
|
3
5
|
/**
|
|
4
6
|
* - Pattern to vibrate on start
|
|
@@ -31,55 +33,77 @@ export type VibrationPatterns = {
|
|
|
31
33
|
* @template {HTMLElement} HTMLTarget
|
|
32
34
|
*/
|
|
33
35
|
declare class TinyDragger<HTMLTarget extends HTMLElement> {
|
|
36
|
+
#private;
|
|
37
|
+
/** @private */
|
|
38
|
+
_onMouseDown;
|
|
39
|
+
/** @private */
|
|
40
|
+
_onMouseMove;
|
|
41
|
+
/** @private */
|
|
42
|
+
_onMouseUp;
|
|
43
|
+
/**
|
|
44
|
+
* @type {TouchDragEvent}
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
_onTouchStart;
|
|
48
|
+
/**
|
|
49
|
+
* @type {TouchDragEvent}
|
|
50
|
+
* @private
|
|
51
|
+
*/
|
|
52
|
+
_onTouchMove;
|
|
53
|
+
/**
|
|
54
|
+
* @type {TouchDragEvent}
|
|
55
|
+
* @private
|
|
56
|
+
*/
|
|
57
|
+
_onTouchEnd;
|
|
34
58
|
static Utils: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
depth: CollData;
|
|
49
|
-
dirs: CollDirs;
|
|
50
|
-
isNeg: NegCollDirs;
|
|
51
|
-
};
|
|
52
|
-
areElsCollTop: (rect1: ObjRect, rect2: ObjRect) => boolean;
|
|
53
|
-
areElsCollBottom: (rect1: ObjRect, rect2: ObjRect) => boolean;
|
|
54
|
-
areElsCollLeft: (rect1: ObjRect, rect2: ObjRect) => boolean;
|
|
55
|
-
areElsCollRight: (rect1: ObjRect, rect2: ObjRect) => boolean;
|
|
56
|
-
areElsCollPerfTop: (rect1: ObjRect, rect2: ObjRect) => boolean;
|
|
57
|
-
areElsCollPerfBottom: (rect1: ObjRect, rect2: ObjRect) => boolean;
|
|
58
|
-
areElsCollPerfLeft: (rect1: ObjRect, rect2: ObjRect) => boolean;
|
|
59
|
-
areElsCollPerfRight: (rect1: ObjRect, rect2: ObjRect) => boolean;
|
|
60
|
-
areElsColliding: (rect1: ObjRect, rect2: ObjRect) => boolean;
|
|
61
|
-
areElsPerfColliding: (rect1: ObjRect, rect2: ObjRect) => boolean;
|
|
62
|
-
getElsColliding: (rect1: ObjRect, rect2: ObjRect) => string | null;
|
|
63
|
-
getElsPerfColliding: (rect1: ObjRect, rect2: ObjRect) => "top" | "bottom" | "left" | "right" | null;
|
|
64
|
-
getElsCollOverlap: (rect1: ObjRect, rect2: ObjRect) => {
|
|
59
|
+
areElsCollTop: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
|
|
60
|
+
areElsCollBottom: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
|
|
61
|
+
areElsCollLeft: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
|
|
62
|
+
areElsCollRight: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
|
|
63
|
+
areElsCollPerfTop: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
|
|
64
|
+
areElsCollPerfBottom: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
|
|
65
|
+
areElsCollPerfLeft: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
|
|
66
|
+
areElsCollPerfRight: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
|
|
67
|
+
areElsColliding: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
|
|
68
|
+
areElsPerfColliding: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
|
|
69
|
+
getElsColliding: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => string | null;
|
|
70
|
+
getElsPerfColliding: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => 'top' | 'bottom' | 'left' | 'right' | null;
|
|
71
|
+
getElsCollOverlap: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => {
|
|
65
72
|
overlapLeft: number;
|
|
66
73
|
overlapRight: number;
|
|
67
74
|
overlapTop: number;
|
|
68
75
|
overlapBottom: number;
|
|
69
76
|
};
|
|
70
77
|
getElsCollOverlapPos: ({ overlapLeft, overlapRight, overlapTop, overlapBottom, }?: {
|
|
71
|
-
overlapLeft?: number
|
|
72
|
-
overlapRight?: number
|
|
73
|
-
overlapTop?: number
|
|
74
|
-
overlapBottom?: number
|
|
78
|
+
overlapLeft?: number;
|
|
79
|
+
overlapRight?: number;
|
|
80
|
+
overlapTop?: number;
|
|
81
|
+
overlapBottom?: number;
|
|
75
82
|
}) => {
|
|
76
|
-
dirX: Dirs;
|
|
77
|
-
dirY: Dirs;
|
|
83
|
+
dirX: TinyCollision.Dirs;
|
|
84
|
+
dirY: TinyCollision.Dirs;
|
|
78
85
|
};
|
|
79
|
-
getRectCenter: (rect: ObjRect) => {
|
|
86
|
+
getRectCenter: (rect: TinyCollision.ObjRect) => {
|
|
80
87
|
x: number;
|
|
81
88
|
y: number;
|
|
82
89
|
};
|
|
90
|
+
getElsRelativeCenterOffset(rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect): {
|
|
91
|
+
x: number;
|
|
92
|
+
y: number;
|
|
93
|
+
};
|
|
94
|
+
getElsCollDirDepth(rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect): {
|
|
95
|
+
inDir: TinyCollision.Dirs | null;
|
|
96
|
+
dirX: TinyCollision.Dirs | null;
|
|
97
|
+
dirY: TinyCollision.Dirs | null;
|
|
98
|
+
depthX: number;
|
|
99
|
+
depthY: number;
|
|
100
|
+
};
|
|
101
|
+
getElsCollDetails(rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect): {
|
|
102
|
+
depth: TinyCollision.CollData;
|
|
103
|
+
dirs: TinyCollision.CollDirs;
|
|
104
|
+
isNeg: TinyCollision.NegCollDirs;
|
|
105
|
+
};
|
|
106
|
+
TinyHtml: typeof TinyHtml;
|
|
83
107
|
};
|
|
84
108
|
/** @typedef {(event: TouchEvent) => void} TouchDragEvent */
|
|
85
109
|
/**
|
|
@@ -103,43 +127,22 @@ declare class TinyDragger<HTMLTarget extends HTMLElement> {
|
|
|
103
127
|
* @throws {Error} If any option has an invalid type.
|
|
104
128
|
*/
|
|
105
129
|
constructor(targetElement: HTMLTarget, options?: {
|
|
106
|
-
jail?: HTMLElement
|
|
107
|
-
mirrorElem?: boolean
|
|
108
|
-
defaultZIndex?: number
|
|
109
|
-
collisionByMouse?: boolean
|
|
110
|
-
classDragging?: string
|
|
111
|
-
classBodyDragging?: string
|
|
112
|
-
classJailDragging?: string
|
|
113
|
-
classJailDragDisabled?: string
|
|
114
|
-
classDragCollision?: string
|
|
115
|
-
lockInsideJail?: boolean
|
|
116
|
-
dropInJailOnly?: boolean
|
|
117
|
-
multiCollision?: boolean
|
|
118
|
-
vibration?:
|
|
119
|
-
revertOnDrop?: boolean
|
|
120
|
-
classHidden?: string
|
|
130
|
+
jail?: HTMLElement;
|
|
131
|
+
mirrorElem?: boolean;
|
|
132
|
+
defaultZIndex?: number;
|
|
133
|
+
collisionByMouse?: boolean;
|
|
134
|
+
classDragging?: string;
|
|
135
|
+
classBodyDragging?: string;
|
|
136
|
+
classJailDragging?: string;
|
|
137
|
+
classJailDragDisabled?: string;
|
|
138
|
+
classDragCollision?: string;
|
|
139
|
+
lockInsideJail?: boolean;
|
|
140
|
+
dropInJailOnly?: boolean;
|
|
141
|
+
multiCollision?: boolean;
|
|
142
|
+
vibration?: VibrationPatterns | false;
|
|
143
|
+
revertOnDrop?: boolean;
|
|
144
|
+
classHidden?: string;
|
|
121
145
|
});
|
|
122
|
-
/** @private */
|
|
123
|
-
private _onMouseDown;
|
|
124
|
-
/** @private */
|
|
125
|
-
private _onMouseMove;
|
|
126
|
-
/** @private */
|
|
127
|
-
private _onMouseUp;
|
|
128
|
-
/**
|
|
129
|
-
* @type {TouchDragEvent}
|
|
130
|
-
* @private
|
|
131
|
-
*/
|
|
132
|
-
private _onTouchStart;
|
|
133
|
-
/**
|
|
134
|
-
* @type {TouchDragEvent}
|
|
135
|
-
* @private
|
|
136
|
-
*/
|
|
137
|
-
private _onTouchMove;
|
|
138
|
-
/**
|
|
139
|
-
* @type {TouchDragEvent}
|
|
140
|
-
* @private
|
|
141
|
-
*/
|
|
142
|
-
private _onTouchEnd;
|
|
143
146
|
/**
|
|
144
147
|
* Enables the drag functionality.
|
|
145
148
|
*/
|
|
@@ -170,10 +173,10 @@ declare class TinyDragger<HTMLTarget extends HTMLElement> {
|
|
|
170
173
|
* @throws {Error} If any pattern is not false or an array of numbers.
|
|
171
174
|
*/
|
|
172
175
|
setVibrationPattern({ startPattern, endPattern, collidePattern, movePattern, }?: {
|
|
173
|
-
startPattern?:
|
|
174
|
-
endPattern?:
|
|
175
|
-
collidePattern?:
|
|
176
|
-
movePattern?:
|
|
176
|
+
startPattern?: number[] | false;
|
|
177
|
+
endPattern?: number[] | false;
|
|
178
|
+
collidePattern?: number[] | false;
|
|
179
|
+
movePattern?: number[] | false;
|
|
177
180
|
}): void;
|
|
178
181
|
/**
|
|
179
182
|
* Disables all vibration feedback.
|
|
@@ -386,8 +389,6 @@ declare class TinyDragger<HTMLTarget extends HTMLElement> {
|
|
|
386
389
|
* Does NOT remove the original HTML element.
|
|
387
390
|
*/
|
|
388
391
|
destroy(): void;
|
|
389
|
-
#private;
|
|
390
392
|
}
|
|
391
|
-
|
|
392
|
-
import * as TinyCollision from '../basics/collision.mjs';
|
|
393
|
+
export default TinyDragger;
|
|
393
394
|
//# sourceMappingURL=TinyDragger.d.mts.map
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export default TinyElementObserver;
|
|
2
|
-
/**
|
|
3
|
-
* Callback type used for element mutation detectors.
|
|
4
|
-
*/
|
|
5
1
|
export type ElementDetectorsFn = (mutation: MutationRecord, index: number, mutations: MutationRecord[]) => void;
|
|
6
2
|
/**
|
|
7
3
|
* Callback type used for element mutation detectors.
|
|
@@ -21,18 +17,7 @@ export type ElementDetectorsFn = (mutation: MutationRecord, index: number, mutat
|
|
|
21
17
|
* @template {Element} HTMLElement
|
|
22
18
|
*/
|
|
23
19
|
declare class TinyElementObserver<HTMLElement extends Element> {
|
|
24
|
-
|
|
25
|
-
* Create a new TinyElementObserver instance.
|
|
26
|
-
*
|
|
27
|
-
* @param {HTMLElement} el - Set the target element to be observed.
|
|
28
|
-
* @param {Object} [settings={}] - Configuration object.
|
|
29
|
-
* @param {Array<[string, ElementDetectorsFn]>} [settings.initDetectors=[]] - Optional initial detectors to register.
|
|
30
|
-
* @param {MutationObserverInit} [settings.initCfg] - Optional MutationObserver configuration.
|
|
31
|
-
*/
|
|
32
|
-
constructor(el: HTMLElement, { initDetectors, initCfg }?: {
|
|
33
|
-
initDetectors?: [string, ElementDetectorsFn][] | undefined;
|
|
34
|
-
initCfg?: MutationObserverInit | undefined;
|
|
35
|
-
});
|
|
20
|
+
#private;
|
|
36
21
|
/**
|
|
37
22
|
* Gets the current destruction status of the instance.
|
|
38
23
|
*
|
|
@@ -44,31 +29,31 @@ declare class TinyElementObserver<HTMLElement extends Element> {
|
|
|
44
29
|
* @returns {HTMLElement} The DOM element being tracked, or `undefined` if none is set.
|
|
45
30
|
*/
|
|
46
31
|
get el(): HTMLElement;
|
|
47
|
-
/**
|
|
48
|
-
* Set the observer settings.
|
|
49
|
-
* @param {MutationObserverInit} settings
|
|
50
|
-
*/
|
|
51
|
-
set settings(settings: MutationObserverInit);
|
|
52
32
|
/**
|
|
53
33
|
* Get the observer settings.
|
|
54
34
|
* @returns {MutationObserverInit}
|
|
55
35
|
*/
|
|
56
36
|
get settings(): MutationObserverInit;
|
|
37
|
+
/**
|
|
38
|
+
* Set the observer settings.
|
|
39
|
+
* @param {MutationObserverInit} settings
|
|
40
|
+
*/
|
|
41
|
+
set settings(settings: MutationObserverInit);
|
|
57
42
|
/**
|
|
58
43
|
* Get the current MutationObserver instance.
|
|
59
44
|
* @returns {MutationObserver|null}
|
|
60
45
|
*/
|
|
61
46
|
get observer(): MutationObserver | null;
|
|
62
|
-
/**
|
|
63
|
-
* Set the element detectors.
|
|
64
|
-
* @param {Array<[string, ElementDetectorsFn]>} detectors
|
|
65
|
-
*/
|
|
66
|
-
set detectors(detectors: Array<[string, ElementDetectorsFn]>);
|
|
67
47
|
/**
|
|
68
48
|
* Get the element detectors.
|
|
69
49
|
* @returns {Array<[string, ElementDetectorsFn]>}
|
|
70
50
|
*/
|
|
71
51
|
get detectors(): Array<[string, ElementDetectorsFn]>;
|
|
52
|
+
/**
|
|
53
|
+
* Set the element detectors.
|
|
54
|
+
* @param {Array<[string, ElementDetectorsFn]>} detectors
|
|
55
|
+
*/
|
|
56
|
+
set detectors(detectors: Array<[string, ElementDetectorsFn]>);
|
|
72
57
|
/**
|
|
73
58
|
* Returns true if a MutationObserver is currently active.
|
|
74
59
|
* @returns {boolean}
|
|
@@ -80,6 +65,18 @@ declare class TinyElementObserver<HTMLElement extends Element> {
|
|
|
80
65
|
* @returns {number} Total count of detectors.
|
|
81
66
|
*/
|
|
82
67
|
get size(): number;
|
|
68
|
+
/**
|
|
69
|
+
* Create a new TinyElementObserver instance.
|
|
70
|
+
*
|
|
71
|
+
* @param {HTMLElement} el - Set the target element to be observed.
|
|
72
|
+
* @param {Object} [settings={}] - Configuration object.
|
|
73
|
+
* @param {Array<[string, ElementDetectorsFn]>} [settings.initDetectors=[]] - Optional initial detectors to register.
|
|
74
|
+
* @param {MutationObserverInit} [settings.initCfg] - Optional MutationObserver configuration.
|
|
75
|
+
*/
|
|
76
|
+
constructor(el: HTMLElement, { initDetectors, initCfg }?: {
|
|
77
|
+
initDetectors?: Array<[string, ElementDetectorsFn]>;
|
|
78
|
+
initCfg?: MutationObserverInit;
|
|
79
|
+
});
|
|
83
80
|
/**
|
|
84
81
|
* Remove all registered detectors.
|
|
85
82
|
* After calling this, no mutation events will be processed
|
|
@@ -115,7 +112,7 @@ declare class TinyElementObserver<HTMLElement extends Element> {
|
|
|
115
112
|
* @param {ElementDetectorsFn} handler
|
|
116
113
|
* @param {'before'|'after'} position - Position relative to the index
|
|
117
114
|
*/
|
|
118
|
-
insertAt(index: number, name: string, handler: ElementDetectorsFn, position?:
|
|
115
|
+
insertAt(index: number, name: string, handler: ElementDetectorsFn, position?: 'before' | 'after'): void;
|
|
119
116
|
/**
|
|
120
117
|
* Remove a detector at a specific index.
|
|
121
118
|
* @param {number} index
|
|
@@ -146,6 +143,6 @@ declare class TinyElementObserver<HTMLElement extends Element> {
|
|
|
146
143
|
* leaving the instance unusable until reconfigured.
|
|
147
144
|
*/
|
|
148
145
|
destroy(): void;
|
|
149
|
-
#private;
|
|
150
146
|
}
|
|
147
|
+
export default TinyElementObserver;
|
|
151
148
|
//# sourceMappingURL=TinyElementObserver.d.mts.map
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export default TinyGamepad;
|
|
2
|
-
/**
|
|
3
|
-
* Describes the status of a key or button.
|
|
4
|
-
*/
|
|
5
1
|
export type KeyStatus = {
|
|
6
2
|
/**
|
|
7
3
|
* - Whether the key is currently pressed.
|
|
@@ -10,84 +6,30 @@ export type KeyStatus = {
|
|
|
10
6
|
/**
|
|
11
7
|
* - Optional analog value associated with the key.
|
|
12
8
|
*/
|
|
13
|
-
value?: number
|
|
9
|
+
value?: number;
|
|
14
10
|
/**
|
|
15
11
|
* - Optional second analog value.
|
|
16
12
|
*/
|
|
17
|
-
value2?: number
|
|
13
|
+
value2?: number;
|
|
18
14
|
};
|
|
19
|
-
|
|
20
|
-
* Defines the available input modes.
|
|
21
|
-
*/
|
|
22
|
-
export type InputMode = "gamepad-only" | "keyboard-only" | "both";
|
|
23
|
-
/**
|
|
24
|
-
* A callback function that is invoked when a mapped logical input is activated or deactivated.
|
|
25
|
-
*
|
|
26
|
-
* This function receives the logical name associated with the input (e.g., "Jump", "Shoot", "Menu")
|
|
27
|
-
* and can be used to handle input-related actions such as triggering game mechanics or UI behavior.
|
|
28
|
-
*/
|
|
15
|
+
export type InputMode = 'gamepad-only' | 'keyboard-only' | 'both';
|
|
29
16
|
export type MappedInputCallback = (payload: {
|
|
30
17
|
logicalName: string;
|
|
31
18
|
activeTime: number;
|
|
32
19
|
comboTime: number;
|
|
33
20
|
}) => void;
|
|
34
|
-
/**
|
|
35
|
-
* A callback function that is invoked when a mapped key is activated or deactivated.
|
|
36
|
-
*
|
|
37
|
-
* This function receives the key name associated with the input (e.g., "KeyA", "KeyB", "KeyC")
|
|
38
|
-
* and can be used to handle input-related actions such as triggering game mechanics or UI behavior.
|
|
39
|
-
*/
|
|
40
21
|
export type MappedKeyCallback = (payload: {
|
|
41
22
|
key: string;
|
|
42
23
|
activeTime: number;
|
|
43
24
|
}) => void;
|
|
44
|
-
/**
|
|
45
|
-
* Callback for handling input events.
|
|
46
|
-
*/
|
|
47
25
|
export type PayloadCallback = (payload: InputPayload | InputAnalogPayload) => void;
|
|
48
|
-
/**
|
|
49
|
-
* Callback for handling gamepad connection events.
|
|
50
|
-
*/
|
|
51
26
|
export type ConnectionCallback = (payload: ConnectionPayload) => void;
|
|
52
|
-
/**
|
|
53
|
-
* A callback function that is triggered when a registered input sequence is fully activated.
|
|
54
|
-
*/
|
|
55
27
|
export type InputSequenceCallback = (timestamp: number) => any;
|
|
56
|
-
/**
|
|
57
|
-
* A callback function that is triggered when a registered key sequence is fully activated.
|
|
58
|
-
*/
|
|
59
28
|
export type KeySequenceCallback = (timestamp: number) => any;
|
|
60
|
-
/**
|
|
61
|
-
* Represents any valid callback type used in the TinyGamepad event system.
|
|
62
|
-
* This is a union of all supported callback signatures.
|
|
63
|
-
*/
|
|
64
29
|
export type CallbackList = ConnectionCallback | PayloadCallback | MappedInputCallback | MappedKeyCallback;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
* - 'gamepad-button' refers to digital buttons on the gamepad.
|
|
69
|
-
*/
|
|
70
|
-
export type GamepadDeviceSource = "gamepad-analog" | "gamepad-button";
|
|
71
|
-
/**
|
|
72
|
-
* Represents any possible physical device source that can be used for input.
|
|
73
|
-
* - 'mouse': Input from a mouse.
|
|
74
|
-
* - 'keyboard': Input from a keyboard.
|
|
75
|
-
* - 'gamepad-analog': Analog input from a gamepad (e.g., sticks, triggers).
|
|
76
|
-
* - 'gamepad-button': Digital button input from a gamepad.
|
|
77
|
-
*/
|
|
78
|
-
export type DeviceSource = "mouse" | "keyboard" | GamepadDeviceSource;
|
|
79
|
-
/**
|
|
80
|
-
* Represents the type of input interaction detected.
|
|
81
|
-
* - 'up': Input was released.
|
|
82
|
-
* - 'down': Input was pressed.
|
|
83
|
-
* - 'hold': Input is being held.
|
|
84
|
-
* - 'change': Input value changed (e.g., pressure or axis).
|
|
85
|
-
* - 'move': Analog movement detected (e.g., joystick motion).
|
|
86
|
-
*/
|
|
87
|
-
export type DeviceInputType = "up" | "down" | "hold" | "change" | "move";
|
|
88
|
-
/**
|
|
89
|
-
* Structure for digital button input payload.
|
|
90
|
-
*/
|
|
30
|
+
export type GamepadDeviceSource = 'gamepad-analog' | 'gamepad-button';
|
|
31
|
+
export type DeviceSource = 'mouse' | 'keyboard' | GamepadDeviceSource;
|
|
32
|
+
export type DeviceInputType = 'up' | 'down' | 'hold' | 'change' | 'move';
|
|
91
33
|
export type InputPayload = {
|
|
92
34
|
/**
|
|
93
35
|
* - Unique identifier for the input.
|
|
@@ -96,7 +38,7 @@ export type InputPayload = {
|
|
|
96
38
|
/**
|
|
97
39
|
* - Optional DOM event reference.
|
|
98
40
|
*/
|
|
99
|
-
event?: Event
|
|
41
|
+
event?: Event;
|
|
100
42
|
/**
|
|
101
43
|
* - Type of input event (down, up, hold).
|
|
102
44
|
*/
|
|
@@ -132,7 +74,7 @@ export type InputPayload = {
|
|
|
132
74
|
/**
|
|
133
75
|
* - Previous pressed status.
|
|
134
76
|
*/
|
|
135
|
-
prevPressed?: boolean | null
|
|
77
|
+
prevPressed?: boolean | null;
|
|
136
78
|
/**
|
|
137
79
|
* - Timestamp of the event.
|
|
138
80
|
*/
|
|
@@ -140,11 +82,8 @@ export type InputPayload = {
|
|
|
140
82
|
/**
|
|
141
83
|
* - Reference to the originating Gamepad.
|
|
142
84
|
*/
|
|
143
|
-
gp?: Gamepad
|
|
85
|
+
gp?: Gamepad;
|
|
144
86
|
};
|
|
145
|
-
/**
|
|
146
|
-
* Structure for analog input payload.
|
|
147
|
-
*/
|
|
148
87
|
export type InputAnalogPayload = {
|
|
149
88
|
/**
|
|
150
89
|
* - Unique identifier for the input.
|
|
@@ -153,7 +92,7 @@ export type InputAnalogPayload = {
|
|
|
153
92
|
/**
|
|
154
93
|
* - Optional DOM event reference.
|
|
155
94
|
*/
|
|
156
|
-
event?: Event
|
|
95
|
+
event?: Event;
|
|
157
96
|
/**
|
|
158
97
|
* - Type of input event (change).
|
|
159
98
|
*/
|
|
@@ -185,11 +124,8 @@ export type InputAnalogPayload = {
|
|
|
185
124
|
/**
|
|
186
125
|
* - Reference to the originating Gamepad.
|
|
187
126
|
*/
|
|
188
|
-
gp?: Gamepad
|
|
127
|
+
gp?: Gamepad;
|
|
189
128
|
};
|
|
190
|
-
/**
|
|
191
|
-
* Internal structure for digital input events.
|
|
192
|
-
*/
|
|
193
129
|
export type InputEvents = {
|
|
194
130
|
/**
|
|
195
131
|
* - Unique identifier for the input.
|
|
@@ -198,7 +134,7 @@ export type InputEvents = {
|
|
|
198
134
|
/**
|
|
199
135
|
* - Optional DOM event reference.
|
|
200
136
|
*/
|
|
201
|
-
event?: Event
|
|
137
|
+
event?: Event;
|
|
202
138
|
/**
|
|
203
139
|
* - Input key identifier.
|
|
204
140
|
*/
|
|
@@ -230,7 +166,7 @@ export type InputEvents = {
|
|
|
230
166
|
/**
|
|
231
167
|
* - Previous pressed status.
|
|
232
168
|
*/
|
|
233
|
-
prevPressed?: boolean | null
|
|
169
|
+
prevPressed?: boolean | null;
|
|
234
170
|
/**
|
|
235
171
|
* - Timestamp of the event.
|
|
236
172
|
*/
|
|
@@ -238,11 +174,8 @@ export type InputEvents = {
|
|
|
238
174
|
/**
|
|
239
175
|
* - Reference to the gamepad.
|
|
240
176
|
*/
|
|
241
|
-
gp?: Gamepad
|
|
177
|
+
gp?: Gamepad;
|
|
242
178
|
};
|
|
243
|
-
/**
|
|
244
|
-
* Internal structure for analog input events.
|
|
245
|
-
*/
|
|
246
179
|
export type InputAnalogEvents = {
|
|
247
180
|
/**
|
|
248
181
|
* - Unique identifier for the input.
|
|
@@ -251,7 +184,7 @@ export type InputAnalogEvents = {
|
|
|
251
184
|
/**
|
|
252
185
|
* - Optional DOM event reference.
|
|
253
186
|
*/
|
|
254
|
-
event?: Event
|
|
187
|
+
event?: Event;
|
|
255
188
|
/**
|
|
256
189
|
* - Analog key.
|
|
257
190
|
*/
|
|
@@ -279,11 +212,8 @@ export type InputAnalogEvents = {
|
|
|
279
212
|
/**
|
|
280
213
|
* - Gamepad reference.
|
|
281
214
|
*/
|
|
282
|
-
gp?: Gamepad
|
|
215
|
+
gp?: Gamepad;
|
|
283
216
|
};
|
|
284
|
-
/**
|
|
285
|
-
* Payload for connection-related events.
|
|
286
|
-
*/
|
|
287
217
|
export type ConnectionPayload = {
|
|
288
218
|
/**
|
|
289
219
|
* - ID of the gamepad.
|
|
@@ -492,8 +422,7 @@ export type ExportedConfig = {
|
|
|
492
422
|
* detailed input feedback, and JSON-based profile serialization for saving and restoring mappings.
|
|
493
423
|
*/
|
|
494
424
|
declare class TinyGamepad {
|
|
495
|
-
|
|
496
|
-
static #specialMap: Record<string, string>;
|
|
425
|
+
#private;
|
|
497
426
|
/**
|
|
498
427
|
* Add or update a special key mapping.
|
|
499
428
|
* @param {string} char - The character to map.
|
|
@@ -541,14 +470,14 @@ declare class TinyGamepad {
|
|
|
541
470
|
* @param {Window|Element} [options.elementBase=window] - The DOM element or window to bind keyboard and mouse events to.
|
|
542
471
|
*/
|
|
543
472
|
constructor({ expectedId, inputMode, ignoreIds, deadZone, axisActiveSensitivity, timeoutComboKeys, allowMouse, elementBase, }?: {
|
|
544
|
-
expectedId?: string | null
|
|
545
|
-
inputMode?: InputMode
|
|
546
|
-
ignoreIds?: string[]
|
|
547
|
-
deadZone?: number
|
|
548
|
-
allowMouse?: boolean
|
|
549
|
-
timeoutComboKeys?: number
|
|
550
|
-
axisActiveSensitivity?: number
|
|
551
|
-
elementBase?:
|
|
473
|
+
expectedId?: string | null;
|
|
474
|
+
inputMode?: InputMode;
|
|
475
|
+
ignoreIds?: string[];
|
|
476
|
+
deadZone?: number;
|
|
477
|
+
allowMouse?: boolean;
|
|
478
|
+
timeoutComboKeys?: number;
|
|
479
|
+
axisActiveSensitivity?: number;
|
|
480
|
+
elementBase?: Window | Element;
|
|
552
481
|
});
|
|
553
482
|
/**
|
|
554
483
|
* Waits for a single input event from the user and resolves with detailed input information.
|
|
@@ -570,9 +499,9 @@ declare class TinyGamepad {
|
|
|
570
499
|
* - `gp`: the Gamepad object (only if the input source is a gamepad).
|
|
571
500
|
*/
|
|
572
501
|
awaitInputMapping({ timeout, eventName, canMove }?: {
|
|
573
|
-
timeout?: number
|
|
574
|
-
eventName?: string
|
|
575
|
-
canMove?: boolean
|
|
502
|
+
timeout?: number;
|
|
503
|
+
eventName?: string;
|
|
504
|
+
canMove?: boolean;
|
|
576
505
|
}): Promise<{
|
|
577
506
|
key: string | null;
|
|
578
507
|
source: DeviceSource | null;
|
|
@@ -906,20 +835,20 @@ declare class TinyGamepad {
|
|
|
906
835
|
* @param {'all' | 'start' | 'end' | 'hold' | 'change' | 'move'} [type='all']
|
|
907
836
|
* @returns {Function[]}
|
|
908
837
|
*/
|
|
909
|
-
getCalls(logicalName: string, type?:
|
|
838
|
+
getCalls(logicalName: string, type?: 'all' | 'start' | 'end' | 'hold' | 'change' | 'move'): Function[];
|
|
910
839
|
/**
|
|
911
840
|
* Removes all callbacks for a specific logical input event.
|
|
912
841
|
* @param {string} logicalName
|
|
913
842
|
* @param {'all'| 'start' | 'end' | 'hold' | 'change' | 'move'} [type='all']
|
|
914
843
|
*/
|
|
915
|
-
offAllInputs(logicalName: string, type?:
|
|
844
|
+
offAllInputs(logicalName: string, type?: 'all' | 'start' | 'end' | 'hold' | 'change' | 'move'): void;
|
|
916
845
|
/**
|
|
917
846
|
* Returns the number of registered callbacks for a specific logical input and type.
|
|
918
847
|
* @param {string} logicalName
|
|
919
848
|
* @param {'all' | 'start' | 'end' | 'hold' | 'change' | 'move'} [type='all']
|
|
920
849
|
* @returns {number}
|
|
921
850
|
*/
|
|
922
|
-
getCallSize(logicalName: string, type?:
|
|
851
|
+
getCallSize(logicalName: string, type?: 'all' | 'start' | 'end' | 'hold' | 'change' | 'move'): number;
|
|
923
852
|
/**
|
|
924
853
|
* Returns the current default haptic feedback effect configuration.
|
|
925
854
|
*
|
|
@@ -1220,6 +1149,11 @@ declare class TinyGamepad {
|
|
|
1220
1149
|
* @returns {number}
|
|
1221
1150
|
*/
|
|
1222
1151
|
get timeMappedInputs(): number;
|
|
1152
|
+
/**
|
|
1153
|
+
* Returns the timeout duration (in milliseconds) before raw key combos are reset.
|
|
1154
|
+
* @returns {number}
|
|
1155
|
+
*/
|
|
1156
|
+
get timeoutComboKeys(): number;
|
|
1223
1157
|
/**
|
|
1224
1158
|
* Sets the timeout duration (in milliseconds) before raw key combos are reset.
|
|
1225
1159
|
* Must be a positive number.
|
|
@@ -1227,10 +1161,14 @@ declare class TinyGamepad {
|
|
|
1227
1161
|
*/
|
|
1228
1162
|
set timeoutComboKeys(value: number);
|
|
1229
1163
|
/**
|
|
1230
|
-
*
|
|
1231
|
-
*
|
|
1164
|
+
* Gets the sensitivity threshold used to detect when an axis (like a thumbstick or trigger)
|
|
1165
|
+
* is considered "actively moved". This helps distinguish minor noise from intentional input.
|
|
1166
|
+
*
|
|
1167
|
+
* A value of 0 means even the slightest movement is detected; a value closer to 1 means only strong input is accepted.
|
|
1168
|
+
*
|
|
1169
|
+
* @returns {number} The current axis activity sensitivity (between 0 and 1).
|
|
1232
1170
|
*/
|
|
1233
|
-
get
|
|
1171
|
+
get axisActiveSensitivity(): number;
|
|
1234
1172
|
/**
|
|
1235
1173
|
* Sets the sensitivity threshold used to detect active axis input.
|
|
1236
1174
|
* This value defines how far an analog axis (such as a thumbstick or trigger) must move from its rest position
|
|
@@ -1242,14 +1180,10 @@ declare class TinyGamepad {
|
|
|
1242
1180
|
*/
|
|
1243
1181
|
set axisActiveSensitivity(value: number);
|
|
1244
1182
|
/**
|
|
1245
|
-
*
|
|
1246
|
-
*
|
|
1247
|
-
*
|
|
1248
|
-
* A value of 0 means even the slightest movement is detected; a value closer to 1 means only strong input is accepted.
|
|
1249
|
-
*
|
|
1250
|
-
* @returns {number} The current axis activity sensitivity (between 0 and 1).
|
|
1183
|
+
* Returns the current dead zone threshold for analog inputs.
|
|
1184
|
+
* @returns {number}
|
|
1251
1185
|
*/
|
|
1252
|
-
get
|
|
1186
|
+
get deadZone(): number;
|
|
1253
1187
|
/**
|
|
1254
1188
|
* Sets a new dead zone threshold for analog inputs.
|
|
1255
1189
|
* Must be a number between 0 and 1.
|
|
@@ -1257,20 +1191,14 @@ declare class TinyGamepad {
|
|
|
1257
1191
|
*/
|
|
1258
1192
|
set deadZone(value: number);
|
|
1259
1193
|
/**
|
|
1260
|
-
* Returns the
|
|
1261
|
-
* @returns {
|
|
1194
|
+
* Returns the expected device ID, or null if any is accepted.
|
|
1195
|
+
* @returns {string|null}
|
|
1262
1196
|
*/
|
|
1263
|
-
get
|
|
1197
|
+
get expectedId(): string | null;
|
|
1264
1198
|
/**
|
|
1265
1199
|
* Sets the expected device ID.
|
|
1266
|
-
* @returns {string}
|
|
1267
1200
|
*/
|
|
1268
1201
|
set expectedId(value: string | null);
|
|
1269
|
-
/**
|
|
1270
|
-
* Returns the expected device ID, or null if any is accepted.
|
|
1271
|
-
* @returns {string|null}
|
|
1272
|
-
*/
|
|
1273
|
-
get expectedId(): string | null;
|
|
1274
1202
|
/**
|
|
1275
1203
|
* Returns whether the instance has been destroyed
|
|
1276
1204
|
* @returns {boolean}
|
|
@@ -1281,6 +1209,6 @@ declare class TinyGamepad {
|
|
|
1281
1209
|
* Marks the instance as destroyed.
|
|
1282
1210
|
*/
|
|
1283
1211
|
destroy(): void;
|
|
1284
|
-
#private;
|
|
1285
1212
|
}
|
|
1213
|
+
export default TinyGamepad;
|
|
1286
1214
|
//# sourceMappingURL=TinyGamepad.d.mts.map
|