Skip to content

Commit f15ef86

Browse files
committed
Lots of type fixes
1 parent 91e59ab commit f15ef86

24 files changed

Lines changed: 875 additions & 316 deletions

src/physics/matter-js/Factory.js

Lines changed: 31 additions & 31 deletions
Large diffs are not rendered by default.

src/physics/matter-js/MatterPhysics.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ var MatterPhysics = new Class({
10441044
*
10451045
* @param {array} [bodies] - An array of objects to extract the bodies from. If falsey, it will return all bodies in the world.
10461046
*
1047-
* @return {MatterJS.Body[]} An array of native Matter Body objects.
1047+
* @return {MatterJS.BodyType[]} An array of native Matter Body objects.
10481048
*/
10491049
getMatterBodies: function (bodies)
10501050
{
@@ -1290,7 +1290,7 @@ var MatterPhysics = new Class({
12901290
* @method Phaser.Physics.Matter.MatterPhysics#getConstraintLength
12911291
* @since 3.22.0
12921292
*
1293-
* @param {MatterJS.Constraint} constraint - The constraint to get the length from.
1293+
* @param {MatterJS.ConstraintType} constraint - The constraint to get the length from.
12941294
*
12951295
* @return {number} The length of the constraint.
12961296
*/

src/physics/matter-js/MatterTileBody.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ var MatterTileBody = new Class({
243243
* @method Phaser.Physics.Matter.TileBody#setBody
244244
* @since 3.0.0
245245
*
246-
* @param {MatterJS.Body} body - The new Matter body to use.
246+
* @param {MatterJS.BodyType} body - The new Matter body to use.
247247
* @param {boolean} [addToWorld=true] - Whether or not to add the body to the Matter world.
248248
*
249249
* @return {Phaser.Physics.Matter.TileBody} This TileBody object.

src/physics/matter-js/PhysicsEditorParser.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var PhysicsEditorParser = {
3232
* @param {object} config - The body configuration and fixture (child body) definitions, as exported by PhysicsEditor.
3333
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
3434
*
35-
* @return {MatterJS.Body} A compound Matter JS Body.
35+
* @return {MatterJS.BodyType} A compound Matter JS Body.
3636
*/
3737
parseBody: function (x, y, config, options)
3838
{
@@ -75,7 +75,7 @@ var PhysicsEditorParser = {
7575
*
7676
* @param {object} fixtureConfig - The fixture object to parse.
7777
*
78-
* @return {MatterJS.Body[]} - An array of Matter JS Bodies.
78+
* @return {MatterJS.BodyType[]} - An array of Matter JS Bodies.
7979
*/
8080
parseFixture: function (fixtureConfig)
8181
{
@@ -110,7 +110,7 @@ var PhysicsEditorParser = {
110110
* @param {array} vertexSets - The vertex lists to parse.
111111
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
112112
*
113-
* @return {MatterJS.Body[]} - An array of Matter JS Bodies.
113+
* @return {MatterJS.BodyType[]} - An array of Matter JS Bodies.
114114
*/
115115
parseVertices: function (vertexSets, options)
116116
{

src/physics/matter-js/PhysicsJSONParser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var PhysicsJSONParser = {
6161
* @param {object} config - The body configuration data.
6262
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
6363
*
64-
* @return {MatterJS.Body} A Matter JS Body.
64+
* @return {MatterJS.BodyType} A Matter JS Body.
6565
*/
6666
parseBody: function (x, y, config, options)
6767
{

src/physics/matter-js/PointerConstraint.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ var PointerConstraint = new Class({
125125
* The body that is currently being dragged, if any.
126126
*
127127
* @name Phaser.Physics.Matter.PointerConstraint#body
128-
* @type {?MatterJS.Body}
128+
* @type {?MatterJS.BodyType}
129129
* @since 3.16.2
130130
*/
131131
this.body = null;
@@ -134,7 +134,7 @@ var PointerConstraint = new Class({
134134
* The part of the body that was clicked on to start the drag.
135135
*
136136
* @name Phaser.Physics.Matter.PointerConstraint#part
137-
* @type {?MatterJS.Body}
137+
* @type {?MatterJS.BodyType}
138138
* @since 3.16.2
139139
*/
140140
this.part = null;
@@ -143,7 +143,7 @@ var PointerConstraint = new Class({
143143
* The native Matter Constraint that is used to attach to bodies.
144144
*
145145
* @name Phaser.Physics.Matter.PointerConstraint#constraint
146-
* @type {MatterJS.Constraint}
146+
* @type {MatterJS.ConstraintType}
147147
* @since 3.0.0
148148
*/
149149
this.constraint = Constraint.create(Merge(options, defaults));
@@ -239,7 +239,7 @@ var PointerConstraint = new Class({
239239
* @method Phaser.Physics.Matter.PointerConstraint#hitTestBody
240240
* @since 3.16.2
241241
*
242-
* @param {MatterJS.Body} body - The Matter Body to check.
242+
* @param {MatterJS.BodyType} body - The Matter Body to check.
243243
* @param {Phaser.Math.Vector2} position - A translated hit test position.
244244
*
245245
* @return {boolean} `true` if a part of the body was hit, otherwise `false`.

src/physics/matter-js/World.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ var World = new Class({
354354
* @method Phaser.Physics.Matter.World#setCompositeRenderStyle
355355
* @since 3.22.0
356356
*
357-
* @param {MatterJS.Composite} composite - The Matter Composite to set the render style on.
357+
* @param {MatterJS.CompositeType} composite - The Matter Composite to set the render style on.
358358
*
359359
* @return {this} This Matter World instance for method chaining.
360360
*/
@@ -408,7 +408,7 @@ var World = new Class({
408408
* @method Phaser.Physics.Matter.World#setBodyRenderStyle
409409
* @since 3.22.0
410410
*
411-
* @param {MatterJS.Body} body - The Matter Body to set the render style on.
411+
* @param {MatterJS.BodyType} body - The Matter Body to set the render style on.
412412
* @param {number} [lineColor] - The line color. If `null` it will use the World Debug Config value.
413413
* @param {number} [lineOpacity] - The line opacity, between 0 and 1. If `null` it will use the World Debug Config value.
414414
* @param {number} [lineThickness] - The line thickness. If `null` it will use the World Debug Config value.
@@ -494,7 +494,7 @@ var World = new Class({
494494
* @method Phaser.Physics.Matter.World#setConstraintRenderStyle
495495
* @since 3.22.0
496496
*
497-
* @param {MatterJS.Constraint} constraint - The Matter Constraint to set the render style on.
497+
* @param {MatterJS.ConstraintType} constraint - The Matter Constraint to set the render style on.
498498
* @param {number} [lineColor] - The line color. If `null` it will use the World Debug Config value.
499499
* @param {number} [lineOpacity] - The line opacity, between 0 and 1. If `null` it will use the World Debug Config value.
500500
* @param {number} [lineThickness] - The line thickness. If `null` it will use the World Debug Config value.
@@ -886,7 +886,7 @@ var World = new Class({
886886
* @param {number} height - The height of the body.
887887
* @param {object} options - Optional Matter configuration object.
888888
*
889-
* @return {MatterJS.Body} The Matter.js body that was created.
889+
* @return {MatterJS.BodyType} The Matter.js body that was created.
890890
*/
891891
create: function (x, y, width, height, options)
892892
{
@@ -960,7 +960,7 @@ var World = new Class({
960960
* @method Phaser.Physics.Matter.World#removeConstraint
961961
* @since 3.0.0
962962
*
963-
* @param {(MatterJS.Constraint|MatterJS.Constraint[])} constraint - A Matter JS Constraint, or an array of constraints, to be removed.
963+
* @param {(MatterJS.ConstraintType|MatterJS.ConstraintType[])} constraint - A Matter JS Constraint, or an array of constraints, to be removed.
964964
* @param {boolean} [deep=false] - Optionally search the objects children and recursively remove those as well.
965965
*
966966
* @return {this} This Matter World object.
@@ -1244,7 +1244,7 @@ var World = new Class({
12441244
*
12451245
* @param {(MatterJS.Body|Phaser.GameObjects.GameObject)} body - The Matter Body, or Game Object, to search for within the world.
12461246
*
1247-
* @return {MatterJS.Body[]} An array of all the Matter JS Bodies in this World.
1247+
* @return {MatterJS.BodyType[]} An array of all the Matter JS Bodies in this World.
12481248
*/
12491249
has: function (body)
12501250
{
@@ -1259,7 +1259,7 @@ var World = new Class({
12591259
* @method Phaser.Physics.Matter.World#getAllBodies
12601260
* @since 3.22.0
12611261
*
1262-
* @return {MatterJS.Body[]} An array of all the Matter JS Bodies in this World.
1262+
* @return {MatterJS.BodyType[]} An array of all the Matter JS Bodies in this World.
12631263
*/
12641264
getAllBodies: function ()
12651265
{
@@ -1272,7 +1272,7 @@ var World = new Class({
12721272
* @method Phaser.Physics.Matter.World#getAllConstraints
12731273
* @since 3.22.0
12741274
*
1275-
* @return {MatterJS.Constraint[]} An array of all the Matter JS Constraints in this World.
1275+
* @return {MatterJS.ConstraintType[]} An array of all the Matter JS Constraints in this World.
12761276
*/
12771277
getAllConstraints: function ()
12781278
{
@@ -1285,7 +1285,7 @@ var World = new Class({
12851285
* @method Phaser.Physics.Matter.World#getAllComposites
12861286
* @since 3.22.0
12871287
*
1288-
* @return {MatterJS.Composite[]} An array of all the Matter JS Composites in this World.
1288+
* @return {MatterJS.CompositeType[]} An array of all the Matter JS Composites in this World.
12891289
*/
12901290
getAllComposites: function ()
12911291
{
@@ -1851,7 +1851,7 @@ var World = new Class({
18511851
* @method Phaser.Physics.Matter.World#renderBody
18521852
* @since 3.22.0
18531853
*
1854-
* @param {MatterJS.Body} body - The Matter Body to be rendered.
1854+
* @param {MatterJS.BodyType} body - The Matter Body to be rendered.
18551855
* @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.
18561856
* @param {boolean} showInternalEdges - Render internal edges of the polygon?
18571857
* @param {number} [lineColor] - The line color.
@@ -1988,7 +1988,7 @@ var World = new Class({
19881988
* @method Phaser.Physics.Matter.World#renderConvexHull
19891989
* @since 3.22.0
19901990
*
1991-
* @param {MatterJS.Body} body - The Matter Body to be rendered.
1991+
* @param {MatterJS.BodyType} body - The Matter Body to be rendered.
19921992
* @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.
19931993
* @param {number} hullColor - The color used to render the hull.
19941994
* @param {number} [lineThickness=1] - The hull line thickness.
@@ -2066,7 +2066,7 @@ var World = new Class({
20662066
* @method Phaser.Physics.Matter.World#renderConstraint
20672067
* @since 3.22.0
20682068
*
2069-
* @param {MatterJS.Constraint} constraint - The Matter Constraint to render.
2069+
* @param {MatterJS.ConstraintType} constraint - The Matter Constraint to render.
20702070
* @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.
20712071
* @param {number} lineColor - The line color.
20722072
* @param {number} lineOpacity - The line opacity, between 0 and 1.

src/physics/matter-js/components/SetBody.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ var SetBody = {
108108
* @method Phaser.Physics.Matter.Components.SetBody#setExistingBody
109109
* @since 3.0.0
110110
*
111-
* @param {MatterJS.Body} body - The Body this Game Object should use.
111+
* @param {MatterJS.BodyType} body - The Body this Game Object should use.
112112
* @param {boolean} [addToWorld=true] - Should the body be immediately added to the World?
113113
*
114114
* @return {Phaser.GameObjects.GameObject} This Game Object.

src/physics/matter-js/events/COLLISION_ACTIVE_EVENT.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* @since 3.0.0
2626
*
2727
* @param {Phaser.Physics.Matter.Events.CollisionActiveEvent} event - The Collision Event object.
28-
* @param {MatterJS.Body} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
29-
* @param {MatterJS.Body} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
28+
* @param {MatterJS.BodyType} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
29+
* @param {MatterJS.BodyType} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
3030
*/
3131
module.exports = 'collisionactive';

src/physics/matter-js/events/COLLISION_END_EVENT.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* @since 3.0.0
2626
*
2727
* @param {Phaser.Physics.Matter.Events.CollisionEndEvent} event - The Collision Event object.
28-
* @param {MatterJS.Body} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
29-
* @param {MatterJS.Body} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
28+
* @param {MatterJS.BodyType} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
29+
* @param {MatterJS.BodyType} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
3030
*/
3131
module.exports = 'collisionend';

0 commit comments

Comments
 (0)