@vpmedia/phaser 1.106.0 → 1.108.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 (217) hide show
  1. package/dist/index.js +225 -226
  2. package/dist/index.js.map +1 -1
  3. package/dist/phaser/core/animation.d.ts +2 -2
  4. package/dist/phaser/core/animation.d.ts.map +1 -1
  5. package/dist/phaser/core/animation_manager.d.ts +2 -2
  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.map +1 -1
  10. package/dist/phaser/core/cache.d.ts +6 -6
  11. package/dist/phaser/core/cache.d.ts.map +1 -1
  12. package/dist/phaser/core/device.d.ts.map +1 -1
  13. package/dist/phaser/core/device_util.d.ts.map +1 -1
  14. package/dist/phaser/core/dom.d.ts +2 -2
  15. package/dist/phaser/core/dom.d.ts.map +1 -1
  16. package/dist/phaser/core/event_manager.d.ts.map +1 -1
  17. package/dist/phaser/core/factory.d.ts +1 -1
  18. package/dist/phaser/core/factory.d.ts.map +1 -1
  19. package/dist/phaser/core/frame.d.ts.map +1 -1
  20. package/dist/phaser/core/frame_data.d.ts.map +1 -1
  21. package/dist/phaser/core/frame_util.d.ts.map +1 -1
  22. package/dist/phaser/core/game.d.ts +1 -1
  23. package/dist/phaser/core/game.d.ts.map +1 -1
  24. package/dist/phaser/core/input.d.ts +3 -3
  25. package/dist/phaser/core/input.d.ts.map +1 -1
  26. package/dist/phaser/core/input_handler.d.ts +8 -8
  27. package/dist/phaser/core/input_handler.d.ts.map +1 -1
  28. package/dist/phaser/core/input_mouse.d.ts +8 -8
  29. package/dist/phaser/core/input_mouse.d.ts.map +1 -1
  30. package/dist/phaser/core/input_mspointer.d.ts +6 -6
  31. package/dist/phaser/core/input_mspointer.d.ts.map +1 -1
  32. package/dist/phaser/core/input_pointer.d.ts +3 -3
  33. package/dist/phaser/core/input_pointer.d.ts.map +1 -1
  34. package/dist/phaser/core/input_touch.d.ts +7 -7
  35. package/dist/phaser/core/input_touch.d.ts.map +1 -1
  36. package/dist/phaser/core/loader.d.ts +6 -6
  37. package/dist/phaser/core/loader.d.ts.map +1 -1
  38. package/dist/phaser/core/loader_parser.d.ts +4 -4
  39. package/dist/phaser/core/loader_parser.d.ts.map +1 -1
  40. package/dist/phaser/core/raf.d.ts.map +1 -1
  41. package/dist/phaser/core/scale_manager.d.ts +5 -5
  42. package/dist/phaser/core/scale_manager.d.ts.map +1 -1
  43. package/dist/phaser/core/scene.d.ts +3 -3
  44. package/dist/phaser/core/scene.d.ts.map +1 -1
  45. package/dist/phaser/core/scene_manager.d.ts.map +1 -1
  46. package/dist/phaser/core/signal.d.ts +7 -7
  47. package/dist/phaser/core/signal.d.ts.map +1 -1
  48. package/dist/phaser/core/signal_binding.d.ts +1 -1
  49. package/dist/phaser/core/signal_binding.d.ts.map +1 -1
  50. package/dist/phaser/core/sound.d.ts +3 -3
  51. package/dist/phaser/core/sound.d.ts.map +1 -1
  52. package/dist/phaser/core/sound_manager.d.ts +1 -1
  53. package/dist/phaser/core/sound_manager.d.ts.map +1 -1
  54. package/dist/phaser/core/sound_sprite.d.ts.map +1 -1
  55. package/dist/phaser/core/stage.d.ts.map +1 -1
  56. package/dist/phaser/core/time.d.ts.map +1 -1
  57. package/dist/phaser/core/timer.d.ts +5 -5
  58. package/dist/phaser/core/timer.d.ts.map +1 -1
  59. package/dist/phaser/core/timer_event.d.ts.map +1 -1
  60. package/dist/phaser/core/tween.d.ts +1 -1
  61. package/dist/phaser/core/tween.d.ts.map +1 -1
  62. package/dist/phaser/core/tween_data.d.ts +1 -1
  63. package/dist/phaser/core/tween_data.d.ts.map +1 -1
  64. package/dist/phaser/core/tween_easing.d.ts.map +1 -1
  65. package/dist/phaser/core/tween_manager.d.ts +1 -1
  66. package/dist/phaser/core/tween_manager.d.ts.map +1 -1
  67. package/dist/phaser/core/world.d.ts.map +1 -1
  68. package/dist/phaser/display/bitmap_text.d.ts +3 -3
  69. package/dist/phaser/display/bitmap_text.d.ts.map +1 -1
  70. package/dist/phaser/display/button.d.ts +12 -11
  71. package/dist/phaser/display/button.d.ts.map +1 -1
  72. package/dist/phaser/display/canvas/buffer.d.ts.map +1 -1
  73. package/dist/phaser/display/canvas/graphics.d.ts +3 -3
  74. package/dist/phaser/display/canvas/graphics.d.ts.map +1 -1
  75. package/dist/phaser/display/canvas/masker.d.ts.map +1 -1
  76. package/dist/phaser/display/canvas/pool.d.ts.map +1 -1
  77. package/dist/phaser/display/canvas/renderer.d.ts +2 -2
  78. package/dist/phaser/display/canvas/renderer.d.ts.map +1 -1
  79. package/dist/phaser/display/canvas/tinter.d.ts +1 -1
  80. package/dist/phaser/display/canvas/tinter.d.ts.map +1 -1
  81. package/dist/phaser/display/canvas/util.d.ts +1 -1
  82. package/dist/phaser/display/canvas/util.d.ts.map +1 -1
  83. package/dist/phaser/display/display_object.d.ts +12 -21
  84. package/dist/phaser/display/display_object.d.ts.map +1 -1
  85. package/dist/phaser/display/graphics.d.ts +1 -1
  86. package/dist/phaser/display/graphics.d.ts.map +1 -1
  87. package/dist/phaser/display/graphics_data.d.ts.map +1 -1
  88. package/dist/phaser/display/graphics_data_util.d.ts.map +1 -1
  89. package/dist/phaser/display/group.d.ts +3 -3
  90. package/dist/phaser/display/group.d.ts.map +1 -1
  91. package/dist/phaser/display/image.d.ts +8 -8
  92. package/dist/phaser/display/image.d.ts.map +1 -1
  93. package/dist/phaser/display/sprite_batch.d.ts.map +1 -1
  94. package/dist/phaser/display/sprite_util.d.ts +5 -5
  95. package/dist/phaser/display/sprite_util.d.ts.map +1 -1
  96. package/dist/phaser/display/text.d.ts +8 -7
  97. package/dist/phaser/display/text.d.ts.map +1 -1
  98. package/dist/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
  99. package/dist/phaser/display/webgl/base_texture.d.ts.map +1 -1
  100. package/dist/phaser/display/webgl/blend_manager.d.ts.map +1 -1
  101. package/dist/phaser/display/webgl/earcut.d.ts +5 -5
  102. package/dist/phaser/display/webgl/earcut.d.ts.map +1 -1
  103. package/dist/phaser/display/webgl/earcut_node.d.ts.map +1 -1
  104. package/dist/phaser/display/webgl/fast_sprite_batch.d.ts +3 -2
  105. package/dist/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
  106. package/dist/phaser/display/webgl/filter_manager.d.ts.map +1 -1
  107. package/dist/phaser/display/webgl/filter_texture.d.ts.map +1 -1
  108. package/dist/phaser/display/webgl/graphics.d.ts +4 -3
  109. package/dist/phaser/display/webgl/graphics.d.ts.map +1 -1
  110. package/dist/phaser/display/webgl/graphics_data.d.ts.map +1 -1
  111. package/dist/phaser/display/webgl/mask_manager.d.ts.map +1 -1
  112. package/dist/phaser/display/webgl/render_texture.d.ts +2 -2
  113. package/dist/phaser/display/webgl/render_texture.d.ts.map +1 -1
  114. package/dist/phaser/display/webgl/renderer.d.ts.map +1 -1
  115. package/dist/phaser/display/webgl/shader/complex.d.ts.map +1 -1
  116. package/dist/phaser/display/webgl/shader/fast.d.ts.map +1 -1
  117. package/dist/phaser/display/webgl/shader/normal.d.ts +1 -1
  118. package/dist/phaser/display/webgl/shader/normal.d.ts.map +1 -1
  119. package/dist/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
  120. package/dist/phaser/display/webgl/shader/strip.d.ts.map +1 -1
  121. package/dist/phaser/display/webgl/shader_manager.d.ts +2 -1
  122. package/dist/phaser/display/webgl/shader_manager.d.ts.map +1 -1
  123. package/dist/phaser/display/webgl/sprite_batch.d.ts +2 -1
  124. package/dist/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
  125. package/dist/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
  126. package/dist/phaser/display/webgl/texture.d.ts.map +1 -1
  127. package/dist/phaser/display/webgl/texture_util.d.ts.map +1 -1
  128. package/dist/phaser/display/webgl/util.d.ts +8 -4
  129. package/dist/phaser/display/webgl/util.d.ts.map +1 -1
  130. package/dist/phaser/geom/circle.d.ts +1 -1
  131. package/dist/phaser/geom/circle.d.ts.map +1 -1
  132. package/dist/phaser/geom/ellipse.d.ts +1 -1
  133. package/dist/phaser/geom/ellipse.d.ts.map +1 -1
  134. package/dist/phaser/geom/line.d.ts +3 -3
  135. package/dist/phaser/geom/line.d.ts.map +1 -1
  136. package/dist/phaser/geom/matrix.d.ts +3 -3
  137. package/dist/phaser/geom/matrix.d.ts.map +1 -1
  138. package/dist/phaser/geom/point.d.ts.map +1 -1
  139. package/dist/phaser/geom/polygon.d.ts +1 -1
  140. package/dist/phaser/geom/polygon.d.ts.map +1 -1
  141. package/dist/phaser/geom/rectangle.d.ts +2 -2
  142. package/dist/phaser/geom/rectangle.d.ts.map +1 -1
  143. package/dist/phaser/geom/rounded_rectangle.d.ts.map +1 -1
  144. package/dist/phaser/geom/util/circle.d.ts +3 -3
  145. package/dist/phaser/geom/util/circle.d.ts.map +1 -1
  146. package/dist/phaser/geom/util/ellipse.d.ts +1 -1
  147. package/dist/phaser/geom/util/ellipse.d.ts.map +1 -1
  148. package/dist/phaser/geom/util/line.d.ts +3 -3
  149. package/dist/phaser/geom/util/line.d.ts.map +1 -1
  150. package/dist/phaser/geom/util/matrix.d.ts +1 -1
  151. package/dist/phaser/geom/util/matrix.d.ts.map +1 -1
  152. package/dist/phaser/geom/util/point.d.ts +15 -15
  153. package/dist/phaser/geom/util/point.d.ts.map +1 -1
  154. package/dist/phaser/geom/util/polygon.d.ts +1 -1
  155. package/dist/phaser/geom/util/polygon.d.ts.map +1 -1
  156. package/dist/phaser/geom/util/rectangle.d.ts +5 -5
  157. package/dist/phaser/geom/util/rectangle.d.ts.map +1 -1
  158. package/dist/phaser/geom/util/rounded_rectangle.d.ts +1 -1
  159. package/dist/phaser/geom/util/rounded_rectangle.d.ts.map +1 -1
  160. package/dist/phaser/util/math.d.ts.map +1 -1
  161. package/package.json +13 -13
  162. package/src/phaser/core/animation.ts +6 -6
  163. package/src/phaser/core/animation_manager.ts +2 -2
  164. package/src/phaser/core/cache.ts +9 -8
  165. package/src/phaser/core/device_util.ts +4 -2
  166. package/src/phaser/core/dom.ts +2 -2
  167. package/src/phaser/core/factory.ts +3 -5
  168. package/src/phaser/core/game.ts +21 -34
  169. package/src/phaser/core/input.ts +2 -2
  170. package/src/phaser/core/input_handler.ts +6 -5
  171. package/src/phaser/core/input_mouse.ts +8 -84
  172. package/src/phaser/core/input_mspointer.ts +12 -8
  173. package/src/phaser/core/input_touch.ts +7 -7
  174. package/src/phaser/core/loader.ts +35 -31
  175. package/src/phaser/core/loader_parser.ts +12 -4
  176. package/src/phaser/core/scale_manager.ts +5 -5
  177. package/src/phaser/core/scene.ts +3 -3
  178. package/src/phaser/core/signal.ts +9 -9
  179. package/src/phaser/core/signal_binding.ts +1 -1
  180. package/src/phaser/core/sound.ts +12 -21
  181. package/src/phaser/core/sound_manager.ts +3 -3
  182. package/src/phaser/core/stage.ts +6 -6
  183. package/src/phaser/core/timer.ts +4 -4
  184. package/src/phaser/core/tween.ts +7 -5
  185. package/src/phaser/core/tween_data.ts +2 -2
  186. package/src/phaser/core/tween_manager.ts +2 -2
  187. package/src/phaser/display/bitmap_text.ts +6 -6
  188. package/src/phaser/display/button.ts +33 -26
  189. package/src/phaser/display/canvas/renderer.ts +2 -2
  190. package/src/phaser/display/canvas/util.ts +12 -12
  191. package/src/phaser/display/display_object.ts +17 -31
  192. package/src/phaser/display/graphics.ts +9 -9
  193. package/src/phaser/display/group.ts +8 -8
  194. package/src/phaser/display/image.ts +21 -21
  195. package/src/phaser/display/sprite_util.ts +1 -1
  196. package/src/phaser/display/text.ts +9 -9
  197. package/src/phaser/display/webgl/earcut.ts +12 -4
  198. package/src/phaser/display/webgl/fast_sprite_batch.ts +4 -2
  199. package/src/phaser/display/webgl/graphics.ts +3 -2
  200. package/src/phaser/display/webgl/render_texture.ts +2 -2
  201. package/src/phaser/display/webgl/shader/normal.ts +1 -1
  202. package/src/phaser/display/webgl/shader_manager.ts +2 -1
  203. package/src/phaser/display/webgl/sprite_batch.ts +2 -1
  204. package/src/phaser/display/webgl/util.ts +9 -0
  205. package/src/phaser/geom/circle.ts +1 -1
  206. package/src/phaser/geom/ellipse.ts +1 -1
  207. package/src/phaser/geom/line.ts +2 -2
  208. package/src/phaser/geom/matrix.ts +3 -3
  209. package/src/phaser/geom/polygon.ts +1 -1
  210. package/src/phaser/geom/rectangle.ts +2 -2
  211. package/src/phaser/geom/util/circle.ts +8 -3
  212. package/src/phaser/geom/util/line.ts +9 -2
  213. package/src/phaser/geom/util/matrix.ts +1 -1
  214. package/src/phaser/geom/util/point.ts +15 -15
  215. package/src/phaser/geom/util/polygon.ts +1 -1
  216. package/src/phaser/geom/util/rectangle.ts +5 -5
  217. package/src/phaser/geom/util/rounded_rectangle.ts +1 -1
