@vpmedia/phaser 1.95.0 → 1.96.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 (167) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/package.json +9 -9
  3. package/src/phaser/core/animation.js +61 -56
  4. package/src/phaser/core/animation_manager.js +55 -55
  5. package/src/phaser/core/cache.js +154 -154
  6. package/src/phaser/core/device.js +2 -1
  7. package/src/phaser/core/device_util.js +27 -27
  8. package/src/phaser/core/dom.js +43 -43
  9. package/src/phaser/core/event_manager.js +63 -63
  10. package/src/phaser/core/factory.js +47 -47
  11. package/src/phaser/core/frame.js +30 -30
  12. package/src/phaser/core/frame_data.js +30 -28
  13. package/src/phaser/core/frame_util.js +8 -8
  14. package/src/phaser/core/game.js +34 -18
  15. package/src/phaser/core/loader.js +170 -170
  16. package/src/phaser/core/loader_parser.js +22 -22
  17. package/src/phaser/core/raf.js +1 -1
  18. package/src/phaser/core/scene.js +16 -10
  19. package/src/phaser/core/scene_manager.js +51 -43
  20. package/src/phaser/core/signal.js +56 -52
  21. package/src/phaser/core/sound.js +54 -54
  22. package/src/phaser/core/sound_manager.js +49 -49
  23. package/src/phaser/core/stage.js +16 -16
  24. package/src/phaser/core/time.js +30 -30
  25. package/src/phaser/core/timer.js +64 -64
  26. package/src/phaser/core/timer_event.js +9 -9
  27. package/src/phaser/core/tween.js +90 -90
  28. package/src/phaser/core/tween_data.js +30 -30
  29. package/src/phaser/core/tween_manager.js +29 -24
  30. package/src/phaser/core/world.js +4 -3
  31. package/src/phaser/display/bitmap_text.js +61 -54
  32. package/src/phaser/display/button.js +48 -47
  33. package/src/phaser/display/canvas/buffer.js +8 -8
  34. package/src/phaser/display/canvas/graphics.js +8 -8
  35. package/src/phaser/display/canvas/masker.js +5 -5
  36. package/src/phaser/display/canvas/pool.js +18 -18
  37. package/src/phaser/display/canvas/renderer.js +16 -16
  38. package/src/phaser/display/canvas/tinter.js +22 -22
  39. package/src/phaser/display/canvas/util.js +42 -42
  40. package/src/phaser/display/display_object.js +119 -108
  41. package/src/phaser/display/graphics.js +112 -112
  42. package/src/phaser/display/graphics_data.js +10 -10
  43. package/src/phaser/display/graphics_data_util.js +3 -3
  44. package/src/phaser/display/group.js +50 -50
  45. package/src/phaser/display/image.js +54 -50
  46. package/src/phaser/display/sprite_batch.js +2 -2
  47. package/src/phaser/display/sprite_util.js +19 -19
  48. package/src/phaser/display/text.js +212 -187
  49. package/src/phaser/display/webgl/abstract_filter.js +4 -4
  50. package/src/phaser/display/webgl/base_texture.js +9 -9
  51. package/src/phaser/display/webgl/blend_manager.js +7 -7
  52. package/src/phaser/display/webgl/earcut.js +95 -95
  53. package/src/phaser/display/webgl/earcut_node.js +4 -4
  54. package/src/phaser/display/webgl/fast_sprite_batch.js +15 -15
  55. package/src/phaser/display/webgl/filter_manager.js +9 -9
  56. package/src/phaser/display/webgl/filter_texture.js +10 -10
  57. package/src/phaser/display/webgl/graphics.js +37 -37
  58. package/src/phaser/display/webgl/graphics_data.js +4 -4
  59. package/src/phaser/display/webgl/mask_manager.js +6 -6
  60. package/src/phaser/display/webgl/render_texture.js +16 -16
  61. package/src/phaser/display/webgl/renderer.js +20 -20
  62. package/src/phaser/display/webgl/shader/complex.js +4 -4
  63. package/src/phaser/display/webgl/shader/fast.js +4 -4
  64. package/src/phaser/display/webgl/shader/normal.js +8 -8
  65. package/src/phaser/display/webgl/shader/primitive.js +4 -4
  66. package/src/phaser/display/webgl/shader/strip.js +4 -4
  67. package/src/phaser/display/webgl/shader_manager.js +9 -9
  68. package/src/phaser/display/webgl/sprite_batch.js +18 -18
  69. package/src/phaser/display/webgl/stencil_manager.js +16 -16
  70. package/src/phaser/display/webgl/texture.js +13 -13
  71. package/src/phaser/display/webgl/texture_util.js +8 -8
  72. package/src/phaser/display/webgl/util.js +25 -25
  73. package/src/phaser/geom/circle.js +69 -69
  74. package/src/phaser/geom/ellipse.js +28 -28
  75. package/src/phaser/geom/line.js +93 -93
  76. package/src/phaser/geom/matrix.js +54 -54
  77. package/src/phaser/geom/point.js +96 -96
  78. package/src/phaser/geom/polygon.js +22 -22
  79. package/src/phaser/geom/rectangle.js +132 -132
  80. package/src/phaser/geom/rounded_rectangle.js +12 -12
  81. package/src/phaser/geom/util/circle.js +33 -33
  82. package/src/phaser/geom/util/ellipse.js +5 -5
  83. package/src/phaser/geom/util/line.js +26 -26
  84. package/src/phaser/geom/util/matrix.js +8 -8
  85. package/src/phaser/geom/util/point.js +97 -97
  86. package/src/phaser/geom/util/polygon.js +4 -4
  87. package/src/phaser/geom/util/rectangle.js +74 -74
  88. package/src/phaser/geom/util/rounded_rectangle.js +4 -4
  89. package/src/phaser/util/math.js +81 -81
  90. package/types/phaser/core/animation.d.ts +61 -56
  91. package/types/phaser/core/animation.d.ts.map +1 -1
  92. package/types/phaser/core/animation_manager.d.ts +55 -55
  93. package/types/phaser/core/cache.d.ts +154 -154
  94. package/types/phaser/core/device.d.ts.map +1 -1
  95. package/types/phaser/core/dom.d.ts +43 -43
  96. package/types/phaser/core/event_manager.d.ts +63 -63
  97. package/types/phaser/core/factory.d.ts +47 -47
  98. package/types/phaser/core/frame.d.ts +30 -30
  99. package/types/phaser/core/frame_data.d.ts +28 -27
  100. package/types/phaser/core/frame_data.d.ts.map +1 -1
  101. package/types/phaser/core/game.d.ts +52 -19
  102. package/types/phaser/core/game.d.ts.map +1 -1
  103. package/types/phaser/core/loader.d.ts +170 -170
  104. package/types/phaser/core/loader_parser.d.ts.map +1 -1
  105. package/types/phaser/core/raf.d.ts +1 -1
  106. package/types/phaser/core/scene.d.ts +15 -9
  107. package/types/phaser/core/scene.d.ts.map +1 -1
  108. package/types/phaser/core/scene_manager.d.ts +51 -43
  109. package/types/phaser/core/scene_manager.d.ts.map +1 -1
  110. package/types/phaser/core/signal.d.ts +54 -51
  111. package/types/phaser/core/signal.d.ts.map +1 -1
  112. package/types/phaser/core/sound.d.ts +54 -54
  113. package/types/phaser/core/sound_manager.d.ts +49 -49
  114. package/types/phaser/core/stage.d.ts +10 -10
  115. package/types/phaser/core/time.d.ts +30 -30
  116. package/types/phaser/core/timer.d.ts +64 -64
  117. package/types/phaser/core/timer_event.d.ts +9 -9
  118. package/types/phaser/core/tween.d.ts +90 -90
  119. package/types/phaser/core/tween_data.d.ts +30 -30
  120. package/types/phaser/core/tween_manager.d.ts +29 -24
  121. package/types/phaser/core/tween_manager.d.ts.map +1 -1
  122. package/types/phaser/core/world.d.ts +4 -3
  123. package/types/phaser/core/world.d.ts.map +1 -1
  124. package/types/phaser/display/bitmap_text.d.ts +59 -52
  125. package/types/phaser/display/bitmap_text.d.ts.map +1 -1
  126. package/types/phaser/display/button.d.ts +47 -46
  127. package/types/phaser/display/button.d.ts.map +1 -1
  128. package/types/phaser/display/canvas/buffer.d.ts +8 -8
  129. package/types/phaser/display/canvas/renderer.d.ts +16 -16
  130. package/types/phaser/display/display_object.d.ts +119 -108
  131. package/types/phaser/display/display_object.d.ts.map +1 -1
  132. package/types/phaser/display/graphics.d.ts +101 -101
  133. package/types/phaser/display/graphics_data.d.ts +10 -10
  134. package/types/phaser/display/group.d.ts +47 -47
  135. package/types/phaser/display/image.d.ts +42 -40
  136. package/types/phaser/display/image.d.ts.map +1 -1
  137. package/types/phaser/display/text.d.ts +207 -184
  138. package/types/phaser/display/text.d.ts.map +1 -1
  139. package/types/phaser/display/webgl/abstract_filter.d.ts +4 -4
  140. package/types/phaser/display/webgl/base_texture.d.ts +9 -9
  141. package/types/phaser/display/webgl/blend_manager.d.ts +6 -6
  142. package/types/phaser/display/webgl/earcut.d.ts +95 -95
  143. package/types/phaser/display/webgl/earcut_node.d.ts +4 -4
  144. package/types/phaser/display/webgl/fast_sprite_batch.d.ts +15 -15
  145. package/types/phaser/display/webgl/filter_manager.d.ts +8 -8
  146. package/types/phaser/display/webgl/filter_texture.d.ts +10 -10
  147. package/types/phaser/display/webgl/graphics_data.d.ts +4 -4
  148. package/types/phaser/display/webgl/render_texture.d.ts +16 -16
  149. package/types/phaser/display/webgl/renderer.d.ts +20 -20
  150. package/types/phaser/display/webgl/shader/complex.d.ts +4 -4
  151. package/types/phaser/display/webgl/shader/fast.d.ts +4 -4
  152. package/types/phaser/display/webgl/shader/normal.d.ts +8 -8
  153. package/types/phaser/display/webgl/shader/primitive.d.ts +4 -4
  154. package/types/phaser/display/webgl/shader/strip.d.ts +4 -4
  155. package/types/phaser/display/webgl/shader_manager.d.ts +8 -8
  156. package/types/phaser/display/webgl/sprite_batch.d.ts +17 -17
  157. package/types/phaser/display/webgl/stencil_manager.d.ts +15 -15
  158. package/types/phaser/display/webgl/texture.d.ts +12 -12
  159. package/types/phaser/geom/circle.d.ts +69 -69
  160. package/types/phaser/geom/ellipse.d.ts +28 -28
  161. package/types/phaser/geom/line.d.ts +93 -93
  162. package/types/phaser/geom/matrix.d.ts +54 -54
  163. package/types/phaser/geom/point.d.ts +96 -96
  164. package/types/phaser/geom/polygon.d.ts +22 -22
  165. package/types/phaser/geom/rectangle.d.ts +132 -132
  166. package/types/phaser/geom/rounded_rectangle.d.ts +12 -12
  167. package/pnpm-workspace.yaml +0 -4
