@vpmedia/phaser 1.103.0 → 1.105.0

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 (298) hide show
  1. package/dist/index.js +997 -403
  2. package/dist/index.js.map +1 -1
  3. package/dist/phaser/core/animation.d.ts +35 -11
  4. package/dist/phaser/core/animation.d.ts.map +1 -1
  5. package/dist/phaser/core/animation_manager.d.ts +20 -10
  6. package/dist/phaser/core/animation_manager.d.ts.map +1 -1
  7. package/dist/phaser/core/animation_parser.d.ts +2 -2
  8. package/dist/phaser/core/animation_parser.d.ts.map +1 -1
  9. package/dist/phaser/core/array_set.d.ts +3 -3
  10. package/dist/phaser/core/array_set.d.ts.map +1 -1
  11. package/dist/phaser/core/cache.d.ts +68 -60
  12. package/dist/phaser/core/cache.d.ts.map +1 -1
  13. package/dist/phaser/core/device.d.ts +23 -0
  14. package/dist/phaser/core/device.d.ts.map +1 -1
  15. package/dist/phaser/core/device_util.d.ts +10 -10
  16. package/dist/phaser/core/device_util.d.ts.map +1 -1
  17. package/dist/phaser/core/dom.d.ts +6 -5
  18. package/dist/phaser/core/dom.d.ts.map +1 -1
  19. package/dist/phaser/core/event_manager.d.ts +49 -158
  20. package/dist/phaser/core/event_manager.d.ts.map +1 -1
  21. package/dist/phaser/core/factory.d.ts +8 -7
  22. package/dist/phaser/core/factory.d.ts.map +1 -1
  23. package/dist/phaser/core/frame.d.ts +27 -48
  24. package/dist/phaser/core/frame.d.ts.map +1 -1
  25. package/dist/phaser/core/frame_data.d.ts +11 -58
  26. package/dist/phaser/core/frame_data.d.ts.map +1 -1
  27. package/dist/phaser/core/frame_util.d.ts +4 -14
  28. package/dist/phaser/core/frame_util.d.ts.map +1 -1
  29. package/dist/phaser/core/game.d.ts +50 -3
  30. package/dist/phaser/core/game.d.ts.map +1 -1
  31. package/dist/phaser/core/input.d.ts +66 -13
  32. package/dist/phaser/core/input.d.ts.map +1 -1
  33. package/dist/phaser/core/input_handler.d.ts +64 -20
  34. package/dist/phaser/core/input_handler.d.ts.map +1 -1
  35. package/dist/phaser/core/input_mouse.d.ts +26 -1
  36. package/dist/phaser/core/input_mouse.d.ts.map +1 -1
  37. package/dist/phaser/core/input_mspointer.d.ts +18 -2
  38. package/dist/phaser/core/input_mspointer.d.ts.map +1 -1
  39. package/dist/phaser/core/input_pointer.d.ts +53 -9
  40. package/dist/phaser/core/input_pointer.d.ts.map +1 -1
  41. package/dist/phaser/core/input_touch.d.ts +19 -1
  42. package/dist/phaser/core/input_touch.d.ts.map +1 -1
  43. package/dist/phaser/core/loader.d.ts +56 -28
  44. package/dist/phaser/core/loader.d.ts.map +1 -1
  45. package/dist/phaser/core/loader_parser.d.ts +4 -4
  46. package/dist/phaser/core/loader_parser.d.ts.map +1 -1
  47. package/dist/phaser/core/raf.d.ts +2 -2
  48. package/dist/phaser/core/raf.d.ts.map +1 -1
  49. package/dist/phaser/core/scale_manager.d.ts +77 -17
  50. package/dist/phaser/core/scale_manager.d.ts.map +1 -1
  51. package/dist/phaser/core/scene.d.ts +3 -1
  52. package/dist/phaser/core/scene.d.ts.map +1 -1
  53. package/dist/phaser/core/scene_manager.d.ts +25 -9
  54. package/dist/phaser/core/scene_manager.d.ts.map +1 -1
  55. package/dist/phaser/core/signal.d.ts +9 -8
  56. package/dist/phaser/core/signal.d.ts.map +1 -1
  57. package/dist/phaser/core/signal_binding.d.ts +2 -2
  58. package/dist/phaser/core/signal_binding.d.ts.map +1 -1
  59. package/dist/phaser/core/sound.d.ts +58 -10
  60. package/dist/phaser/core/sound.d.ts.map +1 -1
  61. package/dist/phaser/core/sound_manager.d.ts +28 -9
  62. package/dist/phaser/core/sound_manager.d.ts.map +1 -1
  63. package/dist/phaser/core/sound_sprite.d.ts +10 -4
  64. package/dist/phaser/core/sound_sprite.d.ts.map +1 -1
  65. package/dist/phaser/core/stage.d.ts +7 -3
  66. package/dist/phaser/core/stage.d.ts.map +1 -1
  67. package/dist/phaser/core/time.d.ts +32 -5
  68. package/dist/phaser/core/time.d.ts.map +1 -1
  69. package/dist/phaser/core/timer.d.ts +30 -10
  70. package/dist/phaser/core/timer.d.ts.map +1 -1
  71. package/dist/phaser/core/timer_event.d.ts +11 -12
  72. package/dist/phaser/core/timer_event.d.ts.map +1 -1
  73. package/dist/phaser/core/tween.d.ts +38 -14
  74. package/dist/phaser/core/tween.d.ts.map +1 -1
  75. package/dist/phaser/core/tween_data.d.ts +30 -5
  76. package/dist/phaser/core/tween_data.d.ts.map +1 -1
  77. package/dist/phaser/core/tween_easing.d.ts +31 -31
  78. package/dist/phaser/core/tween_easing.d.ts.map +1 -1
  79. package/dist/phaser/core/tween_manager.d.ts +8 -4
  80. package/dist/phaser/core/tween_manager.d.ts.map +1 -1
  81. package/dist/phaser/core/world.d.ts +1 -1
  82. package/dist/phaser/core/world.d.ts.map +1 -1
  83. package/dist/phaser/display/bitmap_text.d.ts +35 -20
  84. package/dist/phaser/display/bitmap_text.d.ts.map +1 -1
  85. package/dist/phaser/display/button.d.ts +24 -8
  86. package/dist/phaser/display/button.d.ts.map +1 -1
  87. package/dist/phaser/display/canvas/buffer.d.ts +6 -2
  88. package/dist/phaser/display/canvas/buffer.d.ts.map +1 -1
  89. package/dist/phaser/display/canvas/graphics.d.ts +3 -3
  90. package/dist/phaser/display/canvas/graphics.d.ts.map +1 -1
  91. package/dist/phaser/display/canvas/masker.d.ts.map +1 -1
  92. package/dist/phaser/display/canvas/pool.d.ts +2 -2
  93. package/dist/phaser/display/canvas/pool.d.ts.map +1 -1
  94. package/dist/phaser/display/canvas/renderer.d.ts +18 -5
  95. package/dist/phaser/display/canvas/renderer.d.ts.map +1 -1
  96. package/dist/phaser/display/canvas/tinter.d.ts +3 -3
  97. package/dist/phaser/display/canvas/tinter.d.ts.map +1 -1
  98. package/dist/phaser/display/canvas/util.d.ts +9 -9
  99. package/dist/phaser/display/canvas/util.d.ts.map +1 -1
  100. package/dist/phaser/display/display_object.d.ts +82 -23
  101. package/dist/phaser/display/display_object.d.ts.map +1 -1
  102. package/dist/phaser/display/graphics.d.ts +42 -16
  103. package/dist/phaser/display/graphics.d.ts.map +1 -1
  104. package/dist/phaser/display/graphics_data.d.ts +11 -1
  105. package/dist/phaser/display/graphics_data.d.ts.map +1 -1
  106. package/dist/phaser/display/graphics_data_util.d.ts +1 -1
  107. package/dist/phaser/display/graphics_data_util.d.ts.map +1 -1
  108. package/dist/phaser/display/group.d.ts +24 -9
  109. package/dist/phaser/display/group.d.ts.map +1 -1
  110. package/dist/phaser/display/image.d.ts +36 -13
  111. package/dist/phaser/display/image.d.ts.map +1 -1
  112. package/dist/phaser/display/sprite_batch.d.ts +1 -1
  113. package/dist/phaser/display/sprite_batch.d.ts.map +1 -1
  114. package/dist/phaser/display/sprite_util.d.ts +5 -5
  115. package/dist/phaser/display/sprite_util.d.ts.map +1 -1
  116. package/dist/phaser/display/text.d.ts +86 -66
  117. package/dist/phaser/display/text.d.ts.map +1 -1
  118. package/dist/phaser/display/webgl/abstract_filter.d.ts +8 -1
  119. package/dist/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
  120. package/dist/phaser/display/webgl/base_texture.d.ts +14 -2
  121. package/dist/phaser/display/webgl/base_texture.d.ts.map +1 -1
  122. package/dist/phaser/display/webgl/blend_manager.d.ts +5 -2
  123. package/dist/phaser/display/webgl/blend_manager.d.ts.map +1 -1
  124. package/dist/phaser/display/webgl/earcut.d.ts +10 -10
  125. package/dist/phaser/display/webgl/earcut.d.ts.map +1 -1
  126. package/dist/phaser/display/webgl/earcut_node.d.ts +1 -1
  127. package/dist/phaser/display/webgl/earcut_node.d.ts.map +1 -1
  128. package/dist/phaser/display/webgl/fast_sprite_batch.d.ts +17 -1
  129. package/dist/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
  130. package/dist/phaser/display/webgl/filter_manager.d.ts +5 -1
  131. package/dist/phaser/display/webgl/filter_manager.d.ts.map +1 -1
  132. package/dist/phaser/display/webgl/filter_texture.d.ts +7 -2
  133. package/dist/phaser/display/webgl/filter_texture.d.ts.map +1 -1
  134. package/dist/phaser/display/webgl/graphics.d.ts +11 -10
  135. package/dist/phaser/display/webgl/graphics.d.ts.map +1 -1
  136. package/dist/phaser/display/webgl/graphics_data.d.ts +11 -1
  137. package/dist/phaser/display/webgl/graphics_data.d.ts.map +1 -1
  138. package/dist/phaser/display/webgl/mask_manager.d.ts.map +1 -1
  139. package/dist/phaser/display/webgl/render_texture.d.ts +12 -1
  140. package/dist/phaser/display/webgl/render_texture.d.ts.map +1 -1
  141. package/dist/phaser/display/webgl/renderer.d.ts +25 -6
  142. package/dist/phaser/display/webgl/renderer.d.ts.map +1 -1
  143. package/dist/phaser/display/webgl/shader/complex.d.ts +7 -1
  144. package/dist/phaser/display/webgl/shader/complex.d.ts.map +1 -1
  145. package/dist/phaser/display/webgl/shader/fast.d.ts +8 -1
  146. package/dist/phaser/display/webgl/shader/fast.d.ts.map +1 -1
  147. package/dist/phaser/display/webgl/shader/normal.d.ts +11 -0
  148. package/dist/phaser/display/webgl/shader/normal.d.ts.map +1 -1
  149. package/dist/phaser/display/webgl/shader/primitive.d.ts +7 -1
  150. package/dist/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
  151. package/dist/phaser/display/webgl/shader/strip.d.ts +7 -1
  152. package/dist/phaser/display/webgl/shader/strip.d.ts.map +1 -1
  153. package/dist/phaser/display/webgl/shader_manager.d.ts +14 -2
  154. package/dist/phaser/display/webgl/shader_manager.d.ts.map +1 -1
  155. package/dist/phaser/display/webgl/sprite_batch.d.ts +19 -2
  156. package/dist/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
  157. package/dist/phaser/display/webgl/stencil_manager.d.ts +8 -4
  158. package/dist/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
  159. package/dist/phaser/display/webgl/texture.d.ts +35 -2
  160. package/dist/phaser/display/webgl/texture.d.ts.map +1 -1
  161. package/dist/phaser/display/webgl/texture_util.d.ts +2 -2
  162. package/dist/phaser/display/webgl/texture_util.d.ts.map +1 -1
  163. package/dist/phaser/display/webgl/util.d.ts +6 -6
  164. package/dist/phaser/display/webgl/util.d.ts.map +1 -1
  165. package/dist/phaser/geom/circle.d.ts +11 -10
  166. package/dist/phaser/geom/circle.d.ts.map +1 -1
  167. package/dist/phaser/geom/ellipse.d.ts +6 -5
  168. package/dist/phaser/geom/ellipse.d.ts.map +1 -1
  169. package/dist/phaser/geom/line.d.ts +14 -14
  170. package/dist/phaser/geom/line.d.ts.map +1 -1
  171. package/dist/phaser/geom/matrix.d.ts +13 -12
  172. package/dist/phaser/geom/matrix.d.ts.map +1 -1
  173. package/dist/phaser/geom/point.d.ts +19 -19
  174. package/dist/phaser/geom/point.d.ts.map +1 -1
  175. package/dist/phaser/geom/polygon.d.ts +6 -6
  176. package/dist/phaser/geom/polygon.d.ts.map +1 -1
  177. package/dist/phaser/geom/rectangle.d.ts +20 -20
  178. package/dist/phaser/geom/rectangle.d.ts.map +1 -1
  179. package/dist/phaser/geom/rounded_rectangle.d.ts +2 -2
  180. package/dist/phaser/geom/rounded_rectangle.d.ts.map +1 -1
  181. package/dist/phaser/geom/util/circle.d.ts +9 -7
  182. package/dist/phaser/geom/util/circle.d.ts.map +1 -1
  183. package/dist/phaser/geom/util/ellipse.d.ts +1 -1
  184. package/dist/phaser/geom/util/ellipse.d.ts.map +1 -1
  185. package/dist/phaser/geom/util/line.d.ts +5 -3
  186. package/dist/phaser/geom/util/line.d.ts.map +1 -1
  187. package/dist/phaser/geom/util/matrix.d.ts +2 -1
  188. package/dist/phaser/geom/util/matrix.d.ts.map +1 -1
  189. package/dist/phaser/geom/util/point.d.ts +19 -19
  190. package/dist/phaser/geom/util/point.d.ts.map +1 -1
  191. package/dist/phaser/geom/util/polygon.d.ts +2 -1
  192. package/dist/phaser/geom/util/polygon.d.ts.map +1 -1
  193. package/dist/phaser/geom/util/rectangle.d.ts +17 -15
  194. package/dist/phaser/geom/util/rectangle.d.ts.map +1 -1
  195. package/dist/phaser/geom/util/rounded_rectangle.d.ts +2 -1
  196. package/dist/phaser/geom/util/rounded_rectangle.d.ts.map +1 -1
  197. package/dist/phaser/util/math.d.ts +51 -142
  198. package/dist/phaser/util/math.d.ts.map +1 -1
  199. package/package.json +2 -2
  200. package/src/phaser/core/animation.ts +41 -18
  201. package/src/phaser/core/animation_manager.ts +21 -12
  202. package/src/phaser/core/animation_parser.ts +11 -3
  203. package/src/phaser/core/array_set.ts +8 -8
  204. package/src/phaser/core/cache.ts +75 -60
  205. package/src/phaser/core/device.ts +23 -1
  206. package/src/phaser/core/device_util.ts +10 -10
  207. package/src/phaser/core/dom.ts +5 -5
  208. package/src/phaser/core/event_manager.ts +52 -177
  209. package/src/phaser/core/factory.ts +25 -17
  210. package/src/phaser/core/frame.ts +37 -51
  211. package/src/phaser/core/frame_data.ts +29 -74
  212. package/src/phaser/core/frame_util.ts +3 -16
  213. package/src/phaser/core/game.ts +40 -11
  214. package/src/phaser/core/input.ts +68 -17
  215. package/src/phaser/core/input_handler.ts +81 -45
  216. package/src/phaser/core/input_mouse.ts +42 -13
  217. package/src/phaser/core/input_mspointer.ts +24 -9
  218. package/src/phaser/core/input_pointer.ts +55 -12
  219. package/src/phaser/core/input_touch.ts +26 -9
  220. package/src/phaser/core/loader.ts +97 -42
  221. package/src/phaser/core/loader_parser.ts +6 -7
  222. package/src/phaser/core/raf.ts +2 -2
  223. package/src/phaser/core/scale_manager.ts +85 -27
  224. package/src/phaser/core/scene.ts +3 -2
  225. package/src/phaser/core/scene_manager.ts +26 -11
  226. package/src/phaser/core/signal.ts +10 -10
  227. package/src/phaser/core/signal_binding.ts +2 -2
  228. package/src/phaser/core/sound.ts +72 -26
  229. package/src/phaser/core/sound_manager.ts +31 -13
  230. package/src/phaser/core/sound_sprite.ts +10 -5
  231. package/src/phaser/core/stage.ts +8 -4
  232. package/src/phaser/core/time.ts +33 -7
  233. package/src/phaser/core/timer.ts +40 -14
  234. package/src/phaser/core/timer_event.ts +23 -14
  235. package/src/phaser/core/tween.ts +43 -23
  236. package/src/phaser/core/tween_data.ts +31 -7
  237. package/src/phaser/core/tween_easing.ts +31 -31
  238. package/src/phaser/core/tween_manager.ts +10 -7
  239. package/src/phaser/core/world.ts +1 -2
  240. package/src/phaser/display/bitmap_text.ts +41 -18
  241. package/src/phaser/display/button.ts +24 -23
  242. package/src/phaser/display/canvas/buffer.ts +6 -3
  243. package/src/phaser/display/canvas/graphics.ts +3 -4
  244. package/src/phaser/display/canvas/masker.ts +2 -3
  245. package/src/phaser/display/canvas/pool.ts +3 -4
  246. package/src/phaser/display/canvas/renderer.ts +19 -7
  247. package/src/phaser/display/canvas/tinter.ts +4 -5
  248. package/src/phaser/display/canvas/util.ts +9 -9
  249. package/src/phaser/display/display_object.ts +120 -61
  250. package/src/phaser/display/graphics.ts +56 -25
  251. package/src/phaser/display/graphics_data.ts +11 -2
  252. package/src/phaser/display/graphics_data_util.ts +1 -2
  253. package/src/phaser/display/group.ts +32 -14
  254. package/src/phaser/display/image.ts +37 -19
  255. package/src/phaser/display/sprite_batch.ts +1 -2
  256. package/src/phaser/display/sprite_util.ts +5 -6
  257. package/src/phaser/display/text.ts +82 -56
  258. package/src/phaser/display/webgl/abstract_filter.ts +8 -2
  259. package/src/phaser/display/webgl/base_texture.ts +14 -3
  260. package/src/phaser/display/webgl/blend_manager.ts +5 -3
  261. package/src/phaser/display/webgl/earcut.ts +27 -27
  262. package/src/phaser/display/webgl/earcut_node.ts +1 -1
  263. package/src/phaser/display/webgl/fast_sprite_batch.ts +19 -4
  264. package/src/phaser/display/webgl/filter_manager.ts +5 -2
  265. package/src/phaser/display/webgl/filter_texture.ts +7 -3
  266. package/src/phaser/display/webgl/graphics.ts +10 -11
  267. package/src/phaser/display/webgl/graphics_data.ts +11 -2
  268. package/src/phaser/display/webgl/mask_manager.ts +2 -3
  269. package/src/phaser/display/webgl/render_texture.ts +12 -2
  270. package/src/phaser/display/webgl/renderer.ts +24 -7
  271. package/src/phaser/display/webgl/shader/complex.ts +7 -2
  272. package/src/phaser/display/webgl/shader/fast.ts +8 -2
  273. package/src/phaser/display/webgl/shader/normal.ts +12 -2
  274. package/src/phaser/display/webgl/shader/primitive.ts +7 -2
  275. package/src/phaser/display/webgl/shader/strip.ts +7 -2
  276. package/src/phaser/display/webgl/shader_manager.ts +13 -3
  277. package/src/phaser/display/webgl/sprite_batch.ts +20 -4
  278. package/src/phaser/display/webgl/stencil_manager.ts +8 -5
  279. package/src/phaser/display/webgl/texture.ts +35 -4
  280. package/src/phaser/display/webgl/texture_util.ts +2 -3
  281. package/src/phaser/display/webgl/util.ts +6 -6
  282. package/src/phaser/geom/circle.ts +10 -10
  283. package/src/phaser/geom/ellipse.ts +6 -6
  284. package/src/phaser/geom/line.ts +14 -14
  285. package/src/phaser/geom/matrix.ts +12 -12
  286. package/src/phaser/geom/point.ts +19 -19
  287. package/src/phaser/geom/polygon.ts +5 -5
  288. package/src/phaser/geom/rectangle.ts +21 -21
  289. package/src/phaser/geom/rounded_rectangle.ts +2 -2
  290. package/src/phaser/geom/util/circle.ts +7 -7
  291. package/src/phaser/geom/util/ellipse.ts +1 -1
  292. package/src/phaser/geom/util/line.ts +5 -5
  293. package/src/phaser/geom/util/matrix.ts +1 -1
  294. package/src/phaser/geom/util/point.ts +20 -20
  295. package/src/phaser/geom/util/polygon.ts +1 -1
  296. package/src/phaser/geom/util/rectangle.ts +15 -15
  297. package/src/phaser/geom/util/rounded_rectangle.ts +1 -1
  298. package/src/phaser/util/math.ts +65 -151
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import { Circle } from '../geom/circle.js';
3
2
  import { Point } from '../geom/point.js';
