Skip to content

Commit b1d8318

Browse files
committed
Add generic type and fix types on Data and Display
1 parent 1ded1d1 commit b1d8318

30 files changed

Lines changed: 63 additions & 5 deletions

src/data/DataManager.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var DataManager = new Class({
6262
* [description]
6363
*
6464
* @name Phaser.Data.DataManager#list
65-
* @type {Object.<string, any>}
65+
* @type {Object.<string, *>}
6666
* @default {}
6767
* @since 3.0.0
6868
*/
@@ -113,7 +113,7 @@ var DataManager = new Class({
113113
* @method Phaser.Data.DataManager#getAll
114114
* @since 3.0.0
115115
*
116-
* @return {Object.<string, any>} [description]
116+
* @return {Object.<string, *>} [description]
117117
*/
118118
getAll: function ()
119119
{
@@ -138,7 +138,7 @@ var DataManager = new Class({
138138
*
139139
* @param {string} search - [description]
140140
*
141-
* @return {Object.<string, any>} [description]
141+
* @return {Object.<string, *>} [description]
142142
*/
143143
query: function (search)
144144
{
@@ -209,7 +209,7 @@ var DataManager = new Class({
209209
* @since 3.0.0
210210
*
211211
* @param {DataEachCallback} callback - The function to call.
212-
* @param {object} [scope] - Value to use as `this` when executing callback.
212+
* @param {*} [scope] - Value to use as `this` when executing callback.
213213
* @param {...*} [arguments] - Additional arguments that will be passed to the callback, after the game object, key, and data.
214214
*
215215
* @return {Phaser.Data.DataManager} This DataManager object.
@@ -240,7 +240,7 @@ var DataManager = new Class({
240240
* @method Phaser.Data.DataManager#merge
241241
* @since 3.0.0
242242
*
243-
* @param {Object.<string, any>} data - [description]
243+
* @param {Object.<string, *>} data - [description]
244244
* @param {boolean} overwrite - [description]
245245
*
246246
* @return {Phaser.Data.DataManager} This DataManager object.

src/display/align/in/BottomCenter.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ var SetCenterX = require('../../bounds/SetCenterX');
1515
* @function Phaser.Display.Align.In.BottomCenter
1616
* @since 3.0.0
1717
*
18+
* @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]
19+
*
1820
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.
1921
* @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.
2022
* @param {number} [offsetX=0] - Optional horizontal offset from the position.

src/display/align/in/BottomLeft.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ var SetLeft = require('../../bounds/SetLeft');
1515
* @function Phaser.Display.Align.In.BottomLeft
1616
* @since 3.0.0
1717
*
18+
* @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]
19+
*
1820
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.
1921
* @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.
2022
* @param {number} [offsetX=0] - Optional horizontal offset from the position.

src/display/align/in/BottomRight.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ var SetRight = require('../../bounds/SetRight');
1515
* @function Phaser.Display.Align.In.BottomRight
1616
* @since 3.0.0
1717
*
18+
* @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]
19+
*
1820
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.
1921
* @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.
2022
* @param {number} [offsetX=0] - Optional horizontal offset from the position.

src/display/align/in/Center.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ var GetCenterY = require('../../bounds/GetCenterY');
1414
* @function Phaser.Display.Align.In.Center
1515
* @since 3.0.0
1616
*
17+
* @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]
18+
*
1719
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.
1820
* @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.
1921
* @param {number} [offsetX=0] - Optional horizontal offset from the position.

src/display/align/in/LeftCenter.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ var SetLeft = require('../../bounds/SetLeft');
1515
* @function Phaser.Display.Align.In.LeftCenter
1616
* @since 3.0.0
1717
*
18+
* @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]
19+
*
1820
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.
1921
* @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.
2022
* @param {number} [offsetX=0] - Optional horizontal offset from the position.

src/display/align/in/QuickSet.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ AlignInMap[ALIGN_CONST.TOP_RIGHT] = require('./TopRight');
2525
* @function Phaser.Display.Align.In.QuickSet
2626
* @since 3.0.0
2727
*
28+
* @generic {Phaser.GameObjects.GameObject} G - [child,$return]
29+
*
2830
* @param {Phaser.GameObjects.GameObject} child - The Game Object that will be positioned.
2931
* @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.
3032
* @param {integer} position - The position to align the Game Object with. This is an align constant, such as `ALIGN_CONST.LEFT_CENTER`.

src/display/align/in/RightCenter.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ var SetRight = require('../../bounds/SetRight');
1515
* @function Phaser.Display.Align.In.RightCenter
1616
* @since 3.0.0
1717
*
18+
* @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]
19+
*
1820
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.
1921
* @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.
2022
* @param {number} [offsetX=0] - Optional horizontal offset from the position.

src/display/align/in/TopCenter.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ var SetTop = require('../../bounds/SetTop');
1515
* @function Phaser.Display.Align.In.TopCenter
1616
* @since 3.0.0
1717
*
18+
* @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]
19+
*
1820
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.
1921
* @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.
2022
* @param {number} [offsetX=0] - Optional horizontal offset from the position.

src/display/align/in/TopLeft.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ var SetTop = require('../../bounds/SetTop');
1515
* @function Phaser.Display.Align.In.TopLeft
1616
* @since 3.0.0
1717
*
18+
* @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return]
19+
*
1820
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned.
1921
* @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on.
2022
* @param {number} [offsetX=0] - Optional horizontal offset from the position.

0 commit comments

Comments
 (0)