@@ -1,12 +1,12 @@
1
1
  export class Matrix {
2
2
  /**
3
- * TBD.
4
- * @param {number} a - TBD.
5
- * @param {number} b - TBD.
6
- * @param {number} c - TBD.
7
- * @param {number} d - TBD.
8
- * @param {number} tx - TBD.
9
- * @param {number} ty - TBD.
3
+ * Creates a new Matrix instance.
4
+ * @param {number} a - The a component of the matrix (default: 1).
5
+ * @param {number} b - The b component of the matrix (default: 0).
6
+ * @param {number} c - The c component of the matrix (default: 0).
7
+ * @param {number} d - The d component of the matrix (default: 1).
8
+ * @param {number} tx - The tx component of the matrix (default: 0).
9
+ * @param {number} ty - The ty component of the matrix (default: 0).
10
10
  */
11
11
  constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);
12
12
  /** @type {number} */
@@ -24,89 +24,89 @@ export class Matrix {
24
24
  /** @type {number} */
25
25
  type: number;
26
26
  /**
27
- * TBD.
28
- * @param {number[]} array - TBD.
29
- * @returns {Matrix} TBD.
27
+ * Sets the matrix components from an array.
28
+ * @param {number[]} array - The array to read the matrix components from (should have 6 elements).
29
+ * @returns {Matrix} This matrix instance for chaining.
30
30
  */
31
31
  fromArray(array: number[]): Matrix;
32
32
  /**
33
- * TBD.
34
- * @param {number} a - TBD.
35
- * @param {number} b - TBD.
36
- * @param {number} c - TBD.
37
- * @param {number} d - TBD.
38
- * @param {number} tx - TBD.
39
- * @param {number} ty - TBD.
40
- * @returns {Matrix} TBD.
33
+ * Sets the matrix components to new values.
34
+ * @param {number} a - The new a component of the matrix.
35
+ * @param {number} b - The new b component of the matrix.
36
+ * @param {number} c - The new c component of the matrix.
37
+ * @param {number} d - The new d component of the matrix.
38
+ * @param {number} tx - The new tx component of the matrix.
39
+ * @param {number} ty - The new ty component of the matrix.
40
+ * @returns {Matrix} This matrix instance for chaining.
41
41
  */
42
42
  setTo(a: number, b: number, c: number, d: number, tx: number, ty: number): Matrix;
43
43
  /**
44
- * TBD.
45
- * @returns {Matrix} TBD.
44
+ * Creates a clone of this matrix.
45
+ * @returns {Matrix} A new matrix with the same values as this one.
46
46
  */
47
47
  clone(): Matrix;
48
48
  /**
49
- * TBD.
50
- * @param {Matrix} matrix - TBD.
51
- * @returns {Matrix} TBD.
49
+ * Copies the values of this matrix to another matrix.
50
+ * @param {Matrix} matrix - The matrix to copy values to.
51
+ * @returns {Matrix} The destination matrix.
52
52
  */
53
53
  copyTo(matrix: Matrix): Matrix;
54
54
  /**
55
- * TBD.
56
- * @param {Matrix} matrix - TBD.
57
- * @returns {Matrix} TBD.
55
+ * Copies the values from another matrix to this matrix.
56
+ * @param {Matrix} matrix - The matrix to copy values from.
57
+ * @returns {Matrix} This matrix instance for chaining.
58
58
  */
59
59
  copyFrom(matrix: Matrix): Matrix;
60
60
  /**
61
- * TBD.
62
- * @param {boolean} transpose - TBD.
63
- * @param {Float32Array} output - TBD.
64
- * @returns {Float32Array} TBD.
61
+ * Converts this matrix to a Float32Array.
62
+ * @param {boolean} transpose - Whether to transpose the matrix (default: false).
63
+ * @param {Float32Array} output - The array to store the result in (optional).
64
+ * @returns {Float32Array} A Float32Array containing the matrix elements.
65
65
  */
66
66
  toArray(transpose?: boolean, output?: Float32Array): Float32Array;
67
67
  /**
68
- * TBD.
69
- * @param {Point} pos - TBD.
70
- * @param {Point} output - TBD.
71
- * @returns {Point} TBD.
68
+ * Applies this matrix to a point.
69
+ * @param {Point} pos - The point to apply the matrix to.
70
+ * @param {Point} output - The point to store the result in (optional).
71
+ * @returns {Point} The transformed point.
72
72
  */
73
73
  apply(pos: Point, output?: Point): Point;
74
74
  /**
75
- * TBD.
76
- * @param {Point} pos - TBD.
77
- * @param {Point} output - TBD.
78
- * @returns {Point} TBD.
75
+ * Applies the inverse of this matrix to a point.
76
+ * @param {Point} pos - The point to apply the inverse matrix to.
77
+ * @param {Point} output - The point to store the result in (optional).
78
+ * @returns {Point} The transformed point.
79
79
  */
80
80
  applyInverse(pos: Point, output?: Point): Point;
81
81
  /**
82
- * TBD.
83
- * @param {number} x - TBD.
84
- * @param {number} y - TBD.
85
- * @returns {Matrix} TBD.
82
+ * Translates this matrix by the specified amounts.
83
+ * @param {number} x - The amount to translate in the x direction.
84
+ * @param {number} y - The amount to translate in the y direction.
85
+ * @returns {Matrix} This matrix instance for chaining.
86
86
  */
87
87
  translate(x: number, y: number): Matrix;
88
88
  /**
89
- * TBD.
90
- * @param {number} x - TBD.
91
- * @param {number} y - TBD.
92
- * @returns {Matrix} TBD.
89
+ * Scales this matrix by the specified amounts.
90
+ * @param {number} x - The amount to scale in the x direction.
91
+ * @param {number} y - The amount to scale in the y direction.
92
+ * @returns {Matrix} This matrix instance for chaining.
93
93
  */
94
94
  scale(x: number, y: number): Matrix;
95
95
  /**
96
- * TBD.
97
- * @param {number} angle - TBD.
98
- * @returns {Matrix} TBD.
96
+ * Rotates this matrix by the specified angle.
97
+ * @param {number} angle - The angle in radians to rotate by.
98
+ * @returns {Matrix} This matrix instance for chaining.
99
99
  */
100
100
  rotate(angle: number): Matrix;
101
101
  /**
102
- * TBD.
103
- * @param {Matrix} matrix - TBD.
104
- * @returns {Matrix} TBD.
102
+ * Appends another matrix to this matrix (multiplying matrices).
103
+ * @param {Matrix} matrix - The matrix to append.
104
+ * @returns {Matrix} This matrix instance for chaining.
105
105
  */
106
106
  append(matrix: Matrix): Matrix;
107
107
  /**
108
- * TBD.
109
- * @returns {Matrix} TBD.
108
+ * Sets this matrix to an identity matrix (no transformation).
109
+ * @returns {Matrix} This matrix instance for chaining.
110
110
  */
111
111
  identity(): Matrix;
112
112
  }