4
3
  import {
@@ -11,13 +10,57 @@ import {
11
10
  } from './const.js';
12
11
 
13
12
  export class Pointer {
13
+ game!: any;
14
+ id!: any;
15
+ type!: any;
16
+ exists!: any;
17
+ identifier!: any;
18
+ pointerId!: any;
19
+ pointerMode!: any;
20
+ target!: any;
21
+ button!: any;
22
+ _holdSent!: any;
23
+ _history!: any;
24
+ _nextDrop!: any;
25
+ _stateReset!: any;
26
+ withinGame!: any;
27
+ clientX!: any;
28
+ clientY!: any;
29
+ pageX!: any;
30
+ pageY!: any;
31
+ screenX!: any;
32
+ screenY!: any;
33
+ rawMovementX!: any;
34
+ rawMovementY!: any;
35
+ movementX!: any;
36
+ movementY!: any;
37
+ x!: any;
38
+ y!: any;
39
+ isMouse!: any;
40
+ isDown!: any;
41
+ isUp!: any;
42
+ timeDown!: any;
43
+ timeUp!: any;
44
+ previousTapTime!: any;
45
+ totalTouches!: any;
46
+ msSinceLastClick!: any;
47
+ targetObject!: any;
48
+ interactiveCandidates!: any;
49
+ active!: any;
50
+ dirty!: any;
51
+ position!: any;
52
+ positionDown!: any;
53
+ positionUp!: any;
54
+ circle!: any;
55
+ _clickTrampolines!: any;
56
+ _trampolineTargetObject!: any;
14
57
  /**
15
58
  * TBD.
16
59
  * @param {import('./game.js').Game} game - TBD.
17
60
  * @param {number} id - TBD.
18
61
  * @param {number} pointerMode - TBD.
19
62
  */
20
- constructor(game, id, pointerMode) {
63
+ constructor(game: import('./game.js').Game, id: number, pointerMode: number) {
21
64
  this.game = game;
22
65
  this.id = id;
23
66
  /** @type {number} */
@@ -94,7 +137,7 @@ export class Pointer {
94
137
  * TBD.
95
138
  * @param {MouseEvent|PointerEvent} event - TBD.
96
139
  */
97
- updateButtons(event) {
140
+ updateButtons(event: any|PointerEvent) {
98
141
  if (event.type.toLowerCase().substr(-4) === 'down') {
99
142
  this.isUp = false;
100
143
  this.isDown = true;
@@ -109,7 +152,7 @@ export class Pointer {
109
152
  * @param {PointerEvent} event - TBD.
110
153
  * @returns {Pointer} TBD.
111
154
  */
112
- start(event) {
155
+ start(event: any) {
113
156
  const input = this.game.input;
114
157
  if (event.pointerId) {
115
158
  this.pointerId = event.pointerId;
@@ -198,7 +241,7 @@ export class Pointer {
198
241
  * @param {boolean} fromClick - TBD.
199
242
  * @returns {Pointer} TBD.
200
243
  */
201
- move(event, fromClick = false) {
244
+ move(event: any|PointerEvent, fromClick: boolean = false) {
202
245
  const input = this.game.input;
203
246
  if (input.pollLocked) {
204
247
  return null;
@@ -261,7 +304,7 @@ export class Pointer {
261
304
  * @param {boolean} fromClick - TBD.
262
305
  * @returns {boolean} TBD.
263
306
  */
264
- processInteractiveObjects(fromClick = false) {
307
+ processInteractiveObjects(fromClick: boolean = false) {
265
308
  // Work out which object is on the top
266
309
  let highestRenderOrderID = 0;
267
310
  let highestInputPriorityID = -1;
@@ -323,7 +366,7 @@ export class Pointer {
323
366
  * @param {import('./input_handler.js').InputHandler} newTarget - TBD.
324
367
  * @param {boolean} silent - TBD.
325
368
  */
326
- swapTarget(newTarget, silent = false) {
369
+ swapTarget(newTarget: import('./input_handler.js').InputHandler, silent: boolean = false) {
327
370
  // Now we know the top-most item (if any) we can process it
328
371
  if (newTarget === null) {
329
372
  // The pointer isn't currently over anything, check if we've got a lingering previous target
@@ -354,7 +397,7 @@ export class Pointer {
354
397
  * TBD.
355
398
  * @param {MouseEvent|PointerEvent} event - TBD.
356
399
  */
357
- leave(event) {
400
+ leave(event: any|PointerEvent) {
358
401
  this.withinGame = false;
359
402
  this.move(event, false);
360
403
  }
@@ -364,7 +407,7 @@ export class Pointer {
364
407
  * @param {MouseEvent|PointerEvent} event - TBD.
365
408
  * @returns {Pointer} TBD.
366
409
  */
367
- stop(event) {
410
+ stop(event: any|PointerEvent) {
368
411
  const input = this.game.input;
369
412
  if (this._stateReset && this.withinGame) {
370
413
  event.preventDefault();
@@ -420,7 +463,7 @@ export class Pointer {
420
463
  * @param {number} duration - TBD.
421
464
  * @returns {boolean} TBD.
422
465
  */
423
- justPressed(duration) {
466
+ justPressed(duration: number) {
424
467
  duration = duration || this.game.input.justPressedRate;
425
468
  return this.isDown === true && this.timeDown + duration > this.game.time.time;
426
469
  }
@@ -430,7 +473,7 @@ export class Pointer {
430
473
  * @param {number} duration - TBD.
431
474
  * @returns {boolean} TBD.
432
475
  */
433
- justReleased(duration) {
476
+ justReleased(duration: number) {
434
477
  duration = duration || this.game.input.justReleasedRate;
435
478
  return this.isUp && this.timeUp + duration > this.game.time.time;
436
479
  }
@@ -442,7 +485,7 @@ export class Pointer {
442
485
  * @param {object} callbackContext - TBD.
443
486
  * @param {...any} callbackArgs - TBD.
444
487
  */
445
- addClickTrampoline(name, callback, callbackContext, callbackArgs) {
488
+ addClickTrampoline(name: string, callback: Function, callbackContext: any, callbackArgs: any) {
446
489
  if (!this.isDown) {
447
490
  return;
448
491
  }
@@ -1,10 +1,27 @@
1
- // @ts-nocheck
2
1
  export class Touch {
2
+ game!: any;
3
+ enabled!: any;
4
+ callbackContext!: any;
5
+ touchStartCallback!: any;
6
+ touchMoveCallback!: any;
7
+ touchEndCallback!: any;
8
+ touchEnterCallback!: any;
9
+ touchLeaveCallback!: any;
10
+ touchCancelCallback!: any;
11
+ preventDefault!: any;
12
+ event!: any;
13
+ _onTouchStart!: any;
14
+ _onTouchMove!: any;
15
+ _onTouchEnd!: any;
16
+ _onTouchEnter!: any;
17
+ _onTouchLeave!: any;
18
+ _onTouchCancel!: any;
19
+ _documentTouchMove!: any;
3
20
  /**
4
21
  * TBD.
5
22
  * @param {import('./game.js').Game} game - TBD.
6
23
  */
7
- constructor(game) {
24
+ constructor(game: import('./game.js').Game) {
8
25
  this.game = game;
9
26
  this.enabled = true;
10
27
  this.callbackContext = this.game;
@@ -76,7 +93,7 @@ export class Touch {
76
93
  * TBD.
77
94
  * @param {TouchEvent} event - TBD.
78
95
  */
79
- onTouchStart(event) {
96
+ onTouchStart(event: any) {
80
97
  this.event = event;
81
98
  if (!this.game.input.enabled || !this.enabled) {
82
99
  return;
@@ -97,7 +114,7 @@ export class Touch {
97
114
  * TBD.
98
115
  * @param {TouchEvent} event - TBD.
99
116
  */
100
- onTouchCancel(event) {
117
+ onTouchCancel(event: any) {
101
118
  this.event = event;
102
119
  if (this.touchCancelCallback) {
103
120
  this.touchCancelCallback.call(this.callbackContext, event);
@@ -117,7 +134,7 @@ export class Touch {
117
134
  * TBD.
118
135
  * @param {TouchEvent} event - TBD.
119
136
  */
120
- onTouchEnter(event) {
137
+ onTouchEnter(event: any) {
121
138
  this.event = event;
122
139
  if (this.touchEnterCallback) {
123
140
  this.touchEnterCallback.call(this.callbackContext, event);
@@ -132,7 +149,7 @@ export class Touch {
132
149
  * TBD.
133
150
  * @param {TouchEvent} event - TBD.
134
151
  */
135
- onTouchLeave(event) {
152
+ onTouchLeave(event: any) {
136
153
  this.event = event;
137
154
  if (this.touchLeaveCallback) {
138
155
  this.touchLeaveCallback.call(this.callbackContext, event);
@@ -144,7 +161,7 @@ export class Touch {
144
161
  * TBD.
145
162
  * @param {TouchEvent} event - TBD.
146
163
  */
147
- onTouchMove(event) {
164
+ onTouchMove(event: any) {
148
165
  this.event = event;
149
166
  if (this.touchMoveCallback) {
150
167
  this.touchMoveCallback.call(this.callbackContext, event);
@@ -159,7 +176,7 @@ export class Touch {
159
176
  * TBD.
160
177
  * @param {TouchEvent} event - TBD.
161
178
  */
162
- onTouchEnd(event) {
179
+ onTouchEnd(event: any) {
163
180
  this.event = event;
164
181
  if (this.touchEndCallback) {
165
182
  this.touchEndCallback.call(this.callbackContext, event);
@@ -177,7 +194,7 @@ export class Touch {
177
194
  * TBD.
178
195
  * @param {TouchEvent} event - TBD.
179
196
  */
180
- eventPreventDefault(event) {
197
+ eventPreventDefault(event: any) {
181
198
  if (this.preventDefault) {
182
199
  if (typeof event.cancelable !== 'boolean' || event.cancelable) {
183
200
  event.preventDefault();
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import { Rectangle } from '../geom/rectangle.js';
3
2
  import { canPlayAudio } from './device_util.js';
4
3
  import { ENGINE_ERROR_INVALID_BITMAP_FONT_ATLAS } from './error_code.js';
@@ -7,11 +6,39 @@ import { Signal } from './signal.js';
7
6
  const TEXTURE_ATLAS_JSON_HASH = 1;
8
7
 
9
8
  export class Loader {
9
+ game!: any;
10
+ cache!: any;
11
+ isLoading!: any;
12
+ isUseLog!: any;
13
+ isUseRetry!: any;
14
+ maxRetry!: any;
15
+ hasLoaded!: any;
16
+ preloadSprite!: any;
17
+ crossOrigin!: any;
18
+ baseURL!: any;
19
+ path!: any;
20
+ headers!: any;
21
+ onLoadStart!: any;
22
+ onLoadComplete!: any;
23
+ onPackComplete!: any;
24
+ onFileStart!: any;
25
+ onFileComplete!: any;
26
+ onFileError!: any;
27
+ maxParallelDownloads!: any;
28
+ _withSyncPointDepth!: any;
29
+ _fileList!: any;
30
+ _flightQueue!: any;
31
+ _processingHead!: any;
32
+ _fileLoadStarted!: any;
33
+ _totalPackCount!: any;
34
+ _totalFileCount!: any;
35
+ _loadedPackCount!: any;
36
+ _loadedFileCount!: any;
10
37
  /**
11
38
  * Creates a new Loader instance.
12
39
  * @param {import('./game.js').Game} game - Reference to the Phaser Game instance.
13
40
  */
14
- constructor(game) {
41
+ constructor(game: import('./game.js').Game) {
15
42
  this.game = game;
16
43
  this.cache = game.cache;
17
44
  this.isLoading = false;
@@ -51,7 +78,7 @@ export class Loader {
51
78
  * @param {import('../display/image.js').Image} sprite - The image to use as the preload sprite.
52
79
  * @param {number} direction - The direction of the progress (0 = horizontal, 1 = vertical).
53
80
  */
54
- setPreloadSprite(sprite, direction = 0) {
81
+ setPreloadSprite(sprite: import('../display/image.js').Image, direction: number = 0) {
55
82
  this.preloadSprite = {
56
83
  sprite,
57
84
  direction,
@@ -85,7 +112,7 @@ export class Loader {
85
112
  * @param {string} key - The key of the file to check for.
86
113
  * @returns {boolean} True if the file exists, false otherwise.
87
114
  */
88
- checkKeyExists(type, key) {
115
+ checkKeyExists(type: string, key: string) {
89
116
  return this.getAssetIndex(type, key) > -1;
90
117
  }
91
118
 
@@ -95,7 +122,7 @@ export class Loader {
95
122
  * @param {string} key - The key of the file to find.
96
123
  * @returns {number} The index of the file in the list, or -1 if not found.
97
124
  */
98
- getAssetIndex(type, key) {
125
+ getAssetIndex(type: string, key: string) {
99
126
  let bestFound = -1;
100
127
  for (let i = 0; i < this._fileList.length; i += 1) {
101
128
  const file = this._fileList[i];
@@ -117,7 +144,7 @@ export class Loader {
117
144
  * @param {string} key - The key of the file to get.
118
145
  * @returns {{index: number, file: object} | null} The file and its index, or null if not found.
119
146
  */
120
- getAsset(type, key) {
147
+ getAsset(type: string, key: string) {
121
148
  const fileIndex = this.getAssetIndex(type, key);
122
149
  if (fileIndex > -1) {
123
150
  return { index: fileIndex, file: this._fileList[fileIndex] };
@@ -130,7 +157,7 @@ export class Loader {
130
157
  * @param {boolean} hard - Whether to perform a hard reset (clears preload sprite).
131
158
  * @param {boolean} clearEvents - Whether to clear event listeners.
132
159
  */
133
- reset(hard = false, clearEvents = false) {
160
+ reset(hard: boolean = false, clearEvents: boolean = false) {
134
161
  if (hard) {
135
162
  this.preloadSprite = null;
136
163
  }
@@ -163,7 +190,14 @@ export class Loader {
163
190
  * @param {string} extension - The file extension to use if URL is not provided.
164
191
  * @returns {Loader} This Loader instance for chaining.
165
192
  */
166
- addToFileList(type, key = '', url = null, properties = null, overwrite = false, extension = null) {
193
+ addToFileList(
194
+ type: string,
195
+ key: string = '',
196
+ url: string = null,
197
+ properties: any = null,
198
+ overwrite: boolean = false,
199
+ extension: string = null
200
+ ) {
167
201
  if (key === undefined || key === '') {
168
202
  this.game.logger.warn(`Loader: Invalid or no key given of type ${type}`);
169
203
  return this;
@@ -218,7 +252,7 @@ export class Loader {
218
252
  * @param {object} properties - The new properties for the file.
219
253
  * @returns {Loader} This Loader instance for chaining.
220
254
  */
221
- replaceInFileList(type, key, url, properties) {
255
+ replaceInFileList(type: string, key: string, url: string, properties: any) {
222
256
  return this.addToFileList(type, key, url, properties, true);
223
257
  }
224
258
 
@@ -230,7 +264,7 @@ export class Loader {
230
264
  * @param {object} callbackContext - The context in which to call the callback.
231
265
  * @returns {Loader} This Loader instance for chaining.
232
266
  */
233
- pack(key, url, data, callbackContext) {
267
+ pack(key: string, url: string, data: any, callbackContext: any) {
234
268
  const pack = {
235
269
  type: 'packfile',
236
270
  key: key,
@@ -268,7 +302,7 @@ export class Loader {
268
302
  * @param {boolean} overwrite - Whether to overwrite an existing file with the same key.
269
303
  * @returns {Loader} This Loader instance for chaining.
270
304
  */
271
- image(key, url, overwrite = false) {
305
+ image(key: string, url?: any, overwrite: boolean = false) {
272
306
  return this.addToFileList('image', key, url, undefined, overwrite, '.png');
273
307
  }
274
308
 
@@ -278,7 +312,7 @@ export class Loader {
278
312
  * @param {string[]} urls - The URLs of the image files to load.
279
313
  * @returns {Loader} This Loader instance for chaining.
280
314
  */
281
- images(keys, urls) {
315
+ images(keys: string[], urls: string[]) {
282
316
  if (Array.isArray(urls)) {
283
317
  for (let i = 0; i < keys.length; i += 1) {
284
318
  this.image(keys[i], urls[i]);
@@ -298,7 +332,7 @@ export class Loader {
298
332
  * @param {boolean} overwrite - Whether to overwrite an existing file with the same key.
299
333
  * @returns {Loader} This Loader instance for chaining.
300
334
  */
301
- text(key, url, overwrite = false) {
335
+ text(key: string, url: string, overwrite: boolean = false) {
302
336
  return this.addToFileList('text', key, url, undefined, overwrite, '.txt');
303
337
  }
304
338
 
@@ -309,7 +343,7 @@ export class Loader {
309
343
  * @param {boolean} overwrite - Whether to overwrite an existing file with the same key.
310
344
  * @returns {Loader} This Loader instance for chaining.
311
345
  */
312
- json(key, url, overwrite = false) {
346
+ json(key: string, url: string, overwrite: boolean = false) {
313
347
  return this.addToFileList('json', key, url, undefined, overwrite, '.json');
314
348
  }
315
349
 
@@ -320,7 +354,7 @@ export class Loader {
320
354
  * @param {boolean} overwrite - Whether to overwrite an existing file with the same key.
321
355
  * @returns {Loader} This Loader instance for chaining.
322
356
  */
323
- xml(key, url, overwrite = false) {
357
+ xml(key: string, url: string, overwrite: boolean = false) {
324
358
  return this.addToFileList('xml', key, url, undefined, overwrite, '.xml');
325
359
  }
326
360
 
@@ -335,7 +369,15 @@ export class Loader {
335
369
  * @param {number} spacing - The spacing between frames in pixels.
336
370
  * @returns {Loader} This Loader instance for chaining.
337
371
  */
338
- spritesheet(key, url, frameWidth, frameHeight, frameMax = -1, margin = 0, spacing = 0) {
372
+ spritesheet(
373
+ key: string,
374
+ url: string,
375
+ frameWidth: number,
376
+ frameHeight: number,
377
+ frameMax: number = -1,
378
+ margin: number = 0,
379
+ spacing: number = 0
380
+ ) {
339
381
  return this.addToFileList(
340
382
  'spritesheet',
341
383
  key,
@@ -353,7 +395,7 @@ export class Loader {
353
395
  * @param {boolean} autoDecode - Whether to automatically decode the audio file.
354
396
  * @returns {Loader} This Loader instance for chaining.
355
397
  */
356
- audio(key, urls, autoDecode = true) {
398
+ audio(key: string, urls: any, autoDecode: boolean = true) {
357
399
  if (this.game.sound.noAudio || this.game.device.noAudioFormat) {
358
400
  return this;
359
401
  }
@@ -372,7 +414,7 @@ export class Loader {
372
414
  * @param {boolean} autoDecode - Whether to automatically decode the audio file.
373
415
  * @returns {Loader} This Loader instance for chaining.
374
416
  */
375
- audioSprite(key, urls, jsonURL, jsonData, autoDecode = true) {
417
+ audioSprite(key: string, urls: string, jsonURL: string, jsonData: any, autoDecode: boolean = true) {
376
418
  if (this.game.sound.noAudio || this.game.device.noAudioFormat) {
377
419
  return this;
378
420
  }
@@ -399,7 +441,14 @@ export class Loader {
399
441
  * @returns {Loader} This Loader instance for chaining.
400
442
  * @throws {Error} If the bitmap font atlas data is invalid.
401
443
  */
402
- bitmapFont(key, textureURL = null, atlasURL = null, atlasData = null, xSpacing = 0, ySpacing = 0) {
444
+ bitmapFont(
445
+ key: string,
446
+ textureURL: string = null,
447
+ atlasURL: string = null,
448
+ atlasData: any = null,
449
+ xSpacing: number = 0,
450
+ ySpacing: number = 0
451
+ ) {
403
452
  if (textureURL === undefined || textureURL === null) {
404
453
  textureURL = `${key}.png`;
405
454
  }
@@ -441,7 +490,13 @@ export class Loader {
441
490
  * @param {number} format - The format of the atlas file (JSON or XML).
442
491
  * @returns {Loader} This Loader instance for chaining.
443
492
  */
444
- atlas(key, textureURL, atlasURL = null, atlasData = null, format = TEXTURE_ATLAS_JSON_HASH) {
493
+ atlas(
494
+ key: string,
495
+ textureURL: string,
496
+ atlasURL: string = null,
497
+ atlasData: any = null,
498
+ format: number = TEXTURE_ATLAS_JSON_HASH
499
+ ) {
445
500
  if (textureURL === undefined || textureURL === null) {
446
501
  textureURL = `${key}.png`;
447
502
  }
@@ -463,7 +518,7 @@ export class Loader {
463
518
  * @param {object} callbackContext - The context in which to call the callback.
464
519
  * @returns {Loader} This Loader instance for chaining.
465
520
  */
466
- withSyncPoint(callback, callbackContext) {
521
+ withSyncPoint(callback: Function, callbackContext: any) {
467
522
  this._withSyncPointDepth += 1;
468
523
  try {
469
524
  callback.call(callbackContext || this, this);
@@ -479,7 +534,7 @@ export class Loader {
479
534
  * @param {string} key - The key of the file to add a sync point to.
480
535
  * @returns {Loader} This Loader instance for chaining.
481
536
  */
482
- addSyncPoint(type, key) {
537
+ addSyncPoint(type: string, key: string) {
483
538
  const asset = this.getAsset(type, key);
484
539
  if (asset) {
485
540
  asset.file.syncPoint = true;
@@ -492,10 +547,10 @@ export class Loader {
492
547
  * @param {string} type - The type of file to remove.
493
548
  * @param {string} key - The key of the file to remove.
494
549
  */
495
- removeFile(type, key) {
550
+ removeFile(type: string, key: string) {
496
551
  const asset = this.getAsset(type, key);
497
552
  if (asset) {
498
- if (!asset.loaded && !asset.loading) {
553
+ if (!asset.file.loaded && !asset.file.loading) {
499
554
  this._fileList.splice(asset.index, 1);
500
555
  }
501
556
  }
@@ -624,7 +679,7 @@ export class Loader {
624
679
  * Finishes the loading process, optionally reporting an abnormal termination.
625
680
  * @param {boolean} abnormal - Whether the loading was terminated abnormally.
626
681
  */
627
- finishedLoading(abnormal = false) {
682
+ finishedLoading(abnormal: boolean = false) {
628
683
  if (this.hasLoaded) {
629
684
  return;
630
685
  }
@@ -648,7 +703,7 @@ export class Loader {
648
703
  * @param {object} file - The file to complete or mark as failed.
649
704
  * @param {string} errorMessage - An error message if the file failed to load.
650
705
  */
651
- asyncComplete(file, errorMessage = '') {
706
+ asyncComplete(file: any, errorMessage: string = '') {
652
707
  file.loaded = true;
653
708
  file.error = !!errorMessage;
654
709
  if (file.error) {
@@ -663,7 +718,7 @@ export class Loader {
663
718
  * Processes a pack file, adding its contained files to the loader.
664
719
  * @param {object} pack - The pack file object to process.
665
720
  */
666
- processPack(pack) {
721
+ processPack(pack: any) {
667
722
  const packData = pack.data[pack.key];
668
723
  if (!packData) {
669
724
  this.game.logger.warn('Missing loader pack key', { key: pack.key });
@@ -728,7 +783,7 @@ export class Loader {
728
783
  * @param {object} file - The file object containing path information.
729
784
  * @returns {string} The transformed URL.
730
785
  */
731
- transformUrl(url, file) {
786
+ transformUrl(url: any, file: any): any {
732
787
  if (!url) {
733
788
  return false;
734
789
  }
@@ -742,7 +797,7 @@ export class Loader {
742
797
  * Loads a file using XMLHttpRequest, handling image files specially.
743
798
  * @param {object} file - The file object to load.
744
799
  */
745
- loadFile(file) {
800
+ loadFile(file: any) {
746
801
  switch (file.type) {
747
802
  case 'packfile':
748
803
  this.xhrLoad(file, this.transformUrl(file.url, file), 'text', this.fileComplete);
@@ -784,7 +839,7 @@ export class Loader {
784
839
  * Loads an image file using the Image DOM element.
785
840
  * @param {object} file - The file object to load.
786
841
  */
787
- loadImageTag(file) {
842
+ loadImageTag(file: any) {
788
843
  this.log('loadImageTag', file);
789
844
  const scope = this;
790
845
  file.data = new Image();
@@ -822,7 +877,7 @@ export class Loader {
822
877
  * @param {Function} onload - The function to call when the file loads successfully.
823
878
  * @param {Function} onerror - The function to call if the file fails to load.
824
879
  */
825
- xhrLoad(file, url, type, onload, onerror = null) {
880
+ xhrLoad(file: any, url: any, type: any, onload: Function, onerror: Function = null) {
826
881
  this.log('xhrLoad', file);
827
882
  const scope = this;
828
883
  const xhr = new XMLHttpRequest();
@@ -855,7 +910,7 @@ export class Loader {
855
910
  // If this was the last file in the queue and an error is thrown in the create method
856
911
  // then it's caught here, so be sure we don't carry on processing it
857
912
  if (!scope.hasLoaded) {
858
- scope.asyncComplete(file, error.message || 'Exception');
913
+ scope.asyncComplete(file, typedError.message || 'Exception');
859
914
  } else {
860
915
  scope.game.logger.exception('Loader', typedError);
861
916
  }
@@ -874,7 +929,7 @@ export class Loader {
874
929
  } catch (error) {
875
930
  const typedError = error instanceof Error ? error : new Error(String(error));
876
931
  if (!scope.hasLoaded) {
877
- scope.asyncComplete(file, error.message || 'Exception');
932
+ scope.asyncComplete(file, typedError.message || 'Exception');
878
933
  } else {
879
934
  scope.game.logger.exception('Loader', typedError);
880
935
  }
@@ -900,7 +955,7 @@ export class Loader {
900
955
  * @param {object[]} urls - The array of URLs to check for supported audio formats.
901
956
  * @returns {string} The first URL with a supported audio format, or null if none found.
902
957
  */
903
- getAudioURL(urls) {
958
+ getAudioURL(urls: any[]) {
904
959
  if (this.game.sound.noAudio || this.game.device.noAudioFormat) {
905
960
  return null;
906
961
  }
@@ -941,7 +996,7 @@ export class Loader {
941
996
  * @param {XMLHttpRequest} xhr - The XMLHttpRequest object that failed.
942
997
  * @param {number | string} reason - The error code or message explaining the failure.
943
998
  */
944
- fileError(file, xhr = null, reason = 0) {
999
+ fileError(file: any, xhr: any = null, reason: any = 0) {
945
1000
  // const url = file.requestUrl || this.transformUrl(file.url, file);
946
1001
  if (!reason && xhr) {
947
1002
  reason = xhr.status;
@@ -956,7 +1011,7 @@ export class Loader {
956
1011
  * @param {XMLHttpRequest} xhr - TBD.
957
1012
  * @throws {Error}
958
1013
  */
959
- fileComplete(file, xhr) {
1014
+ fileComplete(file: any, xhr?: any) {
960
1015
  let loadNext = true;
961
1016
  switch (file.type) {
962
1017
  case 'packfile':
@@ -1047,7 +1102,7 @@ export class Loader {
1047
1102
  * @param {object} file - The file object that was loaded successfully.
1048
1103
  * @param {XMLHttpRequest} xhr - The XMLHttpRequest object containing the file data.
1049
1104
  */
1050
- jsonLoadComplete(file, xhr) {
1105
+ jsonLoadComplete(file: any, xhr: XMLHttpRequest) {
1051
1106
  const data = JSON.parse(xhr.responseText);
1052
1107
  if (file.type === 'bitmapfont') {
1053
1108
  this.cache.addBitmapFont(file.key, file.url, file.data, data, file.atlasType, file.xSpacing, file.ySpacing);
@@ -1072,12 +1127,12 @@ export class Loader {
1072
1127
  * @param {object} file - The file object containing the JSON data.
1073
1128
  * @param {XMLHttpRequest} xhr - The XMLHttpRequest object containing the file data.
1074
1129
  */
1075
- xmlLoadComplete(file, xhr) {
1130
+ xmlLoadComplete(file: any, xhr: XMLHttpRequest) {
1076
1131
  // Always try parsing the content as XML, regardless of actually response type
1077
1132
  const data = xhr.responseText;
1078
1133
  const xml = this.parseXml(data);
1079
1134
  if (!xml) {
1080
- const responseType = xhr.responseType || xhr.contentType; // contentType for MS-XDomainRequest
1135
+ const responseType = xhr.responseType || (xhr as any).contentType; // contentType for MS-XDomainRequest
1081
1136
  this.game.logger.warn(`${file.key}: invalid XML (${responseType})`);
1082
1137
  this.asyncComplete(file, 'invalid XML');
1083
1138
  return;
@@ -1097,7 +1152,7 @@ export class Loader {
1097
1152
  * @param {object} data - The XML string data to parse.
1098
1153
  * @returns {Document} The parsed DOM Document, or null if parsing failed.
1099
1154
  */
1100
- parseXml(data) {
1155
+ parseXml(data: any) {
1101
1156
  let xml = null;
1102
1157
  try {
1103
1158
  if (window.DOMParser) {
@@ -1142,7 +1197,7 @@ export class Loader {
1142
1197
  * @param {string} message - The message to log.
1143
1198
  * @param {string|object} data - Additional data to log with the message.
1144
1199
  */
1145
- log(message, data = '') {
1200
+ log(message: string, data: string | any = '') {
1146
1201
  if (!this.isUseLog) {
1147
1202
  return;
1148
1203
  }
@@ -1197,4 +1252,4 @@ export class Loader {
1197
1252
  get progress() {
1198
1253
  return Math.round(this.progressFloat);
1199
1254
  }
1200
- }
1255
+ }