@vpmedia/phaser 1.104.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 (297) hide show
  1. package/dist/index.js +151 -574
  2. package/dist/index.js.map +1 -1
  3. package/dist/phaser/core/animation.d.ts +35 -57
  4. package/dist/phaser/core/animation.d.ts.map +1 -1
  5. package/dist/phaser/core/animation_manager.d.ts +11 -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 +60 -60
  12. package/dist/phaser/core/cache.d.ts.map +1 -1
  13. package/dist/phaser/core/device.d.ts.map +1 -1
  14. package/dist/phaser/core/device_util.d.ts +10 -10
  15. package/dist/phaser/core/device_util.d.ts.map +1 -1
  16. package/dist/phaser/core/dom.d.ts +6 -5
  17. package/dist/phaser/core/dom.d.ts.map +1 -1
  18. package/dist/phaser/core/event_manager.d.ts +49 -174
  19. package/dist/phaser/core/event_manager.d.ts.map +1 -1
  20. package/dist/phaser/core/factory.d.ts +7 -7
  21. package/dist/phaser/core/factory.d.ts.map +1 -1
  22. package/dist/phaser/core/frame.d.ts +27 -48
  23. package/dist/phaser/core/frame.d.ts.map +1 -1
  24. package/dist/phaser/core/frame_data.d.ts +11 -60
  25. package/dist/phaser/core/frame_data.d.ts.map +1 -1
  26. package/dist/phaser/core/frame_util.d.ts +4 -14
  27. package/dist/phaser/core/frame_util.d.ts.map +1 -1
  28. package/dist/phaser/core/game.d.ts +49 -58
  29. package/dist/phaser/core/game.d.ts.map +1 -1
  30. package/dist/phaser/core/input.d.ts +15 -13
  31. package/dist/phaser/core/input.d.ts.map +1 -1
  32. package/dist/phaser/core/input_handler.d.ts +23 -20
  33. package/dist/phaser/core/input_handler.d.ts.map +1 -1
  34. package/dist/phaser/core/input_mouse.d.ts +26 -1
  35. package/dist/phaser/core/input_mouse.d.ts.map +1 -1
  36. package/dist/phaser/core/input_mspointer.d.ts +2 -2
  37. package/dist/phaser/core/input_mspointer.d.ts.map +1 -1
  38. package/dist/phaser/core/input_pointer.d.ts +9 -9
  39. package/dist/phaser/core/input_pointer.d.ts.map +1 -1
  40. package/dist/phaser/core/input_touch.d.ts +2 -1
  41. package/dist/phaser/core/input_touch.d.ts.map +1 -1
  42. package/dist/phaser/core/loader.d.ts +28 -28
  43. package/dist/phaser/core/loader.d.ts.map +1 -1
  44. package/dist/phaser/core/loader_parser.d.ts +4 -4
  45. package/dist/phaser/core/loader_parser.d.ts.map +1 -1
  46. package/dist/phaser/core/raf.d.ts +2 -2
  47. package/dist/phaser/core/raf.d.ts.map +1 -1
  48. package/dist/phaser/core/scale_manager.d.ts +22 -17
  49. package/dist/phaser/core/scale_manager.d.ts.map +1 -1
  50. package/dist/phaser/core/scene.d.ts +1 -1
  51. package/dist/phaser/core/scene.d.ts.map +1 -1
  52. package/dist/phaser/core/scene_manager.d.ts +10 -9
  53. package/dist/phaser/core/scene_manager.d.ts.map +1 -1
  54. package/dist/phaser/core/signal.d.ts +9 -8
  55. package/dist/phaser/core/signal.d.ts.map +1 -1
  56. package/dist/phaser/core/signal_binding.d.ts +2 -2
  57. package/dist/phaser/core/signal_binding.d.ts.map +1 -1
  58. package/dist/phaser/core/sound.d.ts +56 -101
  59. package/dist/phaser/core/sound.d.ts.map +1 -1
  60. package/dist/phaser/core/sound_manager.d.ts +11 -9
  61. package/dist/phaser/core/sound_manager.d.ts.map +1 -1
  62. package/dist/phaser/core/sound_sprite.d.ts +4 -4
  63. package/dist/phaser/core/sound_sprite.d.ts.map +1 -1
  64. package/dist/phaser/core/stage.d.ts +3 -3
  65. package/dist/phaser/core/stage.d.ts.map +1 -1
  66. package/dist/phaser/core/time.d.ts +5 -5
  67. package/dist/phaser/core/time.d.ts.map +1 -1
  68. package/dist/phaser/core/timer.d.ts +10 -10
  69. package/dist/phaser/core/timer.d.ts.map +1 -1
  70. package/dist/phaser/core/timer_event.d.ts +11 -21
  71. package/dist/phaser/core/timer_event.d.ts.map +1 -1
  72. package/dist/phaser/core/tween.d.ts +37 -59
  73. package/dist/phaser/core/tween.d.ts.map +1 -1
  74. package/dist/phaser/core/tween_data.d.ts +6 -5
  75. package/dist/phaser/core/tween_data.d.ts.map +1 -1
  76. package/dist/phaser/core/tween_easing.d.ts +31 -31
  77. package/dist/phaser/core/tween_easing.d.ts.map +1 -1
  78. package/dist/phaser/core/tween_manager.d.ts +4 -4
  79. package/dist/phaser/core/tween_manager.d.ts.map +1 -1
  80. package/dist/phaser/core/world.d.ts +1 -1
  81. package/dist/phaser/core/world.d.ts.map +1 -1
  82. package/dist/phaser/display/bitmap_text.d.ts +22 -20
  83. package/dist/phaser/display/bitmap_text.d.ts.map +1 -1
  84. package/dist/phaser/display/button.d.ts +23 -35
  85. package/dist/phaser/display/button.d.ts.map +1 -1
  86. package/dist/phaser/display/canvas/buffer.d.ts +2 -2
  87. package/dist/phaser/display/canvas/buffer.d.ts.map +1 -1
  88. package/dist/phaser/display/canvas/graphics.d.ts +3 -3
  89. package/dist/phaser/display/canvas/graphics.d.ts.map +1 -1
  90. package/dist/phaser/display/canvas/masker.d.ts.map +1 -1
  91. package/dist/phaser/display/canvas/pool.d.ts +2 -2
  92. package/dist/phaser/display/canvas/pool.d.ts.map +1 -1
  93. package/dist/phaser/display/canvas/renderer.d.ts +5 -5
  94. package/dist/phaser/display/canvas/renderer.d.ts.map +1 -1
  95. package/dist/phaser/display/canvas/tinter.d.ts +3 -3
  96. package/dist/phaser/display/canvas/tinter.d.ts.map +1 -1
  97. package/dist/phaser/display/canvas/util.d.ts +9 -9
  98. package/dist/phaser/display/canvas/util.d.ts.map +1 -1
  99. package/dist/phaser/display/display_object.d.ts +45 -42
  100. package/dist/phaser/display/display_object.d.ts.map +1 -1
  101. package/dist/phaser/display/graphics.d.ts +24 -16
  102. package/dist/phaser/display/graphics.d.ts.map +1 -1
  103. package/dist/phaser/display/graphics_data.d.ts +1 -1
  104. package/dist/phaser/display/graphics_data.d.ts.map +1 -1
  105. package/dist/phaser/display/graphics_data_util.d.ts +1 -1
  106. package/dist/phaser/display/graphics_data_util.d.ts.map +1 -1
  107. package/dist/phaser/display/group.d.ts +24 -37
  108. package/dist/phaser/display/group.d.ts.map +1 -1
  109. package/dist/phaser/display/image.d.ts +34 -49
  110. package/dist/phaser/display/image.d.ts.map +1 -1
  111. package/dist/phaser/display/sprite_batch.d.ts +1 -1
  112. package/dist/phaser/display/sprite_batch.d.ts.map +1 -1
  113. package/dist/phaser/display/sprite_util.d.ts +5 -5
  114. package/dist/phaser/display/sprite_util.d.ts.map +1 -1
  115. package/dist/phaser/display/text.d.ts +86 -66
  116. package/dist/phaser/display/text.d.ts.map +1 -1
  117. package/dist/phaser/display/webgl/abstract_filter.d.ts +2 -1
  118. package/dist/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
  119. package/dist/phaser/display/webgl/base_texture.d.ts +2 -2
  120. package/dist/phaser/display/webgl/base_texture.d.ts.map +1 -1
  121. package/dist/phaser/display/webgl/blend_manager.d.ts +3 -2
  122. package/dist/phaser/display/webgl/blend_manager.d.ts.map +1 -1
  123. package/dist/phaser/display/webgl/earcut.d.ts +10 -10
  124. package/dist/phaser/display/webgl/earcut.d.ts.map +1 -1
  125. package/dist/phaser/display/webgl/earcut_node.d.ts +1 -1
  126. package/dist/phaser/display/webgl/earcut_node.d.ts.map +1 -1
  127. package/dist/phaser/display/webgl/fast_sprite_batch.d.ts +2 -1
  128. package/dist/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
  129. package/dist/phaser/display/webgl/filter_manager.d.ts +2 -1
  130. package/dist/phaser/display/webgl/filter_manager.d.ts.map +1 -1
  131. package/dist/phaser/display/webgl/filter_texture.d.ts +3 -2
  132. package/dist/phaser/display/webgl/filter_texture.d.ts.map +1 -1
  133. package/dist/phaser/display/webgl/graphics.d.ts +11 -10
  134. package/dist/phaser/display/webgl/graphics.d.ts.map +1 -1
  135. package/dist/phaser/display/webgl/graphics_data.d.ts +2 -1
  136. package/dist/phaser/display/webgl/graphics_data.d.ts.map +1 -1
  137. package/dist/phaser/display/webgl/mask_manager.d.ts.map +1 -1
  138. package/dist/phaser/display/webgl/render_texture.d.ts +2 -1
  139. package/dist/phaser/display/webgl/render_texture.d.ts.map +1 -1
  140. package/dist/phaser/display/webgl/renderer.d.ts +8 -6
  141. package/dist/phaser/display/webgl/renderer.d.ts.map +1 -1
  142. package/dist/phaser/display/webgl/shader/complex.d.ts +2 -1
  143. package/dist/phaser/display/webgl/shader/complex.d.ts.map +1 -1
  144. package/dist/phaser/display/webgl/shader/fast.d.ts +2 -1
  145. package/dist/phaser/display/webgl/shader/fast.d.ts.map +1 -1
  146. package/dist/phaser/display/webgl/shader/normal.d.ts +1 -0
  147. package/dist/phaser/display/webgl/shader/normal.d.ts.map +1 -1
  148. package/dist/phaser/display/webgl/shader/primitive.d.ts +2 -1
  149. package/dist/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
  150. package/dist/phaser/display/webgl/shader/strip.d.ts +2 -1
  151. package/dist/phaser/display/webgl/shader/strip.d.ts.map +1 -1
  152. package/dist/phaser/display/webgl/shader_manager.d.ts +4 -2
  153. package/dist/phaser/display/webgl/shader_manager.d.ts.map +1 -1
  154. package/dist/phaser/display/webgl/sprite_batch.d.ts +3 -2
  155. package/dist/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
  156. package/dist/phaser/display/webgl/stencil_manager.d.ts +5 -4
  157. package/dist/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
  158. package/dist/phaser/display/webgl/texture.d.ts +15 -2
  159. package/dist/phaser/display/webgl/texture.d.ts.map +1 -1
  160. package/dist/phaser/display/webgl/texture_util.d.ts +2 -2
  161. package/dist/phaser/display/webgl/texture_util.d.ts.map +1 -1
  162. package/dist/phaser/display/webgl/util.d.ts +6 -6
  163. package/dist/phaser/display/webgl/util.d.ts.map +1 -1
  164. package/dist/phaser/geom/circle.d.ts +11 -10
  165. package/dist/phaser/geom/circle.d.ts.map +1 -1
  166. package/dist/phaser/geom/ellipse.d.ts +6 -5
  167. package/dist/phaser/geom/ellipse.d.ts.map +1 -1
  168. package/dist/phaser/geom/line.d.ts +14 -14
  169. package/dist/phaser/geom/line.d.ts.map +1 -1
  170. package/dist/phaser/geom/matrix.d.ts +13 -12
  171. package/dist/phaser/geom/matrix.d.ts.map +1 -1
  172. package/dist/phaser/geom/point.d.ts +19 -19
  173. package/dist/phaser/geom/point.d.ts.map +1 -1
  174. package/dist/phaser/geom/polygon.d.ts +6 -6
  175. package/dist/phaser/geom/polygon.d.ts.map +1 -1
  176. package/dist/phaser/geom/rectangle.d.ts +20 -20
  177. package/dist/phaser/geom/rectangle.d.ts.map +1 -1
  178. package/dist/phaser/geom/rounded_rectangle.d.ts +2 -2
  179. package/dist/phaser/geom/rounded_rectangle.d.ts.map +1 -1
  180. package/dist/phaser/geom/util/circle.d.ts +9 -7
  181. package/dist/phaser/geom/util/circle.d.ts.map +1 -1
  182. package/dist/phaser/geom/util/ellipse.d.ts +1 -1
  183. package/dist/phaser/geom/util/ellipse.d.ts.map +1 -1
  184. package/dist/phaser/geom/util/line.d.ts +5 -3
  185. package/dist/phaser/geom/util/line.d.ts.map +1 -1
  186. package/dist/phaser/geom/util/matrix.d.ts +2 -1
  187. package/dist/phaser/geom/util/matrix.d.ts.map +1 -1
  188. package/dist/phaser/geom/util/point.d.ts +19 -19
  189. package/dist/phaser/geom/util/point.d.ts.map +1 -1
  190. package/dist/phaser/geom/util/polygon.d.ts +2 -1
  191. package/dist/phaser/geom/util/polygon.d.ts.map +1 -1
  192. package/dist/phaser/geom/util/rectangle.d.ts +17 -15
  193. package/dist/phaser/geom/util/rectangle.d.ts.map +1 -1
  194. package/dist/phaser/geom/util/rounded_rectangle.d.ts +2 -1
  195. package/dist/phaser/geom/util/rounded_rectangle.d.ts.map +1 -1
  196. package/dist/phaser/util/math.d.ts +51 -142
  197. package/dist/phaser/util/math.d.ts.map +1 -1
  198. package/package.json +1 -1
  199. package/src/phaser/core/animation.ts +38 -61
  200. package/src/phaser/core/animation_manager.ts +21 -21
  201. package/src/phaser/core/animation_parser.ts +11 -3
  202. package/src/phaser/core/array_set.ts +8 -8
  203. package/src/phaser/core/cache.ts +75 -68
  204. package/src/phaser/core/device.ts +23 -24
  205. package/src/phaser/core/device_util.ts +10 -10
  206. package/src/phaser/core/dom.ts +5 -5
  207. package/src/phaser/core/event_manager.ts +52 -193
  208. package/src/phaser/core/factory.ts +25 -18
  209. package/src/phaser/core/frame.ts +37 -51
  210. package/src/phaser/core/frame_data.ts +29 -76
  211. package/src/phaser/core/frame_util.ts +3 -16
  212. package/src/phaser/core/game.ts +36 -63
  213. package/src/phaser/core/input.ts +68 -68
  214. package/src/phaser/core/input_handler.ts +81 -86
  215. package/src/phaser/core/input_mouse.ts +42 -36
  216. package/src/phaser/core/input_mspointer.ts +24 -25
  217. package/src/phaser/core/input_pointer.ts +55 -56
  218. package/src/phaser/core/input_touch.ts +26 -26
  219. package/src/phaser/core/loader.ts +97 -70
  220. package/src/phaser/core/loader_parser.ts +6 -7
  221. package/src/phaser/core/raf.ts +2 -2
  222. package/src/phaser/core/scale_manager.ts +85 -82
  223. package/src/phaser/core/scene.ts +3 -4
  224. package/src/phaser/core/scene_manager.ts +26 -26
  225. package/src/phaser/core/signal.ts +10 -10
  226. package/src/phaser/core/signal_binding.ts +2 -2
  227. package/src/phaser/core/sound.ts +65 -112
  228. package/src/phaser/core/sound_manager.ts +31 -30
  229. package/src/phaser/core/sound_sprite.ts +10 -11
  230. package/src/phaser/core/stage.ts +8 -8
  231. package/src/phaser/core/time.ts +33 -34
  232. package/src/phaser/core/timer.ts +40 -34
  233. package/src/phaser/core/timer_event.ts +23 -23
  234. package/src/phaser/core/tween.ts +42 -68
  235. package/src/phaser/core/tween_data.ts +31 -31
  236. package/src/phaser/core/tween_easing.ts +31 -31
  237. package/src/phaser/core/tween_manager.ts +10 -11
  238. package/src/phaser/core/world.ts +1 -2
  239. package/src/phaser/display/bitmap_text.ts +41 -31
  240. package/src/phaser/display/button.ts +24 -51
  241. package/src/phaser/display/canvas/buffer.ts +6 -7
  242. package/src/phaser/display/canvas/graphics.ts +3 -4
  243. package/src/phaser/display/canvas/masker.ts +2 -3
  244. package/src/phaser/display/canvas/pool.ts +3 -4
  245. package/src/phaser/display/canvas/renderer.ts +19 -20
  246. package/src/phaser/display/canvas/tinter.ts +4 -5
  247. package/src/phaser/display/canvas/util.ts +9 -9
  248. package/src/phaser/display/display_object.ts +49 -50
  249. package/src/phaser/display/graphics.ts +56 -43
  250. package/src/phaser/display/graphics_data.ts +11 -12
  251. package/src/phaser/display/graphics_data_util.ts +1 -2
  252. package/src/phaser/display/group.ts +32 -42
  253. package/src/phaser/display/image.ts +32 -52
  254. package/src/phaser/display/sprite_batch.ts +1 -2
  255. package/src/phaser/display/sprite_util.ts +5 -6
  256. package/src/phaser/display/text.ts +82 -56
  257. package/src/phaser/display/webgl/abstract_filter.ts +8 -8
  258. package/src/phaser/display/webgl/base_texture.ts +14 -15
  259. package/src/phaser/display/webgl/blend_manager.ts +5 -5
  260. package/src/phaser/display/webgl/earcut.ts +27 -27
  261. package/src/phaser/display/webgl/earcut_node.ts +1 -1
  262. package/src/phaser/display/webgl/fast_sprite_batch.ts +19 -19
  263. package/src/phaser/display/webgl/filter_manager.ts +5 -5
  264. package/src/phaser/display/webgl/filter_texture.ts +7 -7
  265. package/src/phaser/display/webgl/graphics.ts +10 -11
  266. package/src/phaser/display/webgl/graphics_data.ts +11 -11
  267. package/src/phaser/display/webgl/mask_manager.ts +2 -3
  268. package/src/phaser/display/webgl/render_texture.ts +12 -12
  269. package/src/phaser/display/webgl/renderer.ts +24 -24
  270. package/src/phaser/display/webgl/shader/complex.ts +7 -7
  271. package/src/phaser/display/webgl/shader/fast.ts +8 -8
  272. package/src/phaser/display/webgl/shader/normal.ts +12 -12
  273. package/src/phaser/display/webgl/shader/primitive.ts +7 -7
  274. package/src/phaser/display/webgl/shader/strip.ts +7 -7
  275. package/src/phaser/display/webgl/shader_manager.ts +13 -13
  276. package/src/phaser/display/webgl/sprite_batch.ts +20 -20
  277. package/src/phaser/display/webgl/stencil_manager.ts +8 -8
  278. package/src/phaser/display/webgl/texture.ts +35 -24
  279. package/src/phaser/display/webgl/texture_util.ts +2 -3
  280. package/src/phaser/display/webgl/util.ts +6 -6
  281. package/src/phaser/geom/circle.ts +10 -10
  282. package/src/phaser/geom/ellipse.ts +6 -6
  283. package/src/phaser/geom/line.ts +14 -14
  284. package/src/phaser/geom/matrix.ts +12 -12
  285. package/src/phaser/geom/point.ts +19 -19
  286. package/src/phaser/geom/polygon.ts +5 -5
  287. package/src/phaser/geom/rectangle.ts +21 -21
  288. package/src/phaser/geom/rounded_rectangle.ts +2 -2
  289. package/src/phaser/geom/util/circle.ts +7 -7
  290. package/src/phaser/geom/util/ellipse.ts +1 -1
  291. package/src/phaser/geom/util/line.ts +5 -5
  292. package/src/phaser/geom/util/matrix.ts +1 -1
  293. package/src/phaser/geom/util/point.ts +20 -20
  294. package/src/phaser/geom/util/polygon.ts +1 -1
  295. package/src/phaser/geom/util/rectangle.ts +15 -15
  296. package/src/phaser/geom/util/rounded_rectangle.ts +1 -1
  297. package/src/phaser/util/math.ts +65 -151