@@ -1,8 +1,8 @@
1
1
  export class Point {
2
2
  /**
3
- * TBD.
4
- * @param {number} x - TBD.
5
- * @param {number} y - TBD.
3
+ * Creates a new Point instance.
4
+ * @param {number} x - The x coordinate of the point (default: 0).
5
+ * @param {number} y - The y coordinate of the point (default: 0).
6
6
  */
7
7
  constructor(x?: number, y?: number);
8
8
  /** @type {number} */
@@ -12,186 +12,186 @@ export class Point {
12
12
  /** @type {number} */
13
13
  type: number;
14
14
  /**
15
- * TBD.
16
- * @param {Point} source - TBD.
17
- * @returns {Point} TBD.
15
+ * Copies the coordinates from another point to this point.
16
+ * @param {Point} source - The point to copy coordinates from.
17
+ * @returns {Point} This point instance for chaining.
18
18
  */
19
19
  copyFrom(source: Point): Point;
20
20
  /**
21
- * TBD.
22
- * @returns {Point} TBD.
21
+ * Returns a new point with the x and y coordinates swapped.
22
+ * @returns {Point} A new point instance with swapped coordinates.
23
23
  */
24
24
  invert(): Point;
25
25
  /**
26
- * TBD.
27
- * @param {number} x - TBD.
28
- * @param {number} y - TBD.
29
- * @returns {Point} TBD.
26
+ * Sets the coordinates of this point to new values.
27
+ * @param {number} x - The new x coordinate for the point.
28
+ * @param {number} y - The new y coordinate for the point.
29
+ * @returns {Point} This point instance for chaining.
30
30
  */
31
31
  setTo(x: number, y: number): Point;
32
32
  /**
33
- * TBD.
34
- * @param {number} x - TBD.
35
- * @param {number} y - TBD.
36
- * @returns {Point} TBD.
37
- * @deprecated
33
+ * Sets the coordinates of this point to new values.
34
+ * @param {number} x - The new x coordinate for the point.
35
+ * @param {number} y - The new y coordinate for the point.
36
+ * @returns {Point} This point instance for chaining.
37
+ * @deprecated Use setTo instead.
38
38
  */
39
39
  set(x: number, y: number): Point;
40
40
  /**
41
- * TBD.
42
- * @param {number} x - TBD.
43
- * @param {number} y - TBD.
44
- * @returns {Point} TBD.
41
+ * Adds the given x and y values to the point's coordinates.
42
+ * @param {number} x - The amount to add to the x coordinate.
43
+ * @param {number} y - The amount to add to the y coordinate.
44
+ * @returns {Point} This point instance for chaining.
45
45
  */
46
46
  add(x: number, y: number): Point;
47
47
  /**
48
- * TBD.
49
- * @param {number} x - TBD.
50
- * @param {number} y - TBD.
51
- * @returns {Point} TBD.
48
+ * Subtracts the given x and y values from the point's coordinates.
49
+ * @param {number} x - The amount to subtract from the x coordinate.
50
+ * @param {number} y - The amount to subtract from the y coordinate.
51
+ * @returns {Point} This point instance for chaining.
52
52
  */
53
53
  subtract(x: number, y: number): Point;
54
54
  /**
55
- * TBD.
56
- * @param {number} x - TBD.
57
- * @param {number} y - TBD.
58
- * @returns {Point} TBD.
55
+ * Multiplies the point's coordinates by the given x and y values.
56
+ * @param {number} x - The amount to multiply the x coordinate by.
57
+ * @param {number} y - The amount to multiply the y coordinate by.
58
+ * @returns {Point} This point instance for chaining.
59
59
  */
60
60
  multiply(x: number, y: number): Point;
61
61
  /**
62
- * TBD.
63
- * @param {number} x - TBD.
64
- * @param {number} y - TBD.
65
- * @returns {Point} TBD.
62
+ * Divides the point's coordinates by the given x and y values.
63
+ * @param {number} x - The amount to divide the x coordinate by.
64
+ * @param {number} y - The amount to divide the y coordinate by.
65
+ * @returns {Point} This point instance for chaining.
66
66
  */
67
67
  divide(x: number, y: number): Point;
68
68
  /**
69
- * TBD.
70
- * @param {number} min - TBD.
71
- * @param {number} max - TBD.
72
- * @returns {Point} TBD.
69
+ * Constrains the x coordinate of this point to the given range.
70
+ * @param {number} min - The minimum value for the x coordinate.
71
+ * @param {number} max - The maximum value for the x coordinate.
72
+ * @returns {Point} This point instance for chaining.
73
73
  */
74
74
  clampX(min: number, max: number): Point;
75
75
  /**
76
- * TBD.
77
- * @param {number} min - TBD.
78
- * @param {number} max - TBD.
79
- * @returns {Point} TBD.
76
+ * Constrains the y coordinate of this point to the given range.
77
+ * @param {number} min - The minimum value for the y coordinate.
78
+ * @param {number} max - The maximum value for the y coordinate.
79
+ * @returns {Point} This point instance for chaining.
80
80
  */
81
81
  clampY(min: number, max: number): Point;
82
82
  /**
83
- * TBD.
84
- * @param {number} min - TBD.
85
- * @param {number} max - TBD.
86
- * @returns {Point} TBD.
83
+ * Constrains both coordinates of this point to the given range.
84
+ * @param {number} min - The minimum value for both coordinates.
85
+ * @param {number} max - The maximum value for both coordinates.
86
+ * @returns {Point} This point instance for chaining.
87
87
  */
88
88
  clamp(min: number, max: number): Point;
89
89
  /**
90
- * TBD.
91
- * @returns {Point} TBD.
90
+ * Creates a clone of this point.
91
+ * @returns {Point} A new point with the same coordinates as this one.
92
92
  */
93
93
  clone(): Point;
94
94
  /**
95
- * TBD.
96
- * @param {Point} dest - TBD.
97
- * @returns {Point} TBD.
95
+ * Copies the coordinates of this point to another point.
96
+ * @param {Point} dest - The point to copy coordinates to.
97
+ * @returns {Point} The destination point.
98
98
  */
99
99
  copyTo(dest: Point): Point;
100
100
  /**
101
- * TBD.
102
- * @param {Point} b - TBD.
103
- * @returns {number} TBD.
101
+ * Calculates the distance between this point and another point.
102
+ * @param {Point} b - The other point to calculate the distance to.
103
+ * @returns {number} The distance between the two points.
104
104
  */
105
105
  distance(b: Point): number;
106
106
  /**
107
- * TBD.
108
- * @param {Point} a - TBD.
109
- * @returns {boolean} TBD.
107
+ * Checks if this point is equal to another point.
108
+ * @param {Point} a - The other point to compare with.
109
+ * @returns {boolean} True if the points have the same coordinates, false otherwise.
110
110
  */
111
111
  equals(a: Point): boolean;
112
112
  /**
113
- * TBD.
114
- * @param {Point} a - TBD.
115
- * @param {boolean} asDegrees - TBD.
116
- * @returns {number} TBD.
113
+ * Calculates the angle between this point and another point.
114
+ * @param {Point} a - The other point to calculate the angle to.
115
+ * @param {boolean} asDegrees - Whether to return the result in degrees (default: false).
116
+ * @returns {number} The angle between the two points in radians or degrees.
117
117
  */
118
118
  angle(a: Point, asDegrees?: boolean): number;
119
119
  /**
120
- * TBD.
121
- * @param {number} x - TBD.
122
- * @param {number} y - TBD.
123
- * @param {number} angle - TBD.
124
- * @param {boolean} asDegrees - TBD.
125
- * @param {number | null | undefined} dist - TBD.
126
- * @returns {Point} TBD.
120
+ * Rotates this point around another point by a given angle.
121
+ * @param {number} x - The x coordinate of the center point to rotate around.
122
+ * @param {number} y - The y coordinate of the center point to rotate around.
123
+ * @param {number} angle - The angle in radians to rotate by.
124
+ * @param {boolean} asDegrees - Whether the angle is provided in degrees (default: false).
125
+ * @param {number | null | undefined} dist - The distance to rotate from (default: null).
126
+ * @returns {Point} This point instance for chaining.
127
127
  */
128
128
  rotate(x: number, y: number, angle: number, asDegrees: boolean, dist?: number | null | undefined): Point;
129
129
  /**
130
- * TBD.
131
- * @returns {number} TBD.
130
+ * Calculates the magnitude (length) of this point from the origin.
131
+ * @returns {number} The magnitude of the point.
132
132
  */
133
133
  getMagnitude(): number;
134
134
  /**
135
- * TBD.
136
- * @returns {number} TBD.
135
+ * Calculates the square of the magnitude (length) of this point from the origin.
136
+ * @returns {number} The square of the magnitude of the point.
137
137
  */
138
138
  getMagnitudeSq(): number;
139
139
  /**
140
- * TBD.
141
- * @param {number} magnitude - TBD.
142
- * @returns {Point} TBD.
140
+ * Sets the magnitude (length) of this point while preserving its direction.
141
+ * @param {number} magnitude - The new magnitude for the point.
142
+ * @returns {Point} This point instance for chaining.
143
143
  */
144
144
  setMagnitude(magnitude: number): Point;
145
145
  /**
146
- * TBD.
147
- * @returns {Point} TBD.
146
+ * Normalizes this point to have a magnitude of 1 while preserving its direction.
147
+ * @returns {Point} This point instance for chaining.
148
148
  */
149
149
  normalize(): Point;
150
150
  /**
151
- * TBD.
152
- * @returns {boolean} TBD.
151
+ * Checks if this point has zero magnitude (is at the origin).
152
+ * @returns {boolean} True if both x and y coordinates are zero, false otherwise.
153
153
  */
154
154
  isZero(): boolean;
155
155
  /**
156
- * TBD.
157
- * @param {Point} a - TBD.
158
- * @returns {number} TBD.
156
+ * Calculates the dot product of this point and another point.
157
+ * @param {Point} a - The other point to calculate the dot product with.
158
+ * @returns {number} The dot product of the two points.
159
159
  */
160
160
  dot(a: Point): number;
161
161
  /**
162
- * TBD.
163
- * @param {Point} a - TBD.
164
- * @returns {number} TBD.
162
+ * Calculates the cross product of this point and another point.
163
+ * @param {Point} a - The other point to calculate the cross product with.
164
+ * @returns {number} The cross product of the two points.
165
165
  */
166
166
  cross(a: Point): number;
167
167
  /**
168
- * TBD.
169
- * @returns {Point} TBD.
168
+ * Returns a perpendicular point (rotated 90 degrees counter-clockwise).
169
+ * @returns {Point} A new point that is perpendicular to this one.
170
170
  */
171
171
  perp(): Point;
172
172
  /**
173
- * TBD.
174
- * @returns {Point} TBD.
173
+ * Returns a perpendicular point (rotated 90 degrees clockwise).
174
+ * @returns {Point} A new point that is perpendicular to this one (rotated clockwise).
175
175
  */
176
176
  rperp(): Point;
177
177
  /**
178
- * TBD.
179
- * @returns {Point} TBD.
178
+ * Returns a point with the same direction as this one but with y coordinate negated.
179
+ * @returns {Point} A new point with the same x coordinate but negated y coordinate.
180
180
  */
181
181
  normalRightHand(): Point;
182
182
  /**
183
- * TBD.
184
- * @returns {Point} TBD.
183
+ * Returns a new point with the x and y coordinates rounded down to the nearest integer.
184
+ * @returns {Point} A new point with floored coordinates.
185
185
  */
186
186
  floor(): Point;
187
187
  /**
188
- * TBD.
189
- * @returns {Point} TBD.
188
+ * Returns a new point with the x and y coordinates rounded up to the nearest integer.
189
+ * @returns {Point} A new point with ceiled coordinates.
190
190
  */
191
191
  ceil(): Point;
192
192
  /**
193
- * TBD.
194
- * @returns {string} TBD.
193
+ * Returns a string representation of this point.
194
+ * @returns {string} A string representation of the point in the format "[Point (x=value y=value)]".
195
195
  */
196
196
  toString(): string;
197
197
  }
@@ -1,7 +1,7 @@
1
1
  export class Polygon {
2
2
  /**
3
- * TBD.
4
- * @param {object[]} points - TBD.
3
+ * Creates a new Polygon instance.
4
+ * @param {object[]} points - The array of points to define the polygon (optional).
5
5
  */
6
6
  constructor(points?: object[]);
7
7
  /** @type {number} */
@@ -15,47 +15,47 @@ export class Polygon {
15
15
  /** @type {number} */
16
16
  type: number;
17
17
  /**
18
- * TBD.
19
- * @param {number[]} output - TBD.
20
- * @returns {number[]} TBD.
18
+ * Converts the polygon's points to a number array.
19
+ * @param {number[]} output - The array to store the result in (optional).
20
+ * @returns {number[]} An array of numbers representing the polygon's points.
21
21
  */
22
22
  toNumberArray(output?: number[]): number[];
23
23
  /**
24
- * TBD.
25
- * @returns {Polygon} TBD.
24
+ * Flattens the polygon's point array to a simple numeric array.
25
+ * @returns {Polygon} This polygon instance for chaining.
26
26
  */
27
27
  flatten(): Polygon;
28
28
  /**
29
- * TBD.
30
- * @returns {Polygon} TBD.
29
+ * Creates a clone of this polygon.
30
+ * @returns {Polygon} A new polygon with the same values as this one.
31
31
  */
32
32
  clone(): Polygon;
33
33
  /**
34
- * TBD.
35
- * @param {number} x - TBD.
36
- * @param {number} y - TBD.
37
- * @returns {boolean} TBD.
34
+ * Checks if the specified point is contained within this polygon.
35
+ * @param {number} x - The x coordinate of the point to check.
36
+ * @param {number} y - The y coordinate of the point to check.
37
+ * @returns {boolean} True if the point is contained within this polygon, false otherwise.
38
38
  */
39
39
  contains(x: number, y: number): boolean;
40
40
  /**
41
- * TBD.
42
- * @param {object[]} points - TBD.
43
- * @returns {Polygon} TBD.
41
+ * Sets the polygon's points to new values.
42
+ * @param {object[]} points - The array of points to define the polygon.
43
+ * @returns {Polygon} This polygon instance for chaining.
44
44
  */
45
45
  setTo(points: object[]): Polygon;
46
46
  /**
47
- * TBD.
48
- * @param {number} y0 - TBD.
49
- * @returns {number} TBD.
47
+ * Calculates the area of this polygon.
48
+ * @param {number} y0 - The y coordinate of the lowest boundary (internal use).
49
+ * @returns {number} The area of this polygon.
50
50
  */
51
51
  calculateArea(y0: number): number;
52
52
  /**
53
- * TBD.
53
+ * Sets the points of this polygon.
54
54
  */
55
55
  set points(value: object[]);
56
56
  /**
57
- * TBD.
58
- * @returns {object[]} TBD.
57
+ * Gets the points of this polygon.
58
+ * @returns {object[]} The array of points that define this polygon.
59
59
  */
60
60
  get points(): object[];
61
61
  }