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.
Files changed (218) hide show
  1. package/changelog/1/28/2.md +43 -0
  2. package/changelog/1/28/3.md +9 -0
  3. package/dist/_/numbers.d.mts +91 -16
  4. package/dist/v1/TinyBasicsEs.min.js +1 -1
  5. package/dist/v1/TinyEssentials.min.js +1 -1
  6. package/dist/v1/TinyMediaPlayer.min.js +1 -1
  7. package/dist/v1/TinyRadioFm.min.js +1 -1
  8. package/dist/v1/basics/array.d.mts +14 -14
  9. package/dist/v1/basics/clock.cjs +15 -15
  10. package/dist/v1/basics/clock.d.mts +21 -21
  11. package/dist/v1/basics/clock.mjs +15 -15
  12. package/dist/v1/basics/collision.d.mts +245 -104
  13. package/dist/v1/basics/deprecated/html.d.mts +33 -33
  14. package/dist/v1/basics/extendObjType/Buffer.d.mts +1 -1
  15. package/dist/v1/basics/fullScreen.d.mts +47 -7
  16. package/dist/v1/basics/html.d.mts +52 -61
  17. package/dist/v1/basics/index.cjs +2 -0
  18. package/dist/v1/basics/index.d.mts +11 -67
  19. package/dist/v1/basics/index.mjs +2 -2
  20. package/dist/v1/basics/mediaContent.cjs +65 -23
  21. package/dist/v1/basics/mediaContent.d.mts +144 -73
  22. package/dist/v1/basics/mediaContent.mjs +65 -23
  23. package/dist/v1/basics/objChecker.d.mts +2 -2
  24. package/dist/v1/basics/objFilter.cjs +50 -16
  25. package/dist/v1/basics/objFilter.d.mts +34 -13
  26. package/dist/v1/basics/objFilter.mjs +48 -16
  27. package/dist/v1/basics/simpleMath.d.mts +21 -21
  28. package/dist/v1/basics/text.d.mts +34 -46
  29. package/dist/v1/build/ColorSafeStringify.d.mts +1 -1
  30. package/dist/v1/build/TinyAdvancedRaffle.d.mts +1 -1
  31. package/dist/v1/build/TinyAfterScrollWatcher.d.mts +1 -1
  32. package/dist/v1/build/TinyAnalogClock.d.mts +1 -1
  33. package/dist/v1/build/TinyArrayComparator.d.mts +1 -1
  34. package/dist/v1/build/TinyArrayPaginator.d.mts +1 -1
  35. package/dist/v1/build/TinyClassManager.d.mts +1 -1
  36. package/dist/v1/build/TinyClipboard.d.mts +1 -1
  37. package/dist/v1/build/TinyColorConverter.d.mts +1 -1
  38. package/dist/v1/build/TinyColorValidator.d.mts +1 -1
  39. package/dist/v1/build/TinyCookieConsent.d.mts +1 -1
  40. package/dist/v1/build/TinyDayNightCycle.d.mts +1 -1
  41. package/dist/v1/build/TinyDomReadyManager.d.mts +1 -1
  42. package/dist/v1/build/TinyDragDropDetector.d.mts +1 -1
  43. package/dist/v1/build/TinyDragger.d.mts +1 -1
  44. package/dist/v1/build/TinyElementObserver.d.mts +1 -1
  45. package/dist/v1/build/TinyGamepad.d.mts +1 -1
  46. package/dist/v1/build/TinyHtml.d.mts +1 -1
  47. package/dist/v1/build/TinyI18.d.mts +1 -1
  48. package/dist/v1/build/TinyIframeEvents.d.mts +1 -1
  49. package/dist/v1/build/TinyInventory.d.mts +1 -1
  50. package/dist/v1/build/TinyInventoryTrader.d.mts +1 -1
  51. package/dist/v1/build/TinyLevelUp.d.mts +1 -1
  52. package/dist/v1/build/TinyLoadingScreen.d.mts +1 -1
  53. package/dist/v1/build/TinyLocalStorage.d.mts +1 -1
  54. package/dist/v1/build/TinyMediaPlayer.d.mts +1 -1
  55. package/dist/v1/build/TinyNeedBar.d.mts +1 -1
  56. package/dist/v1/build/TinyNewWinEvents.d.mts +1 -1
  57. package/dist/v1/build/TinyNotifications.d.mts +1 -1
  58. package/dist/v1/build/TinyNotifyCenter.d.mts +1 -1
  59. package/dist/v1/build/TinyPromiseQueue.d.mts +1 -1
  60. package/dist/v1/build/TinyRadioFm.d.mts +1 -1
  61. package/dist/v1/build/TinyRateLimiter.d.mts +1 -1
  62. package/dist/v1/build/TinySimpleDice.d.mts +1 -1
  63. package/dist/v1/build/TinySmartScroller.d.mts +1 -1
  64. package/dist/v1/build/TinyTextDiffer.d.mts +1 -1
  65. package/dist/v1/build/TinyTextRangeEditor.d.mts +1 -1
  66. package/dist/v1/build/TinyTextarea.d.mts +1 -1
  67. package/dist/v1/build/TinyTimeout.d.mts +1 -1
  68. package/dist/v1/build/TinyToastNotify.d.mts +1 -1
  69. package/dist/v1/build/TinyUploadClicker.d.mts +1 -1
  70. package/dist/v1/build/UltraRandomMsgGen.d.mts +1 -1
  71. package/dist/v1/fileManager/asyncFuncs.d.mts +13 -13
  72. package/dist/v1/fileManager/index.d.mts +3 -29
  73. package/dist/v1/fileManager/normalFuncs.d.mts +22 -22
  74. package/dist/v1/index.cjs +2 -0
  75. package/dist/v1/index.d.mts +53 -139
  76. package/dist/v1/index.mjs +2 -2
  77. package/dist/v1/libs/ColorSafeStringify.d.mts +3 -12
  78. package/dist/v1/libs/TinyAdvancedRaffle.d.mts +60 -103
  79. package/dist/v1/libs/TinyAfterScrollWatcher.d.mts +11 -18
  80. package/dist/v1/libs/TinyAnalogClock.d.mts +8 -11
  81. package/dist/v1/libs/TinyArrayComparator.d.mts +14 -20
  82. package/dist/v1/libs/TinyArrayPaginator.d.mts +22 -26
  83. package/dist/v1/libs/TinyClassManager/TinyPluginInliner.d.mts +8 -8
  84. package/dist/v1/libs/TinyClassManager.cjs +5 -7
  85. package/dist/v1/libs/TinyClassManager.d.mts +16 -16
  86. package/dist/v1/libs/TinyClassManager.mjs +5 -6
  87. package/dist/v1/libs/TinyClipboard.d.mts +8 -3
  88. package/dist/v1/libs/TinyColorConverter.d.mts +8 -31
  89. package/dist/v1/libs/TinyColorValidator.d.mts +145 -184
  90. package/dist/v1/libs/TinyCookieConsent.d.mts +17 -17
  91. package/dist/v1/libs/TinyDayNightCycle.d.mts +85 -110
  92. package/dist/v1/libs/TinyDomReadyManager.d.mts +8 -16
  93. package/dist/v1/libs/TinyDragDropDetector.d.mts +30 -30
  94. package/dist/v1/libs/TinyDragger.d.mts +82 -81
  95. package/dist/v1/libs/TinyElementObserver.d.mts +25 -28
  96. package/dist/v1/libs/TinyGamepad.cjs +0 -1
  97. package/dist/v1/libs/TinyGamepad.d.mts +50 -122
  98. package/dist/v1/libs/TinyGamepad.mjs +0 -1
  99. package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.cjs +2 -25
  100. package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.d.mts +19 -25
  101. package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.mjs +3 -27
  102. package/dist/v1/libs/TinyHtml/TinyHtmlButton.cjs +2 -1
  103. package/dist/v1/libs/TinyHtml/TinyHtmlButton.d.mts +55 -55
  104. package/dist/v1/libs/TinyHtml/TinyHtmlButton.mjs +2 -1
  105. package/dist/v1/libs/TinyHtml/TinyHtmlCanvas.d.mts +6 -6
  106. package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.cjs +8 -4
  107. package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.d.mts +19 -21
  108. package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.mjs +7 -4
  109. package/dist/v1/libs/TinyHtml/TinyHtmlEmbed.d.mts +8 -8
  110. package/dist/v1/libs/TinyHtml/TinyHtmlForm.d.mts +18 -18
  111. package/dist/v1/libs/TinyHtml/TinyHtmlIcon.d.mts +5 -6
  112. package/dist/v1/libs/TinyHtml/TinyHtmlIframe.d.mts +19 -19
  113. package/dist/v1/libs/TinyHtml/TinyHtmlImage.cjs +0 -28
  114. package/dist/v1/libs/TinyHtml/TinyHtmlImage.d.mts +22 -28
  115. package/dist/v1/libs/TinyHtml/TinyHtmlImage.mjs +1 -27
  116. package/dist/v1/libs/TinyHtml/TinyHtmlInput.d.mts +11 -11
  117. package/dist/v1/libs/TinyHtml/TinyHtmlLink.d.mts +23 -23
  118. package/dist/v1/libs/TinyHtml/TinyHtmlMedia.d.mts +26 -26
  119. package/dist/v1/libs/TinyHtml/TinyHtmlScript.cjs +4 -30
  120. package/dist/v1/libs/TinyHtml/TinyHtmlScript.d.mts +20 -26
  121. package/dist/v1/libs/TinyHtml/TinyHtmlScript.mjs +5 -32
  122. package/dist/v1/libs/TinyHtml/TinyHtmlSelect.d.mts +19 -19
  123. package/dist/v1/libs/TinyHtml/TinyHtmlStyle.d.mts +8 -8
  124. package/dist/v1/libs/TinyHtml/TinyHtmlTemplate.d.mts +26 -28
  125. package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.cjs +14 -15
  126. package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.d.mts +32 -32
  127. package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.mjs +15 -15
  128. package/dist/v1/libs/TinyHtml/index.d.mts +102 -45
  129. package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.cjs +11 -9
  130. package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.d.mts +21 -21
  131. package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.mjs +11 -9
  132. package/dist/v1/libs/TinyHtml/input/TinyHtmlFileInput.d.mts +11 -11
  133. package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.cjs +4 -4
  134. package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.d.mts +17 -13
  135. package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.mjs +4 -4
  136. package/dist/v1/libs/TinyHtml/input/TinyHtmlImageInput.d.mts +21 -21
  137. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.cjs +5 -4
  138. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.d.mts +14 -14
  139. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.mjs +5 -4
  140. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.cjs +4 -3
  141. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.d.mts +10 -10
  142. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.mjs +4 -3
  143. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.cjs +4 -3
  144. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.d.mts +19 -19
  145. package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.mjs +4 -3
  146. package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.cjs +5 -4
  147. package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.d.mts +11 -11
  148. package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.mjs +5 -4
  149. package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.cjs +4 -3
  150. package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.d.mts +15 -11
  151. package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.mjs +4 -3
  152. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.cjs +49 -21
  153. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.d.mts +34 -20
  154. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.mjs +45 -20
  155. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.cjs +1 -1
  156. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.d.mts +14 -14
  157. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.mjs +1 -1
  158. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.cjs +1 -1
  159. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.d.mts +14 -14
  160. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.mjs +1 -1
  161. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.cjs +48 -25
  162. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.d.mts +27 -21
  163. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.mjs +40 -27
  164. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.cjs +1 -1
  165. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.d.mts +14 -14
  166. package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.mjs +1 -1
  167. package/dist/v1/libs/TinyHtml/input/number/TinyHtmlNumberInput.d.mts +14 -14
  168. package/dist/v1/libs/TinyHtml/input/number/TinyHtmlRangeInput.d.mts +14 -14
  169. package/dist/v1/libs/TinyHtml/input/text/TinyHtmlEmailInput.d.mts +25 -21
  170. package/dist/v1/libs/TinyHtml/input/text/TinyHtmlPasswordInput.d.mts +18 -18
  171. package/dist/v1/libs/TinyHtml/input/text/TinyHtmlSearchInput.d.mts +33 -29
  172. package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTelInput.d.mts +22 -22
  173. package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTextInput.d.mts +18 -18
  174. package/dist/v1/libs/TinyHtml/input/text/TinyHtmlUrlInput.d.mts +31 -27
  175. package/dist/v1/libs/TinyHtml/media/TinyHtmlAudio.d.mts +35 -11
  176. package/dist/v1/libs/TinyHtml/media/TinyHtmlObject.d.mts +10 -10
  177. package/dist/v1/libs/TinyHtml/media/TinyHtmlSource.d.mts +12 -12
  178. package/dist/v1/libs/TinyHtml/media/TinyHtmlVideo.d.mts +35 -27
  179. package/dist/v1/libs/TinyHtml.cjs +3 -4
  180. package/dist/v1/libs/TinyHtml.d.mts +1503 -1731
  181. package/dist/v1/libs/TinyHtml.mjs +3 -4
  182. package/dist/v1/libs/TinyI18.d.mts +23 -61
  183. package/dist/v1/libs/TinyIframeEvents.cjs +1 -1
  184. package/dist/v1/libs/TinyIframeEvents.d.mts +29 -38
  185. package/dist/v1/libs/TinyIframeEvents.mjs +1 -1
  186. package/dist/v1/libs/TinyInventory.d.mts +78 -141
  187. package/dist/v1/libs/TinyInventoryTrader.d.mts +19 -22
  188. package/dist/v1/libs/TinyLevelUp.d.mts +10 -13
  189. package/dist/v1/libs/TinyLoadingScreen.d.mts +21 -31
  190. package/dist/v1/libs/TinyLocalStorage.d.mts +11 -36
  191. package/dist/v1/libs/TinyMamdaniInferenceSystem.d.mts +37 -23
  192. package/dist/v1/libs/TinyMediaPlayer.cjs +5 -3
  193. package/dist/v1/libs/TinyMediaPlayer.d.mts +102 -109
  194. package/dist/v1/libs/TinyMediaPlayer.mjs +5 -3
  195. package/dist/v1/libs/TinyNeedBar.d.mts +25 -37
  196. package/dist/v1/libs/TinyNewWinEvents.d.mts +29 -32
  197. package/dist/v1/libs/TinyNotifications.d.mts +6 -6
  198. package/dist/v1/libs/TinyNotifyCenter.d.mts +15 -21
  199. package/dist/v1/libs/TinyPromiseQueue.d.mts +11 -11
  200. package/dist/v1/libs/TinyRadioFm.cjs +32 -12
  201. package/dist/v1/libs/TinyRadioFm.d.mts +44 -80
  202. package/dist/v1/libs/TinyRadioFm.mjs +29 -12
  203. package/dist/v1/libs/TinyRateLimiter.d.mts +26 -39
  204. package/dist/v1/libs/TinySimpleDice.d.mts +17 -36
  205. package/dist/v1/libs/TinySmartScroller.d.mts +50 -60
  206. package/dist/v1/libs/TinyTextDiffer.d.mts +11 -14
  207. package/dist/v1/libs/TinyTextRangeEditor.d.mts +8 -8
  208. package/dist/v1/libs/TinyTextarea.d.mts +31 -31
  209. package/dist/v1/libs/TinyTimeout.d.mts +14 -14
  210. package/dist/v1/libs/TinyToastNotify.cjs +1 -1
  211. package/dist/v1/libs/TinyToastNotify.d.mts +15 -23
  212. package/dist/v1/libs/TinyToastNotify.mjs +1 -1
  213. package/dist/v1/libs/TinyUploadClicker.d.mts +38 -14
  214. package/dist/v1/libs/UltraRandomMsgGen.d.mts +44 -84
  215. package/dist/v1/libs/utils.d.mts +5 -1
  216. package/docs/v1/basics/deprecated/objFilter.md +14 -0
  217. package/docs/v1/basics/objFilter.md +31 -17
  218. package/package.json +2 -2
