From 4cff464555d8ac30b90d89aece1334da6e35031c Mon Sep 17 00:00:00 2001 From: orblazer Date: Tue, 20 Mar 2018 15:36:03 +0100 Subject: [PATCH 1/9] Fix nullable types --- src/curves/path/Path.js | 2 +- src/display/canvas/Smoothing.js | 2 +- src/dom/ParseXML.js | 2 +- src/gameobjects/group/Group.js | 2 +- src/gameobjects/text/static/Text.js | 2 +- src/physics/impact/Body.js | 2 +- src/physics/impact/World.js | 2 +- src/scene/SceneManager.js | 4 ++-- src/sound/BaseSound.js | 2 +- src/textures/TextureManager.js | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/curves/path/Path.js b/src/curves/path/Path.js index d9d8c2c39..b9439bebd 100644 --- a/src/curves/path/Path.js +++ b/src/curves/path/Path.js @@ -516,7 +516,7 @@ var Path = new Class({ * @param {number} t - [description] * @param {Phaser.Math.Vector2} [out] - [description] * - * @return {Phaser.Math.Vector2|null} [description] + * @return {?Phaser.Math.Vector2} [description] */ getPoint: function (t, out) { diff --git a/src/display/canvas/Smoothing.js b/src/display/canvas/Smoothing.js index 6e7bad9c1..12a70f84b 100644 --- a/src/display/canvas/Smoothing.js +++ b/src/display/canvas/Smoothing.js @@ -107,7 +107,7 @@ var Smoothing = function () * * @param {CanvasRenderingContext2D|WebGLRenderingContext} context - [description] * - * @return {boolean|null} [description] + * @return {?boolean} [description] */ var isEnabled = function (context) { diff --git a/src/dom/ParseXML.js b/src/dom/ParseXML.js index ddfe48bcb..6278b1320 100644 --- a/src/dom/ParseXML.js +++ b/src/dom/ParseXML.js @@ -14,7 +14,7 @@ * * @param {string} data - The XML source stored in a string. * - * @return {DOMParser|ActiveXObject|null} The parsed XML data, or `null` if the data could not be parsed. + * @return {?(DOMParser|ActiveXObject)} The parsed XML data, or `null` if the data could not be parsed. */ var ParseXML = function (data) { diff --git a/src/gameobjects/group/Group.js b/src/gameobjects/group/Group.js index 6230ec2c6..ce2ab23a7 100644 --- a/src/gameobjects/group/Group.js +++ b/src/gameobjects/group/Group.js @@ -562,7 +562,7 @@ var Group = new Class({ * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {boolean} [visible] - [description] * - * @return {Phaser.GameObjects.GameObject|null} [description] + * @return {?Phaser.GameObjects.GameObject} [description] */ getFirst: function (state, createIfNull, x, y, key, frame, visible) { diff --git a/src/gameobjects/text/static/Text.js b/src/gameobjects/text/static/Text.js index 5eeb9baec..9ca92d56e 100644 --- a/src/gameobjects/text/static/Text.js +++ b/src/gameobjects/text/static/Text.js @@ -779,7 +779,7 @@ var Text = new Class({ * @method Phaser.GameObjects.Text#setWordWrapWidth * @since 3.0.0 * - * @param {number|null} width - The maximum width of a line in pixels. Set to null to remove wrapping. + * @param {?number} width - The maximum width of a line in pixels. Set to null to remove wrapping. * @param {boolean} [useAdvancedWrap=false] - Whether or not to use the advanced wrapping * algorithm. If true, spaces are collapsed and whitespace is trimmed from lines. If false, * spaces and whitespace are left as is. diff --git a/src/physics/impact/Body.js b/src/physics/impact/Body.js index ea6be90e7..48df4b383 100644 --- a/src/physics/impact/Body.js +++ b/src/physics/impact/Body.js @@ -74,7 +74,7 @@ var Body = new Class({ * The ImpactBody, ImpactSprite or ImpactImage object that owns this Body, if any. * * @name Phaser.Physics.Impact.Body#parent - * @type {Phaser.Physics.Impact.ImpactBody|Phaser.Physics.Impact.ImpactImage|Phaser.Physics.Impact.ImpactSprite|null} + * @type {?(Phaser.Physics.Impact.ImpactBody|Phaser.Physics.Impact.ImpactImage|Phaser.Physics.Impact.ImpactSprite)} * @since 3.0.0 */ this.parent; diff --git a/src/physics/impact/World.js b/src/physics/impact/World.js index ed444f6a2..0c5a5cd7c 100644 --- a/src/physics/impact/World.js +++ b/src/physics/impact/World.js @@ -227,7 +227,7 @@ var World = new Class({ * @param {integer} tileSize - The size of a tile. This is optional if loading from a Weltmeister * level in the cache. * - * @return {CollisionMap|null} The newly created CollisionMap, or null if the method failed to + * @return {?Phaser.Physics.Impact.CollisionMap} The newly created CollisionMap, or null if the method failed to * create the CollisionMap. */ setCollisionMap: function (key, tileSize) diff --git a/src/scene/SceneManager.js b/src/scene/SceneManager.js index 0e2bc6ed8..3e0d4ed0d 100644 --- a/src/scene/SceneManager.js +++ b/src/scene/SceneManager.js @@ -260,7 +260,7 @@ var SceneManager = new Class({ * @param {Phaser.Scene|object|function} sceneConfig - [description] * @param {boolean} [autoStart=false] - If `true` the Scene will be started immediately after being added. * - * @return {Phaser.Scene|null} [description] + * @return {?Phaser.Scene} [description] */ add: function (key, sceneConfig, autoStart) { @@ -747,7 +747,7 @@ var SceneManager = new Class({ * * @param {string} key - [description] * - * @return {Phaser.Scene|null} [description] + * @return {?Phaser.Scene} [description] */ getScene: function (key) { diff --git a/src/sound/BaseSound.js b/src/sound/BaseSound.js index ca4fbfe3a..f1cab5b41 100644 --- a/src/sound/BaseSound.js +++ b/src/sound/BaseSound.js @@ -312,7 +312,7 @@ var BaseSound = new Class({ * * @param {string} markerName - The name of the marker to remove. * - * @return {SoundMarker|null} Removed marker object or 'null' if there was no marker with provided name. + * @return {?SoundMarker} Removed marker object or 'null' if there was no marker with provided name. */ removeMarker: function (markerName) { diff --git a/src/textures/TextureManager.js b/src/textures/TextureManager.js index 68df61d63..21ba55c1b 100644 --- a/src/textures/TextureManager.js +++ b/src/textures/TextureManager.js @@ -679,7 +679,7 @@ var TextureManager = new Class({ * @param {string} key - The unique string-based key of the Texture. * @param {string|integer} frame - The string or index of the Frame. * - * @return {Phaser.Display.Color|null} A Color object populated with the color values of the requested pixel, + * @return {?Phaser.Display.Color} A Color object populated with the color values of the requested pixel, * or `null` if the coordinates were out of bounds. */ getPixel: function (x, y, key, frame) From 87633fdfadc5d0de44f75e5b015fdc2ef62f5bfb Mon Sep 17 00:00:00 2001 From: orblazer Date: Tue, 20 Mar 2018 15:56:31 +0100 Subject: [PATCH 2/9] Fix multiple types on GameObjects --- .../bitmaptext/GetBitmapTextSize.js | 8 +-- .../bitmaptext/dynamic/DynamicBitmapText.js | 4 +- .../dynamic/DynamicBitmapTextFactory.js | 8 +-- .../bitmaptext/static/BitmapText.js | 4 +- .../bitmaptext/static/BitmapTextFactory.js | 8 +-- src/gameobjects/blitter/Blitter.js | 4 +- src/gameobjects/blitter/BlitterFactory.js | 2 +- src/gameobjects/blitter/Bob.js | 4 +- src/gameobjects/components/Animation.js | 12 ++--- src/gameobjects/components/BlendMode.js | 24 ++++----- src/gameobjects/components/GetBounds.js | 50 +++++++++---------- src/gameobjects/components/Texture.js | 18 +++---- src/gameobjects/components/ToJSON.js | 2 +- src/gameobjects/components/TransformMatrix.js | 6 +-- src/gameobjects/graphics/Graphics.js | 8 +-- src/gameobjects/group/Group.js | 14 +++--- src/gameobjects/group/GroupFactory.js | 8 +-- src/gameobjects/image/Image.js | 4 +- src/gameobjects/image/ImageFactory.js | 8 +-- src/gameobjects/mesh/Mesh.js | 2 +- src/gameobjects/mesh/MeshFactory.js | 2 +- src/gameobjects/particles/GravityWell.js | 2 +- src/gameobjects/particles/ParticleEmitter.js | 4 +- .../particles/ParticleEmitterManager.js | 8 +-- .../particles/ParticleManagerFactory.js | 12 ++--- src/gameobjects/pathfollower/PathFollower.js | 2 +- .../pathfollower/PathFollowerFactory.js | 8 +-- src/gameobjects/quad/Quad.js | 38 +++++++------- src/gameobjects/quad/QuadFactory.js | 2 +- .../rendertexture/RenderTexture.js | 4 +- src/gameobjects/sprite/Sprite.js | 4 +- src/gameobjects/sprite/SpriteFactory.js | 8 +-- src/gameobjects/sprite3d/Sprite3D.js | 12 ++--- src/gameobjects/sprite3d/Sprite3DFactory.js | 8 +-- src/gameobjects/text/TextStyle.js | 4 +- src/gameobjects/text/static/Text.js | 6 +-- src/gameobjects/text/static/TextFactory.js | 8 +-- src/gameobjects/tilesprite/TileSprite.js | 4 +- .../tilesprite/TileSpriteFactory.js | 8 +-- 39 files changed, 171 insertions(+), 171 deletions(-) diff --git a/src/gameobjects/bitmaptext/GetBitmapTextSize.js b/src/gameobjects/bitmaptext/GetBitmapTextSize.js index c9adf8c96..b1622ced1 100644 --- a/src/gameobjects/bitmaptext/GetBitmapTextSize.js +++ b/src/gameobjects/bitmaptext/GetBitmapTextSize.js @@ -10,8 +10,8 @@ * @function GetBitmapTextSize * @since 3.0.0 * @private - * - * @param {Phaser.GameObjects.DynamicBitmapText|Phaser.GameObjects.BitmapText} src - [description] + * + * @param {(Phaser.GameObjects.DynamicBitmapText|Phaser.GameObjects.BitmapText)} src - [description] * @param {boolean} round - [description] */ var GetBitmapTextSize = function (src, round) @@ -23,7 +23,7 @@ var GetBitmapTextSize = function (src, round) var by = Number.MAX_VALUE; var bw = 0; var bh = 0; - + var chars = src.fontData.chars; var lineHeight = src.fontData.lineHeight; @@ -92,7 +92,7 @@ var GetBitmapTextSize = function (src, round) { bw = gw; } - + if (bh < gh) { bh = gh; diff --git a/src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js b/src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js index 1d4da25eb..c35e793d4 100644 --- a/src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js +++ b/src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js @@ -49,7 +49,7 @@ var Render = require('./DynamicBitmapTextRender'); * @param {number} [x=0] - The x coordinate of this Game Object in world space. * @param {number} [y=0] - The y coordinate of this Game Object in world space. * @param {string} font - [description] - * @param {string|string[]} [text] - [description] + * @param {(string|string[])} [text] - [description] * @param {number} [size] - [description] */ var DynamicBitmapText = new Class({ @@ -240,7 +240,7 @@ var DynamicBitmapText = new Class({ * @method Phaser.GameObjects.DynamicBitmapText#setText * @since 3.0.0 * - * @param {string|string[]} value - The string, or array of strings, to be set as the content of this BitmapText. + * @param {(string|string[])} value - The string, or array of strings, to be set as the content of this BitmapText. * * @return {Phaser.GameObjects.DynamicBitmapText} This Game Object. */ diff --git a/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextFactory.js b/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextFactory.js index 37a45ecc7..df58733c4 100644 --- a/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextFactory.js +++ b/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextFactory.js @@ -18,9 +18,9 @@ var GameObjectFactory = require('../../GameObjectFactory'); * @param {number} x - The x position of the Game Object. * @param {number} y - The y position of the Game Object. * @param {string} font - [description] - * @param {string|string[]} [text] - [description] + * @param {(string|string[])} [text] - [description] * @param {number} [size] - [description] - * + * * @return {Phaser.GameObjects.DynamicBitmapText} The Game Object that was created. */ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size) @@ -29,9 +29,9 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/bitmaptext/static/BitmapText.js b/src/gameobjects/bitmaptext/static/BitmapText.js index deb9cf6cc..6aea6549b 100644 --- a/src/gameobjects/bitmaptext/static/BitmapText.js +++ b/src/gameobjects/bitmaptext/static/BitmapText.js @@ -53,7 +53,7 @@ var Render = require('./BitmapTextRender'); * @param {number} [x=0] - The x coordinate of this Game Object in world space. * @param {number} [y=0] - The y coordinate of this Game Object in world space. * @param {string} font - [description] - * @param {string|string[]} [text] - [description] + * @param {(string|string[])} [text] - [description] * @param {number} [size] - [description] */ var BitmapText = new Class({ @@ -160,7 +160,7 @@ var BitmapText = new Class({ * @method Phaser.GameObjects.BitmapText#setText * @since 3.0.0 * - * @param {string|string[]} value - The string, or array of strings, to be set as the content of this BitmapText. + * @param {(string|string[])} value - The string, or array of strings, to be set as the content of this BitmapText. * * @return {Phaser.GameObjects.BitmapText} This Game Object. */ diff --git a/src/gameobjects/bitmaptext/static/BitmapTextFactory.js b/src/gameobjects/bitmaptext/static/BitmapTextFactory.js index f70850b9e..4cdcd80eb 100644 --- a/src/gameobjects/bitmaptext/static/BitmapTextFactory.js +++ b/src/gameobjects/bitmaptext/static/BitmapTextFactory.js @@ -18,9 +18,9 @@ var GameObjectFactory = require('../../GameObjectFactory'); * @param {number} x - The x position of the Game Object. * @param {number} y - The y position of the Game Object. * @param {string} font - [description] - * @param {string|string[]} [text] - [description] + * @param {(string|string[])} [text] - [description] * @param {number} [size] - [description] - * + * * @return {Phaser.GameObjects.BitmapText} The Game Object that was created. */ GameObjectFactory.register('bitmapText', function (x, y, font, text, size) @@ -29,9 +29,9 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size) }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/blitter/Blitter.js b/src/gameobjects/blitter/Blitter.js index 7cb68b44a..60d2ee52a 100644 --- a/src/gameobjects/blitter/Blitter.js +++ b/src/gameobjects/blitter/Blitter.js @@ -56,7 +56,7 @@ var List = require('../../structs/List'); * @param {number} [x=0] - The x coordinate of this Game Object in world space. * @param {number} [y=0] - The y coordinate of this Game Object in world space. * @param {string} [texture='__DEFAULT'] - The key of the texture this Game Object will use for rendering. The Texture must already exist in the Texture Manager. - * @param {string|integer} [frame=0] - The Frame of the Texture that this Game Object will use. Only set if the Texture has multiple frames, such as a Texture Atlas or Sprite Sheet. + * @param {(string|integer)} [frame=0] - The Frame of the Texture that this Game Object will use. Only set if the Texture has multiple frames, such as a Texture Atlas or Sprite Sheet. */ var Blitter = new Class({ @@ -116,7 +116,7 @@ var Blitter = new Class({ * * @param {number} x - The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. * @param {number} y - The y position of the Bob. Bob coordinate are relative to the position of the Blitter object. - * @param {string|integer|Phaser.Textures.Frame} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. + * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. * @param {boolean} [visible=true] - Should the created Bob render or not? * @param {integer} [index] - The position in the Blitters Display List to add the new Bob at. Defaults to the top of the list. * diff --git a/src/gameobjects/blitter/BlitterFactory.js b/src/gameobjects/blitter/BlitterFactory.js index 03f46be35..7eddee64d 100644 --- a/src/gameobjects/blitter/BlitterFactory.js +++ b/src/gameobjects/blitter/BlitterFactory.js @@ -18,7 +18,7 @@ var GameObjectFactory = require('../GameObjectFactory'); * @param {number} x - The x position of the Game Object. * @param {number} y - The y position of the Game Object. * @param {string} key - The key of the Texture the Blitter object will use. - * @param {string|integer} [frame] - The default Frame children of the Blitter will use. + * @param {(string|integer)} [frame] - The default Frame children of the Blitter will use. * * @return {Phaser.GameObjects.Blitter} The Game Object that was created. */ diff --git a/src/gameobjects/blitter/Bob.js b/src/gameobjects/blitter/Bob.js index 9573693cd..6a15cbecd 100644 --- a/src/gameobjects/blitter/Bob.js +++ b/src/gameobjects/blitter/Bob.js @@ -30,7 +30,7 @@ var Class = require('../../utils/Class'); * @param {Phaser.GameObjects.Blitter} blitter - The parent Blitter object is responsible for updating this Bob. * @param {number} x - The horizontal position of this Game Object in the world, relative to the parent Blitter position. * @param {number} y - The vertical position of this Game Object in the world, relative to the parent Blitter position. - * @param {string|integer} frame - The Frame this Bob will render with, as defined in the Texture the parent Blitter is using. + * @param {(string|integer)} frame - The Frame this Bob will render with, as defined in the Texture the parent Blitter is using. * @param {boolean} visible - Should the Bob render visible or not to start with? */ var Bob = new Class({ @@ -70,7 +70,7 @@ var Bob = new Class({ * [description] * * @name Phaser.GameObjects.Blitter.Bob#frame - * @type {string|integer} + * @type {(string|integer)} * @since 3.0.0 */ this.frame = frame; diff --git a/src/gameobjects/components/Animation.js b/src/gameobjects/components/Animation.js index a438a90e0..ac5a1d263 100644 --- a/src/gameobjects/components/Animation.js +++ b/src/gameobjects/components/Animation.js @@ -390,7 +390,7 @@ var Animation = new Class({ * * @param {boolean} [value] - [description] * - * @return {boolean|Phaser.GameObjects.GameObject} [description] + * @return {(boolean|Phaser.GameObjects.GameObject)} [description] */ paused: function (value) { @@ -474,7 +474,7 @@ var Animation = new Class({ * * @param {number} [value] - [description] * - * @return {number|Phaser.GameObjects.GameObject} [description] + * @return {(number|Phaser.GameObjects.GameObject)} [description] */ progress: function (value) { @@ -534,7 +534,7 @@ var Animation = new Class({ * * @param {number} value - [description] * - * @return {number|Phaser.GameObjects.GameObject} [description] + * @return {(number|Phaser.GameObjects.GameObject)} [description] */ repeat: function (value) { @@ -562,7 +562,7 @@ var Animation = new Class({ * * @param {number} [value] - [description] * - * @return {number|Phaser.GameObjects.GameObject} [description] + * @return {(number|Phaser.GameObjects.GameObject)} [description] */ repeatDelay: function (value) { @@ -666,7 +666,7 @@ var Animation = new Class({ * * @param {number} [value] - [description] * - * @return {number|Phaser.GameObjects.GameObject} [description] + * @return {(number|Phaser.GameObjects.GameObject)} [description] */ timeScale: function (value) { @@ -779,7 +779,7 @@ var Animation = new Class({ * * @param {boolean} [value] - [description] * - * @return {boolean|Phaser.GameObjects.GameObject} [description] + * @return {(boolean|Phaser.GameObjects.GameObject)} [description] */ yoyo: function (value) { diff --git a/src/gameobjects/components/BlendMode.js b/src/gameobjects/components/BlendMode.js index 426cf5d85..d65a3a81f 100644 --- a/src/gameobjects/components/BlendMode.js +++ b/src/gameobjects/components/BlendMode.js @@ -9,7 +9,7 @@ var BlendModes = require('../../renderer/BlendModes'); /** * Provides methods used for setting the blend mode of a Game Object. * Should be applied as a mixin and not used directly. - * + * * @name Phaser.GameObjects.Components.BlendMode * @since 3.0.0 */ @@ -20,11 +20,11 @@ var BlendMode = { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * ADD * * MULTIPLY * * SCREEN @@ -37,9 +37,9 @@ var BlendMode = { * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency of which blend modes * are used. - * + * * @name Phaser.GameObjects.Components.BlendMode#blendMode - * @type {integer|string} + * @type {(integer|string)} * @since 3.0.0 */ blendMode: { @@ -68,11 +68,11 @@ var BlendMode = { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * ADD * * MULTIPLY * * SCREEN @@ -85,12 +85,12 @@ var BlendMode = { * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency of which blend modes * are used. - * + * * @method Phaser.GameObjects.Components.BlendMode#setBlendMode * @since 3.0.0 * - * @param {string|integer} value - The BlendMode value. Either a string or a CONST. - * + * @param {(string|integer)} value - The BlendMode value. Either a string or a CONST. + * * @return {Phaser.GameObjects.GameObject} This Game Object instance. */ setBlendMode: function (value) diff --git a/src/gameobjects/components/GetBounds.js b/src/gameobjects/components/GetBounds.js index 22c2cc9ca..94dc3e919 100644 --- a/src/gameobjects/components/GetBounds.js +++ b/src/gameobjects/components/GetBounds.js @@ -11,7 +11,7 @@ var Vector2 = require('../../math/Vector2'); /** * Provides methods used for obtaining the bounds of a Game Object. * Should be applied as a mixin and not used directly. - * + * * @name Phaser.GameObjects.Components.GetBounds * @since 3.0.0 */ @@ -20,13 +20,13 @@ var GetBounds = { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * @method Phaser.GameObjects.Components.GetBounds#getCenter * @since 3.0.0 * - * @param {Phaser.Math.Vector2|object} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * - * @return {Phaser.Math.Vector2|object} The values stored in the output object. + * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. */ getCenter: function (output) { @@ -40,13 +40,13 @@ var GetBounds = { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * @method Phaser.GameObjects.Components.GetBounds#getTopLeft * @since 3.0.0 * - * @param {Phaser.Math.Vector2|object} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * - * @return {Phaser.Math.Vector2|object} The values stored in the output object. + * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. */ getTopLeft: function (output) { @@ -65,13 +65,13 @@ var GetBounds = { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * @method Phaser.GameObjects.Components.GetBounds#getTopRight * @since 3.0.0 * - * @param {Phaser.Math.Vector2|object} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * - * @return {Phaser.Math.Vector2|object} The values stored in the output object. + * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. */ getTopRight: function (output) { @@ -90,13 +90,13 @@ var GetBounds = { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * @method Phaser.GameObjects.Components.GetBounds#getBottomLeft * @since 3.0.0 * - * @param {Phaser.Math.Vector2|object} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * - * @return {Phaser.Math.Vector2|object} The values stored in the output object. + * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. */ getBottomLeft: function (output) { @@ -115,13 +115,13 @@ var GetBounds = { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * @method Phaser.GameObjects.Components.GetBounds#getBottomRight * @since 3.0.0 * - * @param {Phaser.Math.Vector2|object} [output] - An object to store the values in. If not provided a new Vector2 will be created. - * - * @return {Phaser.Math.Vector2|object} The values stored in the output object. + * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. */ getBottomRight: function (output) { @@ -141,13 +141,13 @@ var GetBounds = { /** * Gets the bounds of this Game Object, regardless of origin. * The values are stored and returned in a Rectangle, or Rectangle-like, object. - * + * * @method Phaser.GameObjects.Components.GetBounds#getBounds * @since 3.0.0 * - * @param {Phaser.Geom.Rectangle|object} [output] - An object to store the values in. If not provided a new Rectangle will be created. - * - * @return {Phaser.Geom.Rectangle|object} The values stored in the output object. + * @param {(Phaser.Geom.Rectangle|object)} [output] - An object to store the values in. If not provided a new Rectangle will be created. + * + * @return {(Phaser.Geom.Rectangle|object)} The values stored in the output object. */ getBounds: function (output) { diff --git a/src/gameobjects/components/Texture.js b/src/gameobjects/components/Texture.js index c403c4a96..1c299fb09 100644 --- a/src/gameobjects/components/Texture.js +++ b/src/gameobjects/components/Texture.js @@ -9,7 +9,7 @@ var _FLAG = 8; // 1000 /** * Provides methods used for getting and setting the texture of a Game Object. - * + * * @name Phaser.GameObjects.Components.Texture * @since 3.0.0 */ @@ -18,7 +18,7 @@ var Texture = { /** * The Texture this Game Object is using to render with. - * + * * @name Phaser.GameObjects.Components.Texture#texture * @type {Phaser.Textures.Texture} * @since 3.0.0 @@ -27,7 +27,7 @@ var Texture = { /** * The Texture Frame this Game Object is using to render with. - * + * * @name Phaser.GameObjects.Components.Texture#frame * @type {Phaser.Textures.Frame} * @since 3.0.0 @@ -38,13 +38,13 @@ var Texture = { * Sets the texture and frame this Game Object will use to render with. * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * @method Phaser.GameObjects.Components.Texture#setTexture * @since 3.0.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {string|integer} [frame] - The name or index of the frame within the Texture. - * + * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * * @return {Phaser.GameObjects.GameObject} This Game Object instance. */ setTexture: function (key, frame) @@ -63,14 +63,14 @@ var Texture = { * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. - * + * * @method Phaser.GameObjects.Components.Texture#setFrame * @since 3.0.0 * - * @param {string|integer} frame - The name or index of the frame within the Texture. + * @param {(string|integer)} frame - The name or index of the frame within the Texture. * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? - * + * * @return {Phaser.GameObjects.GameObject} This Game Object instance. */ setFrame: function (frame, updateSize, updateOrigin) diff --git a/src/gameobjects/components/ToJSON.js b/src/gameobjects/components/ToJSON.js index 47f58c1de..a8f364b8a 100644 --- a/src/gameobjects/components/ToJSON.js +++ b/src/gameobjects/components/ToJSON.js @@ -23,7 +23,7 @@ * @property {float} alpha - The alpha value of the Game Object. * @property {boolean} visible - The visible state of the Game Object. * @property {integer} scaleMode - The Scale Mode being used by this Game Object. - * @property {integer|string} blendMode - Sets the Blend Mode being used by this Game Object. + * @property {(integer|string)} blendMode - Sets the Blend Mode being used by this Game Object. * @property {string} textureKey - The texture key of this Game Object. * @property {string} frameKey - The frame key of this Game Object. * @property {object} data - The data of this Game Object. diff --git a/src/gameobjects/components/TransformMatrix.js b/src/gameobjects/components/TransformMatrix.js index a0e7af8ff..092cb94da 100644 --- a/src/gameobjects/components/TransformMatrix.js +++ b/src/gameobjects/components/TransformMatrix.js @@ -71,7 +71,7 @@ var TransformMatrix = new Class({ loadIdentity: function () { var matrix = this.matrix; - + matrix[0] = 1; matrix[1] = 0; matrix[2] = 0; @@ -227,9 +227,9 @@ var TransformMatrix = new Class({ * * @param {number} x - [description] * @param {number} y - [description] - * @param {Phaser.Geom.Point|Phaser.Math.Vec2|object} point - [description] + * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - [description] * - * @return {Phaser.Geom.Point|Phaser.Math.Vec2|object} [description] + * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} [description] */ transformPoint: function (x, y, point) { diff --git a/src/gameobjects/graphics/Graphics.js b/src/gameobjects/graphics/Graphics.js index da9c8ceee..9cc72f0f7 100644 --- a/src/gameobjects/graphics/Graphics.js +++ b/src/gameobjects/graphics/Graphics.js @@ -477,7 +477,7 @@ var Graphics = new Class({ * @method Phaser.GameObjects.Graphics#fillPointShape * @since 3.0.0 * - * @param {Phaser.Geom.Point|Phaser.Math.Vector2|object} point - [description] + * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - [description] * @param {number} [size=1] - [description] * * @return {Phaser.GameObjects.Graphics} This Game Object. @@ -731,7 +731,7 @@ var Graphics = new Class({ * @method Phaser.GameObjects.Graphics#strokePoints * @since 3.0.0 * - * @param {array|Phaser.Geom.Point[]} points - [description] + * @param {(array|Phaser.Geom.Point[])} points - [description] * @param {boolean} [autoClose=false] - [description] * @param {integer} [endIndex] - [description] * @@ -767,7 +767,7 @@ var Graphics = new Class({ * @method Phaser.GameObjects.Graphics#fillPoints * @since 3.0.0 * - * @param {array|Phaser.Geom.Point[]} points - [description] + * @param {(array|Phaser.Geom.Point[])} points - [description] * @param {boolean} [autoClose=false] - [description] * @param {integer} [endIndex] - [description] * @@ -1043,7 +1043,7 @@ var Graphics = new Class({ * @method Phaser.GameObjects.Graphics#generateTexture * @since 3.0.0 * - * @param {string|HTMLCanvasElement} key - [description] + * @param {(string|HTMLCanvasElement)} key - [description] * @param {integer} [width] - [description] * @param {integer} [height] - [description] * diff --git a/src/gameobjects/group/Group.js b/src/gameobjects/group/Group.js index ce2ab23a7..2f96718d7 100644 --- a/src/gameobjects/group/Group.js +++ b/src/gameobjects/group/Group.js @@ -108,7 +108,7 @@ var Group = new Class({ * [description] * * @name Phaser.GameObjects.Group#defaultFrame - * @type {string|integer} + * @type {(string|integer)} * @since 3.0.0 */ this.defaultFrame = GetFastValue(config, 'defaultFrame', null); @@ -165,8 +165,8 @@ var Group = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of this Game Object. * @param {boolean} [active=true] - The {@link Phaser.GameObjects.GameObject#active} state of this Game Object. * @@ -559,7 +559,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of this Game Object in the world. * @param {number} [y] - The vertical position of this Game Object in the world. * @param {string} [texture] - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {boolean} [visible] - [description] * * @return {?Phaser.GameObjects.GameObject} [description] @@ -613,7 +613,7 @@ var Group = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {boolean} visible - [description] * * @return {Phaser.GameObjects.GameObject} [description] @@ -633,7 +633,7 @@ var Group = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {boolean} visible - [description] * * @return {Phaser.GameObjects.GameObject} [description] @@ -653,7 +653,7 @@ var Group = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {boolean} visible - [description] * * @return {Phaser.GameObjects.GameObject} [description] diff --git a/src/gameobjects/group/GroupFactory.js b/src/gameobjects/group/GroupFactory.js index 69ec9da4b..491711ff8 100644 --- a/src/gameobjects/group/GroupFactory.js +++ b/src/gameobjects/group/GroupFactory.js @@ -15,9 +15,9 @@ var GameObjectFactory = require('../GameObjectFactory'); * @method Phaser.GameObjects.GameObjectFactory#group * @since 3.0.0 * - * @param {array|object} children - [description] + * @param {(array|object)} children - [description] * @param {object} [config] - [description] - * + * * @return {Phaser.GameObjects.Group} The Game Object that was created. */ GameObjectFactory.register('group', function (children, config) @@ -32,9 +32,9 @@ GameObjectFactory.register('group', function (children, config) }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/image/Image.js b/src/gameobjects/image/Image.js index ee11e1485..b49f23cbf 100644 --- a/src/gameobjects/image/Image.js +++ b/src/gameobjects/image/Image.js @@ -12,7 +12,7 @@ var ImageRender = require('./ImageRender'); /** * @classdesc * An Image Game Object. - * + * * An Image is a light-weight Game Object useful for the display of static images in your game, * such as logos, backgrounds, scenery or other non-animated elements. Images can have input * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an @@ -43,7 +43,7 @@ var ImageRender = require('./ImageRender'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var Image = new Class({ diff --git a/src/gameobjects/image/ImageFactory.js b/src/gameobjects/image/ImageFactory.js index 242a64db9..8282051de 100644 --- a/src/gameobjects/image/ImageFactory.js +++ b/src/gameobjects/image/ImageFactory.js @@ -18,8 +18,8 @@ var GameObjectFactory = require('../GameObjectFactory'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. - * + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * * @return {Phaser.GameObjects.Image} The Game Object that was created. */ GameObjectFactory.register('image', function (x, y, key, frame) @@ -28,9 +28,9 @@ GameObjectFactory.register('image', function (x, y, key, frame) }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/mesh/Mesh.js b/src/gameobjects/mesh/Mesh.js index c9d1320c3..e22bf7da1 100644 --- a/src/gameobjects/mesh/Mesh.js +++ b/src/gameobjects/mesh/Mesh.js @@ -42,7 +42,7 @@ var MeshRender = require('./MeshRender'); * @param {array} colors - An array containing the color data for this Mesh. * @param {array} alphas - An array containing the alpha data for this Mesh. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var Mesh = new Class({ diff --git a/src/gameobjects/mesh/MeshFactory.js b/src/gameobjects/mesh/MeshFactory.js index 5518dd38d..0f1e693dd 100644 --- a/src/gameobjects/mesh/MeshFactory.js +++ b/src/gameobjects/mesh/MeshFactory.js @@ -23,7 +23,7 @@ var GameObjectFactory = require('../GameObjectFactory'); * @param {array} colors - An array containing the color data for this Mesh. * @param {array} alphas - An array containing the alpha data for this Mesh. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.Mesh} The Game Object that was created. */ diff --git a/src/gameobjects/particles/GravityWell.js b/src/gameobjects/particles/GravityWell.js index 405955272..8e20d65b0 100644 --- a/src/gameobjects/particles/GravityWell.js +++ b/src/gameobjects/particles/GravityWell.js @@ -16,7 +16,7 @@ var GetFastValue = require('../../utils/object/GetFastValue'); * @constructor * @since 3.0.0 * - * @param {number|object} [x=0] - The x coordinate of the Gravity Well, in world space. + * @param {(number|object)} [x=0] - The x coordinate of the Gravity Well, in world space. * @param {number} [y=0] - The y coordinate of the Gravity Well, in world space. * @param {number} [power=0] - The power of the Gravity Well. * @param {number} [epsilon=100] - [description] diff --git a/src/gameobjects/particles/ParticleEmitter.js b/src/gameobjects/particles/ParticleEmitter.js index 215981c7d..4c7096cb8 100644 --- a/src/gameobjects/particles/ParticleEmitter.js +++ b/src/gameobjects/particles/ParticleEmitter.js @@ -973,7 +973,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#setFrame * @since 3.0.0 * - * @param {array|string|integer|object} frames - [description] + * @param {(array|string|integer|object)} frames - [description] * @param {boolean} [pickRandom=true] - [description] * @param {integer} [quantity=1] - [description] * @@ -1068,7 +1068,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#setBounds * @since 3.0.0 * - * @param {number|object} x - [description] + * @param {(number|object)} x - [description] * @param {number} y - [description] * @param {number} width - [description] * @param {number} height - [description] diff --git a/src/gameobjects/particles/ParticleEmitterManager.js b/src/gameobjects/particles/ParticleEmitterManager.js index 7bc7f6297..6f5c97a34 100644 --- a/src/gameobjects/particles/ParticleEmitterManager.js +++ b/src/gameobjects/particles/ParticleEmitterManager.js @@ -28,7 +28,7 @@ var Render = require('./ParticleManagerRender'); * * @param {Phaser.Scene} scene - [description] * @param {string} texture - [description] - * @param {string|integer} frame - [description] + * @param {(string|integer)} frame - [description] * @param {Phaser.GameObjects.Particles.ParticleEmitter[]} emitters - [description] */ var ParticleEmitterManager = new Class({ @@ -152,7 +152,7 @@ var ParticleEmitterManager = new Class({ * @since 3.0.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {string|integer} [frame] - The name or index of the frame within the Texture. + * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. * * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Game Object. */ @@ -173,7 +173,7 @@ var ParticleEmitterManager = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setFrame * @since 3.0.0 * - * @param {string|integer} [frame] - The name or index of the frame within the Texture. + * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. * * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Game Object. */ @@ -194,7 +194,7 @@ var ParticleEmitterManager = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setEmitterFrames * @since 3.0.0 * - * @param {Phaser.Textures.Frame|Phaser.Textures.Frame[]} frames - [description] + * @param {(Phaser.Textures.Frame|Phaser.Textures.Frame[])} frames - [description] * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - [description] * * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Game Object. diff --git a/src/gameobjects/particles/ParticleManagerFactory.js b/src/gameobjects/particles/ParticleManagerFactory.js index 70ed407fd..109bb2412 100644 --- a/src/gameobjects/particles/ParticleManagerFactory.js +++ b/src/gameobjects/particles/ParticleManagerFactory.js @@ -16,25 +16,25 @@ var ParticleEmitterManager = require('./ParticleEmitterManager'); * @since 3.0.0 * * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer|object} [frame] - [description] + * @param {(string|integer|object)} [frame] - [description] * @param {object} [emitters] - [description] - * + * * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} The Game Object that was created. */ GameObjectFactory.register('particles', function (key, frame, emitters) { var manager = new ParticleEmitterManager(this.scene, key, frame, emitters); - + this.displayList.add(manager); this.updateList.add(manager); - + return manager; }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/pathfollower/PathFollower.js b/src/gameobjects/pathfollower/PathFollower.js index 6571c73ad..b71eec319 100644 --- a/src/gameobjects/pathfollower/PathFollower.js +++ b/src/gameobjects/pathfollower/PathFollower.js @@ -36,7 +36,7 @@ var Vector2 = require('../../math/Vector2'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var PathFollower = new Class({ diff --git a/src/gameobjects/pathfollower/PathFollowerFactory.js b/src/gameobjects/pathfollower/PathFollowerFactory.js index 2e672f56e..b2698205c 100644 --- a/src/gameobjects/pathfollower/PathFollowerFactory.js +++ b/src/gameobjects/pathfollower/PathFollowerFactory.js @@ -19,8 +19,8 @@ var PathFollower = require('./PathFollower'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. - * + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * * @return {Phaser.GameObjects.PathFollower} The Game Object that was created. */ GameObjectFactory.register('follower', function (path, x, y, key, frame) @@ -34,9 +34,9 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame) }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/quad/Quad.js b/src/gameobjects/quad/Quad.js index 98f3eddac..62f27b8c4 100644 --- a/src/gameobjects/quad/Quad.js +++ b/src/gameobjects/quad/Quad.js @@ -13,7 +13,7 @@ var Mesh = require('../mesh/Mesh'); * * A Quad is a Mesh Game Object pre-configured with two triangles arranged into a rectangle, with a single * texture spread across them. - * + * * You can manipulate the corner points of the quad via the getters and setters such as `topLeftX`, and also * change their alpha and color values. The quad itself can be moved by adjusting the `x` and `y` properties. * @@ -28,7 +28,7 @@ var Mesh = require('../mesh/Mesh'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var Quad = new Class({ @@ -47,7 +47,7 @@ var Quad = new Class({ // 1----2 var vertices = [ - 0, 0, // tl + 0, 0, // tl 0, 0, // bl 0, 0, // br 0, 0, // tl @@ -86,7 +86,7 @@ var Quad = new Class({ /** * The top-left x vertex of this Quad. - * + * * @name Phaser.GameObjects.Quad#topLeftX * @type {number} * @since 3.0.0 @@ -108,7 +108,7 @@ var Quad = new Class({ /** * The top-left y vertex of this Quad. - * + * * @name Phaser.GameObjects.Quad#topLeftY * @type {number} * @since 3.0.0 @@ -130,7 +130,7 @@ var Quad = new Class({ /** * The top-right x vertex of this Quad. - * + * * @name Phaser.GameObjects.Quad#topRightX * @type {number} * @since 3.0.0 @@ -151,7 +151,7 @@ var Quad = new Class({ /** * The top-right y vertex of this Quad. - * + * * @name Phaser.GameObjects.Quad#topRightY * @type {number} * @since 3.0.0 @@ -172,7 +172,7 @@ var Quad = new Class({ /** * The bottom-left x vertex of this Quad. - * + * * @name Phaser.GameObjects.Quad#bottomLeftX * @type {number} * @since 3.0.0 @@ -193,7 +193,7 @@ var Quad = new Class({ /** * The bottom-left y vertex of this Quad. - * + * * @name Phaser.GameObjects.Quad#bottomLeftY * @type {number} * @since 3.0.0 @@ -214,7 +214,7 @@ var Quad = new Class({ /** * The bottom-right x vertex of this Quad. - * + * * @name Phaser.GameObjects.Quad#bottomRightX * @type {number} * @since 3.0.0 @@ -236,7 +236,7 @@ var Quad = new Class({ /** * The bottom-right y vertex of this Quad. - * + * * @name Phaser.GameObjects.Quad#bottomRightY * @type {number} * @since 3.0.0 @@ -258,7 +258,7 @@ var Quad = new Class({ /** * The top-left alpha value of this Quad. - * + * * @name Phaser.GameObjects.Quad#topLeftAlpha * @type {float} * @since 3.0.0 @@ -280,7 +280,7 @@ var Quad = new Class({ /** * The top-right alpha value of this Quad. - * + * * @name Phaser.GameObjects.Quad#topRightAlpha * @type {float} * @since 3.0.0 @@ -301,7 +301,7 @@ var Quad = new Class({ /** * The bottom-left alpha value of this Quad. - * + * * @name Phaser.GameObjects.Quad#bottomLeftAlpha * @type {float} * @since 3.0.0 @@ -322,7 +322,7 @@ var Quad = new Class({ /** * The bottom-right alpha value of this Quad. - * + * * @name Phaser.GameObjects.Quad#bottomRightAlpha * @type {float} * @since 3.0.0 @@ -344,7 +344,7 @@ var Quad = new Class({ /** * The top-left color value of this Quad. - * + * * @name Phaser.GameObjects.Quad#topLeftColor * @type {number} * @since 3.0.0 @@ -366,7 +366,7 @@ var Quad = new Class({ /** * The top-right color value of this Quad. - * + * * @name Phaser.GameObjects.Quad#topRightColor * @type {number} * @since 3.0.0 @@ -387,7 +387,7 @@ var Quad = new Class({ /** * The bottom-left color value of this Quad. - * + * * @name Phaser.GameObjects.Quad#bottomLeftColor * @type {number} * @since 3.0.0 @@ -408,7 +408,7 @@ var Quad = new Class({ /** * The bottom-right color value of this Quad. - * + * * @name Phaser.GameObjects.Quad#bottomRightColor * @type {number} * @since 3.0.0 diff --git a/src/gameobjects/quad/QuadFactory.js b/src/gameobjects/quad/QuadFactory.js index d85936c9d..7be4d6244 100644 --- a/src/gameobjects/quad/QuadFactory.js +++ b/src/gameobjects/quad/QuadFactory.js @@ -19,7 +19,7 @@ var GameObjectFactory = require('../GameObjectFactory'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.Quad} The Game Object that was created. */ diff --git a/src/gameobjects/rendertexture/RenderTexture.js b/src/gameobjects/rendertexture/RenderTexture.js index 0479faa44..da5b95533 100644 --- a/src/gameobjects/rendertexture/RenderTexture.js +++ b/src/gameobjects/rendertexture/RenderTexture.js @@ -80,7 +80,7 @@ var RenderTexture = new Class({ this.renderer = scene.sys.game.renderer; this.globalTint = 0xffffff; this.globalAlpha = 1.0; - + if (this.renderer.type === CONST.WEBGL) { var gl = this.renderer.gl; @@ -183,7 +183,7 @@ var RenderTexture = new Class({ * @since 3.2.0 * * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {number} x - The x position to draw the frame at. * @param {number} y - The y position to draw the frame at. * diff --git a/src/gameobjects/sprite/Sprite.js b/src/gameobjects/sprite/Sprite.js index 62e27ee7e..9bd227d03 100644 --- a/src/gameobjects/sprite/Sprite.js +++ b/src/gameobjects/sprite/Sprite.js @@ -47,7 +47,7 @@ var SpriteRender = require('./SpriteRender'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var Sprite = new Class({ @@ -115,7 +115,7 @@ var Sprite = new Class({ * * @param {string} key - [description] * @param {boolean} ignoreIfPlaying - [description] - * @param {integer|string} startFrame - [description] + * @param {(integer|string)} startFrame - [description] * * @return {Phaser.GameObjects.Sprite} This Game Object. */ diff --git a/src/gameobjects/sprite/SpriteFactory.js b/src/gameobjects/sprite/SpriteFactory.js index 40d7b3893..64096275d 100644 --- a/src/gameobjects/sprite/SpriteFactory.js +++ b/src/gameobjects/sprite/SpriteFactory.js @@ -18,8 +18,8 @@ var Sprite = require('./Sprite'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. - * + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * * @return {Phaser.GameObjects.Sprite} The Game Object that was created. */ GameObjectFactory.register('sprite', function (x, y, key, frame) @@ -33,9 +33,9 @@ GameObjectFactory.register('sprite', function (x, y, key, frame) }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/sprite3d/Sprite3D.js b/src/gameobjects/sprite3d/Sprite3D.js index 6195eb953..cc1ea0cbb 100644 --- a/src/gameobjects/sprite3d/Sprite3D.js +++ b/src/gameobjects/sprite3d/Sprite3D.js @@ -28,7 +28,7 @@ var Vector4 = require('../../math/Vector4'); * @param {number} y - The y position of this Game Object. * @param {number} z - The z position of this Game Object. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var Sprite3D = new Class({ @@ -170,9 +170,9 @@ var Sprite3D = new Class({ /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. - * + * * @name Phaser.GameObjects.Sprite3D#visible * @type {boolean} * @since 3.0.0 @@ -194,7 +194,7 @@ var Sprite3D = new Class({ /** * The x position of this Game Object. - * + * * @name Phaser.GameObjects.Sprite3D#x * @type {number} * @since 3.0.0 @@ -215,7 +215,7 @@ var Sprite3D = new Class({ /** * The y position of this Game Object. - * + * * @name Phaser.GameObjects.Sprite3D#y * @type {number} * @since 3.0.0 @@ -236,7 +236,7 @@ var Sprite3D = new Class({ /** * The z position of this Game Object. - * + * * @name Phaser.GameObjects.Sprite3D#z * @type {number} * @since 3.0.0 diff --git a/src/gameobjects/sprite3d/Sprite3DFactory.js b/src/gameobjects/sprite3d/Sprite3DFactory.js index 19b0db01f..4a0f68754 100644 --- a/src/gameobjects/sprite3d/Sprite3DFactory.js +++ b/src/gameobjects/sprite3d/Sprite3DFactory.js @@ -19,8 +19,8 @@ var GameObjectFactory = require('../GameObjectFactory'); * @param {number} y - The vertical position of this Game Object. * @param {number} z - The z position of this Game Object. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. - * + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * * @return {Phaser.GameObjects.Sprite3D} The Game Object that was created. */ GameObjectFactory.register('sprite3D', function (x, y, z, key, frame) @@ -34,9 +34,9 @@ GameObjectFactory.register('sprite3D', function (x, y, z, key, frame) }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/text/TextStyle.js b/src/gameobjects/text/TextStyle.js index 9bfeaf59c..9e3fd7a7b 100644 --- a/src/gameobjects/text/TextStyle.js +++ b/src/gameobjects/text/TextStyle.js @@ -470,7 +470,7 @@ var TextStyle = new Class({ * @method Phaser.GameObjects.Components.TextStyle#setFont * @since 3.0.0 * - * @param {string|object} font - [description] + * @param {(string|object)} font - [description] * * @return {Phaser.GameObjects.Text} The parent Text object. */ @@ -532,7 +532,7 @@ var TextStyle = new Class({ * @method Phaser.GameObjects.Components.TextStyle#setFontSize * @since 3.0.0 * - * @param {number|string} size - [description] + * @param {(number|string)} size - [description] * * @return {Phaser.GameObjects.Text} The parent Text object. */ diff --git a/src/gameobjects/text/static/Text.js b/src/gameobjects/text/static/Text.js index 9ca92d56e..296e3cf63 100644 --- a/src/gameobjects/text/static/Text.js +++ b/src/gameobjects/text/static/Text.js @@ -42,7 +42,7 @@ var TextStyle = require('../TextStyle'); * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string|string[]} text - The text this Text object will display. + * @param {(string|string[])} text - The text this Text object will display. * @param {object} style - The text style configuration object. */ var Text = new Class({ @@ -499,7 +499,7 @@ var Text = new Class({ * @method Phaser.GameObjects.Text#setText * @since 3.0.0 * - * @param {string|string[]} value - The string, or array of strings, to be set as the content of this Text object. + * @param {(string|string[])} value - The string, or array of strings, to be set as the content of this Text object. * * @return {Phaser.GameObjects.Text} This Text object. */ @@ -832,7 +832,7 @@ var Text = new Class({ * @method Phaser.GameObjects.Text#setPadding * @since 3.0.0 * - * @param {number|object} left - [description] + * @param {(number|object)} left - [description] * @param {number} top - [description] * @param {number} right - [description] * @param {number} bottom - [description] diff --git a/src/gameobjects/text/static/TextFactory.js b/src/gameobjects/text/static/TextFactory.js index a96ddd75f..0e43d058d 100644 --- a/src/gameobjects/text/static/TextFactory.js +++ b/src/gameobjects/text/static/TextFactory.js @@ -17,9 +17,9 @@ var GameObjectFactory = require('../../GameObjectFactory'); * * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string|string[]} text - The text this Text object will display. + * @param {(string|string[])} text - The text this Text object will display. * @param {object} [style] - The Text style configuration object. - * + * * @return {Phaser.GameObjects.Text} The Game Object that was created. */ GameObjectFactory.register('text', function (x, y, text, style) @@ -28,9 +28,9 @@ GameObjectFactory.register('text', function (x, y, text, style) }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/tilesprite/TileSprite.js b/src/gameobjects/tilesprite/TileSprite.js index 090b70374..e84ddd19f 100644 --- a/src/gameobjects/tilesprite/TileSprite.js +++ b/src/gameobjects/tilesprite/TileSprite.js @@ -43,7 +43,7 @@ var TileSpriteRender = require('./TileSpriteRender'); * @param {number} width - The width of the Game Object. * @param {number} height - The height of the Game Object. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var TileSprite = new Class({ @@ -119,7 +119,7 @@ var TileSprite = new Class({ * [description] * * @name Phaser.GameObjects.TileSprite#renderer - * @type {Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer} + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} * @since 3.0.0 */ this.renderer = renderer; diff --git a/src/gameobjects/tilesprite/TileSpriteFactory.js b/src/gameobjects/tilesprite/TileSpriteFactory.js index 125586582..7ef38402b 100644 --- a/src/gameobjects/tilesprite/TileSpriteFactory.js +++ b/src/gameobjects/tilesprite/TileSpriteFactory.js @@ -20,8 +20,8 @@ var GameObjectFactory = require('../GameObjectFactory'); * @param {number} width - The width of the Game Object. * @param {number} height - The height of the Game Object. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. - * + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * * @return {Phaser.GameObjects.TileSprite} The Game Object that was created. */ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, frame) @@ -30,9 +30,9 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns From 3cb00c85c9b289ea6aa1f26c45dbdf0580e9c304 Mon Sep 17 00:00:00 2001 From: orblazer Date: Tue, 20 Mar 2018 15:57:12 +0100 Subject: [PATCH 3/9] Fix multiple types on Actions --- src/actions/Angle.js | 8 ++++---- src/actions/Call.js | 2 +- src/actions/GetFirst.js | 8 ++++---- src/actions/GetLast.js | 8 ++++---- src/actions/GridAlign.js | 4 ++-- src/actions/IncAlpha.js | 8 ++++---- src/actions/IncX.js | 8 ++++---- src/actions/IncXY.js | 10 +++++----- src/actions/IncY.js | 8 ++++---- src/actions/PlaceOnCircle.js | 4 ++-- src/actions/PlaceOnEllipse.js | 4 ++-- src/actions/PlaceOnLine.js | 4 ++-- src/actions/PlaceOnRectangle.js | 4 ++-- src/actions/PlaceOnTriangle.js | 2 +- src/actions/PlayAnimation.js | 6 +++--- src/actions/PropertyValueInc.js | 8 ++++---- src/actions/PropertyValueSet.js | 8 ++++---- src/actions/RandomCircle.js | 4 ++-- src/actions/RandomEllipse.js | 4 ++-- src/actions/RandomLine.js | 4 ++-- src/actions/RandomRectangle.js | 4 ++-- src/actions/RandomTriangle.js | 4 ++-- src/actions/Rotate.js | 8 ++++---- src/actions/RotateAround.js | 4 ++-- src/actions/RotateAroundDistance.js | 2 +- src/actions/ScaleX.js | 8 ++++---- src/actions/ScaleXY.js | 8 ++++---- src/actions/ScaleY.js | 8 ++++---- src/actions/SetAlpha.js | 8 ++++---- src/actions/SetBlendMode.js | 8 ++++---- src/actions/SetDepth.js | 8 ++++---- src/actions/SetHitArea.js | 2 +- src/actions/SetOrigin.js | 8 ++++---- src/actions/SetRotation.js | 8 ++++---- src/actions/SetScale.js | 8 ++++---- src/actions/SetScaleX.js | 8 ++++---- src/actions/SetScaleY.js | 8 ++++---- src/actions/SetTint.js | 4 ++-- src/actions/SetVisible.js | 6 +++--- src/actions/SetX.js | 8 ++++---- src/actions/SetXY.js | 10 +++++----- src/actions/SetY.js | 8 ++++---- src/actions/ShiftPosition.js | 16 +++++++--------- src/actions/Shuffle.js | 4 ++-- src/actions/SmoothStep.js | 4 ++-- src/actions/SmootherStep.js | 4 ++-- src/actions/Spread.js | 6 +++--- src/actions/ToggleVisible.js | 4 ++-- src/actions/WrapInRectangle.js | 4 ++-- 49 files changed, 152 insertions(+), 154 deletions(-) diff --git a/src/actions/Angle.js b/src/actions/Angle.js index bfa6d86cb..5497cf527 100644 --- a/src/actions/Angle.js +++ b/src/actions/Angle.js @@ -9,15 +9,15 @@ var PropertyValueInc = require('./PropertyValueInc'); /** * Takes an array of Game Objects, or any objects that have a public `angle` property, * and then adds the given value to each of their `angle` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `Angle(group.getChildren(), value, step)` * * @function Phaser.Actions.Angle * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `angle` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/Call.js b/src/actions/Call.js index cef7cc788..9bcaa9d5d 100644 --- a/src/actions/Call.js +++ b/src/actions/Call.js @@ -16,7 +16,7 @@ * @function Phaser.Actions.Call * @since 3.0.0 * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {CallCallback} callback - The callback to be invoked. It will be passed just one argument: the item from the array. * @param {object} context - The scope in which the callback will be invoked. * diff --git a/src/actions/GetFirst.js b/src/actions/GetFirst.js index 25de52204..eedfd513f 100644 --- a/src/actions/GetFirst.js +++ b/src/actions/GetFirst.js @@ -8,16 +8,16 @@ * Takes an array of objects and returns the first element in the array that has properties which match * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }` * then it would return the first item which had the property `scaleX` set to 0.5 and `alpha` set to 1. - * + * * To use this with a Group: `GetFirst(group.getChildren(), compare, index)` * * @function Phaser.Actions.GetFirst * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be searched by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be searched by this action. * @param {object} compare - The comparison object. Each property in this object will be checked against the items of the array. * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * + * * @return {object} The first object in the array that matches the comparison object, or `null` if no match was found. */ var GetFirst = function (items, compare, index) diff --git a/src/actions/GetLast.js b/src/actions/GetLast.js index 9782d88b0..f8b52ae7f 100644 --- a/src/actions/GetLast.js +++ b/src/actions/GetLast.js @@ -8,16 +8,16 @@ * Takes an array of objects and returns the last element in the array that has properties which match * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }` * then it would return the last item which had the property `scaleX` set to 0.5 and `alpha` set to 1. - * + * * To use this with a Group: `GetLast(group.getChildren(), compare, index)` * * @function Phaser.Actions.GetLast * @since 3.3.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be searched by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be searched by this action. * @param {object} compare - The comparison object. Each property in this object will be checked against the items of the array. * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * + * * @return {object} The last object in the array that matches the comparison object, or `null` if no match was found. */ var GetLast = function (items, compare, index) diff --git a/src/actions/GridAlign.js b/src/actions/GridAlign.js index 28ba14652..1bbd4ed14 100644 --- a/src/actions/GridAlign.js +++ b/src/actions/GridAlign.js @@ -32,8 +32,8 @@ var tempZone = new Zone({ sys: { queueDepthSort: NOOP }}, 0, 0, 1, 1); * * @function Phaser.Actions.GridAlign * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {GridAlignConfig} options - The GridAlign Configuration object. * * @return {array} The array of objects that were passed to this Action. diff --git a/src/actions/IncAlpha.js b/src/actions/IncAlpha.js index 0b0c96b3a..1f4563c64 100644 --- a/src/actions/IncAlpha.js +++ b/src/actions/IncAlpha.js @@ -9,15 +9,15 @@ var PropertyValueInc = require('./PropertyValueInc'); /** * Takes an array of Game Objects, or any objects that have a public `alpha` property, * and then adds the given value to each of their `alpha` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `IncAlpha(group.getChildren(), value, step)` * * @function Phaser.Actions.IncAlpha * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `alpha` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/IncX.js b/src/actions/IncX.js index cdd3c3949..8a24ee3e6 100644 --- a/src/actions/IncX.js +++ b/src/actions/IncX.js @@ -9,15 +9,15 @@ var PropertyValueInc = require('./PropertyValueInc'); /** * Takes an array of Game Objects, or any objects that have a public `x` property, * and then adds the given value to each of their `x` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `IncX(group.getChildren(), value, step)` * * @function Phaser.Actions.IncX * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `x` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/IncXY.js b/src/actions/IncXY.js index e44379623..4b70acdca 100644 --- a/src/actions/IncXY.js +++ b/src/actions/IncXY.js @@ -9,17 +9,17 @@ var PropertyValueInc = require('./PropertyValueInc'); /** * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, * and then adds the given value to each of them. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `IncXY(group.getChildren(), x, y, stepX, stepY)` * * @function Phaser.Actions.IncXY * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} x - The amount to be added to the `x` property. - * @param {number} [y] - The amount to be added to the `y` property. If `undefined` or `null` it uses the `x` value. + * @param {number} [y=x] - The amount to be added to the `y` property. If `undefined` or `null` it uses the `x` value. * @param {number} [stepX=0] - This is added to the `x` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/IncY.js b/src/actions/IncY.js index db202246f..99b1a5540 100644 --- a/src/actions/IncY.js +++ b/src/actions/IncY.js @@ -9,15 +9,15 @@ var PropertyValueInc = require('./PropertyValueInc'); /** * Takes an array of Game Objects, or any objects that have a public `y` property, * and then adds the given value to each of their `y` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `IncY(group.getChildren(), value, step)` * * @function Phaser.Actions.IncY * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `y` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/PlaceOnCircle.js b/src/actions/PlaceOnCircle.js index 7c7cfdf14..511d4b12c 100644 --- a/src/actions/PlaceOnCircle.js +++ b/src/actions/PlaceOnCircle.js @@ -9,8 +9,8 @@ * * @function Phaser.Actions.PlaceOnCircle * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {Phaser.Geom.Circle} circle - [description] * @param {number} [startAngle=0] - [description] * @param {number} [endAngle=6.28] - [description] diff --git a/src/actions/PlaceOnEllipse.js b/src/actions/PlaceOnEllipse.js index 9af83d0f5..f8644281c 100644 --- a/src/actions/PlaceOnEllipse.js +++ b/src/actions/PlaceOnEllipse.js @@ -9,8 +9,8 @@ * * @function Phaser.Actions.PlaceOnEllipse * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {Phaser.Geom.Ellipse} ellipse - [description] * @param {number} [startAngle=0] - [description] * @param {number} [endAngle=6.28] - [description] diff --git a/src/actions/PlaceOnLine.js b/src/actions/PlaceOnLine.js index d7dc82358..46a5c6fc9 100644 --- a/src/actions/PlaceOnLine.js +++ b/src/actions/PlaceOnLine.js @@ -11,8 +11,8 @@ var GetPoints = require('../geom/line/GetPoints'); * * @function Phaser.Actions.PlaceOnLine * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {Phaser.Geom.Line} line - [description] * * @return {array} The array of Game Objects that was passed to this Action. diff --git a/src/actions/PlaceOnRectangle.js b/src/actions/PlaceOnRectangle.js index 999c9ab10..a62ec7770 100644 --- a/src/actions/PlaceOnRectangle.js +++ b/src/actions/PlaceOnRectangle.js @@ -19,8 +19,8 @@ var RotateRight = require('../utils/array/RotateRight'); * * @function Phaser.Actions.PlaceOnRectangle * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {Phaser.Geom.Rectangle} rect - [description] * @param {integer} [shift=1] - [description] * diff --git a/src/actions/PlaceOnTriangle.js b/src/actions/PlaceOnTriangle.js index f703289ee..7ae44653e 100644 --- a/src/actions/PlaceOnTriangle.js +++ b/src/actions/PlaceOnTriangle.js @@ -13,7 +13,7 @@ var BresenhamPoints = require('../geom/line/BresenhamPoints'); * @function Phaser.Actions.PlaceOnTriangle * @since 3.0.0 * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {Phaser.Geom.Triangle} triangle - [description] * @param {number} [stepRate=1] - [description] * diff --git a/src/actions/PlayAnimation.js b/src/actions/PlayAnimation.js index 3f58b33bd..76e2e5697 100644 --- a/src/actions/PlayAnimation.js +++ b/src/actions/PlayAnimation.js @@ -9,10 +9,10 @@ * * @function Phaser.Actions.PlayAnimation * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {string} key - [description] - * @param {string|integer} [startFrame] - [description] + * @param {(string|integer)} [startFrame] - [description] * * @return {array} The array of Game Objects that was passed to this Action. */ diff --git a/src/actions/PropertyValueInc.js b/src/actions/PropertyValueInc.js index fc5ead23c..ab6aab070 100644 --- a/src/actions/PropertyValueInc.js +++ b/src/actions/PropertyValueInc.js @@ -7,15 +7,15 @@ /** * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, * and then adds the given value to it. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `PropertyValueInc(group.getChildren(), key, value, step)` * * @function Phaser.Actions.PropertyValueInc * @since 3.3.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {string} key - The property to be updated. * @param {number} value - The amount to be added to the property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. diff --git a/src/actions/PropertyValueSet.js b/src/actions/PropertyValueSet.js index f514627ec..3d94a4839 100644 --- a/src/actions/PropertyValueSet.js +++ b/src/actions/PropertyValueSet.js @@ -7,15 +7,15 @@ /** * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `PropertyValueSet(group.getChildren(), key, value, step)` * * @function Phaser.Actions.PropertyValueSet * @since 3.3.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {string} key - The property to be updated. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. diff --git a/src/actions/RandomCircle.js b/src/actions/RandomCircle.js index c94196f3e..0eadb2f55 100644 --- a/src/actions/RandomCircle.js +++ b/src/actions/RandomCircle.js @@ -11,8 +11,8 @@ var Random = require('../geom/circle/Random'); * * @function Phaser.Actions.RandomCircle * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {Phaser.Geom.Circle} circle - [description] * * @return {array} The array of Game Objects that was passed to this Action. diff --git a/src/actions/RandomEllipse.js b/src/actions/RandomEllipse.js index 0f8444ed7..68d724847 100644 --- a/src/actions/RandomEllipse.js +++ b/src/actions/RandomEllipse.js @@ -11,8 +11,8 @@ var Random = require('../geom/ellipse/Random'); * * @function Phaser.Actions.RandomEllipse * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {Phaser.Geom.Ellipse} ellipse - [description] * * @return {array} The array of Game Objects that was passed to this Action. diff --git a/src/actions/RandomLine.js b/src/actions/RandomLine.js index b0739c2ed..a571f4abb 100644 --- a/src/actions/RandomLine.js +++ b/src/actions/RandomLine.js @@ -11,8 +11,8 @@ var Random = require('../geom/line/Random'); * * @function Phaser.Actions.RandomLine * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {Phaser.Geom.Line} line - [description] * * @return {array} The array of Game Objects that was passed to this Action. diff --git a/src/actions/RandomRectangle.js b/src/actions/RandomRectangle.js index 1a33d2528..546b7cf77 100644 --- a/src/actions/RandomRectangle.js +++ b/src/actions/RandomRectangle.js @@ -11,8 +11,8 @@ var Random = require('../geom/rectangle/Random'); * * @function Phaser.Actions.RandomRectangle * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {Phaser.Geom.Rectangle} rect - [description] * * @return {array} The array of Game Objects that was passed to this Action. diff --git a/src/actions/RandomTriangle.js b/src/actions/RandomTriangle.js index 987bfef59..52daed299 100644 --- a/src/actions/RandomTriangle.js +++ b/src/actions/RandomTriangle.js @@ -11,8 +11,8 @@ var Random = require('../geom/triangle/Random'); * * @function Phaser.Actions.RandomTriangle * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {Phaser.Geom.Triangle} triangle - [description] * * @return {array} The array of Game Objects that was passed to this Action. diff --git a/src/actions/Rotate.js b/src/actions/Rotate.js index a5be5e6e1..18c48c5f3 100644 --- a/src/actions/Rotate.js +++ b/src/actions/Rotate.js @@ -9,15 +9,15 @@ var PropertyValueInc = require('./PropertyValueInc'); /** * Takes an array of Game Objects, or any objects that have a public `rotation` property, * and then adds the given value to each of their `rotation` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `Rotate(group.getChildren(), value, step)` * * @function Phaser.Actions.Rotate * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `rotation` property (in radians). * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/RotateAround.js b/src/actions/RotateAround.js index 15d234dc5..46c340dba 100644 --- a/src/actions/RotateAround.js +++ b/src/actions/RotateAround.js @@ -12,8 +12,8 @@ var DistanceBetween = require('../math/distance/DistanceBetween'); * * @function Phaser.Actions.RotateAround * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {object} point - Any object with public `x` and `y` properties. * @param {number} angle - The angle to rotate by, in radians. * diff --git a/src/actions/RotateAroundDistance.js b/src/actions/RotateAroundDistance.js index f7adff392..7a3b5f764 100644 --- a/src/actions/RotateAroundDistance.js +++ b/src/actions/RotateAroundDistance.js @@ -12,7 +12,7 @@ var MathRotateAroundDistance = require('../math/RotateAroundDistance'); * @function Phaser.Actions.RotateAroundDistance * @since 3.0.0 * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {object} point - Any object with public `x` and `y` properties. * @param {number} angle - The angle to rotate by, in radians. * @param {number} distance - The distance from the point of rotation in pixels. diff --git a/src/actions/ScaleX.js b/src/actions/ScaleX.js index 592d5930c..4c4a4cec6 100644 --- a/src/actions/ScaleX.js +++ b/src/actions/ScaleX.js @@ -9,15 +9,15 @@ var PropertyValueInc = require('./PropertyValueInc'); /** * Takes an array of Game Objects, or any objects that have a public `scaleX` property, * and then adds the given value to each of their `scaleX` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `ScaleX(group.getChildren(), value, step)` * * @function Phaser.Actions.ScaleX * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `scaleX` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/ScaleXY.js b/src/actions/ScaleXY.js index 0cc3bf08a..1cbc66fb1 100644 --- a/src/actions/ScaleXY.js +++ b/src/actions/ScaleXY.js @@ -9,15 +9,15 @@ var PropertyValueInc = require('./PropertyValueInc'); /** * Takes an array of Game Objects, or any objects that have public `scaleX` and `scaleY` properties, * and then adds the given value to each of them. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `ScaleXY(group.getChildren(), scaleX, scaleY, stepX, stepY)` * * @function Phaser.Actions.ScaleXY * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} scaleX - The amount to be added to the `scaleX` property. * @param {number} [scaleY] - The amount to be added to the `scaleY` property. If `undefined` or `null` it uses the `scaleX` value. * @param {number} [stepX=0] - This is added to the `scaleX` amount, multiplied by the iteration counter. diff --git a/src/actions/ScaleY.js b/src/actions/ScaleY.js index b1c97e64f..70d6461fc 100644 --- a/src/actions/ScaleY.js +++ b/src/actions/ScaleY.js @@ -9,15 +9,15 @@ var PropertyValueInc = require('./PropertyValueInc'); /** * Takes an array of Game Objects, or any objects that have a public `scaleY` property, * and then adds the given value to each of their `scaleY` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `ScaleY(group.getChildren(), value, step)` * * @function Phaser.Actions.ScaleY * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `scaleY` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/SetAlpha.js b/src/actions/SetAlpha.js index 74b2802b9..eb114e2ce 100644 --- a/src/actions/SetAlpha.js +++ b/src/actions/SetAlpha.js @@ -9,15 +9,15 @@ var PropertyValueSet = require('./PropertyValueSet'); /** * Takes an array of Game Objects, or any objects that have the public property `alpha` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetAlpha(group.getChildren(), value, step)` * * @function Phaser.Actions.SetAlpha * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/SetBlendMode.js b/src/actions/SetBlendMode.js index 1f519a69f..607223561 100644 --- a/src/actions/SetBlendMode.js +++ b/src/actions/SetBlendMode.js @@ -9,15 +9,15 @@ var PropertyValueSet = require('./PropertyValueSet'); /** * Takes an array of Game Objects, or any objects that have the public property `blendMode` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetBlendMode(group.getChildren(), value)` * * @function Phaser.Actions.SetBlendMode * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {integer} [index=0] - An optional offset to start searching from within the items array. * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. diff --git a/src/actions/SetDepth.js b/src/actions/SetDepth.js index 8b2106c8c..9d629f396 100644 --- a/src/actions/SetDepth.js +++ b/src/actions/SetDepth.js @@ -9,15 +9,15 @@ var PropertyValueSet = require('./PropertyValueSet'); /** * Takes an array of Game Objects, or any objects that have the public property `depth` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetDepth(group.getChildren(), value, step)` * * @function Phaser.Actions.SetDepth * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/SetHitArea.js b/src/actions/SetHitArea.js index 2e14d7346..ea1c8e59d 100644 --- a/src/actions/SetHitArea.js +++ b/src/actions/SetHitArea.js @@ -10,7 +10,7 @@ * @function Phaser.Actions.SetHitArea * @since 3.0.0 * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {any} hitArea - [description] * @param {HitAreaCallback} hitAreaCallback - [description] * diff --git a/src/actions/SetOrigin.js b/src/actions/SetOrigin.js index bbf929476..8bddc10ce 100644 --- a/src/actions/SetOrigin.js +++ b/src/actions/SetOrigin.js @@ -9,15 +9,15 @@ var PropertyValueSet = require('./PropertyValueSet'); /** * Takes an array of Game Objects, or any objects that have the public properties `originX` and `originY` * and then sets them to the given values. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetOrigin(group.getChildren(), originX, originY, stepX, stepY)` * * @function Phaser.Actions.SetOrigin * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} originX - The amount to set the `originX` property to. * @param {number} [originY] - The amount to set the `originY` property to. If `undefined` or `null` it uses the `originX` value. * @param {number} [stepX=0] - This is added to the `originX` amount, multiplied by the iteration counter. diff --git a/src/actions/SetRotation.js b/src/actions/SetRotation.js index 0425a7bac..0ccc05cc3 100644 --- a/src/actions/SetRotation.js +++ b/src/actions/SetRotation.js @@ -9,15 +9,15 @@ var PropertyValueSet = require('./PropertyValueSet'); /** * Takes an array of Game Objects, or any objects that have the public property `rotation` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetRotation(group.getChildren(), value, step)` * * @function Phaser.Actions.SetRotation * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/SetScale.js b/src/actions/SetScale.js index 36da9c5e7..bfe22e3b2 100644 --- a/src/actions/SetScale.js +++ b/src/actions/SetScale.js @@ -9,15 +9,15 @@ var PropertyValueSet = require('./PropertyValueSet'); /** * Takes an array of Game Objects, or any objects that have the public properties `scaleX` and `scaleY` * and then sets them to the given values. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetScale(group.getChildren(), scaleX, scaleY, stepX, stepY)` * * @function Phaser.Actions.SetScale * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} scaleX - The amount to set the `scaleX` property to. * @param {number} [scaleY] - The amount to set the `scaleY` property to. If `undefined` or `null` it uses the `scaleX` value. * @param {number} [stepX=0] - This is added to the `scaleX` amount, multiplied by the iteration counter. diff --git a/src/actions/SetScaleX.js b/src/actions/SetScaleX.js index f0558e4dd..d0a071dcb 100644 --- a/src/actions/SetScaleX.js +++ b/src/actions/SetScaleX.js @@ -9,15 +9,15 @@ var PropertyValueSet = require('./PropertyValueSet'); /** * Takes an array of Game Objects, or any objects that have the public property `scaleX` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetScaleX(group.getChildren(), value, step)` * * @function Phaser.Actions.SetScaleX * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/SetScaleY.js b/src/actions/SetScaleY.js index b6fa8e572..754e50380 100644 --- a/src/actions/SetScaleY.js +++ b/src/actions/SetScaleY.js @@ -9,15 +9,15 @@ var PropertyValueSet = require('./PropertyValueSet'); /** * Takes an array of Game Objects, or any objects that have the public property `scaleY` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetScaleY(group.getChildren(), value, step)` * * @function Phaser.Actions.SetScaleY * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/SetTint.js b/src/actions/SetTint.js index 90de9ce0d..7765d8acb 100644 --- a/src/actions/SetTint.js +++ b/src/actions/SetTint.js @@ -9,8 +9,8 @@ * * @function Phaser.Actions.SetTint * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {number} topLeft - [description] * @param {number} [topRight] - [description] * @param {number} [bottomLeft] - [description] diff --git a/src/actions/SetVisible.js b/src/actions/SetVisible.js index 68a7dd6fa..2e25f1603 100644 --- a/src/actions/SetVisible.js +++ b/src/actions/SetVisible.js @@ -9,13 +9,13 @@ var PropertyValueSet = require('./PropertyValueSet'); /** * Takes an array of Game Objects, or any objects that have the public property `visible` * and then sets it to the given value. - * + * * To use this with a Group: `SetVisible(group.getChildren(), value)` * * @function Phaser.Actions.SetVisible * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {boolean} value - The value to set the property to. * @param {integer} [index=0] - An optional offset to start searching from within the items array. * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. diff --git a/src/actions/SetX.js b/src/actions/SetX.js index 579ec86ee..945fa9398 100644 --- a/src/actions/SetX.js +++ b/src/actions/SetX.js @@ -9,15 +9,15 @@ var PropertyValueSet = require('./PropertyValueSet'); /** * Takes an array of Game Objects, or any objects that have the public property `x` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetX(group.getChildren(), value, step)` * * @function Phaser.Actions.SetX * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/SetXY.js b/src/actions/SetXY.js index 37e84f39e..c606fedbc 100644 --- a/src/actions/SetXY.js +++ b/src/actions/SetXY.js @@ -9,17 +9,17 @@ var PropertyValueSet = require('./PropertyValueSet'); /** * Takes an array of Game Objects, or any objects that have the public properties `x` and `y` * and then sets them to the given values. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetXY(group.getChildren(), x, y, stepX, stepY)` * * @function Phaser.Actions.SetXY * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} x - The amount to set the `x` property to. - * @param {number} [y] - The amount to set the `y` property to. If `undefined` or `null` it uses the `x` value. + * @param {number} [y=x] - The amount to set the `y` property to. If `undefined` or `null` it uses the `x` value. * @param {number} [stepX=0] - This is added to the `x` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/SetY.js b/src/actions/SetY.js index 488c8afb9..cb7a4bed0 100644 --- a/src/actions/SetY.js +++ b/src/actions/SetY.js @@ -9,15 +9,15 @@ var PropertyValueSet = require('./PropertyValueSet'); /** * Takes an array of Game Objects, or any objects that have the public property `y` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetY(group.getChildren(), value, step)` * * @function Phaser.Actions.SetY * @since 3.0.0 - * - * @param {array|Phaser.GameObjects.GameObject[]} items - The array of items to be updated by this action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. * @param {integer} [index=0] - An optional offset to start searching from within the items array. diff --git a/src/actions/ShiftPosition.js b/src/actions/ShiftPosition.js index c08212986..d53cb3488 100644 --- a/src/actions/ShiftPosition.js +++ b/src/actions/ShiftPosition.js @@ -6,22 +6,20 @@ var Vector2 = require('../math/Vector2'); -// Iterate through items changing the position of each element to -// be that of the element that came before it in the array (or after it if direction = 1) -// The first items position is set to x/y. -// The final x/y coords are returned - /** - * [description] + * Iterate through items changing the position of each element to + * be that of the element that came before it in the array (or after it if direction = 1) + * The first items position is set to x/y. + * The final x/y coords are returned * * @function Phaser.Actions.ShiftPosition * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {number} x - [description] * @param {number} y - [description] * @param {integer} [direction=0] - [description] - * @param {Phaser.Math.Vector2|object} [output] - [description] + * @param {(Phaser.Math.Vector2|object)} [output] - [description] * * @return {Phaser.Math.Vector2} The output vector. */ diff --git a/src/actions/Shuffle.js b/src/actions/Shuffle.js index 877b04312..5c6fdfd20 100644 --- a/src/actions/Shuffle.js +++ b/src/actions/Shuffle.js @@ -11,8 +11,8 @@ var ArrayShuffle = require('../utils/array/Shuffle'); * * @function Phaser.Actions.Shuffle * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * * @return {array} The array of Game Objects that was passed to this Action. */ diff --git a/src/actions/SmoothStep.js b/src/actions/SmoothStep.js index 2146d49a0..e0b818aed 100644 --- a/src/actions/SmoothStep.js +++ b/src/actions/SmoothStep.js @@ -11,8 +11,8 @@ var MathSmoothStep = require('../math/SmoothStep'); * * @function Phaser.Actions.SmoothStep * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {string} property - [description] * @param {number} min - [description] * @param {number} max - [description] diff --git a/src/actions/SmootherStep.js b/src/actions/SmootherStep.js index 17cfdab74..88cf3205d 100644 --- a/src/actions/SmootherStep.js +++ b/src/actions/SmootherStep.js @@ -11,8 +11,8 @@ var MathSmootherStep = require('../math/SmootherStep'); * * @function Phaser.Actions.SmootherStep * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {string} property - [description] * @param {number} min - [description] * @param {number} max - [description] diff --git a/src/actions/Spread.js b/src/actions/Spread.js index c89c05ab5..414652428 100644 --- a/src/actions/Spread.js +++ b/src/actions/Spread.js @@ -9,12 +9,12 @@ * * @function Phaser.Actions.Spread * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {string} property - [description] * @param {number} min - [description] * @param {number} max - [description] - * @param {number} inc - [description] + * @param {number} [inc=false] - [description] * * @return {array} The array of Game Objects that was passed to this Action. */ diff --git a/src/actions/ToggleVisible.js b/src/actions/ToggleVisible.js index 0d0a04694..b098ae5fe 100644 --- a/src/actions/ToggleVisible.js +++ b/src/actions/ToggleVisible.js @@ -9,8 +9,8 @@ * * @function Phaser.Actions.ToggleVisible * @since 3.0.0 - * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * * @return {array} The array of Game Objects that was passed to this Action. */ diff --git a/src/actions/WrapInRectangle.js b/src/actions/WrapInRectangle.js index f946a538a..d8e023867 100644 --- a/src/actions/WrapInRectangle.js +++ b/src/actions/WrapInRectangle.js @@ -11,10 +11,10 @@ var Wrap = require('../math/Wrap'); * Wrap each item's coordinates within a rectangle's area. * * @function Phaser.Actions.WrapInRectangle - * @since [version] + * @since 3.0.0 * @see Phaser.Math.Wrap * - * @param {array} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {Phaser.Geom.Rectangle} rect - The rectangle. * @param {number} [padding=0] - An amount added to each side of the rectangle during the operation. * From 37b6fc5862779ef06f722a403bca37ed0fff9838 Mon Sep 17 00:00:00 2001 From: orblazer Date: Tue, 20 Mar 2018 15:58:02 +0100 Subject: [PATCH 4/9] Fix many multiple types --- src/animations/Animation.js | 8 ++-- src/animations/AnimationFrame.js | 6 +-- src/animations/AnimationManager.js | 4 +- src/boot/Config.js | 8 ++-- src/boot/Game.js | 6 +-- src/cameras/2d/Camera.js | 8 ++-- src/cameras/2d/CameraManager.js | 4 +- src/cameras/controls/FixedKeyControl.js | 2 +- src/cameras/controls/SmoothedKeyControl.js | 6 +-- src/cameras/sprite3d/Camera.js | 14 +++--- src/cameras/sprite3d/CameraManager.js | 6 +-- src/curves/CubicBezierCurve.js | 2 +- src/curves/QuadraticBezierCurve.js | 2 +- src/curves/path/Path.js | 4 +- src/display/canvas/Smoothing.js | 12 ++--- src/display/color/ValueToColor.js | 2 +- src/display/mask/BitmapMask.js | 8 ++-- src/display/mask/GeometryMask.js | 8 ++-- src/dom/AddToDOM.js | 2 +- src/events/EventEmitter.js | 56 +++++++++++----------- 20 files changed, 84 insertions(+), 84 deletions(-) diff --git a/src/animations/Animation.js b/src/animations/Animation.js index 84c8f1715..5561223c5 100644 --- a/src/animations/Animation.js +++ b/src/animations/Animation.js @@ -29,7 +29,7 @@ var GetValue = require('../utils/object/GetValue'); * @typedef {object} AnimationFrameConfig * * @property {string} key - [description] - * @property {string|number} frame - [description] + * @property {(string|number)} frame - [description] * @property {float} [duration=0] - [description] * @property {boolean} [visible] - [description] * @property {function} [onUpdate] - [description] @@ -350,7 +350,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#addFrame * @since 3.0.0 * - * @param {string|AnimationFrameConfig[]} config - [description] + * @param {(string|AnimationFrameConfig[])} config - [description] * * @return {Phaser.Animations.Animation} This Animation object. */ @@ -368,7 +368,7 @@ var Animation = new Class({ * @since 3.0.0 * * @param {integer} index - [description] - * @param {string|AnimationFrameConfig[]} config - [description] + * @param {(string|AnimationFrameConfig[])} config - [description] * * @return {Phaser.Animations.Animation} This Animation object. */ @@ -478,7 +478,7 @@ var Animation = new Class({ * @since 3.0.0 * * @param {Phaser.Textures.TextureManager} textureManager - [description] - * @param {string|AnimationFrameConfig[]} frames - [description] + * @param {(string|AnimationFrameConfig[])} frames - [description] * @param {string} [defaultTextureKey] - [description] * * @return {Phaser.Animations.AnimationFrame[]} [description] diff --git a/src/animations/AnimationFrame.js b/src/animations/AnimationFrame.js index d7924e01e..800730c04 100644 --- a/src/animations/AnimationFrame.js +++ b/src/animations/AnimationFrame.js @@ -10,7 +10,7 @@ var Class = require('../utils/Class'); * @typedef {object} JSONAnimationFrame * * @property {string} key - The key of the Texture this AnimationFrame uses. - * @property {string|integer} frame - The key of the Frame within the Texture that this AnimationFrame uses. + * @property {(string|integer)} frame - The key of the Frame within the Texture that this AnimationFrame uses. * @property {number} duration - Additional time (in ms) that this frame should appear for during playback. */ @@ -30,7 +30,7 @@ var Class = require('../utils/Class'); * @since 3.0.0 * * @param {string} textureKey - The key of the Texture this AnimationFrame uses. - * @param {string|integer} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses. + * @param {(string|integer)} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses. * @param {integer} index - The index of this AnimationFrame within the Animation sequence. * @param {Phaser.Textures.Frame} frame - A reference to the Texture Frame this AnimationFrame uses for rendering. */ @@ -53,7 +53,7 @@ var AnimationFrame = new Class({ * The key of the Frame within the Texture that this AnimationFrame uses. * * @name Phaser.Animations.AnimationFrame#textureFrame - * @type {string|integer} + * @type {(string|integer)} * @since 3.0.0 */ this.textureFrame = textureFrame; diff --git a/src/animations/AnimationManager.js b/src/animations/AnimationManager.js index eddcb44ce..26ee5a6cb 100644 --- a/src/animations/AnimationManager.js +++ b/src/animations/AnimationManager.js @@ -186,7 +186,7 @@ var AnimationManager = new Class({ * @method Phaser.Animations.AnimationManager#fromJSON * @since 3.0.0 * - * @param {string|object} data - [description] + * @param {(string|object)} data - [description] * @param {boolean} [clearCurrentAnimations=false] - [description] * * @return {Phaser.Animations.Animation[]} An array containing all of the Animation objects that were created as a result of this call. @@ -394,7 +394,7 @@ var AnimationManager = new Class({ * * @param {Phaser.GameObjects.GameObject} child - [description] * @param {string} key - [description] - * @param {string|integer} [startFrame] - [description] + * @param {(string|integer)} [startFrame] - [description] * * @return {Phaser.GameObjects.GameObject} [description] */ diff --git a/src/boot/Config.js b/src/boot/Config.js index 60fd6e7f6..7a27091eb 100644 --- a/src/boot/Config.js +++ b/src/boot/Config.js @@ -41,7 +41,7 @@ var ValueToColor = require('../display/color/ValueToColor'); * @property {string} [path] - [description] * @property {boolean} [enableParallel=true] - [description] * @property {integer} [maxParallelDownloads=4] - [description] - * @property {string|undefined} [crossOrigin=undefined] - [description] + * @property {(string|undefined)} [crossOrigin=undefined] - [description] * @property {string} [responseType] - [description] * @property {boolean} [async=true] - [description] * @property {string} [user] - [description] @@ -52,8 +52,8 @@ var ValueToColor = require('../display/color/ValueToColor'); /** * @typedef {object} GameConfig * - * @property {integer|string} [width=1024] - [description] - * @property {integer|string} [height=768] - [description] + * @property {(integer|string)} [width=1024] - [description] + * @property {(integer|string)} [height=768] - [description] * @property {number} [zoom=1] - [description] * @property {number} [resolution=1] - [description] * @property {number} [type=CONST.AUTO] - [description] @@ -90,7 +90,7 @@ var ValueToColor = require('../display/color/ValueToColor'); * @property {boolean} [preserveDrawingBuffer=false] - [description] * @property {boolean} [failIfMajorPerformanceCaveat=false] - [description] * @property {boolean} [powerPreference='default'] - "high-performance", "low-power" or "default" - * @property {string|number} [backgroundColor=0x000000] - [description] + * @property {(string|number)} [backgroundColor=0x000000] - [description] * @property {object} [?callbacks] - [description] * @property {BootCallback} [callbacks.preBoot=NOOP] - [description] * @property {BootCallback} [callbacks.postBoot=NOOP] - [description] diff --git a/src/boot/Game.js b/src/boot/Game.js index 3305000ce..6d2c047d6 100644 --- a/src/boot/Game.js +++ b/src/boot/Game.js @@ -68,7 +68,7 @@ var Game = new Class({ * A reference to either the Canvas or WebGL Renderer that this Game is using. * * @name Phaser.Game#renderer - * @type {Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer} + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} * @since 3.0.0 */ this.renderer = null; @@ -323,7 +323,7 @@ var Game = new Class({ * the Scenes for rendering, but it won't have actually drawn anything yet. * * @event Phaser.Game#prerenderEvent - * @param {Phaser.Renderer.CanvasRenderer|Phaser.Renderer.WebGLRenderer} renderer - A reference to the current renderer. + * @param {(Phaser.Renderer.CanvasRenderer|Phaser.Renderer.WebGLRenderer)} renderer - A reference to the current renderer. */ /** @@ -333,7 +333,7 @@ var Game = new Class({ * Every Scene will have rendered and drawn to the canvas. * * @event Phaser.Game#postrenderEvent - * @param {Phaser.Renderer.CanvasRenderer|Phaser.Renderer.WebGLRenderer} renderer - A reference to the current renderer. + * @param {(Phaser.Renderer.CanvasRenderer|Phaser.Renderer.WebGLRenderer)} renderer - A reference to the current renderer. */ /** diff --git a/src/cameras/2d/Camera.js b/src/cameras/2d/Camera.js index 61631a75b..5c1b2b18d 100644 --- a/src/cameras/2d/Camera.js +++ b/src/cameras/2d/Camera.js @@ -874,7 +874,7 @@ var Camera = new Class({ * * @param {number} x - [description] * @param {number} y - [description] - * @param {object|Phaser.Math.Vector2} output - [description] + * @param {(object|Phaser.Math.Vector2)} output - [description] * * @return {Phaser.Math.Vector2} [description] */ @@ -935,7 +935,7 @@ var Camera = new Class({ * @method Phaser.Cameras.Scene2D.Camera#ignore * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjectOrArray - [description] + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjectOrArray - [description] * * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. */ @@ -1068,7 +1068,7 @@ var Camera = new Class({ * @method Phaser.Cameras.Scene2D.Camera#setBackgroundColor * @since 3.0.0 * - * @param {string|number|InputColorObject} color - [description] + * @param {(string|number|InputColorObject)} color - [description] * * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. */ @@ -1288,7 +1288,7 @@ var Camera = new Class({ * @method Phaser.Cameras.Scene2D.Camera#startFollow * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|object} target - [description] + * @param {(Phaser.GameObjects.GameObject|object)} target - [description] * @param {boolean} roundPx - [description] * * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. diff --git a/src/cameras/2d/CameraManager.js b/src/cameras/2d/CameraManager.js index 34a004802..741152387 100644 --- a/src/cameras/2d/CameraManager.js +++ b/src/cameras/2d/CameraManager.js @@ -236,7 +236,7 @@ var CameraManager = new Class({ * @method Phaser.Cameras.Scene2D.CameraManager#fromJSON * @since 3.0.0 * - * @param {object|object[]} config - [description] + * @param {(object|object[])} config - [description] * * @return {Phaser.Cameras.Scene2D.CameraManager} [description] */ @@ -375,7 +375,7 @@ var CameraManager = new Class({ * @method Phaser.Cameras.Scene2D.CameraManager#render * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer} renderer - The Renderer that will render the children to this camera. + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Renderer that will render the children to this camera. * @param {Phaser.GameObjects.GameObject[]} children - An array of renderable Game Objects. * @param {number} interpolation - Interpolation value. Reserved for future use. */ diff --git a/src/cameras/controls/FixedKeyControl.js b/src/cameras/controls/FixedKeyControl.js index 33d28e254..98ace2c77 100644 --- a/src/cameras/controls/FixedKeyControl.js +++ b/src/cameras/controls/FixedKeyControl.js @@ -24,7 +24,7 @@ var GetValue = require('../../utils/object/GetValue'); * @property {Phaser.Input.Keyboard.Key} [zoomIn] - The Key to be pressed that will zoom the Camera in. * @property {Phaser.Input.Keyboard.Key} [zoomOut] - The Key to be pressed that will zoom the Camera out. * @property {float} [zoomSpeed=0.01] - The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed. - * @property {float|{x:float,y:float}} [speed=0] - The horizontal and vertical speed the camera will move. + * @property {(float|{x:float,y:float})} [speed=0] - The horizontal and vertical speed the camera will move. */ /** diff --git a/src/cameras/controls/SmoothedKeyControl.js b/src/cameras/controls/SmoothedKeyControl.js index d38a8b282..16a74581b 100644 --- a/src/cameras/controls/SmoothedKeyControl.js +++ b/src/cameras/controls/SmoothedKeyControl.js @@ -31,9 +31,9 @@ var GetValue = require('../../utils/object/GetValue'); * @property {Phaser.Input.Keyboard.Key} [zoomIn] - The Key to be pressed that will zoom the Camera in. * @property {Phaser.Input.Keyboard.Key} [zoomOut] - The Key to be pressed that will zoom the Camera out. * @property {float} [zoomSpeed=0.01] - The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed. - * @property {float|{x:float,y:float}} [acceleration=0] - The horizontal and vertical acceleration the camera will move. - * @property {float|{x:float,y:float}} [drag=0] - The horizontal and vertical drag applied to the camera when it is moving. - * @property {float|{x:float,y:float}} [maxSpeed=0] - The maximum horizontal and vertical speed the camera will move. + * @property {(float|{x:float,y:float})} [acceleration=0] - The horizontal and vertical acceleration the camera will move. + * @property {(float|{x:float,y:float})} [drag=0] - The horizontal and vertical drag applied to the camera when it is moving. + * @property {(float|{x:float,y:float})} [maxSpeed=0] - The maximum horizontal and vertical speed the camera will move. */ /** diff --git a/src/cameras/sprite3d/Camera.js b/src/cameras/sprite3d/Camera.js index 6b4828b76..d48bef998 100644 --- a/src/cameras/sprite3d/Camera.js +++ b/src/cameras/sprite3d/Camera.js @@ -368,7 +368,7 @@ var Camera = new Class({ * @param {number} y - [description] * @param {number} z - [description] * @param {string} key - [description] - * @param {string|number} frame - [description] + * @param {(string|number)} frame - [description] * @param {boolean} [visible=true] - [description] * * @return {Phaser.GameObjects.Sprite3D} [description] @@ -399,7 +399,7 @@ var Camera = new Class({ * * @param {number} quantity - [description] * @param {string} key - [description] - * @param {string|number} frame - [description] + * @param {(string|number)} frame - [description] * @param {boolean} [visible=true] - [description] * * @return {Phaser.GameObjects.Sprite3D[]} [description] @@ -435,10 +435,10 @@ var Camera = new Class({ * @method Phaser.Cameras.Sprite3D.Camera#createRect * @since 3.0.0 * - * @param {number|{x:number,y:number}} size - [description] - * @param {number|{x:number,y:number,z:number}} spacing - [description] + * @param {(number|{x:number,y:number})} size - [description] + * @param {(number|{x:number,y:number,z:number})} spacing - [description] * @param {string} key - [description] - * @param {string|number} [frame] - [description] + * @param {(string|number)} [frame] - [description] * * @return {Phaser.GameObjects.Sprite3D[]} [description] */ @@ -595,7 +595,7 @@ var Camera = new Class({ * @method Phaser.Cameras.Sprite3D.Camera#translate * @since 3.0.0 * - * @param {number|object} x - [description] + * @param {(number|object)} x - [description] * @param {number} [y] - [description] * @param {number} [z] - [description] * @@ -625,7 +625,7 @@ var Camera = new Class({ * @method Phaser.Cameras.Sprite3D.Camera#lookAt * @since 3.0.0 * - * @param {number|object} x - [description] + * @param {(number|object)} x - [description] * @param {number} [y] - [description] * @param {number} [z] - [description] * diff --git a/src/cameras/sprite3d/CameraManager.js b/src/cameras/sprite3d/CameraManager.js index 2f370558c..6396a9ada 100644 --- a/src/cameras/sprite3d/CameraManager.js +++ b/src/cameras/sprite3d/CameraManager.js @@ -151,7 +151,7 @@ var CameraManager = new Class({ * * @param {string} name - [description] * - * @return {Phaser.Cameras.Sprite3D.OrthographicCamera|Phaser.Cameras.Sprite3D.PerspectiveCamera} [description] + * @return {(Phaser.Cameras.Sprite3D.OrthographicCamera|Phaser.Cameras.Sprite3D.PerspectiveCamera)} [description] */ getCamera: function (name) { @@ -172,7 +172,7 @@ var CameraManager = new Class({ * @method Phaser.Cameras.Sprite3D.CameraManager#removeCamera * @since 3.0.0 * - * @param {Phaser.Cameras.Sprite3D.OrthographicCamera|Phaser.Cameras.Sprite3D.PerspectiveCamera} camera - [description] + * @param {(Phaser.Cameras.Sprite3D.OrthographicCamera|Phaser.Cameras.Sprite3D.PerspectiveCamera)} camera - [description] */ removeCamera: function (camera) { @@ -190,7 +190,7 @@ var CameraManager = new Class({ * @method Phaser.Cameras.Sprite3D.CameraManager#removeAll * @since 3.0.0 * - * @return {Phaser.Cameras.Sprite3D.OrthographicCamera|Phaser.Cameras.Sprite3D.PerspectiveCamera} [description] + * @return {(Phaser.Cameras.Sprite3D.OrthographicCamera|Phaser.Cameras.Sprite3D.PerspectiveCamera)} [description] */ removeAll: function () { diff --git a/src/curves/CubicBezierCurve.js b/src/curves/CubicBezierCurve.js index 71779f110..1a2645940 100644 --- a/src/curves/CubicBezierCurve.js +++ b/src/curves/CubicBezierCurve.js @@ -21,7 +21,7 @@ var Vector2 = require('../math/Vector2'); * @constructor * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector2[]} p0 - Start point, or an array of point pairs. + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector2[])} p0 - Start point, or an array of point pairs. * @param {Phaser.Math.Vector2} p1 - Control Point 1. * @param {Phaser.Math.Vector2} p2 - Control Point 2. * @param {Phaser.Math.Vector2} p3 - End Point. diff --git a/src/curves/QuadraticBezierCurve.js b/src/curves/QuadraticBezierCurve.js index bb3e2dbad..3e7b0719f 100644 --- a/src/curves/QuadraticBezierCurve.js +++ b/src/curves/QuadraticBezierCurve.js @@ -19,7 +19,7 @@ var Vector2 = require('../math/Vector2'); * @constructor * @since 3.2.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector2[]} p0 - Start point, or an array of point pairs. + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector2[])} p0 - Start point, or an array of point pairs. * @param {Phaser.Math.Vector2} p1 - Control Point 1. * @param {Phaser.Math.Vector2} p2 - Control Point 2. */ diff --git a/src/curves/path/Path.js b/src/curves/path/Path.js index b9439bebd..e5fec5f31 100644 --- a/src/curves/path/Path.js +++ b/src/curves/path/Path.js @@ -235,7 +235,7 @@ var Path = new Class({ * @method Phaser.Curves.Path#quadraticBezierTo * @since 3.2.0 * - * @param {number|Phaser.Math.Vector2[]} x - [description] + * @param {(number|Phaser.Math.Vector2[])} x - [description] * @param {number} [y] - [description] * @param {number} [controlX] - [description] * @param {number} [controlY] - [description] @@ -671,7 +671,7 @@ var Path = new Class({ * @method Phaser.Curves.Path#lineTo * @since 3.0.0 * - * @param {number|Phaser.Math.Vector2} x - [description] + * @param {(number|Phaser.Math.Vector2)} x - [description] * @param {number} [y] - [description] * * @return {Phaser.Curves.Path} [description] diff --git a/src/display/canvas/Smoothing.js b/src/display/canvas/Smoothing.js index 12a70f84b..4f1cfe10a 100644 --- a/src/display/canvas/Smoothing.js +++ b/src/display/canvas/Smoothing.js @@ -19,7 +19,7 @@ var Smoothing = function () * @function Phaser.Display.Canvas.Smoothing.getPrefix * @since 3.0.0 * - * @param {CanvasRenderingContext2D|WebGLRenderingContext} context - [description] + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - [description] * * @return {string} [description] */ @@ -50,9 +50,9 @@ var Smoothing = function () * @function Phaser.Display.Canvas.Smoothing.enable * @since 3.0.0 * - * @param {CanvasRenderingContext2D|WebGLRenderingContext} context - [description] + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - [description] * - * @return {CanvasRenderingContext2D|WebGLRenderingContext} [description] + * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} [description] */ var enable = function (context) { @@ -79,9 +79,9 @@ var Smoothing = function () * @function Phaser.Display.Canvas.Smoothing.disable * @since 3.0.0 * - * @param {CanvasRenderingContext2D|WebGLRenderingContext} context - [description] + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - [description] * - * @return {CanvasRenderingContext2D|WebGLRenderingContext} [description] + * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} [description] */ var disable = function (context) { @@ -105,7 +105,7 @@ var Smoothing = function () * @function Phaser.Display.Canvas.Smoothing.isEnabled * @since 3.0.0 * - * @param {CanvasRenderingContext2D|WebGLRenderingContext} context - [description] + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - [description] * * @return {?boolean} [description] */ diff --git a/src/display/color/ValueToColor.js b/src/display/color/ValueToColor.js index 08a4b49de..dfe110e65 100644 --- a/src/display/color/ValueToColor.js +++ b/src/display/color/ValueToColor.js @@ -16,7 +16,7 @@ var RGBStringToColor = require('./RGBStringToColor'); * @function Phaser.Display.Color.ValueToColor * @since 3.0.0 * - * @param {string|number|InputColorObject} input - The source color value to convert. + * @param {(string|number|InputColorObject)} input - The source color value to convert. * * @return {Phaser.Display.Color} A Color object. */ diff --git a/src/display/mask/BitmapMask.js b/src/display/mask/BitmapMask.js index fdb26a733..3440773a3 100644 --- a/src/display/mask/BitmapMask.js +++ b/src/display/mask/BitmapMask.js @@ -143,7 +143,7 @@ var BitmapMask = new Class({ * @method Phaser.Display.Masks.BitmapMask#preRenderWebGL * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - [description] * @param {Phaser.GameObjects.GameObject} maskedObject - [description] * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. */ @@ -158,7 +158,7 @@ var BitmapMask = new Class({ * @method Phaser.Display.Masks.BitmapMask#postRenderWebGL * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - [description] */ postRenderWebGL: function (renderer) { @@ -171,7 +171,7 @@ var BitmapMask = new Class({ * @method Phaser.Display.Masks.BitmapMask#preRenderCanvas * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - [description] * @param {Phaser.GameObjects.GameObject} mask - [description] * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. */ @@ -186,7 +186,7 @@ var BitmapMask = new Class({ * @method Phaser.Display.Masks.BitmapMask#postRenderCanvas * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - [description] */ postRenderCanvas: function () { diff --git a/src/display/mask/GeometryMask.js b/src/display/mask/GeometryMask.js index 45da7a536..b24ea0310 100644 --- a/src/display/mask/GeometryMask.js +++ b/src/display/mask/GeometryMask.js @@ -53,7 +53,7 @@ var GeometryMask = new Class({ * @method Phaser.Display.Masks.GeometryMask#preRenderWebGL * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - [description] * @param {Phaser.GameObjects.GameObject} mask - [description] * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] */ @@ -88,7 +88,7 @@ var GeometryMask = new Class({ * @method Phaser.Display.Masks.GeometryMask#postRenderWebGL * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - [description] */ postRenderWebGL: function (renderer) { @@ -105,7 +105,7 @@ var GeometryMask = new Class({ * @method Phaser.Display.Masks.GeometryMask#preRenderCanvas * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - [description] * @param {Phaser.GameObjects.GameObject} mask - [description] * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] */ @@ -126,7 +126,7 @@ var GeometryMask = new Class({ * @method Phaser.Display.Masks.GeometryMask#postRenderCanvas * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - [description] */ postRenderCanvas: function (renderer) { diff --git a/src/dom/AddToDOM.js b/src/dom/AddToDOM.js index 51bf4edf0..41216c835 100644 --- a/src/dom/AddToDOM.js +++ b/src/dom/AddToDOM.js @@ -12,7 +12,7 @@ * @since 3.0.0 * * @param {HTMLElement} element - The element to be added to the DOM. Usually a Canvas object. - * @param {string|HTMLElement} [parent] - The parent in which to add the element. Can be a string which is passed to `getElementById` or an actual DOM object. + * @param {(string|HTMLElement)} [parent] - The parent in which to add the element. Can be a string which is passed to `getElementById` or an actual DOM object. * @param {boolean} [overflowHidden=true] - [description] * * @return {HTMLElement} The element that was added to the DOM. diff --git a/src/events/EventEmitter.js b/src/events/EventEmitter.js index dd71af975..dca6a0ce2 100644 --- a/src/events/EventEmitter.js +++ b/src/events/EventEmitter.js @@ -66,7 +66,7 @@ var EventEmitter = new Class({ * * @method EventEmitter#eventNames * @since 3.0.0 - * + * * @return {array} */ @@ -75,20 +75,20 @@ var EventEmitter = new Class({ * * @method EventEmitter#listeners * @since 3.0.0 - * - * @param {string|symbol} event - The event name. - * + * + * @param {(string|symbol)} event - The event name. + * * @return {array} The registered listeners. */ /** * Return the number of listeners listening to a given event. - * + * * @method EventEmitter#listenerCount * @since 3.0.0 * - * @param {string|symbol} event - The event name. - * + * @param {(string|symbol)} event - The event name. + * * @return {number} The number of listeners. */ @@ -97,9 +97,9 @@ var EventEmitter = new Class({ * * @method EventEmitter#emit * @since 3.0.0 - * - * @param {string|symbol} event - The event name. - * + * + * @param {(string|symbol)} event - The event name. + * * @return {boolean} `true` if the event had listeners, else `false`. */ @@ -108,11 +108,11 @@ var EventEmitter = new Class({ * * @method EventEmitter#on * @since 3.0.0 - * - * @param {string|symbol} event - The event name. + * + * @param {(string|symbol)} event - The event name. * @param {function} fn - The listener function. * @param {*} [context=this] - The context to invoke the listener with. - * + * * @return {EventEmitter} `this`. */ @@ -121,11 +121,11 @@ var EventEmitter = new Class({ * * @method EventEmitter#addListener * @since 3.0.0 - * - * @param {string|symbol} event - The event name. + * + * @param {(string|symbol)} event - The event name. * @param {function} fn - The listener function. * @param {*} [context=this] - The context to invoke the listener with. - * + * * @return {EventEmitter} `this`. */ @@ -134,11 +134,11 @@ var EventEmitter = new Class({ * * @method EventEmitter#once * @since 3.0.0 - * - * @param {string|symbol} event - The event name. + * + * @param {(string|symbol)} event - The event name. * @param {function} fn - The listener function. * @param {*} [context=this] - The context to invoke the listener with. - * + * * @return {EventEmitter} `this`. */ @@ -147,12 +147,12 @@ var EventEmitter = new Class({ * * @method EventEmitter#removeListener * @since 3.0.0 - * - * @param {string|symbol} event - The event name. + * + * @param {(string|symbol)} event - The event name. * @param {function} fn - Only remove the listeners that match this function. * @param {*} context - Only remove the listeners that have this context. * @param {boolean} once - Only remove one-time listeners. - * + * * @return {EventEmitter} `this`. */ @@ -161,12 +161,12 @@ var EventEmitter = new Class({ * * @method EventEmitter#off * @since 3.0.0 - * - * @param {string|symbol} event - The event name. + * + * @param {(string|symbol)} event - The event name. * @param {function} fn - Only remove the listeners that match this function. * @param {*} context - Only remove the listeners that have this context. * @param {boolean} once - Only remove one-time listeners. - * + * * @return {EventEmitter} `this`. */ @@ -175,9 +175,9 @@ var EventEmitter = new Class({ * * @method EventEmitter#removeAllListeners * @since 3.0.0 - * - * @param {string|symbol} [event] - The event name. - * + * + * @param {(string|symbol)} [event] - The event name. + * * @return {EventEmitter} `this`. */ From 8a9223811f02a89d7720f0876af23d3d00bbbf1a Mon Sep 17 00:00:00 2001 From: orblazer Date: Tue, 20 Mar 2018 16:01:08 +0100 Subject: [PATCH 5/9] Fix multiple types on Geom --- src/geom/circle/Circle.js | 20 ++++++++++---------- src/geom/circle/CircumferencePoint.js | 4 ++-- src/geom/circle/Clone.js | 2 +- src/geom/circle/ContainsPoint.js | 2 +- src/geom/circle/ContainsRect.js | 2 +- src/geom/circle/GetBounds.js | 4 ++-- src/geom/circle/GetPoint.js | 4 ++-- src/geom/circle/OffsetPoint.js | 2 +- src/geom/circle/Random.js | 4 ++-- src/geom/ellipse/CircumferencePoint.js | 4 ++-- src/geom/ellipse/ContainsPoint.js | 2 +- src/geom/ellipse/ContainsRect.js | 2 +- src/geom/ellipse/Ellipse.js | 8 ++++---- src/geom/ellipse/GetBounds.js | 4 ++-- src/geom/ellipse/GetPoint.js | 4 ++-- src/geom/ellipse/OffsetPoint.js | 2 +- src/geom/ellipse/Random.js | 4 ++-- src/geom/intersects/LineToRectangle.js | 2 +- src/geom/line/GetMidPoint.js | 4 ++-- src/geom/line/GetNormal.js | 4 ++-- src/geom/line/GetPoint.js | 4 ++-- src/geom/line/Line.js | 10 +++++----- src/geom/line/Random.js | 4 ++-- src/geom/line/RotateAroundPoint.js | 2 +- src/geom/point/Interpolate.js | 4 ++-- src/geom/polygon/GetAABB.js | 4 ++-- src/geom/rectangle/GetCenter.js | 4 ++-- src/geom/rectangle/GetPoint.js | 2 +- src/geom/rectangle/GetSize.js | 6 +++--- src/geom/rectangle/Rectangle.js | 8 ++++---- src/geom/triangle/Centroid.js | 4 ++-- src/geom/triangle/GetPoint.js | 4 ++-- src/geom/triangle/GetPoints.js | 4 ++-- src/geom/triangle/Triangle.js | 8 ++++---- 34 files changed, 76 insertions(+), 76 deletions(-) diff --git a/src/geom/circle/Circle.js b/src/geom/circle/Circle.js index be6173435..dc84e8ee1 100644 --- a/src/geom/circle/Circle.js +++ b/src/geom/circle/Circle.js @@ -103,9 +103,9 @@ var Circle = new Class({ * @since 3.0.0 * * @param {float} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle. - * @param {Phaser.Geom.Point|object} [out] - An object to store the return values in. If not given a Point object will be created. + * @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created. * - * @return {Phaser.Geom.Point|object} A Point, or point-like object, containing the coordinates of the point around the circle. + * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the circle. */ getPoint: function (position, point) { @@ -136,9 +136,9 @@ var Circle = new Class({ * @method Phaser.Geom.Circle#getRandomPoint * @since 3.0.0 * - * @param {Phaser.Geom.Point|object} [point] - A Point or point-like object to set the random `x` and `y` values in. + * @param {(Phaser.Geom.Point|object)} [point] - A Point or point-like object to set the random `x` and `y` values in. * - * @return {Phaser.Geom.Point|object} A Point object with the random values set in the `x` and `y` properties. + * @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties. */ getRandomPoint: function (point) { @@ -220,7 +220,7 @@ var Circle = new Class({ /** * The radius of the Circle. - * + * * @name Phaser.Geom.Circle#radius * @type {number} * @since 3.0.0 @@ -242,7 +242,7 @@ var Circle = new Class({ /** * The diameter of the Circle. - * + * * @name Phaser.Geom.Circle#diameter * @type {number} * @since 3.0.0 @@ -264,7 +264,7 @@ var Circle = new Class({ /** * The left position of the Circle. - * + * * @name Phaser.Geom.Circle#left * @type {number} * @since 3.0.0 @@ -285,7 +285,7 @@ var Circle = new Class({ /** * The right position of the Circle. - * + * * @name Phaser.Geom.Circle#right * @type {number} * @since 3.0.0 @@ -306,7 +306,7 @@ var Circle = new Class({ /** * The top position of the Circle. - * + * * @name Phaser.Geom.Circle#top * @type {number} * @since 3.0.0 @@ -327,7 +327,7 @@ var Circle = new Class({ /** * The bottom position of the Circle. - * + * * @name Phaser.Geom.Circle#bottom * @type {number} * @since 3.0.0 diff --git a/src/geom/circle/CircumferencePoint.js b/src/geom/circle/CircumferencePoint.js index a85b99b99..322246deb 100644 --- a/src/geom/circle/CircumferencePoint.js +++ b/src/geom/circle/CircumferencePoint.js @@ -14,9 +14,9 @@ var Point = require('../point/Point'); * * @param {Phaser.Geom.Circle} circle - The Circle to get the circumference point on. * @param {number} angle - The angle from the center of the Circle to the circumference to return the point from. Given in radians. - * @param {Phaser.Geom.Point|object} [out] - A Point, or point-like object, to store the results in. If not given a Point will be created. + * @param {(Phaser.Geom.Point|object)} [out] - A Point, or point-like object, to store the results in. If not given a Point will be created. * - * @return {Phaser.Geom.Point|object} A Point object where the `x` and `y` properties are the point on the circumference. + * @return {(Phaser.Geom.Point|object)} A Point object where the `x` and `y` properties are the point on the circumference. */ var CircumferencePoint = function (circle, angle, out) { diff --git a/src/geom/circle/Clone.js b/src/geom/circle/Clone.js index c471c52c6..6958cb09b 100644 --- a/src/geom/circle/Clone.js +++ b/src/geom/circle/Clone.js @@ -12,7 +12,7 @@ var Circle = require('./Circle'); * @function Phaser.Geom.Circle.Clone * @since 3.0.0 * - * @param {Phaser.Geom.Circle|object} source - The Circle to be cloned. Can be an instance of a Circle or a circle-like object, with x, y and radius properties. + * @param {(Phaser.Geom.Circle|object)} source - The Circle to be cloned. Can be an instance of a Circle or a circle-like object, with x, y and radius properties. * * @return {Phaser.Geom.Circle} A clone of the source Circle. */ diff --git a/src/geom/circle/ContainsPoint.js b/src/geom/circle/ContainsPoint.js index ad4ceea11..4e1af1e50 100644 --- a/src/geom/circle/ContainsPoint.js +++ b/src/geom/circle/ContainsPoint.js @@ -13,7 +13,7 @@ var Contains = require('./Contains'); * @since 3.0.0 * * @param {Phaser.Geom.Circle} circle - The Circle to check. - * @param {Phaser.Geom.Point|object} point - The Point object to check if it's within the Circle or not. + * @param {(Phaser.Geom.Point|object)} point - The Point object to check if it's within the Circle or not. * * @return {boolean} True if the Point coordinates are within the circle, otherwise false. */ diff --git a/src/geom/circle/ContainsRect.js b/src/geom/circle/ContainsRect.js index 8a38749d2..c19d8ede1 100644 --- a/src/geom/circle/ContainsRect.js +++ b/src/geom/circle/ContainsRect.js @@ -13,7 +13,7 @@ var Contains = require('./Contains'); * @since 3.0.0 * * @param {Phaser.Geom.Circle} circle - The Circle to check. - * @param {Phaser.Geom.Rectangle|object} rect - The Rectangle object to check if it's within the Circle or not. + * @param {(Phaser.Geom.Rectangle|object)} rect - The Rectangle object to check if it's within the Circle or not. * * @return {boolean} True if all of the Rectangle coordinates are within the circle, otherwise false. */ diff --git a/src/geom/circle/GetBounds.js b/src/geom/circle/GetBounds.js index 9813060ef..e0e8cef88 100644 --- a/src/geom/circle/GetBounds.js +++ b/src/geom/circle/GetBounds.js @@ -13,9 +13,9 @@ var Rectangle = require('../rectangle/Rectangle'); * @since 3.0.0 * * @param {Phaser.Geom.Circle} circle - The Circle to get the bounds from. - * @param {Phaser.Geom.Rectangle|object} [out] - A Rectangle, or rectangle-like object, to store the circle bounds in. If not given a new Rectangle will be created. + * @param {(Phaser.Geom.Rectangle|object)} [out] - A Rectangle, or rectangle-like object, to store the circle bounds in. If not given a new Rectangle will be created. * - * @return {Phaser.Geom.Rectangle|object} The Rectangle object containing the Circles bounds. + * @return {(Phaser.Geom.Rectangle|object)} The Rectangle object containing the Circles bounds. */ var GetBounds = function (circle, out) { diff --git a/src/geom/circle/GetPoint.js b/src/geom/circle/GetPoint.js index 53d62fc2b..3a76eee93 100644 --- a/src/geom/circle/GetPoint.js +++ b/src/geom/circle/GetPoint.js @@ -19,9 +19,9 @@ var Point = require('../point/Point'); * * @param {Phaser.Geom.Circle} circle - The Circle to get the circumference point on. * @param {float} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle. - * @param {Phaser.Geom.Point|object} [out] - An object to store the return values in. If not given a Point object will be created. + * @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created. * - * @return {Phaser.Geom.Point|object} A Point, or point-like object, containing the coordinates of the point around the circle. + * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the circle. */ var GetPoint = function (circle, position, out) { diff --git a/src/geom/circle/OffsetPoint.js b/src/geom/circle/OffsetPoint.js index a3fa88b6e..0af4b31ae 100644 --- a/src/geom/circle/OffsetPoint.js +++ b/src/geom/circle/OffsetPoint.js @@ -11,7 +11,7 @@ * @since 3.0.0 * * @param {Phaser.Geom.Circle} circle - The Circle to be offset (translated.) - * @param {Phaser.Geom.Point|object} point - The Point object containing the values to offset the Circle by. + * @param {(Phaser.Geom.Point|object)} point - The Point object containing the values to offset the Circle by. * * @return {Phaser.Geom.Circle} The Circle that was offset. */ diff --git a/src/geom/circle/Random.js b/src/geom/circle/Random.js index be8e4971d..e90c236c6 100644 --- a/src/geom/circle/Random.js +++ b/src/geom/circle/Random.js @@ -13,9 +13,9 @@ var Point = require('../point/Point'); * @since 3.0.0 * * @param {Phaser.Geom.Circle} circle - The Circle to get a random point from. - * @param {Phaser.Geom.Point|object} [point] - A Point or point-like object to set the random `x` and `y` values in. + * @param {(Phaser.Geom.Point|object)} [point] - A Point or point-like object to set the random `x` and `y` values in. * - * @return {Phaser.Geom.Point|object} A Point object with the random values set in the `x` and `y` properties. + * @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties. */ var Random = function (circle, out) { diff --git a/src/geom/ellipse/CircumferencePoint.js b/src/geom/ellipse/CircumferencePoint.js index 83666086a..234cf1bda 100644 --- a/src/geom/ellipse/CircumferencePoint.js +++ b/src/geom/ellipse/CircumferencePoint.js @@ -14,9 +14,9 @@ var Point = require('../point/Point'); * * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the circumference point on. * @param {number} angle - The angle from the center of the Ellipse to the circumference to return the point from. Given in radians. - * @param {Phaser.Geom.Point|object} [out] - A Point, or point-like object, to store the results in. If not given a Point will be created. + * @param {(Phaser.Geom.Point|object)} [out] - A Point, or point-like object, to store the results in. If not given a Point will be created. * - * @return {Phaser.Geom.Point|object} A Point object where the `x` and `y` properties are the point on the circumference. + * @return {(Phaser.Geom.Point|object)} A Point object where the `x` and `y` properties are the point on the circumference. */ var CircumferencePoint = function (ellipse, angle, out) { diff --git a/src/geom/ellipse/ContainsPoint.js b/src/geom/ellipse/ContainsPoint.js index 7819f8cc4..07731ff55 100644 --- a/src/geom/ellipse/ContainsPoint.js +++ b/src/geom/ellipse/ContainsPoint.js @@ -13,7 +13,7 @@ var Contains = require('./Contains'); * @since 3.0.0 * * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to check. - * @param {Phaser.Geom.Point|object} point - The Point object to check if it's within the Circle or not. + * @param {(Phaser.Geom.Point|object)} point - The Point object to check if it's within the Circle or not. * * @return {boolean} True if the Point coordinates are within the circle, otherwise false. */ diff --git a/src/geom/ellipse/ContainsRect.js b/src/geom/ellipse/ContainsRect.js index 076e1f8d7..a0bc1c5f0 100644 --- a/src/geom/ellipse/ContainsRect.js +++ b/src/geom/ellipse/ContainsRect.js @@ -13,7 +13,7 @@ var Contains = require('./Contains'); * @since 3.0.0 * * @param {Phaser.Geom.Ellipse} ellipse - [description] - * @param {Phaser.Geom.Rectangle|object} rect - The Rectangle object to check if it's within the Ellipse or not. + * @param {(Phaser.Geom.Rectangle|object)} rect - The Rectangle object to check if it's within the Ellipse or not. * * @return {boolean} True if all of the Rectangle coordinates are within the ellipse, otherwise false. */ diff --git a/src/geom/ellipse/Ellipse.js b/src/geom/ellipse/Ellipse.js index 45def242b..2c9171d83 100644 --- a/src/geom/ellipse/Ellipse.js +++ b/src/geom/ellipse/Ellipse.js @@ -105,9 +105,9 @@ var Ellipse = new Class({ * @since 3.0.0 * * @param {float} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the ellipse. - * @param {Phaser.Geom.Point|object} [out] - An object to store the return values in. If not given a Point object will be created. + * @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created. * - * @return {Phaser.Geom.Point|object} A Point, or point-like object, containing the coordinates of the point around the ellipse. + * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the ellipse. */ getPoint: function (position, point) { @@ -138,9 +138,9 @@ var Ellipse = new Class({ * @method Phaser.Geom.Ellipse#getRandomPoint * @since 3.0.0 * - * @param {Phaser.Geom.Point|object} [point] - A Point or point-like object to set the random `x` and `y` values in. + * @param {(Phaser.Geom.Point|object)} [point] - A Point or point-like object to set the random `x` and `y` values in. * - * @return {Phaser.Geom.Point|object} A Point object with the random values set in the `x` and `y` properties. + * @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties. */ getRandomPoint: function (point) { diff --git a/src/geom/ellipse/GetBounds.js b/src/geom/ellipse/GetBounds.js index 1e00e043b..4774239b3 100644 --- a/src/geom/ellipse/GetBounds.js +++ b/src/geom/ellipse/GetBounds.js @@ -13,9 +13,9 @@ var Rectangle = require('../rectangle/Rectangle'); * @since 3.0.0 * * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the bounds from. - * @param {Phaser.Geom.Rectangle|object} [out] - A Rectangle, or rectangle-like object, to store the ellipse bounds in. If not given a new Rectangle will be created. + * @param {(Phaser.Geom.Rectangle|object)} [out] - A Rectangle, or rectangle-like object, to store the ellipse bounds in. If not given a new Rectangle will be created. * - * @return {Phaser.Geom.Rectangle|object} The Rectangle object containing the Ellipse bounds. + * @return {(Phaser.Geom.Rectangle|object)} The Rectangle object containing the Ellipse bounds. */ var GetBounds = function (ellipse, out) { diff --git a/src/geom/ellipse/GetPoint.js b/src/geom/ellipse/GetPoint.js index b6a353ed6..48ab96b3d 100644 --- a/src/geom/ellipse/GetPoint.js +++ b/src/geom/ellipse/GetPoint.js @@ -19,9 +19,9 @@ var Point = require('../point/Point'); * * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the circumference point on. * @param {float} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the ellipse. - * @param {Phaser.Geom.Point|object} [out] - An object to store the return values in. If not given a Point object will be created. + * @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created. * - * @return {Phaser.Geom.Point|object} A Point, or point-like object, containing the coordinates of the point around the ellipse. + * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the ellipse. */ var GetPoint = function (ellipse, position, out) { diff --git a/src/geom/ellipse/OffsetPoint.js b/src/geom/ellipse/OffsetPoint.js index f63c5bb26..470b46e10 100644 --- a/src/geom/ellipse/OffsetPoint.js +++ b/src/geom/ellipse/OffsetPoint.js @@ -11,7 +11,7 @@ * @since 3.0.0 * * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to be offset (translated.) - * @param {Phaser.Geom.Point|object} point - The Point object containing the values to offset the Ellipse by. + * @param {(Phaser.Geom.Point|object)} point - The Point object containing the values to offset the Ellipse by. * * @return {Phaser.Geom.Ellipse} The Ellipse that was offset. */ diff --git a/src/geom/ellipse/Random.js b/src/geom/ellipse/Random.js index 291b1599d..f836bc1d6 100644 --- a/src/geom/ellipse/Random.js +++ b/src/geom/ellipse/Random.js @@ -13,9 +13,9 @@ var Point = require('../point/Point'); * @since 3.0.0 * * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get a random point from. - * @param {Phaser.Geom.Point|object} [point] - A Point or point-like object to set the random `x` and `y` values in. + * @param {(Phaser.Geom.Point|object)} [point] - A Point or point-like object to set the random `x` and `y` values in. * - * @return {Phaser.Geom.Point|object} A Point object with the random values set in the `x` and `y` properties. + * @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties. */ var Random = function (ellipse, out) { diff --git a/src/geom/intersects/LineToRectangle.js b/src/geom/intersects/LineToRectangle.js index 38474d297..b56d2c30e 100644 --- a/src/geom/intersects/LineToRectangle.js +++ b/src/geom/intersects/LineToRectangle.js @@ -19,7 +19,7 @@ * @since 3.0.0 * * @param {Phaser.Geom.Line} line - [description] - * @param {Phaser.Geom.Rectangle|object} rect - [description] + * @param {(Phaser.Geom.Rectangle|object)} rect - [description] * * @return {boolean} [description] */ diff --git a/src/geom/line/GetMidPoint.js b/src/geom/line/GetMidPoint.js index 9b5cda24c..376dcf865 100644 --- a/src/geom/line/GetMidPoint.js +++ b/src/geom/line/GetMidPoint.js @@ -13,9 +13,9 @@ var Point = require('../point/Point'); * @since 3.0.0 * * @param {Phaser.Geom.Line} line - [description] - * @param {Phaser.Geom.Point|object} [out] - [description] + * @param {(Phaser.Geom.Point|object)} [out] - [description] * - * @return {Phaser.Geom.Point|object} [description] + * @return {(Phaser.Geom.Point|object)} [description] */ var GetMidPoint = function (line, out) { diff --git a/src/geom/line/GetNormal.js b/src/geom/line/GetNormal.js index aaf85d463..cd54f5689 100644 --- a/src/geom/line/GetNormal.js +++ b/src/geom/line/GetNormal.js @@ -15,9 +15,9 @@ var Point = require('../point/Point'); * @since 3.0.0 * * @param {Phaser.Geom.Line} line - [description] - * @param {Phaser.Geom.Point|object} [out] - [description] + * @param {(Phaser.Geom.Point|object)} [out] - [description] * - * @return {Phaser.Geom.Point|object} [description] + * @return {(Phaser.Geom.Point|object)} [description] */ var GetNormal = function (line, out) { diff --git a/src/geom/line/GetPoint.js b/src/geom/line/GetPoint.js index 2a007a11f..a393889bd 100644 --- a/src/geom/line/GetPoint.js +++ b/src/geom/line/GetPoint.js @@ -17,9 +17,9 @@ var Point = require('../point/Point'); * * @param {Phaser.Geom.Line} line - [description] * @param {float} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle. - * @param {Phaser.Geom.Point|object} [out] - [description] + * @param {(Phaser.Geom.Point|object)} [out] - [description] * - * @return {Phaser.Geom.Point|object} [description] + * @return {(Phaser.Geom.Point|object)} [description] */ var GetPoint = function (line, position, out) { diff --git a/src/geom/line/Line.js b/src/geom/line/Line.js index 14ca7718b..0a564799a 100644 --- a/src/geom/line/Line.js +++ b/src/geom/line/Line.js @@ -79,9 +79,9 @@ var Line = new Class({ * @since 3.0.0 * * @param {float} position - [description] - * @param {Phaser.Geom.Point|object} [output] - [description] + * @param {(Phaser.Geom.Point|object)} [output] - [description] * - * @return {Phaser.Geom.Point|object} A Point, or point-like object, containing the coordinates of the point around the ellipse. + * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the ellipse. */ getPoint: function (position, output) { @@ -96,9 +96,9 @@ var Line = new Class({ * * @param {integer} quantity - [description] * @param {integer} [stepRate] - [description] - * @param {array|Phaser.Geom.Point[]} [output] - [description] + * @param {(array|Phaser.Geom.Point[])} [output] - [description] * - * @return {array|Phaser.Geom.Point[]} [description] + * @return {(array|Phaser.Geom.Point[])} [description] */ getPoints: function (quantity, stepRate, output) { @@ -111,7 +111,7 @@ var Line = new Class({ * @method Phaser.Geom.Line#getRandomPoint * @since 3.0.0 * - * @param {Phaser.Geom.Point|object} point - [description] + * @param {(Phaser.Geom.Point|object)} point - [description] * * @return {Phaser.Geom.Point} [description] */ diff --git a/src/geom/line/Random.js b/src/geom/line/Random.js index 2f03c414e..b035974e0 100644 --- a/src/geom/line/Random.js +++ b/src/geom/line/Random.js @@ -13,9 +13,9 @@ var Point = require('../point/Point'); * @since 3.0.0 * * @param {Phaser.Geom.Line} line - [description] - * @param {Phaser.Geom.Point|object} [out] - [description] + * @param {(Phaser.Geom.Point|object)} [out] - [description] * - * @return {Phaser.Geom.Point|object} [description] + * @return {(Phaser.Geom.Point|object)} [description] */ var Random = function (line, out) { diff --git a/src/geom/line/RotateAroundPoint.js b/src/geom/line/RotateAroundPoint.js index 6a3be00e6..4ba70119e 100644 --- a/src/geom/line/RotateAroundPoint.js +++ b/src/geom/line/RotateAroundPoint.js @@ -13,7 +13,7 @@ var RotateAroundXY = require('./RotateAroundXY'); * @since 3.0.0 * * @param {Phaser.Geom.Line} line - [description] - * @param {Phaser.Geom.Point|object} point - [description] + * @param {(Phaser.Geom.Point|object)} point - [description] * @param {number} angle - [description] * * @return {Phaser.Geom.Line} [description] diff --git a/src/geom/point/Interpolate.js b/src/geom/point/Interpolate.js index 5d2f8dbdd..3f33be868 100644 --- a/src/geom/point/Interpolate.js +++ b/src/geom/point/Interpolate.js @@ -15,9 +15,9 @@ var Point = require('./Point'); * @param {Phaser.Geom.Point} pointA - [description] * @param {Phaser.Geom.Point} pointB - [description] * @param {float} [t=0] - [description] - * @param {Phaser.Geom.Point|object} [out] - [description] + * @param {(Phaser.Geom.Point|object)} [out] - [description] * - * @return {Phaser.Geom.Point|object} [description] + * @return {(Phaser.Geom.Point|object)} [description] */ var Interpolate = function (pointA, pointB, t, out) { diff --git a/src/geom/polygon/GetAABB.js b/src/geom/polygon/GetAABB.js index b857b6def..03ed10580 100644 --- a/src/geom/polygon/GetAABB.js +++ b/src/geom/polygon/GetAABB.js @@ -13,9 +13,9 @@ var Rectangle = require('../rectangle/Rectangle'); * @since 3.0.0 * * @param {Phaser.Geom.Polygon} polygon - [description] - * @param {Phaser.Geom.Rectangle|object} [out] - [description] + * @param {(Phaser.Geom.Rectangle|object)} [out] - [description] * - * @return {Phaser.Geom.Rectangle|object} [description] + * @return {(Phaser.Geom.Rectangle|object)} [description] */ var GetAABB = function (polygon, out) { diff --git a/src/geom/rectangle/GetCenter.js b/src/geom/rectangle/GetCenter.js index b7aaa1bcf..9c5466e2a 100644 --- a/src/geom/rectangle/GetCenter.js +++ b/src/geom/rectangle/GetCenter.js @@ -15,9 +15,9 @@ var Point = require('../point/Point'); * @since 3.0.0 * * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {Phaser.Geom.Point|object} [out] - [description] + * @param {(Phaser.Geom.Point|object)} [out] - [description] * - * @return {Phaser.Geom.Point|object} [description] + * @return {(Phaser.Geom.Point|object)} [description] */ var GetCenter = function (rect, out) { diff --git a/src/geom/rectangle/GetPoint.js b/src/geom/rectangle/GetPoint.js index fc0fa6e47..5814d126a 100644 --- a/src/geom/rectangle/GetPoint.js +++ b/src/geom/rectangle/GetPoint.js @@ -15,7 +15,7 @@ var Point = require('../point/Point'); * * @param {Phaser.Geom.Rectangle} rectangle - [description] * @param {float} position - [description] - * @param {Phaser.Geom.Point|object} [out] - [description] + * @param {(Phaser.Geom.Point|object)} [out] - [description] * * @return {Phaser.Geom.Point} [description] */ diff --git a/src/geom/rectangle/GetSize.js b/src/geom/rectangle/GetSize.js index 38fc761ff..9103e4ab9 100644 --- a/src/geom/rectangle/GetSize.js +++ b/src/geom/rectangle/GetSize.js @@ -6,7 +6,7 @@ var Point = require('../point/Point'); -// The size of the Rectangle object, expressed as a Point object +// The size of the Rectangle object, expressed as a Point object // with the values of the width and height properties. /** @@ -16,9 +16,9 @@ var Point = require('../point/Point'); * @since 3.0.0 * * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {Phaser.Geom.Point|object} [out] - [description] + * @param {(Phaser.Geom.Point|object)} [out] - [description] * - * @return {Phaser.Geom.Point|object} [description] + * @return {(Phaser.Geom.Point|object)} [description] */ var GetSize = function (rect, out) { diff --git a/src/geom/rectangle/Rectangle.js b/src/geom/rectangle/Rectangle.js index f91c08634..62fefd479 100644 --- a/src/geom/rectangle/Rectangle.js +++ b/src/geom/rectangle/Rectangle.js @@ -100,9 +100,9 @@ var Rectangle = new Class({ * @since 3.0.0 * * @param {float} position - [description] - * @param {Phaser.Geom.Point|object} output - [description] + * @param {(Phaser.Geom.Point|object)} output - [description] * - * @return {Phaser.Geom.Point|object} [description] + * @return {(Phaser.Geom.Point|object)} [description] */ getPoint: function (position, output) { @@ -117,9 +117,9 @@ var Rectangle = new Class({ * * @param {integer} quantity - [description] * @param {number} [stepRate] - [description] - * @param {array|Phaser.Geom.Point[]} [output] - [description] + * @param {(array|Phaser.Geom.Point[])} [output] - [description] * - * @return {array|Phaser.Geom.Point[]} [description] + * @return {(array|Phaser.Geom.Point[])} [description] */ getPoints: function (quantity, stepRate, output) { diff --git a/src/geom/triangle/Centroid.js b/src/geom/triangle/Centroid.js index c5ce45e51..1b75ce4cf 100644 --- a/src/geom/triangle/Centroid.js +++ b/src/geom/triangle/Centroid.js @@ -17,9 +17,9 @@ var Point = require('../point/Point'); * @since 3.0.0 * * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {Phaser.Geom.Point|object} [out] - [description] + * @param {(Phaser.Geom.Point|object)} [out] - [description] * - * @return {Phaser.Geom.Point|object} [description] + * @return {(Phaser.Geom.Point|object)} [description] */ var Centroid = function (triangle, out) { diff --git a/src/geom/triangle/GetPoint.js b/src/geom/triangle/GetPoint.js index fa6cf1cf7..8791a0e14 100644 --- a/src/geom/triangle/GetPoint.js +++ b/src/geom/triangle/GetPoint.js @@ -16,9 +16,9 @@ var Length = require('../line/Length'); * * @param {Phaser.Geom.Triangle} triangle - [description] * @param {float} position - [description] - * @param {Phaser.Geom.Point|object} out - [description] + * @param {(Phaser.Geom.Point|object)} out - [description] * - * @return {Phaser.Geom.Point|object} [description] + * @return {(Phaser.Geom.Point|object)} [description] */ var GetPoint = function (triangle, position, out) { diff --git a/src/geom/triangle/GetPoints.js b/src/geom/triangle/GetPoints.js index 8514f9613..150e62dc4 100644 --- a/src/geom/triangle/GetPoints.js +++ b/src/geom/triangle/GetPoints.js @@ -16,9 +16,9 @@ var Point = require('../point/Point'); * @param {Phaser.Geom.Triangle} triangle - [description] * @param {integer} quantity - [description] * @param {number} stepRate - [description] - * @param {array|Phaser.Geom.Point[]} out - [description] + * @param {(array|Phaser.Geom.Point[])} out - [description] * - * @return {array|Phaser.Geom.Point[]} [description] + * @return {(array|Phaser.Geom.Point[])} [description] */ var GetPoints = function (triangle, quantity, stepRate, out) { diff --git a/src/geom/triangle/Triangle.js b/src/geom/triangle/Triangle.js index eb55ba5cb..bc989126a 100644 --- a/src/geom/triangle/Triangle.js +++ b/src/geom/triangle/Triangle.js @@ -126,9 +126,9 @@ var Triangle = new Class({ * @since 3.0.0 * * @param {float} position - [description] - * @param {Phaser.Geom.Point|object} output - [description] + * @param {(Phaser.Geom.Point|object)} output - [description] * - * @return {Phaser.Geom.Point|object} [description] + * @return {(Phaser.Geom.Point|object)} [description] */ getPoint: function (position, output) { @@ -143,9 +143,9 @@ var Triangle = new Class({ * * @param {integer} quantity - [description] * @param {number} [stepRate] - [description] - * @param {array|Phaser.Geom.Point[]} [output] - [description] + * @param {(array|Phaser.Geom.Point[])} [output] - [description] * - * @return {array|Phaser.Geom.Point[]} [description] + * @return {(array|Phaser.Geom.Point[])} [description] */ getPoints: function (quantity, stepRate, output) { From 7e05b333a0b7f175792c794cf82af2b5b3a09be5 Mon Sep 17 00:00:00 2001 From: orblazer Date: Tue, 20 Mar 2018 16:06:30 +0100 Subject: [PATCH 6/9] Fix multiple types on Math --- src/math/Matrix3.js | 6 ++-- src/math/Matrix4.js | 6 ++-- src/math/Quaternion.js | 28 +++++++++---------- src/math/Rotate.js | 2 +- src/math/RotateAround.js | 2 +- src/math/RotateAroundDistance.js | 2 +- src/math/TransformXY.js | 4 +-- src/math/Vector2.js | 6 ++-- src/math/Vector3.js | 18 ++++++------ src/math/Vector4.js | 14 +++++----- src/math/angle/BetweenPoints.js | 4 +-- src/math/angle/BetweenPointsY.js | 4 +-- .../RandomDataGenerator.js | 2 +- 13 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/math/Matrix3.js b/src/math/Matrix3.js index 50efda1dc..442f606d6 100644 --- a/src/math/Matrix3.js +++ b/src/math/Matrix3.js @@ -4,7 +4,7 @@ * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = require('../utils/Class'); @@ -375,7 +375,7 @@ var Matrix3 = new Class({ * @method Phaser.Math.Matrix3#translate * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - [description] * * @return {Phaser.Math.Matrix3} This Matrix3 object. */ @@ -433,7 +433,7 @@ var Matrix3 = new Class({ * @method Phaser.Math.Matrix3#scale * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - [description] * * @return {Phaser.Math.Matrix3} This Matrix3 object. */ diff --git a/src/math/Matrix4.js b/src/math/Matrix4.js index d520044a0..83965a2b2 100644 --- a/src/math/Matrix4.js +++ b/src/math/Matrix4.js @@ -601,7 +601,7 @@ var Matrix4 = new Class({ * @method Phaser.Math.Matrix4#translate * @since 3.0.0 * - * @param {Phaser.Math.Vector3|Phaser.Math.Vector4} v - [description] + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - [description] * * @return {Phaser.Math.Matrix4} This Matrix4 object. */ @@ -626,7 +626,7 @@ var Matrix4 = new Class({ * @method Phaser.Math.Matrix4#scale * @since 3.0.0 * - * @param {Phaser.Math.Vector3|Phaser.Math.Vector4} v - [description] + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - [description] * * @return {Phaser.Math.Matrix4} This Matrix4 object. */ @@ -661,7 +661,7 @@ var Matrix4 = new Class({ * @method Phaser.Math.Matrix4#makeRotationAxis * @since 3.0.0 * - * @param {Phaser.Math.Vector3|Phaser.Math.Vector4} axis - [description] + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - [description] * @param {float} angle - The angle of rotation in radians. * * @return {Phaser.Math.Matrix4} This Matrix4 object. diff --git a/src/math/Quaternion.js b/src/math/Quaternion.js index b2115819e..eaa7c6c6e 100644 --- a/src/math/Quaternion.js +++ b/src/math/Quaternion.js @@ -4,7 +4,7 @@ * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = require('../utils/Class'); @@ -101,7 +101,7 @@ var Quaternion = new Class({ * @method Phaser.Math.Quaternion#copy * @since 3.0.0 * - * @param {Phaser.Math.Quaternion|Phaser.Math.Vector4} src - [description] + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - [description] * * @return {Phaser.Math.Quaternion} This Quaternion object. */ @@ -121,7 +121,7 @@ var Quaternion = new Class({ * @method Phaser.Math.Quaternion#set * @since 3.0.0 * - * @param {number|object} [x=0] - [description] + * @param {(number|object)} [x=0] - [description] * @param {number} [y=0] - [description] * @param {number} [z=0] - [description] * @param {number} [w=0] - [description] @@ -154,7 +154,7 @@ var Quaternion = new Class({ * @method Phaser.Math.Quaternion#add * @since 3.0.0 * - * @param {Phaser.Math.Quaternion|Phaser.Math.Vector4} v - [description] + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - [description] * * @return {Phaser.Math.Quaternion} This Quaternion object. */ @@ -174,7 +174,7 @@ var Quaternion = new Class({ * @method Phaser.Math.Quaternion#subtract * @since 3.0.0 * - * @param {Phaser.Math.Quaternion|Phaser.Math.Vector4} v - [description] + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - [description] * * @return {Phaser.Math.Quaternion} This Quaternion object. */ @@ -279,7 +279,7 @@ var Quaternion = new Class({ * @method Phaser.Math.Quaternion#dot * @since 3.0.0 * - * @param {Phaser.Math.Quaternion|Phaser.Math.Vector4} v - [description] + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - [description] * * @return {number} [description] */ @@ -294,7 +294,7 @@ var Quaternion = new Class({ * @method Phaser.Math.Quaternion#lerp * @since 3.0.0 * - * @param {Phaser.Math.Quaternion|Phaser.Math.Vector4} v - [description] + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - [description] * @param {number} [t=0] - [description] * * @return {Phaser.Math.Quaternion} This Quaternion object. @@ -337,7 +337,7 @@ var Quaternion = new Class({ { tmpvec.copy(yUnitVec3).cross(a); } - + tmpvec.normalize(); return this.setAxisAngle(tmpvec, Math.PI); @@ -445,7 +445,7 @@ var Quaternion = new Class({ * @method Phaser.Math.Quaternion#multiply * @since 3.0.0 * - * @param {Phaser.Math.Quaternion|Phaser.Math.Vector4} b - [description] + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - [description] * * @return {Phaser.Math.Quaternion} This Quaternion object. */ @@ -475,7 +475,7 @@ var Quaternion = new Class({ * @method Phaser.Math.Quaternion#slerp * @since 3.0.0 * - * @param {Phaser.Math.Quaternion|Phaser.Math.Vector4} b - [description] + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - [description] * @param {number} t - [description] * * @return {Phaser.Math.Quaternion} This Quaternion object. @@ -507,7 +507,7 @@ var Quaternion = new Class({ bw = - bw; } - // "from" and "to" quaternions are very close + // "from" and "to" quaternions are very close // ... so we can do a linear interpolation var scale0 = 1 - t; var scale1 = t; @@ -549,7 +549,7 @@ var Quaternion = new Class({ var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; var invDot = (dot) ? 1 / dot : 0; - + // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 this.x = -a0 * invDot; @@ -738,7 +738,7 @@ var Quaternion = new Class({ var j = siNext[i]; var k = siNext[j]; - + // This isn't quite as clean without array access fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); tmp[i] = 0.5 * fRoot; @@ -753,7 +753,7 @@ var Quaternion = new Class({ this.z = tmp[2]; this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; } - + return this; } diff --git a/src/math/Rotate.js b/src/math/Rotate.js index fd9a1a37f..3f4a3bb0d 100644 --- a/src/math/Rotate.js +++ b/src/math/Rotate.js @@ -10,7 +10,7 @@ * @function Phaser.Math.Rotate * @since 3.0.0 * - * @param {Phaser.Geom.Point|object} point - [description] + * @param {(Phaser.Geom.Point|object)} point - [description] * @param {number} angle - [description] * * @return {Phaser.Geom.Point} [description] diff --git a/src/math/RotateAround.js b/src/math/RotateAround.js index b2703fc27..a74f1eed4 100644 --- a/src/math/RotateAround.js +++ b/src/math/RotateAround.js @@ -10,7 +10,7 @@ * @function Phaser.Math.RotateAround * @since 3.0.0 * - * @param {Phaser.Geom.Point|object} point - [description] + * @param {(Phaser.Geom.Point|object)} point - [description] * @param {number} x - [description] * @param {number} y - [description] * @param {number} angle - [description] diff --git a/src/math/RotateAroundDistance.js b/src/math/RotateAroundDistance.js index 91225f955..69fd9f215 100644 --- a/src/math/RotateAroundDistance.js +++ b/src/math/RotateAroundDistance.js @@ -10,7 +10,7 @@ * @function Phaser.Math.RotateAroundDistance * @since 3.0.0 * - * @param {Phaser.Geom.Point|object} point - The Point to be rotated. + * @param {(Phaser.Geom.Point|object)} point - The Point to be rotated. * @param {number} x - The horizontal coordinate to rotate around. * @param {number} y - The vertical coordinate to rotate around. * @param {number} angle - The angle of rotation in radians. diff --git a/src/math/TransformXY.js b/src/math/TransformXY.js index 6d762fc20..748c5bfb9 100644 --- a/src/math/TransformXY.js +++ b/src/math/TransformXY.js @@ -20,9 +20,9 @@ var Vector2 = require('./Vector2'); * @param {number} rotation - Rotation of the transform point, in radians. * @param {number} scaleX - Horizontal scale of the transform point. * @param {number} scaleY - Vertical scale of the transform point. - * @param {Vector2|Point|object} [output] - [description] + * @param {(Vector2|Point|object)} [output] - [description] * - * @return {Vector2|Point|object} The translated point. + * @return {(Vector2|Point|object)} The translated point. */ var TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output) { diff --git a/src/math/Vector2.js b/src/math/Vector2.js index 8a9b1428f..b98d09b03 100644 --- a/src/math/Vector2.js +++ b/src/math/Vector2.js @@ -4,7 +4,7 @@ * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = require('../utils/Class'); @@ -78,7 +78,7 @@ var Vector2 = new Class({ * @method Phaser.Math.Vector2#copy * @since 3.0.0 * - * @param {Phaser.Math.Vector2|object} src - [description] + * @param {(Phaser.Math.Vector2|object)} src - [description] * * @return {Phaser.Math.Vector2} This Vector2. */ @@ -389,7 +389,7 @@ var Vector2 = new Class({ this.x = x * len; this.y = y * len; } - + return this; }, diff --git a/src/math/Vector3.js b/src/math/Vector3.js index d2958a3e4..2c2a8e448 100644 --- a/src/math/Vector3.js +++ b/src/math/Vector3.js @@ -147,7 +147,7 @@ var Vector3 = new Class({ * @method Phaser.Math.Vector3#copy * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3} src - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - [description] * * @return {Phaser.Math.Vector3} This Vector3 object. */ @@ -166,7 +166,7 @@ var Vector3 = new Class({ * @method Phaser.Math.Vector3#set * @since 3.0.0 * - * @param {number|object} x - [description] + * @param {(number|object)} x - [description] * @param {number} [y] - [description] * @param {number} [z] - [description] * @@ -196,7 +196,7 @@ var Vector3 = new Class({ * @method Phaser.Math.Vector3#add * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - [description] * * @return {Phaser.Math.Vector3} This Vector3 object. */ @@ -215,7 +215,7 @@ var Vector3 = new Class({ * @method Phaser.Math.Vector3#subtract * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - [description] * * @return {Phaser.Math.Vector3} This Vector3 object. */ @@ -234,7 +234,7 @@ var Vector3 = new Class({ * @method Phaser.Math.Vector3#multiply * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - [description] * * @return {Phaser.Math.Vector3} This Vector3 object. */ @@ -281,7 +281,7 @@ var Vector3 = new Class({ * @method Phaser.Math.Vector3#divide * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - [description] * * @return {Phaser.Math.Vector3} This Vector3 object. */ @@ -317,7 +317,7 @@ var Vector3 = new Class({ * @method Phaser.Math.Vector3#distance * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - [description] * * @return {number} [description] */ @@ -336,7 +336,7 @@ var Vector3 = new Class({ * @method Phaser.Math.Vector3#distanceSq * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - [description] * * @return {number} [description] */ @@ -389,7 +389,7 @@ var Vector3 = new Class({ * @method Phaser.Math.Vector3#normalize * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - [description] * * @return {Phaser.Math.Vector3} This Vector3 object. */ diff --git a/src/math/Vector4.js b/src/math/Vector4.js index f718b19d8..42da625ba 100644 --- a/src/math/Vector4.js +++ b/src/math/Vector4.js @@ -4,7 +4,7 @@ * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = require('../utils/Class'); @@ -168,7 +168,7 @@ var Vector4 = new Class({ * @method Phaser.Math.Vector4#add * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - [description] * * @return {Phaser.Math.Vector4} This Vector4 object. */ @@ -188,7 +188,7 @@ var Vector4 = new Class({ * @method Phaser.Math.Vector4#subtract * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - [description] * * @return {Phaser.Math.Vector4} This Vector4 object. */ @@ -336,7 +336,7 @@ var Vector4 = new Class({ * @method Phaser.Math.Vector4#multiply * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - [description] * * @return {Phaser.Math.Vector4} This Vector4 object. */ @@ -356,7 +356,7 @@ var Vector4 = new Class({ * @method Phaser.Math.Vector4#divide * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - [description] * * @return {Phaser.Math.Vector4} This Vector4 object. */ @@ -376,7 +376,7 @@ var Vector4 = new Class({ * @method Phaser.Math.Vector4#distance * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - [description] * * @return {number} [description] */ @@ -396,7 +396,7 @@ var Vector4 = new Class({ * @method Phaser.Math.Vector4#distanceSq * @since 3.0.0 * - * @param {Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - [description] * * @return {number} [description] */ diff --git a/src/math/angle/BetweenPoints.js b/src/math/angle/BetweenPoints.js index 3d44deacb..b9977be40 100644 --- a/src/math/angle/BetweenPoints.js +++ b/src/math/angle/BetweenPoints.js @@ -10,8 +10,8 @@ * @function Phaser.Math.Angle.BetweenPoints * @since 3.0.0 * - * @param {Phaser.Geom.Point|object} point1 - [description] - * @param {Phaser.Geom.Point|object} point2 - [description] + * @param {(Phaser.Geom.Point|object)} point1 - [description] + * @param {(Phaser.Geom.Point|object)} point2 - [description] * * @return {number} [description] */ diff --git a/src/math/angle/BetweenPointsY.js b/src/math/angle/BetweenPointsY.js index e1e392df0..7a597dfba 100644 --- a/src/math/angle/BetweenPointsY.js +++ b/src/math/angle/BetweenPointsY.js @@ -10,8 +10,8 @@ * @function Phaser.Math.Angle.BetweenPointsY * @since 3.0.0 * - * @param {Phaser.Geom.Point|object} point1 - [description] - * @param {Phaser.Geom.Point|object} point2 - [description] + * @param {(Phaser.Geom.Point|object)} point1 - [description] + * @param {(Phaser.Geom.Point|object)} point2 - [description] * * @return {number} [description] */ diff --git a/src/math/random-data-generator/RandomDataGenerator.js b/src/math/random-data-generator/RandomDataGenerator.js index eca758f57..b6ff7a5bf 100644 --- a/src/math/random-data-generator/RandomDataGenerator.js +++ b/src/math/random-data-generator/RandomDataGenerator.js @@ -155,7 +155,7 @@ var RandomDataGenerator = new Class({ * @method Phaser.Math.RandomDataGenerator#init * @since 3.0.0 * - * @param {string|array} seeds - [description] + * @param {(string|array)} seeds - [description] */ init: function (seeds) { From dca79961796b77362a9fd1df06c7a17c84ac0321 Mon Sep 17 00:00:00 2001 From: orblazer Date: Tue, 20 Mar 2018 16:10:19 +0100 Subject: [PATCH 7/9] Fix multiple types on Physics, Texture and Input --- src/input/InputPlugin.js | 14 ++++++------ src/input/Pointer.js | 4 ++-- src/input/keyboard/KeyboardManager.js | 10 ++++----- src/input/keyboard/combo/KeyCombo.js | 2 +- src/physics/arcade/ArcadeImage.js | 4 ++-- src/physics/arcade/ArcadePhysics.js | 8 +++---- src/physics/arcade/ArcadeSprite.js | 2 +- src/physics/arcade/Factory.js | 8 +++---- src/physics/arcade/World.js | 8 +++---- src/physics/arcade/tilemap/SeparateTile.js | 2 +- src/physics/impact/Factory.js | 4 ++-- src/physics/impact/ImpactImage.js | 2 +- src/physics/impact/ImpactSprite.js | 2 +- src/physics/impact/World.js | 4 ++-- src/physics/matter-js/Factory.js | 6 ++--- src/physics/matter-js/MatterImage.js | 2 +- src/physics/matter-js/MatterSprite.js | 2 +- src/physics/matter-js/World.js | 4 ++-- src/physics/matter-js/components/Collision.js | 2 +- .../matter-js/lib/plugins/MatterAttractors.js | 14 ++++++------ src/textures/Frame.js | 18 +++++++-------- src/textures/Texture.js | 22 +++++++++---------- src/textures/TextureManager.js | 8 +++---- src/textures/TextureSource.js | 6 ++--- 24 files changed, 79 insertions(+), 79 deletions(-) diff --git a/src/input/InputPlugin.js b/src/input/InputPlugin.js index 27dad065b..3b550939c 100644 --- a/src/input/InputPlugin.js +++ b/src/input/InputPlugin.js @@ -1010,7 +1010,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#setDraggable * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to change the draggable state on. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to change the draggable state on. * @param {boolean} [value=true] - Set to `true` if the Game Objects should be made draggable, `false` if they should be unset. * * @return {Phaser.Input.InputPlugin} This InputPlugin object. @@ -1051,7 +1051,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#setHitArea * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set the hit area on. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set the hit area on. * @param {object} [shape] - The shape or object to check if the pointer is within for hit area checks. * @param {HitAreaCallback} [callback] - The 'contains' function to invoke to check if the pointer is within the hit area. * @@ -1087,7 +1087,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#setHitAreaCircle * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having a circle hit area. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a circle hit area. * @param {number} x - The center of the circle. * @param {number} y - The center of the circle. * @param {number} radius - The radius of the circle. @@ -1110,7 +1110,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#setHitAreaEllipse * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having an ellipse hit area. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having an ellipse hit area. * @param {number} x - The center of the ellipse. * @param {number} y - The center of the ellipse. * @param {number} width - The width of the ellipse. @@ -1134,7 +1134,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#setHitAreaFromTexture * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having an ellipse hit area. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having an ellipse hit area. * @param {HitAreaCallback} [callback] - The hit area callback. If undefined it uses Rectangle.Contains. * * @return {Phaser.Input.InputPlugin} This InputPlugin object. @@ -1184,7 +1184,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#setHitAreaRectangle * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having a rectangular hit area. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a rectangular hit area. * @param {number} x - The top-left of the rectangle. * @param {number} y - The top-left of the rectangle. * @param {number} width - The width of the rectangle. @@ -1208,7 +1208,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#setHitAreaTriangle * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having a triangular hit area. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a triangular hit area. * @param {number} x1 - The x coordinate of the first point of the triangle. * @param {number} y1 - The y coordinate of the first point of the triangle. * @param {number} x2 - The x coordinate of the second point of the triangle. diff --git a/src/input/Pointer.js b/src/input/Pointer.js index 670176a27..cba2e313b 100644 --- a/src/input/Pointer.js +++ b/src/input/Pointer.js @@ -270,9 +270,9 @@ var Pointer = new Class({ * @since 3.0.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] - * @param {Phaser.Math.Vector2|object} output - [description] + * @param {(Phaser.Math.Vector2|object)} output - [description] * - * @return {Phaser.Math.Vector2|object} [description] + * @return {(Phaser.Math.Vector2|object)} [description] */ positionToCamera: function (camera, output) { diff --git a/src/input/keyboard/KeyboardManager.js b/src/input/keyboard/KeyboardManager.js index 21c250573..f20d1b00b 100644 --- a/src/input/keyboard/KeyboardManager.js +++ b/src/input/keyboard/KeyboardManager.js @@ -239,7 +239,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#addKey * @since 3.0.0 * - * @param {string|integer} keyCode - [description] + * @param {(string|integer)} keyCode - [description] * * @return {Phaser.Input.Keyboard.Key} [description] */ @@ -262,7 +262,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#removeKey * @since 3.0.0 * - * @param {string|integer} keyCode - [description] + * @param {(string|integer)} keyCode - [description] */ removeKey: function (keyCode) { @@ -279,7 +279,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#addKeyCapture * @since 3.0.0 * - * @param {string|integer|string[]|integer[]} keyCodes - [description] + * @param {(string|integer|string[]|integer[])} keyCodes - [description] */ addKeyCapture: function (keyCodes) { @@ -300,7 +300,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#removeKeyCapture * @since 3.0.0 * - * @param {string|integer|string[]|integer[]} keyCodes - [description] + * @param {(string|integer|string[]|integer[])} keyCodes - [description] */ removeKeyCapture: function (keyCodes) { @@ -321,7 +321,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#createCombo * @since 3.0.0 * - * @param {string|integer[]|object[]} keys - [description] + * @param {(string|integer[]|object[])} keys - [description] * @param {object} config - [description] * * @return {Phaser.Input.Keyboard.KeyCombo} [description] diff --git a/src/input/keyboard/combo/KeyCombo.js b/src/input/keyboard/combo/KeyCombo.js index 4b41c44b1..6f2791a37 100644 --- a/src/input/keyboard/combo/KeyCombo.js +++ b/src/input/keyboard/combo/KeyCombo.js @@ -31,7 +31,7 @@ var ResetKeyCombo = require('./ResetKeyCombo'); * @since 3.0.0 * * @param {Phaser.Input.Keyboard.KeyboardManager} keyboardManager - [description] - * @param {string|integer[]|object[]} keys - [description] + * @param {(string|integer[]|object[])} keys - [description] * @param {object} [config] - [description] */ var KeyCombo = new Class({ diff --git a/src/physics/arcade/ArcadeImage.js b/src/physics/arcade/ArcadeImage.js index 3fd39254e..828f3d9da 100644 --- a/src/physics/arcade/ArcadeImage.js +++ b/src/physics/arcade/ArcadeImage.js @@ -11,7 +11,7 @@ var Image = require('../../gameobjects/image/Image'); /** * @classdesc * An Arcade Physics Image Game Object. - * + * * An Image is a light-weight Game Object useful for the display of static images in your game, * such as logos, backgrounds, scenery or other non-animated elements. Images can have input * 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'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ArcadeImage = new Class({ diff --git a/src/physics/arcade/ArcadePhysics.js b/src/physics/arcade/ArcadePhysics.js index 54420d02d..77cf1c0ff 100644 --- a/src/physics/arcade/ArcadePhysics.js +++ b/src/physics/arcade/ArcadePhysics.js @@ -142,8 +142,8 @@ var ArcadePhysics = new Class({ * @method Phaser.Physics.Arcade.ArcadePhysics#overlap * @since 3.0.0 * - * @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. - * @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. + * @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. + * @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. * @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. * @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`. * @param {object} [callbackContext] - The context in which to run the callbacks. @@ -165,8 +165,8 @@ var ArcadePhysics = new Class({ * @method Phaser.Physics.Arcade.ArcadePhysics#collide * @since 3.0.0 * - * @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. - * @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. + * @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. + * @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. * @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. * @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`. * @param {object} [callbackContext] - The context in which to run the callbacks. diff --git a/src/physics/arcade/ArcadeSprite.js b/src/physics/arcade/ArcadeSprite.js index c31204c35..5530a1a8d 100644 --- a/src/physics/arcade/ArcadeSprite.js +++ b/src/physics/arcade/ArcadeSprite.js @@ -58,7 +58,7 @@ var Sprite = require('../../gameobjects/sprite/Sprite'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ArcadeSprite = new Class({ diff --git a/src/physics/arcade/Factory.js b/src/physics/arcade/Factory.js index 90c186164..624ae33f3 100644 --- a/src/physics/arcade/Factory.js +++ b/src/physics/arcade/Factory.js @@ -124,7 +124,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Physics.Arcade.Image} The Image object that was created. */ @@ -148,7 +148,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Physics.Arcade.Image} The Image object that was created. */ @@ -172,7 +172,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Physics.Arcade.Sprite} The Sprite object that was created. */ @@ -197,7 +197,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Physics.Arcade.Sprite} The Sprite object that was created. */ diff --git a/src/physics/arcade/World.js b/src/physics/arcade/World.js index 297fa07d1..292c2f9c3 100644 --- a/src/physics/arcade/World.js +++ b/src/physics/arcade/World.js @@ -267,7 +267,7 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#enable * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} object - [description] + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} object - [description] * @param {integer} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. */ enable: function (object, bodyType) @@ -357,7 +357,7 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#disable * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} object - [description] + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} object - [description] */ disable: function (object) { @@ -1531,7 +1531,7 @@ var World = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.Group} group - [description] - * @param {Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} tilemapLayer - [description] + * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - [description] * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {object} callbackContext - [description] @@ -1571,7 +1571,7 @@ var World = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.GameObject} sprite - [description] - * @param {Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} tilemapLayer - [description] + * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - [description] * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {object} callbackContext - [description] diff --git a/src/physics/arcade/tilemap/SeparateTile.js b/src/physics/arcade/tilemap/SeparateTile.js index 4644c7740..ef94f5451 100644 --- a/src/physics/arcade/tilemap/SeparateTile.js +++ b/src/physics/arcade/tilemap/SeparateTile.js @@ -18,7 +18,7 @@ var TileIntersectsBody = require('./TileIntersectsBody'); * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tilemaps.Tile} tile - The tile to collide against. * @param {Phaser.Geom.Rectangle} tileWorldRect - [description] - * @param {Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} tilemapLayer - The tilemapLayer to collide against. + * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The tilemapLayer to collide against. * @param {number} tileBias - [description] * * @return {boolean} Returns true if the body was separated, otherwise false. diff --git a/src/physics/impact/Factory.js b/src/physics/impact/Factory.js index 92bbee070..c8242d579 100644 --- a/src/physics/impact/Factory.js +++ b/src/physics/impact/Factory.js @@ -98,7 +98,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Physics.Impact.ImpactImage} The ImpactImage object that was created. */ @@ -120,7 +120,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Physics.Impact.ImpactSprite} The ImpactSprite object that was created. */ diff --git a/src/physics/impact/ImpactImage.js b/src/physics/impact/ImpactImage.js index 4a805d583..09fe6b09a 100644 --- a/src/physics/impact/ImpactImage.js +++ b/src/physics/impact/ImpactImage.js @@ -54,7 +54,7 @@ var Image = require('../../gameobjects/image/Image'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ImpactImage = new Class({ diff --git a/src/physics/impact/ImpactSprite.js b/src/physics/impact/ImpactSprite.js index 8e43c3d92..441d7826b 100644 --- a/src/physics/impact/ImpactSprite.js +++ b/src/physics/impact/ImpactSprite.js @@ -58,7 +58,7 @@ var Sprite = require('../../gameobjects/sprite/Sprite'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ImpactSprite = new Class({ diff --git a/src/physics/impact/World.js b/src/physics/impact/World.js index 0c5a5cd7c..92c129649 100644 --- a/src/physics/impact/World.js +++ b/src/physics/impact/World.js @@ -222,7 +222,7 @@ var World = new Class({ * @method Phaser.Physics.Impact.World#setCollisionMap * @since 3.0.0 * - * @param {string|integer[][]} key - Either a string key that corresponds to a Weltmeister level + * @param {(string|integer[][])} key - Either a string key that corresponds to a Weltmeister level * in the cache, or a 2D array of collision IDs. * @param {integer} tileSize - The size of a tile. This is optional if loading from a Weltmeister * level in the cache. @@ -278,7 +278,7 @@ var World = new Class({ * @method Phaser.Physics.Impact.World#setCollisionMapFromTilemapLayer * @since 3.0.0 * - * @param {StaticTilemapLayer|DynamicTilemapLayer} tilemapLayer - The tilemap layer to use. + * @param {(StaticTilemapLayer|DynamicTilemapLayer)} tilemapLayer - The tilemap layer to use. * @param {object} [options] - Options for controlling the mapping from tiles to slope IDs. * @param {string} [options.slopeTileProperty=null] - Slope IDs can be stored on tiles directly * using Tiled's tileset editor. If a tile has a property with the given slopeTileProperty string diff --git a/src/physics/matter-js/Factory.js b/src/physics/matter-js/Factory.js index 47377c5be..0b567bd7b 100644 --- a/src/physics/matter-js/Factory.js +++ b/src/physics/matter-js/Factory.js @@ -185,7 +185,7 @@ var Factory = new Class({ * @since 3.0.0 * * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {number} x - The horizontal position of this composite in the world. * @param {number} y - The vertical position of this composite in the world. * @param {number} columns - The number of columns in the grid. @@ -527,7 +527,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {object} options - [description] * * @return {Phaser.Physics.Matter.MatterImage} [description] @@ -568,7 +568,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {object} options - [description] * * @return {Phaser.Physics.Matter.MatterSprite} [description] diff --git a/src/physics/matter-js/MatterImage.js b/src/physics/matter-js/MatterImage.js index debbcaf73..1b1051d5f 100644 --- a/src/physics/matter-js/MatterImage.js +++ b/src/physics/matter-js/MatterImage.js @@ -59,7 +59,7 @@ var Vector2 = require('../../math/Vector2'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {object} options - [description] */ var MatterImage = new Class({ diff --git a/src/physics/matter-js/MatterSprite.js b/src/physics/matter-js/MatterSprite.js index f7c20334b..c24eddcb2 100644 --- a/src/physics/matter-js/MatterSprite.js +++ b/src/physics/matter-js/MatterSprite.js @@ -64,7 +64,7 @@ var Vector2 = require('../../math/Vector2'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {object} options - [description] */ var MatterSprite = new Class({ diff --git a/src/physics/matter-js/World.js b/src/physics/matter-js/World.js index 2f1ee9616..a2eafcf4c 100644 --- a/src/physics/matter-js/World.js +++ b/src/physics/matter-js/World.js @@ -418,7 +418,7 @@ var World = new Class({ * @method Phaser.Physics.Matter.World#add * @since 3.0.0 * - * @param {object|object[]} object - Can be single or an array, and can be a body, composite or constraint + * @param {(object|object[])} object - Can be single or an array, and can be a body, composite or constraint * * @return {Phaser.Physics.Matter.World} This Matter World object. */ @@ -474,7 +474,7 @@ var World = new Class({ * @method Phaser.Physics.Matter.World#convertTilemapLayer * @since 3.0.0 * - * @param {Phaser.GameObjects.StaticTilemapLayer|Phaser.GameObjects.DynamicTilemapLayer} tilemapLayer - + * @param {(Phaser.GameObjects.StaticTilemapLayer|Phaser.GameObjects.DynamicTilemapLayer)} tilemapLayer - * An array of tiles. * @param {object} [options] - Options to be passed to the MatterTileBody constructor. {@ee Phaser.Physics.Matter.TileBody} * diff --git a/src/physics/matter-js/components/Collision.js b/src/physics/matter-js/components/Collision.js index 2384c679f..5843eda57 100644 --- a/src/physics/matter-js/components/Collision.js +++ b/src/physics/matter-js/components/Collision.js @@ -52,7 +52,7 @@ var Collision = { * @method Phaser.Physics.Matter.Components.Collision#setCollidesWith * @since 3.0.0 * - * @param {number|number[]} categories - A unique category bitfield, or an array of them. + * @param {(number|number[])} categories - A unique category bitfield, or an array of them. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ diff --git a/src/physics/matter-js/lib/plugins/MatterAttractors.js b/src/physics/matter-js/lib/plugins/MatterAttractors.js index a4c40dbba..df13db45f 100644 --- a/src/physics/matter-js/lib/plugins/MatterAttractors.js +++ b/src/physics/matter-js/lib/plugins/MatterAttractors.js @@ -64,7 +64,7 @@ var MatterAttractors = { if (Matter.Common.isFunction(attractor)) { forceVector = attractor(bodyA, bodyB); } - + if (forceVector) { Matter.Body.applyForce(bodyB, bodyB.position, forceVector); } @@ -74,9 +74,9 @@ var MatterAttractors = { } } }, - + /** - * Defines some useful common attractor functions that can be used + * Defines some useful common attractor functions that can be used * by pushing them to your body's `body.plugin.attractors` array. * @namespace MatterAttractors.Attractors * @property {number} gravityConstant The gravitational constant used by the gravity attractor. @@ -87,7 +87,7 @@ var MatterAttractors = { /** * An attractor function that applies Newton's law of gravitation. * Use this by pushing `MatterAttractors.Attractors.gravity` to your body's `body.plugin.attractors` array. - * The gravitational constant defaults to `0.001` which you can change + * The gravitational constant defaults to `0.001` which you can change * at `MatterAttractors.Attractors.gravityConstant`. * @function MatterAttractors.Attractors.gravity * @param {Matter.Body} bodyA The first body. @@ -117,7 +117,7 @@ module.exports = MatterAttractors; */ /** - * This plugin adds a new property `body.plugin.attractors` to instances of `Matter.Body`. + * This plugin adds a new property `body.plugin.attractors` to instances of `Matter.Body`. * This is an array of callback functions that will be called automatically * for every pair of bodies, on every engine update. * @property {Function[]} body.plugin.attractors @@ -132,5 +132,5 @@ module.exports = MatterAttractors; * @callback AttractorFunction * @param {Matter.Body} bodyA * @param {Matter.Body} bodyB - * @returns {Vector|undefined} a force vector (optional) - */ \ No newline at end of file + * @returns {(Vector|undefined)} a force vector (optional) + */ diff --git a/src/textures/Frame.js b/src/textures/Frame.js index af1c17f2f..4a2cdf443 100644 --- a/src/textures/Frame.js +++ b/src/textures/Frame.js @@ -17,7 +17,7 @@ var Extend = require('../utils/object/Extend'); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture this Frame is a part of. - * @param {integer|string} name - The name of this Frame. The name is unique within the Texture. + * @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture. * @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of. * @param {number} x - The x coordinate of the top-left of this Frame. * @param {number} y - The y coordinate of the top-left of this Frame. @@ -211,7 +211,7 @@ var Frame = new Class({ /** * **CURRENTLY UNSUPPORTED** - * + * * Is this frame is rotated or not in the Texture? * Rotation allows you to use rotated frames in texture atlas packing. * It has nothing to do with Sprite rotation. @@ -374,7 +374,7 @@ var Frame = new Class({ var tw = this.source.width; var th = this.source.height; var uvs = this.data.uvs; - + uvs.x0 = cx / tw; uvs.y0 = cy / th; @@ -403,16 +403,16 @@ var Frame = new Class({ var tw = this.source.width; var th = this.source.height; var uvs = this.data.uvs; - + uvs.x3 = (this.cutX + this.cutHeight) / tw; uvs.y3 = (this.cutY + this.cutWidth) / th; uvs.x2 = this.cutX / tw; uvs.y2 = (this.cutY + this.cutWidth) / th; - + uvs.x1 = this.cutX / tw; uvs.y1 = this.cutY / th; - + uvs.x0 = (this.cutX + this.cutHeight) / tw; uvs.y0 = this.cutY / th; @@ -525,7 +525,7 @@ var Frame = new Class({ /** * The radius of the Frame (derived from sqrt(w * w + h * h) / 2) - * + * * @name Phaser.Textures.Frame#radius * @type {number} * @readOnly @@ -542,7 +542,7 @@ var Frame = new Class({ /** * Is the Frame trimmed or not? - * + * * @name Phaser.Textures.Frame#trimmed * @type {boolean} * @readOnly @@ -559,7 +559,7 @@ var Frame = new Class({ /** * The Canvas drawImage data object. - * + * * @name Phaser.Textures.Frame#canvasData * @type {object} * @readOnly diff --git a/src/textures/Texture.js b/src/textures/Texture.js index 9a8e41c80..d763b611f 100644 --- a/src/textures/Texture.js +++ b/src/textures/Texture.js @@ -27,7 +27,7 @@ var TextureSource = require('./TextureSource'); * * @param {Phaser.Textures.TextureManager} manager - A reference to the Texture Manager this Texture belongs to. * @param {string} key - The unique string-based key of this Texture. - * @param {Image|HTMLCanvasElement} source - The source that is used to create the texture. Usually an Image, but can also be a Canvas. + * @param {(Image|HTMLCanvasElement)} source - The source that is used to create the texture. Usually an Image, but can also be a Canvas. * @param {number} [width] - The width of the Texture. This is optional and automatically derived from the source images. * @param {number} [height] - The height of the Texture. This is optional and automatically derived from the source images. */ @@ -133,7 +133,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#add * @since 3.0.0 * - * @param {integer|string} name - The name of this Frame. The name is unique within the Texture. + * @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture. * @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of. * @param {number} x - The x coordinate of the top-left of this Frame. * @param {number} y - The y coordinate of the top-left of this Frame. @@ -187,7 +187,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#get * @since 3.0.0 * - * @param {string|integer} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. * * @return {Phaser.Textures.Frame} The Texture Frame. */ @@ -204,10 +204,10 @@ var Texture = new Class({ if (!frame) { console.warn('No Texture.frame found with name ' + name); - + frame = this.frames[this.firstFrame]; } - + return frame; }, @@ -271,7 +271,7 @@ var Texture = new Class({ /** * Returns an array with all of the names of the Frames in this Texture. - * + * * Useful if you want to randomly assign a Frame to a Game Object, as you can * pick a random element from the returned array. * @@ -309,9 +309,9 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#getSourceImage * @since 3.0.0 * - * @param {string|integer} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. * - * @return {HTMLImageElement|HTMLCanvasElement} The DOM Image or Canvas Element. + * @return {(HTMLImageElement|HTMLCanvasElement)} The DOM Image or Canvas Element. */ getSourceImage: function (name) { @@ -336,14 +336,14 @@ var Texture = new Class({ /** * Adds a data source image to this Texture. - * + * * An example of a data source image would be a normal map, where all of the Frames for this Texture * equally apply to the normal map. * * @method Phaser.Textures.Texture#setDataSource * @since 3.0.0 * - * @param {Image|HTMLCanvasElement} data - The source image. + * @param {(Image|HTMLCanvasElement)} data - The source image. */ setDataSource: function (data) { @@ -372,7 +372,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#setFilter * @since 3.0.0 * - * @param {Phaser.Textures.FilterMode.LINEAR|Phaser.Textures.FilterMode.NEAREST} filterMode - The Filter Mode. + * @param {(Phaser.Textures.FilterMode.LINEAR|Phaser.Textures.FilterMode.NEAREST)} filterMode - The Filter Mode. */ setFilter: function (filterMode) { diff --git a/src/textures/TextureManager.js b/src/textures/TextureManager.js index 21ba55c1b..f27d17fa9 100644 --- a/src/textures/TextureManager.js +++ b/src/textures/TextureManager.js @@ -611,7 +611,7 @@ var TextureManager = new Class({ * @since 3.0.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {string|integer} frame - The string or index of the Frame to be cloned. + * @param {(string|integer)} frame - The string or index of the Frame to be cloned. * * @return {Phaser.Textures.Frame} A Clone of the given Frame. */ @@ -630,7 +630,7 @@ var TextureManager = new Class({ * @since 3.0.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {string|integer} frame - The string or index of the Frame. + * @param {(string|integer)} frame - The string or index of the Frame. * * @return {Phaser.Textures.Frame} A Texture Frame object. */ @@ -677,7 +677,7 @@ var TextureManager = new Class({ * @param {integer} x - The x coordinate of the pixel within the Texture. * @param {integer} y - The y coordinate of the pixel within the Texture. * @param {string} key - The unique string-based key of the Texture. - * @param {string|integer} frame - The string or index of the Frame. + * @param {(string|integer)} frame - The string or index of the Frame. * * @return {?Phaser.Display.Color} A Color object populated with the color values of the requested pixel, * or `null` if the coordinates were out of bounds. @@ -724,7 +724,7 @@ var TextureManager = new Class({ * * @param {Phaser.GameObjects.GameObject} gameObject - [description] * @param {string} key - The unique string-based key of the Texture. - * @param {string|integer} frame - The string or index of the Frame. + * @param {(string|integer)} frame - The string or index of the Frame. * * @return {Phaser.GameObjects.GameObject} The Game Object the texture was set on. */ diff --git a/src/textures/TextureSource.js b/src/textures/TextureSource.js index 18985e715..f71aae339 100644 --- a/src/textures/TextureSource.js +++ b/src/textures/TextureSource.js @@ -22,7 +22,7 @@ var ScaleModes = require('../renderer/ScaleModes'); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture this TextureSource belongs to. - * @param {Image|HTMLCanvasElement} source - The source image data. + * @param {(Image|HTMLCanvasElement)} source - The source image data. * @param {integer} [width] - Optional width of the source image. If not given it's derived from the source itself. * @param {integer} [height] - Optional height of the source image. If not given it's derived from the source itself. */ @@ -47,7 +47,7 @@ var TextureSource = new Class({ * The source image data. This is either an Image Element, or a Canvas Element. * * @name Phaser.Textures.TextureSource#image - * @type {HTMLImageElement|HTMLCanvasElement} + * @type {(HTMLImageElement|HTMLCanvasElement)} * @since 3.0.0 */ this.image = source; @@ -164,7 +164,7 @@ var TextureSource = new Class({ * @method Phaser.Textures.TextureSource#setFilter * @since 3.0.0 * - * @param {Phaser.Textures.FilterMode.LINEAR|Phaser.Textures.FilterMode.NEAREST} filterMode - The Filter Mode. + * @param {(Phaser.Textures.FilterMode.LINEAR|Phaser.Textures.FilterMode.NEAREST)} filterMode - The Filter Mode. */ setFilter: function (filterMode) { From 9375bb0530e5f2cf49fde862ea17b85d93d85a39 Mon Sep 17 00:00:00 2001 From: orblazer Date: Tue, 20 Mar 2018 16:11:33 +0100 Subject: [PATCH 8/9] Fix multiple types on Tilemaps --- src/sound/BaseSoundManager.js | 2 +- src/tilemaps/Tile.js | 2 +- src/tilemaps/Tilemap.js | 40 +++++++++--------- src/tilemaps/components/CreateFromTiles.js | 6 +-- .../components/GetTilesWithinShape.js | 4 +- src/tilemaps/components/PutTileAt.js | 4 +- src/tilemaps/components/PutTileAtWorldXY.js | 4 +- src/tilemaps/components/PutTilesAt.js | 2 +- src/tilemaps/components/RemoveTileAt.js | 4 +- .../components/RemoveTileAtWorldXY.js | 4 +- src/tilemaps/components/SetCollision.js | 2 +- .../components/SetTileIndexCallback.js | 2 +- .../dynamiclayer/DynamicTilemapLayer.js | 20 ++++----- src/tilemaps/mapdata/LayerData.js | 42 +++++++++---------- src/tilemaps/parsers/Parse.js | 2 +- .../staticlayer/StaticTilemapLayer.js | 12 +++--- 16 files changed, 76 insertions(+), 76 deletions(-) diff --git a/src/sound/BaseSoundManager.js b/src/sound/BaseSoundManager.js index 2b50b3de4..783237109 100644 --- a/src/sound/BaseSoundManager.js +++ b/src/sound/BaseSoundManager.js @@ -222,7 +222,7 @@ var BaseSoundManager = new Class({ * @since 3.0.0 * * @param {string} key - Asset key for the sound. - * @param {SoundConfig|SoundMarker} [extra] - An optional additional object containing settings to be applied to the sound. It could be either config or marker object. + * @param {(SoundConfig|SoundMarker)} [extra] - An optional additional object containing settings to be applied to the sound. It could be either config or marker object. * * @return {boolean} Whether the sound started playing successfully. */ diff --git a/src/tilemaps/Tile.js b/src/tilemaps/Tile.js index 654c8c2ec..149a1998c 100644 --- a/src/tilemaps/Tile.js +++ b/src/tilemaps/Tile.js @@ -443,7 +443,7 @@ var Tile = new Class({ * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * @param {object} [output] - [description] * - * @return {Phaser.Geom.Rectangle|object} + * @return {(Phaser.Geom.Rectangle|object)} */ getBounds: function (camera, output) { diff --git a/src/tilemaps/Tilemap.js b/src/tilemaps/Tilemap.js index 0f88e08df..e4f54ebcf 100644 --- a/src/tilemaps/Tilemap.js +++ b/src/tilemaps/Tilemap.js @@ -300,7 +300,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#convertLayerToStatic * @since 3.0.0 * - * @param {string|integer|Phaser.Tilemaps.DynamicTilemapLayer} [layer] - The name of the layer from Tiled, the + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer)} [layer] - The name of the layer from Tiled, the * index of the layer in the map, or a DynamicTilemapLayer. * * @return {?Phaser.Tilemaps.StaticTilemapLayer} Returns the new layer that was created, or null if it @@ -444,7 +444,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#createDynamicLayer * @since 3.0.0 * - * @param {integer|string} layerID - The layer array index value, or if a string is given, the + * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the * layer name from Tiled. * @param {Phaser.Tilemaps.Tileset} tileset - The tileset the new layer will use. * @param {number} x - The x position to place the layer in the world. If not specified, it will @@ -503,7 +503,7 @@ var Tilemap = new Class({ * @since 3.0.0 * * @param {string} name - The name of the object layer (from Tiled) to create Sprites from. - * @param {integer|string} id - Either the id (object), gid (tile object) or name (object or + * @param {(integer|string)} id - Either the id (object), gid (tile object) or name (object or * tile object) from Tiled. Ids are unique in Tiled, but a gid is shared by all tile objects * with the same graphic. The same name can be used on multiple objects. * @param {object} spriteConfig - The config object to pass into the Sprite creator (i.e. @@ -593,8 +593,8 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#createFromTiles * @since 3.0.0 * - * @param {integer|array} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {integer|array} replacements - The tile index, or array of indexes, to change a converted + * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. + * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a * one-to-one mapping with the indexes array. * @param {object} spriteConfig - The config object to pass into the Sprite creator (i.e. @@ -628,7 +628,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#createStaticLayer * @since 3.0.0 * - * @param {integer|string} layerID - The layer array index value, or if a string is given, the + * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the * layer name from Tiled. * @param {Phaser.Tilemaps.Tileset} tileset - The tileset the new layer will use. * @param {number} x - The x position to place the layer in the world. If not specified, it will @@ -735,7 +735,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#filterObjects * @since 3.0.0 * - * @param {Phaser.Tilemaps.ObjectLayer|string} [objectLayer] - The name of an object layer (from Tiled) or an + * @param {(Phaser.Tilemaps.ObjectLayer|string)} [objectLayer] - The name of an object layer (from Tiled) or an * ObjectLayer instance. * @param {TilemapFilterCallback} callback - The callback. Each object in the given area will be passed to * this callback as the first and only parameter. @@ -835,7 +835,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#findObject * @since 3.0.0 * - * @param {Phaser.Tilemaps.ObjectLayer|string} [objectLayer] - The name of an object layer (from Tiled) or an + * @param {(Phaser.Tilemaps.ObjectLayer|string)} [objectLayer] - The name of an object layer (from Tiled) or an * ObjectLayer instance. * @param {TilemapFindCallback} callback - The callback. Each object in the given area will be passed to * this callback as the first and only parameter. @@ -983,7 +983,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#getLayer * @since 3.0.0 * - * @param {string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} [layer] - The name of the + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a * StaticTilemapLayer. If not given will default to the maps current layer index. * @@ -1021,7 +1021,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#getLayerIndex * @since 3.0.0 * - * @param {string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} [layer] - The name of the + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a * StaticTilemapLayer. If not given will default to the map's current layer index. * @@ -1156,7 +1156,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#getTilesWithinShape * @since 3.0.0 * - * @param {Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle} shape - A shape in world (pixel) coordinates + * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have * -1 for an index. @@ -1308,7 +1308,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#putTileAt * @since 3.0.0 * - * @param {integer|Phaser.Tilemaps.Tile} tile - The index of this tile to set or a Tile object. + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {integer} tileX - [description] * @param {integer} tileY - [description] * @param {boolean} [recalculateFaces=true] - [description] @@ -1339,7 +1339,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#putTileAtWorldXY * @since 3.0.0 * - * @param {integer|Phaser.Tilemaps.Tile} tile - The index of this tile to set or a Tile object. + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {integer} worldX - [description] * @param {integer} worldY - [description] * @param {boolean} [recalculateFaces=true] - [description] @@ -1372,7 +1372,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#putTilesAt * @since 3.0.0 * - * @param {integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][]} tile - A row (array) or grid (2D array) of Tiles + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles * or tile indexes to place. * @param {integer} tileX - [description] * @param {integer} tileY - [description] @@ -1523,7 +1523,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#removeTileAt * @since 3.0.0 * - * @param {integer|Phaser.Tilemaps.Tile} tile - The index of this tile to set or a Tile object. + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {integer} tileX - [description] * @param {integer} tileY - [description] * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified @@ -1554,7 +1554,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#removeTileAtWorldXY * @since 3.0.0 * - * @param {integer|Phaser.Tilemaps.Tile} tile - The index of this tile to set or a Tile object. + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {number} worldX - [description] * @param {number} worldY - [description] * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified @@ -1655,7 +1655,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setCollision * @since 3.0.0 * - * @param {integer|array} indexes - Either a single tile index, or an array of tile indexes. + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear * collision. * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the @@ -1813,7 +1813,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setTileIndexCallback * @since 3.0.0 * - * @param {integer|array} indexes - Either a single tile index, or an array of tile indexes to have a + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a * collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. @@ -1869,7 +1869,7 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setLayer * @since 3.0.0 * - * @param {string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} [layer] - The name of the + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a * StaticTilemapLayer. If not given will default to the map's current layer index. * @@ -1943,7 +1943,7 @@ var Tilemap = new Class({ * * @param {integer} tileWidth - The width of the tiles (in pixels) in the layer. * @param {integer} tileHeight - The height of the tiles (in pixels) in the layer. - * @param {string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} [layer] - The name of the + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a * StaticTilemapLayer. If not given will default to the map's current layer index. * diff --git a/src/tilemaps/components/CreateFromTiles.js b/src/tilemaps/components/CreateFromTiles.js index 8abe7784a..138bd1cba 100644 --- a/src/tilemaps/components/CreateFromTiles.js +++ b/src/tilemaps/components/CreateFromTiles.js @@ -18,8 +18,8 @@ var ReplaceByIndex = require('./ReplaceByIndex'); * @function Phaser.Tilemaps.Components.CreateFromTiles * @since 3.0.0 * - * @param {integer|array} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {integer|array} replacements - The tile index, or array of indexes, to change a converted + * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. + * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a * one-to-one mapping with the indexes array. * @param {object} spriteConfig - The config object to pass into the Sprite creator (i.e. @@ -27,7 +27,7 @@ var ReplaceByIndex = require('./ReplaceByIndex'); * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * + * * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. */ var CreateFromTiles = function (indexes, replacements, spriteConfig, scene, camera, layer) diff --git a/src/tilemaps/components/GetTilesWithinShape.js b/src/tilemaps/components/GetTilesWithinShape.js index 4599cc016..7cd2f259a 100644 --- a/src/tilemaps/components/GetTilesWithinShape.js +++ b/src/tilemaps/components/GetTilesWithinShape.js @@ -28,7 +28,7 @@ var TriangleToRectangle = function (triangle, rect) * @function Phaser.Tilemaps.Components.GetTilesWithinShape * @since 3.0.0 * - * @param {Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle} shape - A shape in world (pixel) coordinates + * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have * -1 for an index. @@ -38,7 +38,7 @@ var TriangleToRectangle = function (triangle, rect) * have at least one interesting face. * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * + * * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. */ var GetTilesWithinShape = function (shape, filteringOptions, camera, layer) diff --git a/src/tilemaps/components/PutTileAt.js b/src/tilemaps/components/PutTileAt.js index 8230ee3f4..dac9a9830 100644 --- a/src/tilemaps/components/PutTileAt.js +++ b/src/tilemaps/components/PutTileAt.js @@ -18,12 +18,12 @@ var SetTileCollision = require('./SetTileCollision'); * @function Phaser.Tilemaps.Components.PutTileAt * @since 3.0.0 * - * @param {integer|Phaser.Tilemaps.Tile} tile - The index of this tile to set or a Tile object. + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {integer} tileX - [description] * @param {integer} tileY - [description] * @param {boolean} [recalculateFaces=true] - [description] * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * + * * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. */ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) diff --git a/src/tilemaps/components/PutTileAtWorldXY.js b/src/tilemaps/components/PutTileAtWorldXY.js index 3bf54443f..aa441840a 100644 --- a/src/tilemaps/components/PutTileAtWorldXY.js +++ b/src/tilemaps/components/PutTileAtWorldXY.js @@ -17,13 +17,13 @@ var WorldToTileY = require('./WorldToTileY'); * @function Phaser.Tilemaps.Components.PutTileAtWorldXY * @since 3.0.0 * - * @param {integer|Phaser.Tilemaps.Tile} tile - The index of this tile to set or a Tile object. + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {integer} worldX - [description] * @param {integer} worldY - [description] * @param {boolean} [recalculateFaces=true] - [description] * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * + * * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. */ var PutTileAtWorldXY = function (tile, worldX, worldY, recalculateFaces, camera, layer) diff --git a/src/tilemaps/components/PutTilesAt.js b/src/tilemaps/components/PutTilesAt.js index 5676059b0..1aebd4f31 100644 --- a/src/tilemaps/components/PutTilesAt.js +++ b/src/tilemaps/components/PutTilesAt.js @@ -17,7 +17,7 @@ var PutTileAt = require('./PutTileAt'); * @function Phaser.Tilemaps.Components.PutTilesAt * @since 3.0.0 * - * @param {integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][]} tile - A row (array) or grid (2D array) of Tiles + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles * or tile indexes to place. * @param {integer} tileX - [description] * @param {integer} tileY - [description] diff --git a/src/tilemaps/components/RemoveTileAt.js b/src/tilemaps/components/RemoveTileAt.js index 59313e5b6..508f1e87b 100644 --- a/src/tilemaps/components/RemoveTileAt.js +++ b/src/tilemaps/components/RemoveTileAt.js @@ -15,14 +15,14 @@ var CalculateFacesAt = require('./CalculateFacesAt'); * @function Phaser.Tilemaps.Components.RemoveTileAt * @since 3.0.0 * - * @param {integer|Phaser.Tilemaps.Tile} tile - The index of this tile to set or a Tile object. + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {integer} tileX - [description] * @param {integer} tileY - [description] * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified * location with null instead of a Tile with an index of -1. * @param {boolean} [recalculateFaces=true] - [description] * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * + * * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. */ var RemoveTileAt = function (tileX, tileY, replaceWithNull, recalculateFaces, layer) diff --git a/src/tilemaps/components/RemoveTileAtWorldXY.js b/src/tilemaps/components/RemoveTileAtWorldXY.js index f27a868a2..37512e898 100644 --- a/src/tilemaps/components/RemoveTileAtWorldXY.js +++ b/src/tilemaps/components/RemoveTileAtWorldXY.js @@ -15,7 +15,7 @@ var WorldToTileY = require('./WorldToTileY'); * @function Phaser.Tilemaps.Components.RemoveTileAtWorldXY * @since 3.0.0 * - * @param {integer|Phaser.Tilemaps.Tile} tile - The index of this tile to set or a Tile object. + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {number} worldX - [description] * @param {number} worldY - [description] * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified @@ -23,7 +23,7 @@ var WorldToTileY = require('./WorldToTileY'); * @param {boolean} [recalculateFaces=true] - [description] * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * + * * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. */ var RemoveTileAtWorldXY = function (worldX, worldY, replaceWithNull, recalculateFaces, camera, layer) diff --git a/src/tilemaps/components/SetCollision.js b/src/tilemaps/components/SetCollision.js index cc91f6a60..778bd7087 100644 --- a/src/tilemaps/components/SetCollision.js +++ b/src/tilemaps/components/SetCollision.js @@ -16,7 +16,7 @@ var SetLayerCollisionIndex = require('./SetLayerCollisionIndex'); * @function Phaser.Tilemaps.Components.SetCollision * @since 3.0.0 * - * @param {integer|array} indexes - Either a single tile index, or an array of tile indexes. + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear * collision. * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the diff --git a/src/tilemaps/components/SetTileIndexCallback.js b/src/tilemaps/components/SetTileIndexCallback.js index b5b263173..7ed5b7eaa 100644 --- a/src/tilemaps/components/SetTileIndexCallback.js +++ b/src/tilemaps/components/SetTileIndexCallback.js @@ -13,7 +13,7 @@ * @function Phaser.Tilemaps.Components.SetTileIndexCallback * @since 3.0.0 * - * @param {integer|array} indexes - Either a single tile index, or an array of tile indexes to have a + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a * collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. diff --git a/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js b/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js index 95aa15bd9..0696d5cbf 100644 --- a/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js +++ b/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js @@ -190,8 +190,8 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#createFromTiles * @since 3.0.0 * - * @param {integer|array} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {integer|array} replacements - The tile index, or array of indexes, to change a converted + * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. + * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a * one-to-one mapping with the indexes array. * @param {object} spriteConfig - The config object to pass into the Sprite creator (i.e. @@ -478,7 +478,7 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinShape * @since 3.0.0 * - * @param {Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle} shape - A shape in world (pixel) coordinates + * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have * -1 for an index. @@ -565,7 +565,7 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#putTileAt * @since 3.0.0 * - * @param {integer|Phaser.Tilemaps.Tile} tile - The index of this tile to set or a Tile object. + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {integer} tileX - [description] * @param {integer} tileY - [description] * @param {boolean} [recalculateFaces=true] - [description] @@ -586,7 +586,7 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#putTileAtWorldXY * @since 3.0.0 * - * @param {integer|Phaser.Tilemaps.Tile} tile - The index of this tile to set or a Tile object. + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {integer} worldX - [description] * @param {integer} worldY - [description] * @param {boolean} [recalculateFaces=true] - [description] @@ -609,7 +609,7 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#putTilesAt * @since 3.0.0 * - * @param {integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][]} tile - A row (array) or grid (2D array) of Tiles + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles * or tile indexes to place. * @param {integer} tileX - [description] * @param {integer} tileY - [description] @@ -656,7 +656,7 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAt * @since 3.0.0 * - * @param {integer|Phaser.Tilemaps.Tile} tile - The index of this tile to set or a Tile object. + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {integer} tileX - [description] * @param {integer} tileY - [description] * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified @@ -677,7 +677,7 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAtWorldXY * @since 3.0.0 * - * @param {integer|Phaser.Tilemaps.Tile} tile - The index of this tile to set or a Tile object. + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {number} worldX - [description] * @param {number} worldY - [description] * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified @@ -751,7 +751,7 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollision * @since 3.0.0 * - * @param {integer|array} indexes - Either a single tile index, or an array of tile indexes. + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear * collision. * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the @@ -874,7 +874,7 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#setTileIndexCallback * @since 3.0.0 * - * @param {integer|array} indexes - Either a single tile index, or an array of tile indexes to have a + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a * collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. diff --git a/src/tilemaps/mapdata/LayerData.js b/src/tilemaps/mapdata/LayerData.js index 5d6150d4a..37a6ef966 100644 --- a/src/tilemaps/mapdata/LayerData.js +++ b/src/tilemaps/mapdata/LayerData.js @@ -30,7 +30,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#name * @type {string} * @since 3.0.0 @@ -39,7 +39,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#x * @type {number} * @since 3.0.0 @@ -48,7 +48,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#y * @type {number} * @since 3.0.0 @@ -57,7 +57,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#width * @type {number} * @since 3.0.0 @@ -66,7 +66,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#height * @type {number} * @since 3.0.0 @@ -75,7 +75,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#tileWidth * @type {number} * @since 3.0.0 @@ -84,7 +84,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#tileHeight * @type {number} * @since 3.0.0 @@ -93,7 +93,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#baseTileWidth * @type {number} * @since 3.0.0 @@ -102,7 +102,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#baseTileHeight * @type {number} * @since 3.0.0 @@ -111,7 +111,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#widthInPixels * @type {number} * @since 3.0.0 @@ -120,7 +120,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#heightInPixels * @type {number} * @since 3.0.0 @@ -129,7 +129,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#alpha * @type {float} * @since 3.0.0 @@ -138,7 +138,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#visible * @type {boolean} * @since 3.0.0 @@ -147,7 +147,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#properties * @type {object} * @since 3.0.0 @@ -156,7 +156,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#indexes * @type {array} * @since 3.0.0 @@ -165,7 +165,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#collideIndexes * @type {array} * @since 3.0.0 @@ -174,7 +174,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#callbacks * @type {array} * @since 3.0.0 @@ -183,7 +183,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#bodies * @type {array} * @since 3.0.0 @@ -192,7 +192,7 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#data * @type {array} * @since 3.0.0 @@ -201,9 +201,9 @@ var LayerData = new Class({ /** * [description] - * + * * @name Phaser.Tilemaps.LayerData#tilemapLayer - * @type {Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} + * @type {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} * @since 3.0.0 */ this.tilemapLayer = GetFastValue(config, 'tilemapLayer', null); diff --git a/src/tilemaps/parsers/Parse.js b/src/tilemaps/parsers/Parse.js index f5b3cbf4f..bed92e725 100644 --- a/src/tilemaps/parsers/Parse.js +++ b/src/tilemaps/parsers/Parse.js @@ -21,7 +21,7 @@ var ParseWeltmeister = require('./impact/ParseWeltmeister'); * * @param {string} name - The name of the tilemap, used to set the name on the MapData. * @param {integer} mapFormat - See ../Formats.js. - * @param {integer[][]|string|object} data - 2D array, CSV string or Tiled JSON object. + * @param {(integer[][]|string|object)} data - 2D array, CSV string or Tiled JSON object. * @param {integer} tileWidth - The width of a tile in pixels. Required for 2D array and CSV, but * ignored for Tiled JSON. * @param {integer} tileHeight - The height of a tile in pixels. Required for 2D array and CSV, but diff --git a/src/tilemaps/staticlayer/StaticTilemapLayer.js b/src/tilemaps/staticlayer/StaticTilemapLayer.js index 2e510a87d..232755707 100644 --- a/src/tilemaps/staticlayer/StaticTilemapLayer.js +++ b/src/tilemaps/staticlayer/StaticTilemapLayer.js @@ -142,7 +142,7 @@ var StaticTilemapLayer = new Class({ /** * @name Phaser.Tilemaps.StaticTilemapLayer#renderer - * @type {Phaser.Renderer.CanvasRenderer|Phaser.Renderer.WebGLRenderer} + * @type {(Phaser.Renderer.CanvasRenderer|Phaser.Renderer.WebGLRenderer)} * @private * @since 3.0.0 */ @@ -393,8 +393,8 @@ var StaticTilemapLayer = new Class({ * @method Phaser.Tilemaps.StaticTilemapLayer#createFromTiles * @since 3.0.0 * - * @param {integer|array} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {integer|array} replacements - The tile index, or array of indexes, to change a converted + * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. + * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a * one-to-one mapping with the indexes array. * @param {object} spriteConfig - The config object to pass into the Sprite creator (i.e. @@ -656,7 +656,7 @@ var StaticTilemapLayer = new Class({ * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithinShape * @since 3.0.0 * - * @param {Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle} shape - A shape in world (pixel) coordinates + * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have * -1 for an index. @@ -743,7 +743,7 @@ var StaticTilemapLayer = new Class({ * @method Phaser.Tilemaps.StaticTilemapLayer#setCollision * @since 3.0.0 * - * @param {integer|array} indexes - Either a single tile index, or an array of tile indexes. + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear * collision. * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the @@ -843,7 +843,7 @@ var StaticTilemapLayer = new Class({ * @method Phaser.Tilemaps.StaticTilemapLayer#setTileIndexCallback * @since 3.0.0 * - * @param {integer|array} indexes - Either a single tile index, or an array of tile indexes to have a + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a * collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. From 44103dc47524b81f2dd5c5030a1bea3a0efdd186 Mon Sep 17 00:00:00 2001 From: orblazer Date: Tue, 20 Mar 2018 16:12:42 +0100 Subject: [PATCH 9/9] Fix remaining multiple types --- src/loader/File.js | 2 +- src/loader/filetypes/AnimationJSONFile.js | 10 ++++---- src/loader/filetypes/AudioFile.js | 2 +- src/loader/filetypes/AudioSprite.js | 6 ++--- src/scene/SceneManager.js | 30 +++++++++++------------ src/scene/ScenePlugin.js | 2 +- src/scene/Systems.js | 2 +- src/tweens/TweenManager.js | 4 +-- src/tweens/builders/GetEaseFunction.js | 2 +- src/tweens/builders/NumberTweenBuilder.js | 6 ++--- src/tweens/builders/TweenBuilder.js | 2 +- src/tweens/tween/Defaults.js | 2 +- src/tweens/tween/Tween.js | 4 +-- src/utils/array/NumberArray.js | 8 +++--- src/utils/array/matrix/RotateMatrix.js | 2 +- 15 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/loader/File.js b/src/loader/File.js index a9a3bd9be..8a64a7f15 100644 --- a/src/loader/File.js +++ b/src/loader/File.js @@ -164,7 +164,7 @@ var File = new Class({ * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set) * * @name Phaser.Loader.File#crossOrigin - * @type {string|undefined} + * @type {(string|undefined)} * @since 3.0.0 */ this.crossOrigin = undefined; diff --git a/src/loader/filetypes/AnimationJSONFile.js b/src/loader/filetypes/AnimationJSONFile.js index ec9bcd9de..e114060b6 100644 --- a/src/loader/filetypes/AnimationJSONFile.js +++ b/src/loader/filetypes/AnimationJSONFile.js @@ -32,7 +32,7 @@ var AnimationJSONFile = function (key, url, path, xhrSettings) /** * Adds an Animation JSON file to the current load queue. - * + * * Note: This method will only be available if the Animation JSON File type has been built into Phaser. * * The file is **not** loaded immediately after calling this method. @@ -41,11 +41,11 @@ var AnimationJSONFile = function (key, url, path, xhrSettings) * @method Phaser.Loader.LoaderPlugin#animation * @since 3.0.0 * - * @param {string|array|object} key - A unique string to be used as the key to reference this file from the Cache. Must be unique within this file type. + * @param {(string|array|object)} key - A unique string to be used as the key to reference this file from the Cache. Must be unique within this file type. * @param {string} [url] - URL of the file. If `undefined` or `null` the url will be set to `.json`, * i.e. if `key` was "alien" then the URL will be "alien.json". * @param {object} [xhrSettings] - File specific XHR settings to be used during the load. These settings are merged with the global Loader XHR settings. - * + * * @return {Phaser.Loader.LoaderPlugin} The Loader. */ FileTypesManager.register('animation', function (key, url, xhrSettings) @@ -68,9 +68,9 @@ FileTypesManager.register('animation', function (key, url, xhrSettings) }); // When registering a factory function 'this' refers to the Loader context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory module.exports = AnimationJSONFile; diff --git a/src/loader/filetypes/AudioFile.js b/src/loader/filetypes/AudioFile.js index 7f60955f4..042a62be9 100644 --- a/src/loader/filetypes/AudioFile.js +++ b/src/loader/filetypes/AudioFile.js @@ -138,7 +138,7 @@ AudioFile.create = function (loader, key, urls, config, xhrSettings) * @since 3.0.0 * * @param {string} key - [description] - * @param {string|string[]} urls - [description] + * @param {(string|string[])} urls - [description] * @param {object} config - [description] * @param {object} xhrSettings - [description] * diff --git a/src/loader/filetypes/AudioSprite.js b/src/loader/filetypes/AudioSprite.js index 5cd85c345..2db0821b5 100644 --- a/src/loader/filetypes/AudioSprite.js +++ b/src/loader/filetypes/AudioSprite.js @@ -11,7 +11,7 @@ var JSONFile = require('./JSONFile.js'); /** * Adds an Audio Sprite file to the current load queue. - * + * * Note: This method will only be available if the Audio Sprite File type has been built into Phaser. * * The file is **not** loaded immediately after calling this method. @@ -21,12 +21,12 @@ var JSONFile = require('./JSONFile.js'); * @since 3.0.0 * * @param {string} key - [description] - * @param {string|string[]} urls - [description] + * @param {(string|string[])} urls - [description] * @param {object} json - [description] * @param {object} config - [description] * @param {object} audioXhrSettings - Optional file specific XHR settings. * @param {object} jsonXhrSettings - Optional file specific XHR settings. - * + * * @return {Phaser.Loader.LoaderPlugin} The Loader. */ FileTypesManager.register('audioSprite', function (key, urls, json, config, audioXhrSettings, jsonXhrSettings) diff --git a/src/scene/SceneManager.js b/src/scene/SceneManager.js index 3e0d4ed0d..29e0bbf6c 100644 --- a/src/scene/SceneManager.js +++ b/src/scene/SceneManager.js @@ -257,7 +257,7 @@ var SceneManager = new Class({ * @since 3.0.0 * * @param {string} key - A unique key used to reference the Scene, i.e. `MainMenu` or `Level1`. - * @param {Phaser.Scene|object|function} sceneConfig - [description] + * @param {(Phaser.Scene|object|function)} sceneConfig - [description] * @param {boolean} [autoStart=false] - If `true` the Scene will be started immediately after being added. * * @return {?Phaser.Scene} [description] @@ -332,7 +332,7 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#remove * @since 3.2.0 * - * @param {string|Phaser.Scene} scene - The Scene to be removed. + * @param {(string|Phaser.Scene)} scene - The Scene to be removed. * * @return {Phaser.Scenes.SceneManager} This SceneManager. */ @@ -706,7 +706,7 @@ var SceneManager = new Class({ * @since 3.0.0 * * @param {string} key - [description] - * @param {Phaser.Scene|object|function} sceneConfig - [description] + * @param {(Phaser.Scene|object|function)} sceneConfig - [description] * * @return {string} [description] */ @@ -1057,7 +1057,7 @@ var SceneManager = new Class({ * * @param {integer} index - [description] * - * @return {Phaser.Scene|undefined} [description] + * @return {(Phaser.Scene|undefined)} [description] */ getAt: function (index) { @@ -1070,7 +1070,7 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#getIndex * @since 3.0.0 * - * @param {string|Phaser.Scene} key - [description] + * @param {(string|Phaser.Scene)} key - [description] * * @return {integer} [description] */ @@ -1087,7 +1087,7 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#bringToTop * @since 3.0.0 * - * @param {string|Phaser.Scene} key - [description] + * @param {(string|Phaser.Scene)} key - [description] * * @return {Phaser.Scenes.SceneManager} [description] */ @@ -1119,7 +1119,7 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#sendToBack * @since 3.0.0 * - * @param {string|Phaser.Scene} key - [description] + * @param {(string|Phaser.Scene)} key - [description] * * @return {Phaser.Scenes.SceneManager} [description] */ @@ -1151,7 +1151,7 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#moveDown * @since 3.0.0 * - * @param {string|Phaser.Scene} key - [description] + * @param {(string|Phaser.Scene)} key - [description] * * @return {Phaser.Scenes.SceneManager} [description] */ @@ -1185,7 +1185,7 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#moveUp * @since 3.0.0 * - * @param {string|Phaser.Scene} key - [description] + * @param {(string|Phaser.Scene)} key - [description] * * @return {Phaser.Scenes.SceneManager} [description] */ @@ -1220,8 +1220,8 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#moveAbove * @since 3.2.0 * - * @param {string|Phaser.Scene} keyA - The Scene that Scene B will be moved above. - * @param {string|Phaser.Scene} keyB - The Scene to be moved. + * @param {(string|Phaser.Scene)} keyA - The Scene that Scene B will be moved above. + * @param {(string|Phaser.Scene)} keyB - The Scene to be moved. * * @return {Phaser.Scenes.SceneManager} [description] */ @@ -1263,8 +1263,8 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#moveBelow * @since 3.2.0 * - * @param {string|Phaser.Scene} keyA - The Scene that Scene B will be moved above. - * @param {string|Phaser.Scene} keyB - The Scene to be moved. + * @param {(string|Phaser.Scene)} keyA - The Scene that Scene B will be moved above. + * @param {(string|Phaser.Scene)} keyB - The Scene to be moved. * * @return {Phaser.Scenes.SceneManager} [description] */ @@ -1312,8 +1312,8 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#swapPosition * @since 3.0.0 * - * @param {string|Phaser.Scene} keyA - [description] - * @param {string|Phaser.Scene} keyB - [description] + * @param {(string|Phaser.Scene)} keyA - [description] + * @param {(string|Phaser.Scene)} keyB - [description] * * @return {Phaser.Scenes.SceneManager} [description] */ diff --git a/src/scene/ScenePlugin.js b/src/scene/ScenePlugin.js index e2724e9f4..a4ece37e8 100644 --- a/src/scene/ScenePlugin.js +++ b/src/scene/ScenePlugin.js @@ -457,7 +457,7 @@ var ScenePlugin = new Class({ * @method Phaser.Scenes.ScenePlugin#remove * @since 3.2.0 * - * @param {string|Phaser.Scene} scene - The Scene to be removed. + * @param {(string|Phaser.Scene)} scene - The Scene to be removed. * * @return {Phaser.Scenes.SceneManager} This SceneManager. */ diff --git a/src/scene/Systems.js b/src/scene/Systems.js index 7f5f0a21d..82e60ecee 100644 --- a/src/scene/Systems.js +++ b/src/scene/Systems.js @@ -288,7 +288,7 @@ var Systems = new Class({ * @method Phaser.Scenes.Systems#render * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - [description] */ render: function (renderer) { diff --git a/src/tweens/TweenManager.js b/src/tweens/TweenManager.js index e61731dae..b91a7b703 100644 --- a/src/tweens/TweenManager.js +++ b/src/tweens/TweenManager.js @@ -446,7 +446,7 @@ var TweenManager = new Class({ * @method Phaser.Tweens.TweenManager#getTweensOf * @since 3.0.0 * - * @param {object|array} target - [description] + * @param {(object|array)} target - [description] * * @return {Phaser.Tweens.Tween[]} [description] */ @@ -542,7 +542,7 @@ var TweenManager = new Class({ * @method Phaser.Tweens.TweenManager#killTweensOf * @since 3.0.0 * - * @param {object|array} target - [description] + * @param {(object|array)} target - [description] * * @return {Phaser.Tweens.TweenManager} [description] */ diff --git a/src/tweens/builders/GetEaseFunction.js b/src/tweens/builders/GetEaseFunction.js index 67afea1ee..3dcc08e30 100644 --- a/src/tweens/builders/GetEaseFunction.js +++ b/src/tweens/builders/GetEaseFunction.js @@ -12,7 +12,7 @@ var EaseMap = require('../../math/easing/EaseMap'); * @function Phaser.Tweens.Builders.GetEaseFunction * @since 3.0.0 * - * @param {string|function} ease - [description] + * @param {(string|function)} ease - [description] * @param {array} easeParams - [description] * * @return {function} [description] diff --git a/src/tweens/builders/NumberTweenBuilder.js b/src/tweens/builders/NumberTweenBuilder.js index 47a658849..366dae6d6 100644 --- a/src/tweens/builders/NumberTweenBuilder.js +++ b/src/tweens/builders/NumberTweenBuilder.js @@ -20,7 +20,7 @@ var TweenData = require('../tween/TweenData'); * @function Phaser.Tweens.Builders.NumberTweenBuilder * @since 3.0.0 * - * @param {Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline} parent - [description] + * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - [description] * @param {object} config - [description] * @param {Phaser.Tweens.Tween~ConfigDefaults} defaults - [description] * @@ -38,9 +38,9 @@ var NumberTweenBuilder = function (parent, config, defaults) // to: 200, // ... (normal tween properties) // }) - // + // // Then use it in your game via: - // + // // tween.getValue() var from = GetValue(config, 'from', 0); diff --git a/src/tweens/builders/TweenBuilder.js b/src/tweens/builders/TweenBuilder.js index 36f13d139..42d0396a1 100644 --- a/src/tweens/builders/TweenBuilder.js +++ b/src/tweens/builders/TweenBuilder.js @@ -22,7 +22,7 @@ var TweenData = require('../tween/TweenData'); * @function Phaser.Tweens.Builders.TweenBuilder * @since 3.0.0 * - * @param {Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline} parent - [description] + * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - [description] * @param {object} config - [description] * @param {Phaser.Tweens.Tween~ConfigDefaults} defaults - [description] * diff --git a/src/tweens/tween/Defaults.js b/src/tweens/tween/Defaults.js index fcebf7227..840d781f3 100644 --- a/src/tweens/tween/Defaults.js +++ b/src/tweens/tween/Defaults.js @@ -6,7 +6,7 @@ /** * @typedef {object} Phaser.Tweens.Tween~ConfigDefaults - * @property {object|object[]} targets - [description] + * @property {(object|object[])} targets - [description] * @property {number} [delay=0] - [description] * @property {number} [duration=1000] - [description] * @property {string} [ease='Power0'] - [description] diff --git a/src/tweens/tween/Tween.js b/src/tweens/tween/Tween.js index bda0e1e40..0e9351d9c 100644 --- a/src/tweens/tween/Tween.js +++ b/src/tweens/tween/Tween.js @@ -18,7 +18,7 @@ var TWEEN_CONST = require('./const'); * @constructor * @since 3.0.0 * - * @param {Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline} parent - [description] + * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - [description] * @param {Phaser.Tweens.TweenData[]} data - [description] * @param {array} targets - [description] */ @@ -32,7 +32,7 @@ var Tween = new Class({ * [description] * * @name Phaser.Tweens.Tween#parent - * @type {Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline} + * @type {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} * @since 3.0.0 */ this.parent = parent; diff --git a/src/utils/array/NumberArray.js b/src/utils/array/NumberArray.js index 8cf8fa0c9..b745dfbfa 100644 --- a/src/utils/array/NumberArray.js +++ b/src/utils/array/NumberArray.js @@ -10,12 +10,12 @@ * * `var array = numberArray(2, 4); // array = [2, 3, 4]` * `var array = numberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` - * + * * This is equivalent to `numberArrayStep(start, end, 1)`. - * + * * You can optionally provide a prefix and / or suffix string. If given the array will contain * strings, not integers. For example: - * + * * `var array = numberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` * `var array = numberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` * @@ -27,7 +27,7 @@ * @param {string} [prefix] - Optional prefix to place before the number. If provided the array will contain strings, not integers. * @param {string} [suffix] - Optional suffix to place after the number. If provided the array will contain strings, not integers. * - * @return {number[]|string[]} The array of number values, or strings if a prefix or suffix was provided. + * @return {(number[]|string[])} The array of number values, or strings if a prefix or suffix was provided. */ var NumberArray = function (start, end, prefix, suffix) { diff --git a/src/utils/array/matrix/RotateMatrix.js b/src/utils/array/matrix/RotateMatrix.js index ea5e098a7..f2144e99e 100644 --- a/src/utils/array/matrix/RotateMatrix.js +++ b/src/utils/array/matrix/RotateMatrix.js @@ -16,7 +16,7 @@ var TransposeMatrix = require('./TransposeMatrix'); * @since 3.0.0 * * @param {array} matrix - The array to rotate. - * @param {number|string} [direction=90] - The amount to rotate the matrix by. The value can be given in degrees: 90, -90, 270, -270 or 180, or a string command: `rotateLeft`, `rotateRight` or `rotate180`. + * @param {(number|string)} [direction=90] - The amount to rotate the matrix by. The value can be given in degrees: 90, -90, 270, -270 or 180, or a string command: `rotateLeft`, `rotateRight` or `rotate180`. * * @return {array} The rotated matrix array. The source matrix should be discard for the returned matrix. */