@@ -5,7 +5,7 @@ import { Node } from './earcut_node.js';
5
5
  * @param {object} list - The list of points to process.
6
6
  * @returns {object} The processed earcut data structure.
7
7
  */
8
- export function sortLinked(list) {
8
+ export function sortLinked(list: any) {
9
9
  let i;
10
10
  let p;
11
11
  let q;
@@ -72,7 +72,7 @@ export function sortLinked(list) {
72
72
  * @param {object} b - The second point of the triangle.
73
73
  * @returns {number} The calculated area of the triangle.
74
74
  */
75
- export function compareX(a, b) {
75
+ export function compareX(a: any, b: any) {
76
76
  return a.x - b.x;
77
77
  }
78
78
 
@@ -85,7 +85,7 @@ export function compareX(a, b) {
85
85
  * @param {number} size - The size of the bounding box.
86
86
  * @returns {number} The calculated distance from the point to the triangle edge.
87
87
  */
88
- export function zOrder(x, y, minX, minY, size) {
88
+ export function zOrder(x: number, y: number, minX: number, minY: number, size: number) {
89
89
  // coords are transformed into non-negative 15-bit integer range
90
90
  x = (32767 * (x - minX)) / size;
91
91
  y = (32767 * (y - minY)) / size;
@@ -107,7 +107,7 @@ export function zOrder(x, y, minX, minY, size) {
107
107
  * @param {number} minY - The minimum y-coordinate of the bounding box.
108
108
  * @param {number} size - The size of the bounding box.
109
109
  */
110
- export function indexCurve(start, minX, minY, size) {
110
+ export function indexCurve(start: any, minX: number, minY: number, size: number) {
111
111
  let p = start;
112
112
  do {
113
113
  if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, size);
@@ -125,7 +125,7 @@ export function indexCurve(start, minX, minY, size) {
125
125
  * @param {object} start - TBD.
126
126
  * @returns {object} The calculated point that is the closest to the triangle edge.
127
127
  */
128
- export function getLeftmost(start) {
128
+ export function getLeftmost(start: any) {
129
129
  let p = start;
130
130
  let leftmost = start;
131
131
  do {
@@ -147,7 +147,7 @@ export function getLeftmost(start) {
147
147
  * @param {number} py - TBD.
148
148
  * @returns {object} TBD.
149
149
  */
150
- export function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
150
+ export function pointInTriangle(ax: number, ay: number, bx: number, by: number, cx: number, cy: number, px: number, py: number) {
151
151
  return (
152
152
  (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&
153
153
  (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&
@@ -162,7 +162,7 @@ export function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
162
162
  * @param {object} r - TBD.
163
163
  * @returns {number} TBD.
164
164
  */
165
- export function area(p, q, r) {
165
+ export function area(p: any, q: any, r: any) {
166
166
  return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
167
167
  }
168
168
 
@@ -172,7 +172,7 @@ export function area(p, q, r) {
172
172
  * @param {object} p2 - The second point of the triangle.
173
173
  * @returns {boolean} True if the point is inside the triangle, false otherwise.
174
174
  */
175
- export function equals(p1, p2) {
175
+ export function equals(p1: any, p2: any) {
176
176
  return p1.x === p2.x && p1.y === p2.y;
177
177
  }
178
178
 
@@ -184,7 +184,7 @@ export function equals(p1, p2) {
184
184
  * @param {object} q2 - The second point of the second line segment.
185
185
  * @returns {boolean} True if the line segments intersect, false otherwise.
186
186
  */
187
- export function intersects(p1, q1, p2, q2) {
187
+ export function intersects(p1: any, q1: any, p2: any, q2: any) {
188
188
  return area(p1, q1, p2) > 0 !== area(p1, q1, q2) > 0 && area(p2, q2, p1) > 0 !== area(p2, q2, q1) > 0;
189
189
  }
190
190
 
@@ -194,7 +194,7 @@ export function intersects(p1, q1, p2, q2) {
194
194
  * @param {object} b - The second point of the line segment.
195
195
  * @returns {boolean} True if the points are collinear, false otherwise.
196
196
  */
197
- export function intersectsPolygon(a, b) {
197
+ export function intersectsPolygon(a: any, b: any) {
198
198
  let p = a;
199
199
  do {
200
200
  if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a, b)) return true;
@@ -209,7 +209,7 @@ export function intersectsPolygon(a, b) {
209
209
  * @param {object} b - The second point of the cross product.
210
210
  * @returns {object} The calculated cross product result.
211
211
  */
212
- export function locallyInside(a, b) {
212
+ export function locallyInside(a: any, b: any) {
213
213
  return area(a.prev, a, a.next) < 0
214
214
  ? area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0
215
215
  : area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;
@@ -221,7 +221,7 @@ export function locallyInside(a, b) {
221
221
  * @param {object} b - The second point of the triangle.
222
222
  * @returns {boolean} True if the point is inside the triangle, false otherwise.
223
223
  */
224
- export function middleInside(a, b) {
224
+ export function middleInside(a: any, b: any) {
225
225
  let p = a;
226
226
  let inside = false;
227
227
  const px = (a.x + b.x) / 2;
@@ -241,7 +241,7 @@ export function middleInside(a, b) {
241
241
  * @param {object} b - The second point of the triangle.
242
242
  * @returns {boolean} True if the point is inside the triangle, false otherwise.
243
243
  */
244
- export function isValidDiagonal(a, b) {
244
+ export function isValidDiagonal(a: any, b: any) {
245
245
  return (
246
246
  equals(a, b) ||
247
247
  (a.next.i !== b.i &&
@@ -259,7 +259,7 @@ export function isValidDiagonal(a, b) {
259
259
  * @param {object} b - TBD.
260
260
  * @returns {object} TBD.
261
261
  */
262
- export function splitPolygon(a, b) {
262
+ export function splitPolygon(a: any, b: any) {
263
263
  const a2 = new Node(a.i, a.x, a.y);
264
264
  const b2 = new Node(b.i, b.x, b.y);
265
265
  const an = a.next;
@@ -283,7 +283,7 @@ export function splitPolygon(a, b) {
283
283
  * @param {object} last - TBD.
284
284
  * @returns {object} TBD.
285
285
  */
286
- export function insertNode(i, x, y, last) {
286
+ export function insertNode(i: number, x: number, y: number, last: any) {
287
287
  const p = new Node(i, x, y);
288
288
  if (!last) {
289
289
  p.prev = p;
@@ -301,7 +301,7 @@ export function insertNode(i, x, y, last) {
301
301
  * TBD.
302
302
  * @param {object} p - TBD.
303
303
  */
304
- export function removeNode(p) {
304
+ export function removeNode(p: any) {
305
305
  p.next.prev = p.prev;
306
306
  p.prev.next = p.next;
307
307
  if (p.prevZ) {
@@ -317,7 +317,7 @@ export function removeNode(p) {
317
317
  * @param {object} ear - TBD.
318
318
  * @returns {boolean} TBD.
319
319
  */
320
- export function isEar(ear) {
320
+ export function isEar(ear: any) {
321
321
  const a = ear.prev;
322
322
  const b = ear;
323
323
  const c = ear.next;
@@ -339,7 +339,7 @@ export function isEar(ear) {
339
339
  * @param {number} size - TBD.
340
340
  * @returns {boolean} TBD.
341
341
  */
342
- export function isEarHashed(ear, minX, minY, size) {
342
+ export function isEarHashed(ear: any, minX: number, minY: number, size: number) {
343
343
  const a = ear.prev;
344
344
  const b = ear;
345
345
  const c = ear.next;
@@ -390,7 +390,7 @@ export function isEarHashed(ear, minX, minY, size) {
390
390
  * @param {boolean} clockwise - Whether the triangles should be clockwise or counterclockwise.
391
391
  * @returns {object} The processed earcut data structure with triangulation information.
392
392
  */
393
- export function linkedList(data, start, end, dim, clockwise) {
393
+ export function linkedList(data: any, start: number, end: number, dim: number, clockwise: boolean) {
394
394
  let sum = 0;
395
395
  let i;
396
396
  let j;
@@ -415,7 +415,7 @@ export function linkedList(data, start, end, dim, clockwise) {
415
415
  * @param {object} end - The ending point in the data structure.
416
416
  * @returns {object} The calculated bounding box with min and max coordinates.
417
417
  */
418
- export function filterPoints(start, end?) {
418
+ export function filterPoints(start: any, end?: any) {
419
419
  if (!start) return start;
420
420
  if (!end) end = start;
421
421
  let p = start;
@@ -441,7 +441,7 @@ export function filterPoints(start, end?) {
441
441
  * @param {object} outerNode - The outer node that contains the hole.
442
442
  * @returns {object} The processed hole data structure.
443
443
  */
444
- export function findHoleBridge(hole, outerNode) {
444
+ export function findHoleBridge(hole: any, outerNode: any) {
445
445
  let p = outerNode;
446
446
  const hx = hole.x;
447
447
  const hy = hole.y;
@@ -490,7 +490,7 @@ export function findHoleBridge(hole, outerNode) {
490
490
  * @param {object} hole - The hole to process.
491
491
  * @param {object} outerNode - The outer node that contains the hole.
492
492
  */
493
- export function eliminateHole(hole, outerNode) {
493
+ export function eliminateHole(hole: any, outerNode: any) {
494
494
  outerNode = findHoleBridge(hole, outerNode);
495
495
  if (outerNode) {
496
496
  const b = splitPolygon(outerNode, hole);
@@ -506,7 +506,7 @@ export function eliminateHole(hole, outerNode) {
506
506
  * @param {object} dim - The dimension of the data (2 or 3).
507
507
  * @returns {object} The processed earcut data structure with holes included.
508
508
  */
509
- export function eliminateHoles(data, holeIndices, outerNode, dim) {
509
+ export function eliminateHoles(data: any, holeIndices: any, outerNode: any, dim: any) {
510
510
  const queue = [];
511
511
  let i;
512
512
  let len;
@@ -536,7 +536,7 @@ export function eliminateHoles(data, holeIndices, outerNode, dim) {
536
536
  * @param {number} dim - The dimension of the data (2 or 3).
537
537
  * @returns {object} The processed triangulation data structure.
538
538
  */
539
- export function cureLocalIntersections(start, triangles, dim) {
539
+ export function cureLocalIntersections(start: any, triangles: any, dim: number) {
540
540
  let p = start;
541
541
  do {
542
542
  const a = p.prev;
@@ -566,7 +566,7 @@ export function cureLocalIntersections(start, triangles, dim) {
566
566
  * @param {number} minY - The minimum y-coordinate of the bounding box.
567
567
  * @param {number} size - The size of the bounding box.
568
568
  */
569
- export function splitEarcut(start, triangles, dim, minX, minY, size) {
569
+ export function splitEarcut(start: any, triangles: any, dim: number, minX: number, minY: number, size: number) {
570
570
  // look for a valid diagonal that divides the polygon into two
571
571
  let a = start;
572
572
  do {
@@ -599,7 +599,7 @@ export function splitEarcut(start, triangles, dim, minX, minY, size) {
599
599
  * @param {number} size - The size of the bounding box.
600
600
  * @param {object} pass - The pass information for triangulation.
601
601
  */
602
- export function earcutLinked(ear, triangles, dim, minX?, minY?, size?, pass?) {
602
+ export function earcutLinked(ear: any, triangles: any, dim: number, minX?: number, minY?: number, size?: number, pass?: any) {
603
603
  if (!ear) return;
604
604
  // interlink polygon nodes in z-order
605
605
  if (!pass && size) indexCurve(ear, minX, minY, size);
@@ -647,7 +647,7 @@ export function earcutLinked(ear, triangles, dim, minX?, minY?, size?, pass?) {
647
647
  * @param {number} dim - The dimension of the data (2 or 3).
648
648
  * @returns {object} The processed earcut data structure with triangulation information.
649
649
  */
650
- export function triangulate(data, holeIndices, dim) {
650
+ export function triangulate(data: any, holeIndices: any, dim: number) {
651
651
  dim = dim || 2;
652
652
  const hasHoles = holeIndices && holeIndices.length;
653
653
  const outerLen = hasHoles ? holeIndices[0] * dim : data.length;
@@ -15,7 +15,7 @@ export class Node {
15
15
  * @param {number} x - The x coordinate of the vertex.
16
16
  * @param {number} y - The y coordinate of the vertex.
17
17
  */
18
- constructor(i, x, y) {
18
+ constructor(i: number, x: number, y: number) {
19
19
  // vertice index in coordinates array
20
20
  this.i = i;
21
21
  // vertex coordinates
@@ -1,20 +1,20 @@
1
- // @ts-nocheck
2
1
  export class FastSpriteBatch {
3
- vertSize;
4
- maxSize;
5
- size;
6
- vertices;
7
- indices;
8
- vertexBuffer;
9
- indexBuffer;
10
- lastIndexCount;
11
- drawing;
12
- currentBatchSize;
13
- currentBaseTexture;
14
- currentBlendMode;
15
- renderSession;
16
- shader;
17
- matrix;
2
+ [key: string]: any;
3
+ vertSize!: any;
4
+ maxSize!: any;
5
+ size!: any;
6
+ vertices!: any;
7
+ indices!: any;
8
+ vertexBuffer!: any;
9
+ indexBuffer!: any;
10
+ lastIndexCount!: any;
11
+ drawing!: any;
12
+ currentBatchSize!: any;
13
+ currentBaseTexture!: any;
14
+ currentBlendMode!: any;
15
+ renderSession!: any;
16
+ shader!: any;
17
+ matrix!: any;
18
18
  /**
19
19
  * Creates a new FastSpriteBatch instance.
20
20
  * @param {WebGLRenderingContext & { id: number }} gl - The WebGL rendering context.
@@ -72,7 +72,7 @@ matrix;
72
72
  * @param {object} spriteBatch - The sprite batch to render.
73
73
  * @param {object} renderSession - The render session to use.
74
74
  */
75
- begin(spriteBatch, renderSession) {
75
+ begin(spriteBatch: any, renderSession: any) {
76
76
  this.renderSession = renderSession;
77
77
  this.shader = this.renderSession.shaderManager.fastShader;
78
78
  this.matrix = spriteBatch.worldTransform.toArray(true);
@@ -90,7 +90,7 @@ matrix;
90
90
  * Flushes the sprite batch to WebGL.
91
91
  * @param {object} spriteBatch - The sprite batch to flush.
92
92
  */
93
- render(spriteBatch) {
93
+ render(spriteBatch: any) {
94
94
  const children = spriteBatch.children;
95
95
  const sprite = children[0];
96
96
  // if the uvs have not updated then no point rendering just yet!
@@ -114,7 +114,7 @@ matrix;
114
114
  * Renders a sprite using WebGL.
115
115
  * @param {import('../../display/image.js').Image} sprite - The sprite to render.
116
116
  */
117
- renderSprite(sprite) {
117
+ renderSprite(sprite: import('../../display/image.js').Image) {
118
118
  if (!sprite.visible) {
119
119
  return;
120
120
  }
@@ -1,8 +1,8 @@
1
- // @ts-nocheck
2
1
  export class WebGLFilterManager {
3
- filterStack;
4
- offsetX;
5
- offsetY;
2
+ [key: string]: any;
3
+ filterStack!: any;
4
+ offsetX!: any;
5
+ offsetY!: any;
6
6
  /**
7
7
  * Creates a new FilterManager instance.
8
8
  */
@@ -16,7 +16,7 @@ offsetY;
16
16
  * Initializes the filter manager with a WebGL context.
17
17
  * @param {WebGLRenderingContext} gl - The WebGL rendering context.
18
18
  */
19
- setContext(gl) {
19
+ setContext(gl: WebGLRenderingContext) {
20
20
  this.gl = gl;
21
21
  this.texturePool = [];
22
22
  this.initShaderBuffers();
@@ -1,11 +1,11 @@
1
- // @ts-nocheck
2
1
  import { SCALE_LINEAR } from '../../core/const.js';
3
2
 
4
3
  export class FilterTexture {
5
- gl;
6
- frameBuffer;
7
- texture;
8
- renderBuffer;
4
+ [key: string]: any;
5
+ gl!: any;
6
+ frameBuffer!: any;
7
+ texture!: any;
8
+ renderBuffer!: any;
9
9
  /**
10
10
  * Creates a new FilterTexture instance.
11
11
  * @param {WebGLRenderingContext} gl - The WebGL rendering context.
@@ -13,7 +13,7 @@ renderBuffer;
13
13
  * @param {number} height - The height of the filter texture.
14
14
  * @param {number} scaleMode - The scale mode to use.
15
15
  */
16
- constructor(gl, width, height, scaleMode) {
16
+ constructor(gl: WebGLRenderingContext, width: number, height: number, scaleMode: number) {
17
17
  this.gl = gl;
18
18
  this.frameBuffer = gl.createFramebuffer();
19
19
  this.texture = gl.createTexture();
@@ -47,7 +47,7 @@ renderBuffer;
47
47
  * @param {number} width - The new width of the filter texture.
48
48
  * @param {number} height - The new height of the filter texture.
49
49
  */
50
- resize(width, height) {
50
+ resize(width: number, height: number) {
51
51
  if (this.width === width && this.height === height) {
52
52
  return;
53
53
  }
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import { GEOM_CIRCLE, GEOM_ELLIPSE, GEOM_POLYGON, GEOM_RECTANGLE, GEOM_ROUNDED_RECTANGLE } from '../../core/const.js';
3
2
  import { Point } from '../../geom/point.js';
4
3
  import { hex2rgb } from '../../util/math.js';
@@ -33,7 +32,7 @@ export const getGraphicsDataPool = () => {
33
32
  * @param {number} type - The type of graphics data to create.
34
33
  * @returns {object} The newly created graphics data object.
35
34
  */
36
- export const switchMode = (webGL, type) => {
35
+ export const switchMode = (webGL: any, type: number) => {
37
36
  let webGLData;
38
37
  if (!webGL.data.length) {
39
38
  webGLData = getGraphicsDataPool().pop() || new GraphicsData(webGL.gl);
@@ -56,7 +55,7 @@ export const switchMode = (webGL, type) => {
56
55
  * @param {object} graphicsData - The graphics data to update.
57
56
  * @param {GraphicsData} webGLData - The WebGL graphics data object.
58
57
  */
59
- export const buildLine = (graphicsData, webGLData) => {
58
+ export const buildLine = (graphicsData: any, webGLData: GraphicsData) => {
60
59
  // TODO OPTIMISE!
61
60
  let i = 0;
62
61
  let points = graphicsData.points;
@@ -221,7 +220,7 @@ export const buildLine = (graphicsData, webGLData) => {
221
220
  * @param {object} graphicsData - The graphics data to update.
222
221
  * @param {GraphicsData} webGLData - The WebGL graphics data object.
223
222
  */
224
- export const buildRectangle = (graphicsData, webGLData) => {
223
+ export const buildRectangle = (graphicsData: any, webGLData: GraphicsData) => {
225
224
  //
226
225
  // need to convert points to a nice regular data
227
226
  //
@@ -270,7 +269,7 @@ export const buildRectangle = (graphicsData, webGLData) => {
270
269
  * @param {number} toY - The ending y-coordinate.
271
270
  * @returns {number[]} The calculated points for the quadratic bezier curve.
272
271
  */
273
- export const quadraticBezierCurve = (fromX, fromY, cpX, cpY, toX, toY) => {
272
+ export const quadraticBezierCurve = (fromX: number, fromY: number, cpX: number, cpY: number, toX: number, toY: number) => {
274
273
  let xa;
275
274
  let ya;
276
275
  let xb;
@@ -304,7 +303,7 @@ export const quadraticBezierCurve = (fromX, fromY, cpX, cpY, toX, toY) => {
304
303
  * @param {object} graphicsData - The graphics data to update.
305
304
  * @param {GraphicsData} webGLData - The WebGL graphics data object.
306
305
  */
307
- export const buildRoundedRectangle = (graphicsData, webGLData) => {
306
+ export const buildRoundedRectangle = (graphicsData: any, webGLData: GraphicsData) => {
308
307
  const rrectData = graphicsData.shape;
309
308
  const x = rrectData.x;
310
309
  const y = rrectData.y;
@@ -354,7 +353,7 @@ export const buildRoundedRectangle = (graphicsData, webGLData) => {
354
353
  * @param {object} graphicsData - The graphics data to update.
355
354
  * @param {GraphicsData} webGLData - The WebGL graphics data object.
356
355
  */
357
- export const buildCircle = (graphicsData, webGLData) => {
356
+ export const buildCircle = (graphicsData: any, webGLData: GraphicsData) => {
358
357
  // need to convert points to a nice regular data
359
358
  const circleData = graphicsData.shape;
360
359
  const x = circleData.x;
@@ -405,7 +404,7 @@ export const buildCircle = (graphicsData, webGLData) => {
405
404
  * @param {object} graphicsData - The graphics data to update.
406
405
  * @param {GraphicsData} webGLData - The WebGL graphics data object.
407
406
  */
408
- export const buildComplexPoly = (graphicsData, webGLData) => {
407
+ export const buildComplexPoly = (graphicsData: any, webGLData: GraphicsData) => {
409
408
  // TODO - no need to copy this as it gets turned into a Float32Array anyways..
410
409
  const points = graphicsData.points.slice();
411
410
  if (points.length < 6) {
@@ -450,7 +449,7 @@ export const buildComplexPoly = (graphicsData, webGLData) => {
450
449
  * @param {GraphicsData} webGLData - TBD.
451
450
  * @returns {boolean} TBD.
452
451
  */
453
- export const buildPoly = (graphicsData, webGLData) => {
452
+ export const buildPoly = (graphicsData: any, webGLData: GraphicsData) => {
454
453
  const points = graphicsData.points;
455
454
  if (points.length < 6) {
456
455
  return false;
@@ -488,7 +487,7 @@ export const buildPoly = (graphicsData, webGLData) => {
488
487
  * @param {import('../graphics.js').Graphics} graphics - The graphics object to update.
489
488
  * @param {WebGLRenderingContext & { id: number }} gl - The WebGL rendering context.
490
489
  */
491
- export const updateGraphics = (graphics, gl) => {
490
+ export const updateGraphics = (graphics: import('../graphics.js').Graphics, gl) => {
492
491
  const stencilBufferLimit = getStencilBufferLimit();
493
492
  // get the contexts graphics object
494
493
  let webGL = graphics._webGL[gl.id];
@@ -577,7 +576,7 @@ export const updateGraphics = (graphics, gl) => {
577
576
  * @param {import('../graphics.js').Graphics} graphics - The graphics object to update.
578
577
  * @param {object} renderSession - The rendering session.
579
578
  */
580
- export const renderGraphics = (graphics, renderSession) => {
579
+ export const renderGraphics = (graphics: import('../graphics.js').Graphics, renderSession: any) => {
581
580
  const gl = renderSession.gl;
582
581
  const projection = renderSession.projection;
583
582
  const offset = renderSession.offset;
@@ -1,19 +1,19 @@
1
- // @ts-nocheck
2
1
  export class GraphicsData {
3
- gl;
4
- color;
5
- points;
6
- indices;
7
- buffer;
8
- indexBuffer;
9
- mode;
10
- alpha;
11
- dirty;
2
+ [key: string]: any;
3
+ gl!: any;
4
+ color!: any;
5
+ points!: any;
6
+ indices!: any;
7
+ buffer!: any;
8
+ indexBuffer!: any;
9
+ mode!: any;
10
+ alpha!: any;
11
+ dirty!: any;
12
12
  /**
13
13
  * Creates a new GraphicsData instance.
14
14
  * @param {WebGLRenderingContext} gl - The WebGL rendering context.
15
15
  */
16
- constructor(gl) {
16
+ constructor(gl: WebGLRenderingContext) {
17
17
  this.gl = gl;
18
18
  // TODO does this need to be split before uploading??
19
19
  this.color = [0, 0, 0]; // color split!
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import { updateGraphics } from './graphics.js';
3
2
 
4
3
  /**
@@ -6,7 +5,7 @@ import { updateGraphics } from './graphics.js';
6
5
  * @param {object} maskData - The mask data to apply.
7
6
  * @param {object} renderSession - The rendering session.
8
7
  */
9
- export const pushMask = (maskData, renderSession) => {
8
+ export const pushMask = (maskData: any, renderSession: any) => {
10
9
  const gl = renderSession.gl;
11
10
  if (maskData.dirty) {
12
11
  updateGraphics(maskData, gl);
@@ -26,7 +25,7 @@ export const pushMask = (maskData, renderSession) => {
26
25
  * @param {object} maskData - The mask data to apply.
27
26
  * @param {object} renderSession - The rendering session.
28
27
  */
29
- export const popMask = (maskData, renderSession) => {
28
+ export const popMask = (maskData: any, renderSession: any) => {
30
29
  const gl = renderSession.gl;
31
30
  if (
32
31
  maskData._webGL[gl.id] === undefined ||
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import { RENDER_WEBGL } from '../../core/const.js';
3
2
  import { Point } from '../../geom/point.js';
4
3
  import { Rectangle } from '../../geom/rectangle.js';
@@ -8,16 +7,17 @@ import { FilterTexture } from './filter_texture.js';
8
7
  import { Texture } from './texture.js';
9
8
 
10
9
  export class RenderTexture extends Texture {
11
- width;
12
- height;
13
- resolution;
14
- frame;
15
- crop;
16
- renderer;
17
- textureBuffer;
18
- render;
19
- projection;
20
- valid;
10
+ [key: string]: any;
11
+ declare width: any;
12
+ declare height: any;
13
+ resolution!: any;
14
+ declare frame: any;
15
+ declare crop: any;
16
+ renderer!: any;
17
+ textureBuffer!: any;
18
+ render!: any;
19
+ projection!: any;
20
+ declare valid: any;
21
21
  /**
22
22
  * Creates a new RenderTexture instance.
23
23
  * @param {number} width - The width of the render texture.
@@ -26,7 +26,7 @@ valid;
26
26
  * @param {number} scaleMode - The scale mode to use.
27
27
  * @param {number} resolution - The resolution to use.
28
28
  */
29
- constructor(width, height, renderer, scaleMode, resolution = 1) {
29
+ constructor(width: number, height: number, renderer: import('./renderer.js').WebGLRenderer|import('../canvas/renderer.js').CanvasRenderer, scaleMode: number, resolution: number = 1) {
30
30
  const w = width || 100;
31
31
  const h = height || 100;
32
32
  const res = resolution || 1;
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import {
3
2
  BLEND_ADD,
4
3
  BLEND_COLOR,
@@ -33,28 +32,29 @@ import { WebGLStencilManager } from './stencil_manager.js';
33
32
  import { getWebGLContextErrorCode, getWebGLContextErrorName } from './util.js';
34
33
 
35
34
  export class WebGLRenderer {
36
- type;
37
- resolution;
38
- autoResize;
39
- contextLost;
40
- clearBeforeRender;
41
- width;
42
- height;
43
- view;
44
- _contextOptions;
45
- projection;
46
- offset;
47
- shaderManager;
48
- spriteBatch;
49
- filterManager;
50
- stencilManager;
51
- blendModeManager;
52
- renderSession;
35
+ [key: string]: any;
36
+ type!: any;
37
+ resolution!: any;
38
+ autoResize!: any;
39
+ contextLost!: any;
40
+ clearBeforeRender!: any;
41
+ width!: any;
42
+ height!: any;
43
+ view!: any;
44
+ _contextOptions!: any;
45
+ projection!: any;
46
+ offset!: any;
47
+ shaderManager!: any;
48
+ spriteBatch!: any;
49
+ filterManager!: any;
50
+ stencilManager!: any;
51
+ blendModeManager!: any;
52
+ renderSession!: any;
53
53
  /**
54
54
  * Creates a new WebGLRenderer instance.
55
55
  * @param {import('../../core/game.js').Game} game - The game instance.
56
56
  */
57
- constructor(game) {
57
+ constructor(game: import('../../core/game.js').Game) {
58
58
  /** @type {number} */
59
59
  this.type = RENDER_WEBGL;
60
60
  this.resolution = game.config.resolution;
@@ -143,7 +143,7 @@ renderSession;
143
143
  * @param {import('../../core/game.js').Game} game - The game instance.
144
144
  * @throws {Error}
145
145
  */
146
- initContext(game) {
146
+ initContext(game: import('../../core/game.js').Game) {
147
147
  game.logger.info('initContext');
148
148
  // TODO: view.addEventListener('webglcontextcreationerror', this.onWebGLContextCreationError, false);
149
149
  /** @type {WebGLRenderingContext & { id: number }} */
@@ -187,7 +187,7 @@ renderSession;
187
187
  * Renders the stage to WebGL.
188
188
  * @param {import('../../core/stage.js').Stage} stage - The root stage to render.
189
189
  */
190
- render(stage) {
190
+ render(stage: import('../../core/stage.js').Stage) {
191
191
  if (this.contextLost) {
192
192
  return;
193
193
  }
@@ -212,7 +212,7 @@ renderSession;
212
212
  * @param {object} buffer - The render buffer.
213
213
  * @param {import('../../geom/matrix.js').Matrix} matrix - The transformation matrix.
214
214
  */
215
- renderDisplayObject(displayObject, projection, buffer, matrix) {
215
+ renderDisplayObject(displayObject: any, projection: Point, buffer?: any, matrix?: any) {
216
216
  this.renderSession.blendModeManager.setBlendMode(BLEND_NORMAL);
217
217
  // reset the render session data..
218
218
  this.renderSession.drawCount = 0;
@@ -237,7 +237,7 @@ renderSession;
237
237
  * @param {number} width - The new width of the canvas.
238
238
  * @param {number} height - The new height of the canvas.
239
239
  */
240
- resize(width, height) {
240
+ resize(width: number, height: number) {
241
241
  this.width = width * this.resolution;
242
242
  this.height = height * this.resolution;
243
243
  this.view.width = this.width;
@@ -256,7 +256,7 @@ renderSession;
256
256
  * @param {import('./base_texture.js').BaseTexture} texture - The base texture to update.
257
257
  * @returns {boolean} Whether the update was successful.
258
258
  */
259
- updateTexture(texture) {
259
+ updateTexture(texture: import('./base_texture.js').BaseTexture) {
260
260
  if (!texture.hasLoaded) {
261
261
  return false;
262
262
  }