@@ -7,7 +7,7 @@ import { Point } from '../point.js';
7
7
  * @param {Point} output - The point to store the result in (optional).
8
8
  * @returns {Point} A new point containing the sum of the two points.
9
9
  */
10
- export const add = (a: Point, b: Point, output: Point = null) => {
10
+ export const add = (a: Point, b: Point, output: Point | null = null) => {
11
11
  const result = output || new Point();
12
12
  result.x = a.x + b.x;
13
13
  result.y = a.y + b.y;
@@ -21,7 +21,7 @@ export const add = (a: Point, b: Point, output: Point = null) => {
21
21
  * @param {Point} output - The point to store the result in (optional).
22
22
  * @returns {Point} A new point containing the difference of the two points.
23
23
  */
24
- export const subtract = (a: Point, b: Point, output: Point = null) => {
24
+ export const subtract = (a: Point, b: Point, output: Point | null = null) => {
25
25
  const result = output || new Point();
26
26
  result.x = a.x - b.x;
27
27
  result.y = a.y - b.y;
@@ -35,7 +35,7 @@ export const subtract = (a: Point, b: Point, output: Point = null) => {
35
35
  * @param {Point} output - The point to store the result in (optional).
36
36
  * @returns {Point} A new point containing the product of the two points.
37
37
  */
38
- export const multiply = (a: Point, b: Point, output: Point = null) => {
38
+ export const multiply = (a: Point, b: Point, output: Point | null = null) => {
39
39
  const result = output || new Point();
40
40
  result.x = a.x * b.x;
41
41
  result.y = a.y * b.y;
@@ -49,7 +49,7 @@ export const multiply = (a: Point, b: Point, output: Point = null) => {
49
49
  * @param {Point} output - The point to store the result in (optional).
50
50
  * @returns {Point} A new point containing the quotient of the two points.
51
51
  */
52
- export const divide = (a: Point, b: Point, output: Point = null) => {
52
+ export const divide = (a: Point, b: Point, output: Point | null = null) => {
53
53
  const result = output || new Point();
54
54
  result.x = a.x / b.x;
55
55
  result.y = a.y / b.y;
@@ -82,7 +82,7 @@ export const angle = (a: Point, b: Point) => {
82
82
  * @param {Point} output - The point to store the result in (optional).
83
83
  * @returns {Point} A new point with negated coordinates.
84
84
  */
85
- export const negative = (a: Point, output: Point = null) => {
85
+ export const negative = (a: Point, output: Point | null = null) => {
86
86
  const result = output || new Point();
87
87
  return result.setTo(-a.x, -a.y);
88
88
  };
@@ -95,7 +95,7 @@ export const negative = (a: Point, output: Point = null) => {
95
95
  * @param {Point} output - The point to store the result in (optional).
96
96
  * @returns {Point} A new point with the result of the operation.
97
97
  */
98
- export const multiplyAdd = (a: Point, b: Point, s: number, output: Point = null) => {
98
+ export const multiplyAdd = (a: Point, b: Point, s: number, output: Point | null = null) => {
99
99
  const result = output || new Point();
100
100
  return result.setTo(a.x + b.x * s, a.y + b.y * s);
101
101
  };
@@ -108,7 +108,7 @@ export const multiplyAdd = (a: Point, b: Point, s: number, output: Point = null)
108
108
  * @param {Point} output - The point to store the result in (optional).
109
109
  * @returns {Point} A new point interpolated between the two points.
110
110
  */
111
- export const interpolate = (a: Point, b: Point, f: number, output: Point = null) => {
111
+ export const interpolate = (a: Point, b: Point, f: number, output: Point | null = null) => {
112
112
  const result = output || new Point();
113
113
  return result.setTo(a.x + (b.x - a.x) * f, a.y + (b.y - a.y) * f);
114
114
  };
@@ -119,7 +119,7 @@ export const interpolate = (a: Point, b: Point, f: number, output: Point = null)
119
119
  * @param {Point} output - The point to store the result in (optional).
120
120
  * @returns {Point} A new point that is perpendicular to the input point.
121
121
  */
122
- export const perp = (a: Point, output: Point = null) => {
122
+ export const perp = (a: Point, output: Point | null = null) => {
123
123
  const result = output || new Point();
124
124
  return result.setTo(-a.y, a.x);
125
125
  };
@@ -130,7 +130,7 @@ export const perp = (a: Point, output: Point = null) => {
130
130
  * @param {Point} output - The point to store the result in (optional).
131
131
  * @returns {Point} A new point that is perpendicular to the input point (rotated clockwise).
132
132
  */
133
- export const rperp = (a: Point, output: Point = null) => {
133
+ export const rperp = (a: Point, output: Point | null = null) => {
134
134
  const result = output || new Point();
135
135
  return result.setTo(a.y, -a.x);
136
136
  };
@@ -156,7 +156,7 @@ export const distance = (a: Point, b: Point, round: boolean = false) => {
156
156
  * @param {Point} output - The point to store the result in (optional).
157
157
  * @returns {Point} A new point with the projected result.
158
158
  */
159
- export const project = (a: Point, b: Point, output: Point = null) => {
159
+ export const project = (a: Point, b: Point, output: Point | null = null) => {
160
160
  const result = output || new Point();
161
161
  const amt = a.dot(b) / b.getMagnitudeSq();
162
162
  if (amt !== 0) {
@@ -172,7 +172,7 @@ export const project = (a: Point, b: Point, output: Point = null) => {
172
172
  * @param {Point} output - The point to store the result in (optional).
173
173
  * @returns {Point} A new point with the projected result.
174
174
  */
175
- export const projectUnit = (a: Point, b: Point, output: Point = null) => {
175
+ export const projectUnit = (a: Point, b: Point, output: Point | null = null) => {
176
176
  const result = output || new Point();
177
177
  const amt = a.dot(b);
178
178
  if (amt !== 0) {
@@ -187,7 +187,7 @@ export const projectUnit = (a: Point, b: Point, output: Point = null) => {
187
187
  * @param {Point} output - The point to store the result in (optional).
188
188
  * @returns {Point} A new point with the same x coordinate but negated y coordinate.
189
189
  */
190
- export const normalRightHand = (a: Point, output: Point = null) => {
190
+ export const normalRightHand = (a: Point, output: Point | null = null) => {
191
191
  const result = output || new Point();
192
192
  return result.setTo(a.y * -1, a.x);
193
193
  };
@@ -198,7 +198,7 @@ export const normalRightHand = (a: Point, output: Point = null) => {
198
198
  * @param {Point} output - The point to store the result in (optional).
199
199
  * @returns {Point} A new normalized point.
200
200
  */
201
- export const normalize = (a: Point, output: Point = null) => {
201
+ export const normalize = (a: Point, output: Point | null = null) => {
202
202
  const result = output || new Point();
203
203
  const m = a.getMagnitude();
204
204
  if (m !== 0) {
@@ -251,7 +251,7 @@ export const rotate = (
251
251
  * @returns {Point} A new point representing the centroid of the input points.
252
252
  * @throws {Error} If the points array is empty.
253
253
  */
254
- export const centroid = (points: Point[], output: Point = null) => {
254
+ export const centroid = (points: Point[], output: Point | null = null) => {
255
255
  const result = output || new Point();
256
256
  const pointsLen = points.length;
257
257
  if (pointsLen < 1) {
@@ -292,7 +292,7 @@ export const parse = (obj: any, xProp: string = 'x', yProp: string = 'y') => {
292
292
  * @param {Point} output - The point to store the result in (optional).
293
293
  * @returns {Point} A new point with the same coordinates as the input.
294
294
  */
295
- export const clone = (input: Point, output: Point = null) => {
295
+ export const clone = (input: Point, output: Point | null = null) => {
296
296
  const result = output || new Point();
297
297
  result.setTo(input.x, input.y);
298
298
  return result;
@@ -6,7 +6,7 @@ import { Polygon } from '../polygon.js';
6
6
  * @param {Polygon} output - Optional polygon to store the result in.
7
7
  * @returns {Polygon} The cloned polygon.
8
8
  */
9
- export const clone = (input: Polygon, output: Polygon = null) => {
9
+ export const clone = (input: Polygon, output: Polygon | null = null) => {
10
10
  const result = output || new Polygon();
11
11
  result.setTo(input._points.slice());
12
12
  return result;
@@ -32,7 +32,7 @@ export const inflatePoint = (a: Rectangle, point: any) => {
32
32
  * @param {Point} output - Optional point to store the result in.
33
33
  * @returns {Point} The size of the rectangle as a point (width, height).
34
34
  */
35
- export const size = (a: Rectangle, output: Point = null) => {
35
+ export const size = (a: Rectangle, output: Point | null = null) => {
36
36
  const result = output || new Point();
37
37
  result.setTo(a.width, a.height);
38
38
  return result;
@@ -44,7 +44,7 @@ export const size = (a: Rectangle, output: Point = null) => {
44
44
  * @param {Rectangle} output - Optional rectangle to store the result in.
45
45
  * @returns {Rectangle} The cloned rectangle.
46
46
  */
47
- export const clone = (input: Rectangle, output: Rectangle = null) => {
47
+ export const clone = (input: Rectangle, output: Rectangle | null = null) => {
48
48
  const result = output || new Rectangle();
49
49
  result.setTo(input.x, input.y, input.width, input.height);
50
50
  return result;
@@ -141,7 +141,7 @@ export const intersects = (a: Rectangle, b: Rectangle) => {
141
141
  * @param {Rectangle} output - Optional rectangle to store the result in.
142
142
  * @returns {Rectangle} The intersection of the rectangles, or an empty rectangle if they don't intersect.
143
143
  */
144
- export const intersection = (a: Rectangle, b: Rectangle, output: Rectangle = null) => {
144
+ export const intersection = (a: Rectangle, b: Rectangle, output: Rectangle | null = null) => {
145
145
  const result = output || new Rectangle();
146
146
  if (intersects(a, b)) {
147
147
  result.x = Math.max(a.x, b.x);
@@ -185,7 +185,7 @@ export const intersectsRaw = (
185
185
  * @param {Rectangle} output - Optional rectangle to store the result in.
186
186
  * @returns {Rectangle} The union of the rectangles.
187
187
  */
188
- export const union = (a: Rectangle, b: Rectangle, output: Rectangle = null) => {
188
+ export const union = (a: Rectangle, b: Rectangle, output: Rectangle | null = null) => {
189
189
  const result = output || new Rectangle();
190
190
  return result.setTo(
191
191
  Math.min(a.x, b.x),
@@ -201,7 +201,7 @@ export const union = (a: Rectangle, b: Rectangle, output: Rectangle = null) => {
201
201
  * @param {Rectangle} output - Optional rectangle to store the result in.
202
202
  * @returns {Rectangle} The AABB of the points.
203
203
  */
204
- export const aabb = (points: Point[], output: Rectangle = null) => {
204
+ export const aabb = (points: Point[], output: Rectangle | null = null) => {
205
205
  const result = output || new Rectangle();
206
206
  let xMax = Number.NEGATIVE_INFINITY;
207
207
  let xMin = Number.POSITIVE_INFINITY;
@@ -6,7 +6,7 @@ import { RoundedRectangle } from '../rounded_rectangle.js';
6
6
  * @param {RoundedRectangle} output - Optional rounded rectangle to store the result in.
7
7
  * @returns {RoundedRectangle} The cloned rounded rectangle.
8
8
  */
9
- export const clone = (input: RoundedRectangle, output: RoundedRectangle = null) => {
9
+ export const clone = (input: RoundedRectangle, output: RoundedRectangle | null = null) => {
10
10
  const result = output || new RoundedRectangle();
11
11
  result.x = input.x;
12
12
  result.y = input.y;