Skip to content

Commit dca7996

Browse files
committed
Fix multiple types on Physics, Texture and Input
1 parent 7e05b33 commit dca7996

24 files changed

Lines changed: 79 additions & 79 deletions

src/input/InputPlugin.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ var InputPlugin = new Class({
10101010
* @method Phaser.Input.InputPlugin#setDraggable
10111011
* @since 3.0.0
10121012
*
1013-
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to change the draggable state on.
1013+
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to change the draggable state on.
10141014
* @param {boolean} [value=true] - Set to `true` if the Game Objects should be made draggable, `false` if they should be unset.
10151015
*
10161016
* @return {Phaser.Input.InputPlugin} This InputPlugin object.
@@ -1051,7 +1051,7 @@ var InputPlugin = new Class({
10511051
* @method Phaser.Input.InputPlugin#setHitArea
10521052
* @since 3.0.0
10531053
*
1054-
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set the hit area on.
1054+
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set the hit area on.
10551055
* @param {object} [shape] - The shape or object to check if the pointer is within for hit area checks.
10561056
* @param {HitAreaCallback} [callback] - The 'contains' function to invoke to check if the pointer is within the hit area.
10571057
*
@@ -1087,7 +1087,7 @@ var InputPlugin = new Class({
10871087
* @method Phaser.Input.InputPlugin#setHitAreaCircle
10881088
* @since 3.0.0
10891089
*
1090-
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having a circle hit area.
1090+
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a circle hit area.
10911091
* @param {number} x - The center of the circle.
10921092
* @param {number} y - The center of the circle.
10931093
* @param {number} radius - The radius of the circle.
@@ -1110,7 +1110,7 @@ var InputPlugin = new Class({
11101110
* @method Phaser.Input.InputPlugin#setHitAreaEllipse
11111111
* @since 3.0.0
11121112
*
1113-
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having an ellipse hit area.
1113+
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having an ellipse hit area.
11141114
* @param {number} x - The center of the ellipse.
11151115
* @param {number} y - The center of the ellipse.
11161116
* @param {number} width - The width of the ellipse.
@@ -1134,7 +1134,7 @@ var InputPlugin = new Class({
11341134
* @method Phaser.Input.InputPlugin#setHitAreaFromTexture
11351135
* @since 3.0.0
11361136
*
1137-
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having an ellipse hit area.
1137+
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having an ellipse hit area.
11381138
* @param {HitAreaCallback} [callback] - The hit area callback. If undefined it uses Rectangle.Contains.
11391139
*
11401140
* @return {Phaser.Input.InputPlugin} This InputPlugin object.
@@ -1184,7 +1184,7 @@ var InputPlugin = new Class({
11841184
* @method Phaser.Input.InputPlugin#setHitAreaRectangle
11851185
* @since 3.0.0
11861186
*
1187-
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having a rectangular hit area.
1187+
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a rectangular hit area.
11881188
* @param {number} x - The top-left of the rectangle.
11891189
* @param {number} y - The top-left of the rectangle.
11901190
* @param {number} width - The width of the rectangle.
@@ -1208,7 +1208,7 @@ var InputPlugin = new Class({
12081208
* @method Phaser.Input.InputPlugin#setHitAreaTriangle
12091209
* @since 3.0.0
12101210
*
1211-
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having a triangular hit area.
1211+
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a triangular hit area.
12121212
* @param {number} x1 - The x coordinate of the first point of the triangle.
12131213
* @param {number} y1 - The y coordinate of the first point of the triangle.
12141214
* @param {number} x2 - The x coordinate of the second point of the triangle.

src/input/Pointer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,9 @@ var Pointer = new Class({
270270
* @since 3.0.0
271271
*
272272
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
273-
* @param {Phaser.Math.Vector2|object} output - [description]
273+
* @param {(Phaser.Math.Vector2|object)} output - [description]
274274
*
275-
* @return {Phaser.Math.Vector2|object} [description]
275+
* @return {(Phaser.Math.Vector2|object)} [description]
276276
*/
277277
positionToCamera: function (camera, output)
278278
{

src/input/keyboard/KeyboardManager.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ var KeyboardManager = new Class({
239239
* @method Phaser.Input.Keyboard.KeyboardManager#addKey
240240
* @since 3.0.0
241241
*
242-
* @param {string|integer} keyCode - [description]
242+
* @param {(string|integer)} keyCode - [description]
243243
*
244244
* @return {Phaser.Input.Keyboard.Key} [description]
245245
*/
@@ -262,7 +262,7 @@ var KeyboardManager = new Class({
262262
* @method Phaser.Input.Keyboard.KeyboardManager#removeKey
263263
* @since 3.0.0
264264
*
265-
* @param {string|integer} keyCode - [description]
265+
* @param {(string|integer)} keyCode - [description]
266266
*/
267267
removeKey: function (keyCode)
268268
{
@@ -279,7 +279,7 @@ var KeyboardManager = new Class({
279279
* @method Phaser.Input.Keyboard.KeyboardManager#addKeyCapture
280280
* @since 3.0.0
281281
*
282-
* @param {string|integer|string[]|integer[]} keyCodes - [description]
282+
* @param {(string|integer|string[]|integer[])} keyCodes - [description]
283283
*/
284284
addKeyCapture: function (keyCodes)
285285
{
@@ -300,7 +300,7 @@ var KeyboardManager = new Class({
300300
* @method Phaser.Input.Keyboard.KeyboardManager#removeKeyCapture
301301
* @since 3.0.0
302302
*
303-
* @param {string|integer|string[]|integer[]} keyCodes - [description]
303+
* @param {(string|integer|string[]|integer[])} keyCodes - [description]
304304
*/
305305
removeKeyCapture: function (keyCodes)
306306
{
@@ -321,7 +321,7 @@ var KeyboardManager = new Class({
321321
* @method Phaser.Input.Keyboard.KeyboardManager#createCombo
322322
* @since 3.0.0
323323
*
324-
* @param {string|integer[]|object[]} keys - [description]
324+
* @param {(string|integer[]|object[])} keys - [description]
325325
* @param {object} config - [description]
326326
*
327327
* @return {Phaser.Input.Keyboard.KeyCombo} [description]

src/input/keyboard/combo/KeyCombo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var ResetKeyCombo = require('./ResetKeyCombo');
3131
* @since 3.0.0
3232
*
3333
* @param {Phaser.Input.Keyboard.KeyboardManager} keyboardManager - [description]
34-
* @param {string|integer[]|object[]} keys - [description]
34+
* @param {(string|integer[]|object[])} keys - [description]
3535
* @param {object} [config] - [description]
3636
*/
3737
var KeyCombo = new Class({

src/physics/arcade/ArcadeImage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var Image = require('../../gameobjects/image/Image');
1111
/**
1212
* @classdesc
1313
* An Arcade Physics Image Game Object.
14-
*
14+
*
1515
* An Image is a light-weight Game Object useful for the display of static images in your game,
1616
* such as logos, backgrounds, scenery or other non-animated elements. Images can have input
1717
* events and physics bodies, or be tweened, tinted or scrolled. The main difference between an
@@ -54,7 +54,7 @@ var Image = require('../../gameobjects/image/Image');
5454
* @param {number} x - The horizontal position of this Game Object in the world.
5555
* @param {number} y - The vertical position of this Game Object in the world.
5656
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
57-
* @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with.
57+
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
5858
*/
5959
var ArcadeImage = new Class({
6060

src/physics/arcade/ArcadePhysics.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ var ArcadePhysics = new Class({
142142
* @method Phaser.Physics.Arcade.ArcadePhysics#overlap
143143
* @since 3.0.0
144144
*
145-
* @param {Phaser.GameObjects.GameObject|array} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
146-
* @param {Phaser.GameObjects.GameObject|array} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
145+
* @param {(Phaser.GameObjects.GameObject|array)} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
146+
* @param {(Phaser.GameObjects.GameObject|array)} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
147147
* @param {ArcadePhysicsCallback} [overlapCallback=null] - An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you specified them, unless you are checking Group vs. Sprite, in which case Sprite will always be the first parameter.
148148
* @param {ArcadePhysicsCallback} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`.
149149
* @param {object} [callbackContext] - The context in which to run the callbacks.
@@ -165,8 +165,8 @@ var ArcadePhysics = new Class({
165165
* @method Phaser.Physics.Arcade.ArcadePhysics#collide
166166
* @since 3.0.0
167167
*
168-
* @param {Phaser.GameObjects.GameObject|array} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
169-
* @param {Phaser.GameObjects.GameObject|array} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
168+
* @param {(Phaser.GameObjects.GameObject|array)} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
169+
* @param {(Phaser.GameObjects.GameObject|array)} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body.
170170
* @param {ArcadePhysicsCallback} [collideCallback=null] - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them, unless you are checking Group vs. Sprite, in which case Sprite will always be the first parameter.
171171
* @param {ArcadePhysicsCallback} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`.
172172
* @param {object} [callbackContext] - The context in which to run the callbacks.

src/physics/arcade/ArcadeSprite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var Sprite = require('../../gameobjects/sprite/Sprite');
5858
* @param {number} x - The horizontal position of this Game Object in the world.
5959
* @param {number} y - The vertical position of this Game Object in the world.
6060
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
61-
* @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with.
61+
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
6262
*/
6363
var ArcadeSprite = new Class({
6464

src/physics/arcade/Factory.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ var Factory = new Class({
124124
* @param {number} x - The horizontal position of this Game Object in the world.
125125
* @param {number} y - The vertical position of this Game Object in the world.
126126
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
127-
* @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with.
127+
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
128128
*
129129
* @return {Phaser.Physics.Arcade.Image} The Image object that was created.
130130
*/
@@ -148,7 +148,7 @@ var Factory = new Class({
148148
* @param {number} x - The horizontal position of this Game Object in the world.
149149
* @param {number} y - The vertical position of this Game Object in the world.
150150
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
151-
* @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with.
151+
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
152152
*
153153
* @return {Phaser.Physics.Arcade.Image} The Image object that was created.
154154
*/
@@ -172,7 +172,7 @@ var Factory = new Class({
172172
* @param {number} x - The horizontal position of this Game Object in the world.
173173
* @param {number} y - The vertical position of this Game Object in the world.
174174
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
175-
* @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with.
175+
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
176176
*
177177
* @return {Phaser.Physics.Arcade.Sprite} The Sprite object that was created.
178178
*/
@@ -197,7 +197,7 @@ var Factory = new Class({
197197
* @param {number} x - The horizontal position of this Game Object in the world.
198198
* @param {number} y - The vertical position of this Game Object in the world.
199199
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
200-
* @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with.
200+
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
201201
*
202202
* @return {Phaser.Physics.Arcade.Sprite} The Sprite object that was created.
203203
*/

src/physics/arcade/World.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ var World = new Class({
267267
* @method Phaser.Physics.Arcade.World#enable
268268
* @since 3.0.0
269269
*
270-
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} object - [description]
270+
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} object - [description]
271271
* @param {integer} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`.
272272
*/
273273
enable: function (object, bodyType)
@@ -357,7 +357,7 @@ var World = new Class({
357357
* @method Phaser.Physics.Arcade.World#disable
358358
* @since 3.0.0
359359
*
360-
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} object - [description]
360+
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} object - [description]
361361
*/
362362
disable: function (object)
363363
{
@@ -1531,7 +1531,7 @@ var World = new Class({
15311531
* @since 3.0.0
15321532
*
15331533
* @param {Phaser.GameObjects.Group} group - [description]
1534-
* @param {Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} tilemapLayer - [description]
1534+
* @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - [description]
15351535
* @param {ArcadePhysicsCallback} collideCallback - [description]
15361536
* @param {ArcadePhysicsCallback} processCallback - [description]
15371537
* @param {object} callbackContext - [description]
@@ -1571,7 +1571,7 @@ var World = new Class({
15711571
* @since 3.0.0
15721572
*
15731573
* @param {Phaser.GameObjects.GameObject} sprite - [description]
1574-
* @param {Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} tilemapLayer - [description]
1574+
* @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - [description]
15751575
* @param {ArcadePhysicsCallback} collideCallback - [description]
15761576
* @param {ArcadePhysicsCallback} processCallback - [description]
15771577
* @param {object} callbackContext - [description]

src/physics/arcade/tilemap/SeparateTile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var TileIntersectsBody = require('./TileIntersectsBody');
1818
* @param {Phaser.Physics.Arcade.Body} body - The Body object to separate.
1919
* @param {Phaser.Tilemaps.Tile} tile - The tile to collide against.
2020
* @param {Phaser.Geom.Rectangle} tileWorldRect - [description]
21-
* @param {Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} tilemapLayer - The tilemapLayer to collide against.
21+
* @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The tilemapLayer to collide against.
2222
* @param {number} tileBias - [description]
2323
*
2424
* @return {boolean} Returns true if the body was separated, otherwise false.

0 commit comments

Comments
 (0)