Skip to content

Commit e7b1d08

Browse files
committed
Moving all of the typedefs to properly namespaced scopes, rather than globals
\o/ ~ "Someone, save me!"
1 parent b50e1c7 commit e7b1d08

141 files changed

Lines changed: 1031 additions & 906 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/actions/GridAlign.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ var Zone = require('../gameobjects/zone/Zone');
1212

1313
var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1);
1414

15-
/**
16-
* @typedef {object} GridAlignConfig
17-
*
18-
* @property {integer} [width=-1] - The width of the grid in items (not pixels). -1 means lay all items out horizontally, regardless of quantity.
19-
* If both this value and height are set to -1 then this value overrides it and the `height` value is ignored.
20-
* @property {integer} [height=-1] - The height of the grid in items (not pixels). -1 means lay all items out vertically, regardless of quantity.
21-
* If both this value and `width` are set to -1 then `width` overrides it and this value is ignored.
22-
* @property {integer} [cellWidth=1] - The width of the cell, in pixels, in which the item is positioned.
23-
* @property {integer} [cellHeight=1] - The height of the cell, in pixels, in which the item is positioned.
24-
* @property {integer} [position=0] - The alignment position. One of the Phaser.Display.Align consts such as `TOP_LEFT` or `RIGHT_CENTER`.
25-
* @property {number} [x=0] - Optionally place the top-left of the final grid at this coordinate.
26-
* @property {number} [y=0] - Optionally place the top-left of the final grid at this coordinate.
27-
*/
28-
2915
/**
3016
* Takes an array of Game Objects, or any objects that have public `x` and `y` properties,
3117
* and then aligns them based on the grid configuration given to this action.
@@ -36,7 +22,7 @@ var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } }
3622
* @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]
3723
*
3824
* @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.
39-
* @param {GridAlignConfig} options - The GridAlign Configuration object.
25+
* @param {Phaser.Actions.Types.GridAlignConfig} options - The GridAlign Configuration object.
4026
*
4127
* @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.
4228
*/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @typedef {object} Phaser.Actions.Types.GridAlignConfig
3+
* @since 3.0.0
4+
*
5+
* @property {integer} [width=-1] - The width of the grid in items (not pixels). -1 means lay all items out horizontally, regardless of quantity.
6+
* If both this value and height are set to -1 then this value overrides it and the `height` value is ignored.
7+
* @property {integer} [height=-1] - The height of the grid in items (not pixels). -1 means lay all items out vertically, regardless of quantity.
8+
* If both this value and `width` are set to -1 then `width` overrides it and this value is ignored.
9+
* @property {integer} [cellWidth=1] - The width of the cell, in pixels, in which the item is positioned.
10+
* @property {integer} [cellHeight=1] - The height of the cell, in pixels, in which the item is positioned.
11+
* @property {integer} [position=0] - The alignment position. One of the Phaser.Display.Align consts such as `TOP_LEFT` or `RIGHT_CENTER`.
12+
* @property {number} [x=0] - Optionally place the top-left of the final grid at this coordinate.
13+
* @property {number} [y=0] - Optionally place the top-left of the final grid at this coordinate.
14+
*/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* @callback Phaser.GameObjects.Group.Types.GroupCallback
3+
* @since 3.0.0
4+
*
5+
* @param {Phaser.GameObjects.GameObject} item - A group member
6+
*/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* A constructor function (class) that can be assigned to `classType`.
3+
*
4+
* @callback Phaser.GameObjects.Group.Types.GroupClassTypeConstructor
5+
* @since 3.0.0
6+
*
7+
* @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.
8+
* @param {number} x - The horizontal position of this Game Object in the world.
9+
* @param {number} y - The vertical position of this Game Object in the world.
10+
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
11+
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
12+
*
13+
* @see Phaser.GameObjects.Group#classType
14+
*/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* @callback Phaser.GameObjects.Group.Types.GroupMultipleCreateCallback
3+
* @since 3.0.0
4+
*
5+
* @param {Phaser.GameObjects.GameObject[]} items - The newly created group members
6+
*/

src/actions/typedefs/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2019 Photon Storm Ltd.
4+
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5+
*/
6+
7+
/**
8+
* @namespace Phaser.Actions.Types
9+
*/

src/animations/typedefs/Animation.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* @typedef {object} Phaser.Animations.Types.Animation
3+
* @since 3.0.0
34
*
45
* @property {string} [key] - The key that the animation will be associated with. i.e. sprite.animations.play(key)
56
* @property {Phaser.Animations.Types.AnimationFrame[]} [frames] - An object containing data used to generate the frames for the animation

src/animations/typedefs/AnimationFrame.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* @typedef {object} Phaser.Animations.Types.AnimationFrame
3+
* @since 3.0.0
34
*
45
* @property {string} key - The key that the animation will be associated with. i.e. sprite.animations.play(key)
56
* @property {(string|number)} frame - [description]

src/animations/typedefs/GenerateFrameNames.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* @typedef {object} Phaser.Animations.Types.GenerateFrameNames
3+
* @since 3.0.0
34
*
45
* @property {string} [prefix=''] - The string to append to every resulting frame name if using a range or an array of `frames`.
56
* @property {integer} [start=0] - If `frames` is not provided, the number of the first frame to return.

src/animations/typedefs/GenerateFrameNumbers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* @typedef {object} Phaser.Animations.Types.GenerateFrameNumbers
3+
* @since 3.0.0
34
*
45
* @property {integer} [start=0] - The starting frame of the animation.
56
* @property {integer} [end=-1] - The ending frame of the animation.

0 commit comments

Comments
 (0)