@@ -1,97 +1,16 @@
1
- /**
2
- * Calculates the offset between the center of rect2 and the center of rect1.
3
- *
4
- * The values will be 0 when rect1 is perfectly centered over rect2.
5
- *
6
- * @param {ObjRect} rect1 - The bounding rectangle of the reference element.
7
- * @param {ObjRect} rect2 - The bounding rectangle of the element being compared.
8
- * @returns {{
9
- * x: number,
10
- * y: number
11
- * }} An object with the X and Y offset in pixels from rect1's center to rect2's center.
12
- */
13
- export function getElsRelativeCenterOffset(rect1: ObjRect, rect2: ObjRect): {
14
- x: number;
15
- y: number;
16
- };
17
- /**
18
- * Detects the direction of the dominant collision between two elements
19
- * and calculates how deep the overlap is in both x and y axes.
20
- *
21
- * @param {ObjRect} rect1 - The bounding rectangle of the first element.
22
- * @param {ObjRect} rect2 - The bounding rectangle of the second element.
23
- * @returns {{
24
- * inDir: Dirs | null;
25
- * dirX: Dirs | null;
26
- * dirY: Dirs | null;
27
- * depthX: number;
28
- * depthY: number;
29
- * }} An object containing the collision direction and how deep the overlap is.
30
- */
31
- export function getElsCollDirDepth(rect1: ObjRect, rect2: ObjRect): {
32
- inDir: Dirs | null;
33
- dirX: Dirs | null;
34
- dirY: Dirs | null;
35
- depthX: number;
36
- depthY: number;
37
- };
38
- /**
39
- * Detects the collision direction and depth between two DOMRects.
40
- *
41
- * @param {ObjRect} rect1 - The bounding rectangle of the first element.
42
- * @param {ObjRect} rect2 - The bounding rectangle of the second element.
43
- * @returns {{ depth: CollData; dirs: CollDirs; isNeg: NegCollDirs; }} Collision info or null if no collision is detected.
44
- */
45
- export function getElsCollDetails(rect1: ObjRect, rect2: ObjRect): {
46
- depth: CollData;
47
- dirs: CollDirs;
48
- isNeg: NegCollDirs;
49
- };
50
- export function areElsCollTop(rect1: ObjRect, rect2: ObjRect): boolean;
51
- export function areElsCollBottom(rect1: ObjRect, rect2: ObjRect): boolean;
52
- export function areElsCollLeft(rect1: ObjRect, rect2: ObjRect): boolean;
53
- export function areElsCollRight(rect1: ObjRect, rect2: ObjRect): boolean;
54
- export function areElsCollPerfTop(rect1: ObjRect, rect2: ObjRect): boolean;
55
- export function areElsCollPerfBottom(rect1: ObjRect, rect2: ObjRect): boolean;
56
- export function areElsCollPerfLeft(rect1: ObjRect, rect2: ObjRect): boolean;
57
- export function areElsCollPerfRight(rect1: ObjRect, rect2: ObjRect): boolean;
58
- export function areElsColliding(rect1: ObjRect, rect2: ObjRect): boolean;
59
- export function areElsPerfColliding(rect1: ObjRect, rect2: ObjRect): boolean;
60
- export function getElsColliding(rect1: ObjRect, rect2: ObjRect): string | null;
61
- export function getElsPerfColliding(rect1: ObjRect, rect2: ObjRect): "top" | "bottom" | "left" | "right" | null;
62
- export function getElsCollOverlap(rect1: ObjRect, rect2: ObjRect): {
63
- overlapLeft: number;
64
- overlapRight: number;
65
- overlapTop: number;
66
- overlapBottom: number;
67
- };
68
- export function getElsCollOverlapPos({ overlapLeft, overlapRight, overlapTop, overlapBottom, }?: {
69
- overlapLeft?: number | undefined;
70
- overlapRight?: number | undefined;
71
- overlapTop?: number | undefined;
72
- overlapBottom?: number | undefined;
73
- }): {
74
- dirX: Dirs;
75
- dirY: Dirs;
76
- };
77
- export function getRectCenter(rect: ObjRect): {
78
- x: number;
79
- y: number;
80
- };
81
1
  /**
82
2
  * A direction relative to a rectangle.
83
3
  *
84
4
  * Represents one of the four cardinal directions from the perspective of the element.
5
+ *
6
+ * @typedef {'top' | 'bottom' | 'left' | 'right'} Dirs
85
7
  */
86
- export type Dirs = "top" | "bottom" | "left" | "right";
87
- /**
88
- * Represents all directional aspects of a collision.
89
- */
8
+ export type Dirs = 'top' | 'bottom' | 'left' | 'right';
90
9
  export type CollDirs = {
91
10
  /**
92
11
  * - The dominant direction of entry. `'center'` if all sides are equally overlapped. `null` if no collision.
93
12
  */
94
- in: Dirs | "center" | null;
13
+ in: Dirs | 'center' | null;
95
14
  /**
96
15
  * - The horizontal direction (`'left'` or `'right'`) the collision is biased toward, or `null`.
97
16
  */
@@ -101,9 +20,6 @@ export type CollDirs = {
101
20
  */
102
21
  y: Dirs | null;
103
22
  };
104
- /**
105
- * Indicates if a collision is in the negative direction (rect2 is outside rect1).
106
- */
107
23
  export type NegCollDirs = {
108
24
  /**
109
25
  * - Horizontal direction of negative overlap, if any.
@@ -114,11 +30,6 @@ export type NegCollDirs = {
114
30
  */
115
31
  y: Dirs | null;
116
32
  };
117
- /**
118
- * Collision depth values from each side of rect2 inside rect1.
119
- *
120
- * Positive values indicate penetration; negative values indicate gaps.
121
- */
122
33
  export type CollData = {
123
34
  /**
124
35
  * - Depth from rect2's top into rect1.
@@ -137,11 +48,6 @@ export type CollData = {
137
48
  */
138
49
  right: number;
139
50
  };
140
- /**
141
- * X and Y offset representing center difference between two rectangles.
142
- *
143
- * Useful to measure how far one element's center is from another.
144
- */
145
51
  export type CollCenter = {
146
52
  /**
147
53
  * - Horizontal distance in pixels from rect1's center to rect2's center.
@@ -152,12 +58,6 @@ export type CollCenter = {
152
58
  */
153
59
  y: number;
154
60
  };
155
- /**
156
- * Represents a rectangular area in absolute pixel values.
157
- *
158
- * Similar to `DOMRect`, this object describes the dimensions and position of a box
159
- * in the 2D plane, typically representing an element's bounding box.
160
- */
161
61
  export type ObjRect = {
162
62
  /**
163
63
  * - The total height of the rectangle in pixels.
@@ -184,4 +84,245 @@ export type ObjRect = {
184
84
  */
185
85
  right: number;
186
86
  };
87
+ /**
88
+ * Represents all directional aspects of a collision.
89
+ *
90
+ * @typedef {Object} CollDirs
91
+ * @property {Dirs | 'center' | null} in - The dominant direction of entry. `'center'` if all sides are equally overlapped. `null` if no collision.
92
+ * @property {Dirs | null} x - The horizontal direction (`'left'` or `'right'`) the collision is biased toward, or `null`.
93
+ * @property {Dirs | null} y - The vertical direction (`'top'` or `'bottom'`) the collision is biased toward, or `null`.
94
+ */
95
+ /**
96
+ * Indicates if a collision is in the negative direction (rect2 is outside rect1).
97
+ *
98
+ * @typedef {Object} NegCollDirs
99
+ * @property {Dirs | null} x - Horizontal direction of negative overlap, if any.
100
+ * @property {Dirs | null} y - Vertical direction of negative overlap, if any.
101
+ */
102
+ /**
103
+ * Collision depth values from each side of rect2 inside rect1.
104
+ *
105
+ * Positive values indicate penetration; negative values indicate gaps.
106
+ *
107
+ * @typedef {Object} CollData
108
+ * @property {number} top - Depth from rect2's top into rect1.
109
+ * @property {number} bottom - Depth from rect2's bottom into rect1.
110
+ * @property {number} left - Depth from rect2's left into rect1.
111
+ * @property {number} right - Depth from rect2's right into rect1.
112
+ */
113
+ /**
114
+ * X and Y offset representing center difference between two rectangles.
115
+ *
116
+ * Useful to measure how far one element's center is from another.
117
+ *
118
+ * @typedef {Object} CollCenter
119
+ * @property {number} x - Horizontal distance in pixels from rect1's center to rect2's center.
120
+ * @property {number} y - Vertical distance in pixels from rect1's center to rect2's center.
121
+ */
122
+ /**
123
+ * Represents a rectangular area in absolute pixel values.
124
+ *
125
+ * Similar to `DOMRect`, this object describes the dimensions and position of a box
126
+ * in the 2D plane, typically representing an element's bounding box.
127
+ *
128
+ * @typedef {Object} ObjRect
129
+ * @property {number} height - The total height of the rectangle in pixels.
130
+ * @property {number} width - The total width of the rectangle in pixels.
131
+ * @property {number} top - The Y-coordinate of the top edge of the rectangle.
132
+ * @property {number} bottom - The Y-coordinate of the bottom edge of the rectangle.
133
+ * @property {number} left - The X-coordinate of the left edge of the rectangle.
134
+ * @property {number} right - The X-coordinate of the right edge of the rectangle.
135
+ */
136
+ /**
137
+ * Checks if rect1 is completely above rect2 (no vertical overlap).
138
+ *
139
+ * @param {ObjRect} rect1 - The bounding rectangle of the first element.
140
+ * @param {ObjRect} rect2 - The bounding rectangle of the second element.
141
+ * @returns {boolean} True if rect1 is entirely above rect2.
142
+ */
143
+ export declare const areElsCollTop: (rect1: ObjRect, rect2: ObjRect) => boolean;
144
+ /**
145
+ * Checks if rect1 is completely below rect2 (no vertical overlap).
146
+ *
147
+ * @param {ObjRect} rect1
148
+ * @param {ObjRect} rect2
149
+ * @returns {boolean} True if rect1 is entirely below rect2.
150
+ */
151
+ export declare const areElsCollBottom: (rect1: ObjRect, rect2: ObjRect) => boolean;
152
+ /**
153
+ * Checks if rect1 is completely to the left of rect2 (no horizontal overlap).
154
+ *
155
+ * @param {ObjRect} rect1
156
+ * @param {ObjRect} rect2
157
+ * @returns {boolean} True if rect1 is entirely to the left of rect2.
158
+ */
159
+ export declare const areElsCollLeft: (rect1: ObjRect, rect2: ObjRect) => boolean;
160
+ /**
161
+ * Checks if rect1 is completely to the right of rect2 (no horizontal overlap).
162
+ *
163
+ * @param {ObjRect} rect1
164
+ * @param {ObjRect} rect2
165
+ * @returns {boolean} True if rect1 is entirely to the right of rect2.
166
+ */
167
+ export declare const areElsCollRight: (rect1: ObjRect, rect2: ObjRect) => boolean;
168
+ /**
169
+ * Checks if rect1 is perfectly above rect2 (no vertical touch or overlap).
170
+ *
171
+ * @param {ObjRect} rect1
172
+ * @param {ObjRect} rect2
173
+ * @returns {boolean} True if rect1 is fully above or touching rect2's top.
174
+ */
175
+ export declare const areElsCollPerfTop: (rect1: ObjRect, rect2: ObjRect) => boolean;
176
+ /**
177
+ * Checks if rect1 is perfectly below rect2 (no vertical touch or overlap).
178
+ *
179
+ * @param {ObjRect} rect1
180
+ * @param {ObjRect} rect2
181
+ * @returns {boolean} True if rect1 is fully below or touching rect2's bottom.
182
+ */
183
+ export declare const areElsCollPerfBottom: (rect1: ObjRect, rect2: ObjRect) => boolean;
184
+ /**
185
+ * Checks if rect1 is perfectly to the left of rect2 (no horizontal touch or overlap).
186
+ *
187
+ * @param {ObjRect} rect1
188
+ * @param {ObjRect} rect2
189
+ * @returns {boolean} True if rect1 is fully left or touching rect2's left.
190
+ */
191
+ export declare const areElsCollPerfLeft: (rect1: ObjRect, rect2: ObjRect) => boolean;
192
+ /**
193
+ * Checks if rect1 is perfectly to the right of rect2 (no horizontal touch or overlap).
194
+ *
195
+ * @param {ObjRect} rect1
196
+ * @param {ObjRect} rect2
197
+ * @returns {boolean} True if rect1 is fully right or touching rect2's right.
198
+ */
199
+ export declare const areElsCollPerfRight: (rect1: ObjRect, rect2: ObjRect) => boolean;
200
+ /**
201
+ * Returns true if rect1 and rect2 are colliding (partially or fully overlapping).
202
+ *
203
+ * @param {ObjRect} rect1
204
+ * @param {ObjRect} rect2
205
+ * @returns {boolean} True if there's any collision between rect1 and rect2.
206
+ */
207
+ export declare const areElsColliding: (rect1: ObjRect, rect2: ObjRect) => boolean;
208
+ /**
209
+ * Returns true if rect1 and rect2 are colliding or perfectly touching.
210
+ *
211
+ * @param {ObjRect} rect1
212
+ * @param {ObjRect} rect2
213
+ * @returns {boolean} True if there's any contact or overlap.
214
+ */
215
+ export declare const areElsPerfColliding: (rect1: ObjRect, rect2: ObjRect) => boolean;
216
+ /**
217
+ * Attempts to determine the direction rect1 entered rect2 based on loose overlap rules.
218
+ *
219
+ * @param {ObjRect} rect1
220
+ * @param {ObjRect} rect2
221
+ * @returns {string|null} 'top' | 'bottom' | 'left' | 'right' | null
222
+ */
223
+ export declare const getElsColliding: (rect1: ObjRect, rect2: ObjRect) => string | null;
224
+ /**
225
+ * Attempts to determine the direction rect1 touched or entered rect2 using perfect mode.
226
+ *
227
+ * @param {ObjRect} rect1
228
+ * @param {ObjRect} rect2
229
+ * @returns {'top' | 'bottom' | 'left' | 'right' | null}
230
+ */
231
+ export declare const getElsPerfColliding: (rect1: ObjRect, rect2: ObjRect) => 'top' | 'bottom' | 'left' | 'right' | null;
232
+ /**
233
+ * Calculates overlap values between rect1 and rect2 in all directions.
234
+ *
235
+ * @param {ObjRect} rect1
236
+ * @param {ObjRect} rect2
237
+ * @returns {{
238
+ * overlapLeft: number,
239
+ * overlapRight: number,
240
+ * overlapTop: number,
241
+ * overlapBottom: number
242
+ * }} Distance of overlap from each direction (can be negative).
243
+ */
244
+ export declare const getElsCollOverlap: (rect1: ObjRect, rect2: ObjRect) => {
245
+ overlapLeft: number;
246
+ overlapRight: number;
247
+ overlapTop: number;
248
+ overlapBottom: number;
249
+ };
250
+ /**
251
+ * Determines directional collision based on overlap depth.
252
+ *
253
+ * @param {Object} [settings={}]
254
+ * @param {number} [settings.overlapLeft]
255
+ * @param {number} [settings.overlapRight]
256
+ * @param {number} [settings.overlapTop]
257
+ * @param {number} [settings.overlapBottom]
258
+ * @returns {{ dirX: Dirs, dirY: Dirs }} Direction of strongest X/Y overlap.
259
+ */
260
+ export declare const getElsCollOverlapPos: ({ overlapLeft, overlapRight, overlapTop, overlapBottom, }?: {
261
+ overlapLeft?: number;
262
+ overlapRight?: number;
263
+ overlapTop?: number;
264
+ overlapBottom?: number;
265
+ }) => {
266
+ dirX: Dirs;
267
+ dirY: Dirs;
268
+ };
269
+ /**
270
+ * Calculates the center point (X and Y) of a given Rect.
271
+ *
272
+ * @param {ObjRect} rect - The bounding rectangle of the element.
273
+ * @returns {{ x: number, y: number }} An object with the `x` and `y` coordinates of the center.
274
+ */
275
+ export declare const getRectCenter: (rect: ObjRect) => {
276
+ x: number;
277
+ y: number;
278
+ };
279
+ /**
280
+ * Calculates the offset between the center of rect2 and the center of rect1.
281
+ *
282
+ * The values will be 0 when rect1 is perfectly centered over rect2.
283
+ *
284
+ * @param {ObjRect} rect1 - The bounding rectangle of the reference element.
285
+ * @param {ObjRect} rect2 - The bounding rectangle of the element being compared.
286
+ * @returns {{
287
+ * x: number,
288
+ * y: number
289
+ * }} An object with the X and Y offset in pixels from rect1's center to rect2's center.
290
+ */
291
+ export declare function getElsRelativeCenterOffset(rect1: ObjRect, rect2: ObjRect): {
292
+ x: number;
293
+ y: number;
294
+ };
295
+ /**
296
+ * Detects the direction of the dominant collision between two elements
297
+ * and calculates how deep the overlap is in both x and y axes.
298
+ *
299
+ * @param {ObjRect} rect1 - The bounding rectangle of the first element.
300
+ * @param {ObjRect} rect2 - The bounding rectangle of the second element.
301
+ * @returns {{
302
+ * inDir: Dirs | null;
303
+ * dirX: Dirs | null;
304
+ * dirY: Dirs | null;
305
+ * depthX: number;
306
+ * depthY: number;
307
+ * }} An object containing the collision direction and how deep the overlap is.
308
+ */
309
+ export declare function getElsCollDirDepth(rect1: ObjRect, rect2: ObjRect): {
310
+ inDir: Dirs | null;
311
+ dirX: Dirs | null;
312
+ dirY: Dirs | null;
313
+ depthX: number;
314
+ depthY: number;
315
+ };
316
+ /**
317
+ * Detects the collision direction and depth between two DOMRects.
318
+ *
319
+ * @param {ObjRect} rect1 - The bounding rectangle of the first element.
320
+ * @param {ObjRect} rect2 - The bounding rectangle of the second element.
321
+ * @returns {{ depth: CollData; dirs: CollDirs; isNeg: NegCollDirs; }} Collision info or null if no collision is detected.
322
+ */
323
+ export declare function getElsCollDetails(rect1: ObjRect, rect2: ObjRect): {
324
+ depth: CollData;
325
+ dirs: CollDirs;
326
+ isNeg: NegCollDirs;
327
+ };
187
328
  //# sourceMappingURL=collision.d.mts.map
@@ -1,3 +1,33 @@
1
+ export type FetchTemplateOptions = {
2
+ /**
3
+ * - HTTP method to use (GET, POST, etc.).
4
+ */
5
+ method?: string;
6
+ /**
7
+ * - Request body (only for methods like POST, PUT).
8
+ */
9
+ body?: any;
10
+ /**
11
+ * - Timeout in milliseconds (ignored if signal is provided).
12
+ */
13
+ timeout?: number;
14
+ /**
15
+ * - Number of retry attempts (ignored if signal is provided).
16
+ */
17
+ retries?: number;
18
+ /**
19
+ * - Additional headers.
20
+ */
21
+ headers?: Headers | Record<string, any>;
22
+ /**
23
+ * - External AbortSignal; disables timeout and retries.
24
+ */
25
+ signal?: AbortSignal | null;
26
+ /**
27
+ * - Track the load progress.
28
+ */
29
+ onProgress?: import('../html.mjs').FetchOnProgressResult;
30
+ };
1
31
  /**
2
32
  * Loads and parses a JSON from a remote URL using Fetch API.
3
33
  *
@@ -7,7 +37,7 @@
7
37
  * @throws {Error} Throws if fetch fails, times out, or returns invalid JSON.
8
38
  * @deprecated
9
39
  */
10
- export function fetchJson(url: string, options?: FetchTemplateOptions): Promise<any[] | Record<string | number | symbol, unknown>>;
40
+ export declare function fetchJson(url: string, options?: FetchTemplateOptions): Promise<any[] | Record<string | number | symbol, unknown>>;
11
41
  /**
12
42
  * Loads a remote file as a Blob using Fetch API.
13
43
  *
@@ -18,7 +48,7 @@ export function fetchJson(url: string, options?: FetchTemplateOptions): Promise<
18
48
  * @throws {Error} Throws if fetch fails, response is not ok, or MIME type is not allowed.
19
49
  * @deprecated
20
50
  */
21
- export function fetchBlob(url: string, allowedMimeTypes?: string[], options?: FetchTemplateOptions): Promise<Blob>;
51
+ export declare function fetchBlob(url: string, allowedMimeTypes?: string[], options?: FetchTemplateOptions): Promise<Blob>;
22
52
  /**
23
53
  * Loads a remote file as a text using Fetch API.
24
54
  *
@@ -29,35 +59,5 @@ export function fetchBlob(url: string, allowedMimeTypes?: string[], options?: Fe
29
59
  * @throws {Error} Throws if fetch fails, response is not ok, or MIME type is not allowed.
30
60
  * @deprecated
31
61
  */
32
- export function fetchText(url: string, allowedMimeTypes?: string[], options?: FetchTemplateOptions): Promise<string>;
33
- export type FetchTemplateOptions = {
34
- /**
35
- * - HTTP method to use (GET, POST, etc.).
36
- */
37
- method?: string | undefined;
38
- /**
39
- * - Request body (only for methods like POST, PUT).
40
- */
41
- body?: any;
42
- /**
43
- * - Timeout in milliseconds (ignored if signal is provided).
44
- */
45
- timeout?: number | undefined;
46
- /**
47
- * - Number of retry attempts (ignored if signal is provided).
48
- */
49
- retries?: number | undefined;
50
- /**
51
- * - Additional headers.
52
- */
53
- headers?: Headers | Record<string, any> | undefined;
54
- /**
55
- * - External AbortSignal; disables timeout and retries.
56
- */
57
- signal?: AbortSignal | null | undefined;
58
- /**
59
- * - Track the load progress.
60
- */
61
- onProgress?: import("../html.mjs").FetchOnProgressResult | undefined;
62
- };
62
+ export declare function fetchText(url: string, allowedMimeTypes?: string[], options?: FetchTemplateOptions): Promise<string>;
63
63
  //# sourceMappingURL=html.d.mts.map
@@ -1,4 +1,4 @@
1
+ import { Buffer } from 'buffer';
1
2
  declare const _default: (string | ((val: any) => val is Buffer))[][];
2
3
  export default _default;
3
- import { Buffer } from 'buffer';
4
4
  //# sourceMappingURL=Buffer.d.mts.map
@@ -1,8 +1,48 @@
1
- export function documentIsFullScreen(): boolean;
2
- export function isScreenFilled(): boolean;
3
- export function isFullScreenMode(): boolean;
4
- export function requestFullScreen(ops?: FullscreenOptions): Promise<void>;
5
- export function exitFullScreen(): Promise<void>;
6
- export function onFullScreenChange(listener: EventListenerOrEventListenerObject, ops?: boolean | AddEventListenerOptions): void;
7
- export function offFullScreenChange(listener: EventListenerOrEventListenerObject, ops?: boolean | AddEventListenerOptions): void;
1
+ /**
2
+ * Checks if the document is currently in fullscreen mode.
3
+ *
4
+ * @returns {boolean}
5
+ */
6
+ export declare const documentIsFullScreen: () => boolean;
7
+ /**
8
+ * Checks if the window occupies the entire screen dimensions.
9
+ *
10
+ * @returns {boolean}
11
+ */
12
+ export declare const isScreenFilled: () => boolean;
13
+ /**
14
+ * Checks if fullscreen mode is active either via document API or by matching screen dimensions.
15
+ *
16
+ * @returns {boolean}
17
+ */
18
+ export declare const isFullScreenMode: () => boolean;
19
+ /**
20
+ * Requests fullscreen mode for the document.
21
+ *
22
+ * @param {FullscreenOptions} [ops]
23
+ * @returns {Promise<void>}
24
+ */
25
+ export declare const requestFullScreen: (ops?: FullscreenOptions) => Promise<void>;
26
+ /**
27
+ * Exits fullscreen mode.
28
+ *
29
+ * @returns {Promise<void>}
30
+ */
31
+ export declare const exitFullScreen: () => Promise<void>;
32
+ /**
33
+ * Attaches a listener to fullscreen change events.
34
+ *
35
+ * @param {EventListenerOrEventListenerObject} listener
36
+ * @param {boolean|AddEventListenerOptions} [ops]
37
+ * @returns {void}
38
+ */
39
+ export declare const onFullScreenChange: (listener: EventListenerOrEventListenerObject, ops?: boolean | AddEventListenerOptions) => void;
40
+ /**
41
+ * Removes a listener from fullscreen change events.
42
+ *
43
+ * @param {EventListenerOrEventListenerObject} listener
44
+ * @param {boolean|AddEventListenerOptions} [ops]
45
+ * @returns {void}
46
+ */
47
+ export declare const offFullScreenChange: (listener: EventListenerOrEventListenerObject, ops?: boolean | AddEventListenerOptions) => void;
8
48
  //# sourceMappingURL=fullScreen.d.mts.map