Skip to content

Commit 0d58832

Browse files
committed
Fix types on Animations and Boot
1 parent bdf373b commit 0d58832

4 files changed

Lines changed: 33 additions & 33 deletions

File tree

src/animations/Animation.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var GetValue = require('../utils/object/GetValue');
3636
*/
3737

3838
/**
39-
* @typedef {object} AnimationConfig // TODO 19/03/2018 fix type
39+
* @typedef {object} AnimationConfig
4040
*
4141
* @property {AnimationFrameConfig[]} [frames] - [description]
4242
* @property {string} [defaultTextureKey=null] - [description]
@@ -49,15 +49,15 @@ var GetValue = require('../utils/object/GetValue');
4949
* @property {boolean} [yoyo=false] - Should the animation yoyo? (reverse back down to the start) before repeating?
5050
* @property {boolean} [showOnStart=false] - Should sprite.visible = true when the animation starts to play?
5151
* @property {boolean} [hideOnComplete=false] - Should sprite.visible = false when the animation finishes?
52-
* @property {object} [callbackScope] - [description]
53-
* @property {boolean} [onStart=false] - [description]
54-
* @property {array} [onStartParams] - [description]
55-
* @property {boolean} [onRepeat=false] - [description]
56-
* @property {array} [onRepeatParams] - [description]
57-
* @property {boolean} [onUpdate=false] - [description]
58-
* @property {array} [onUpdateParams] - [description]
59-
* @property {boolean} [onComplete=false] - [description]
60-
* @property {array} [onCompleteParams] - [description]
52+
* @property {*} [callbackScope] - [description]
53+
* @property {(false|function)} [onStart=false] - [description]
54+
* @property {Array.<*>} [onStartParams] - [description]
55+
* @property {(false|function)} [onRepeat=false] - [description]
56+
* @property {Array.<*>} [onRepeatParams] - [description]
57+
* @property {(false|function)} [onUpdate=false] - [description]
58+
* @property {Array.<*>} [onUpdateParams] - [description]
59+
* @property {(false|function)} [onComplete=false] - [description]
60+
* @property {Array.<*>} [onCompleteParams] - [description]
6161
*/
6262

6363
/**
@@ -250,7 +250,7 @@ var Animation = new Class({
250250
* [description]
251251
*
252252
* @name Phaser.Animations.Animation#callbackScope
253-
* @type {object}
253+
* @type {*}
254254
* @since 3.0.0
255255
*/
256256
this.callbackScope = GetValue(config, 'callbackScope', this);
@@ -259,7 +259,7 @@ var Animation = new Class({
259259
* [description]
260260
*
261261
* @name Phaser.Animations.Animation#onStart
262-
* @type {function}
262+
* @type {(false|function)}
263263
* @since 3.0.0
264264
*/
265265
this.onStart = GetValue(config, 'onStart', false);
@@ -268,7 +268,7 @@ var Animation = new Class({
268268
* [description]
269269
*
270270
* @name Phaser.Animations.Animation#onStartParams
271-
* @type {array}
271+
* @type {Array.<*>}
272272
* @since 3.0.0
273273
*/
274274
this.onStartParams = GetValue(config, 'onStartParams', []);
@@ -277,7 +277,7 @@ var Animation = new Class({
277277
* [description]
278278
*
279279
* @name Phaser.Animations.Animation#onRepeat
280-
* @type {function}
280+
* @type {(false|function)}
281281
* @since 3.0.0
282282
*/
283283
this.onRepeat = GetValue(config, 'onRepeat', false);
@@ -286,7 +286,7 @@ var Animation = new Class({
286286
* [description]
287287
*
288288
* @name Phaser.Animations.Animation#onRepeatParams
289-
* @type {array}
289+
* @type {Array.<*>}
290290
* @since 3.0.0
291291
*/
292292
this.onRepeatParams = GetValue(config, 'onRepeatParams', []);
@@ -296,7 +296,7 @@ var Animation = new Class({
296296
* See AnimationFrame.onUpdate for a frame specific callback.
297297
*
298298
* @name Phaser.Animations.Animation#onUpdate
299-
* @type {function}
299+
* @type {(false|function)}
300300
* @since 3.0.0
301301
*/
302302
this.onUpdate = GetValue(config, 'onUpdate', false);
@@ -305,7 +305,7 @@ var Animation = new Class({
305305
* [description]
306306
*
307307
* @name Phaser.Animations.Animation#onUpdateParams
308-
* @type {array}
308+
* @type {Array.<*>}
309309
* @since 3.0.0
310310
*/
311311
this.onUpdateParams = GetValue(config, 'onUpdateParams', []);
@@ -314,7 +314,7 @@ var Animation = new Class({
314314
* [description]
315315
*
316316
* @name Phaser.Animations.Animation#onComplete
317-
* @type {function}
317+
* @type {(false|function)}
318318
* @since 3.0.0
319319
*/
320320
this.onComplete = GetValue(config, 'onComplete', false);
@@ -323,7 +323,7 @@ var Animation = new Class({
323323
* [description]
324324
*
325325
* @name Phaser.Animations.Animation#onCompleteParams
326-
* @type {array}
326+
* @type {Array.<*>}
327327
* @since 3.0.0
328328
*/
329329
this.onCompleteParams = GetValue(config, 'onCompleteParams', []);

src/animations/AnimationManager.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ var AnimationManager = new Class({
8080
* [description]
8181
*
8282
* @name Phaser.Animations.AnimationManager#anims
83-
* @type {Phaser.Structs.Map<string, Phaser.Animations.Animation>}
83+
* @type {Phaser.Structs.Map.<string, Phaser.Animations.Animation>}
8484
* @protected
8585
* @since 3.0.0
8686
*/
@@ -186,7 +186,7 @@ var AnimationManager = new Class({
186186
* @method Phaser.Animations.AnimationManager#fromJSON
187187
* @since 3.0.0
188188
*
189-
* @param {(string|object)} data - [description]
189+
* @param {(string|JSONAnimationManager|JSONAnimation)} data - [description]
190190
* @param {boolean} [clearCurrentAnimations=false] - [description]
191191
*
192192
* @return {Phaser.Animations.Animation[]} An array containing all of the Animation objects that were created as a result of this call.
@@ -242,7 +242,7 @@ var AnimationManager = new Class({
242242
* @param {integer} [config.end=0] - [description]
243243
* @param {string} [config.suffix=''] - [description]
244244
* @param {integer} [config.zeroPad=0] - [description]
245-
* @param {array} [config.outputArray=[]] - [description]
245+
* @param {AnimationFrameConfig[]} [config.outputArray=[]] - [description]
246246
* @param {boolean} [config.frames=false] - [description]
247247
*
248248
* @return {AnimationFrameConfig[]} [description]
@@ -312,7 +312,7 @@ var AnimationManager = new Class({
312312
* @param {integer} [config.start=0] - [description]
313313
* @param {integer} [config.end=-1] - [description]
314314
* @param {boolean} [config.first=false] - [description]
315-
* @param {array} [config.outputArray=[]] - [description]
315+
* @param {AnimationFrameConfig[]} [config.outputArray=[]] - [description]
316316
* @param {boolean} [config.frames=false] - [description]
317317
*
318318
* @return {AnimationFrameConfig[]} [description]

src/boot/Config.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,25 @@ var ValueToColor = require('../display/color/ValueToColor');
5757
* @property {number} [zoom=1] - [description]
5858
* @property {number} [resolution=1] - [description]
5959
* @property {number} [type=CONST.AUTO] - [description]
60-
* @property {object} [?parent=null] - [description]
60+
* @property {*} [?parent=null] - [description]
6161
* @property {HTMLCanvasElement} [?canvas=null] - [description]
6262
* @property {string} [?canvasStyle=null] - [description]
6363
* @property {object} [?scene=null] - [description]
6464
* @property {string[]} [seed] - [description]
6565
* @property {string} [title=''] - [description]
6666
* @property {string} [url='http://phaser.io'] - [description]
6767
* @property {string} [version=''] - [description]
68-
* @property {object} [input] - [description]
68+
* @property {(boolean|object)} [input] - [description]
6969
* @property {boolean} [input.keyboard=true] - [description]
70-
* @property {object} [input.keyboard.target=window] - [description]
71-
* @property {boolean} [input.mouse=true] - [description]
72-
* @property {object} [?input.mouse.target=null] - [description]
70+
* @property {*} [input.keyboard.target=window] - [description]
71+
* @property {(boolean|object)} [input.mouse=true] - [description]
72+
* @property {*} [?input.mouse.target=null] - [description]
7373
* @property {boolean} [input.touch=true] - [description]
74-
* @property {object} [?input.touch.target=null] - [description]
75-
* @property {object} [?input.touch.capture=true] - [description]
76-
* @property {boolean} [input.gamepad=false] - [description]
74+
* @property {*} [?input.touch.target=null] - [description]
75+
* @property {boolean} [?input.touch.capture=true] - [description]
76+
* @property {(boolean|object)} [input.gamepad=false] - [description]
7777
* @property {boolean} [disableContextMenu=false] - [description]
78-
* @property {boolean} [banner=false] - [description]
78+
* @property {(boolean|object)} [banner=false] - [description]
7979
* @property {boolean} [banner.hidePhaser=false] - [description]
8080
* @property {string} [banner.text='#ffffff'] - [description]
8181
* @property {string[]} [banner.background] - [description]

src/boot/Game.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var VisibilityHandler = require('./VisibilityHandler');
4444
* @constructor
4545
* @since 3.0.0
4646
*
47-
* @param {object} [GameConfig] - The configuration object for your Phaser Game instance.
47+
* @param {GameConfig} [GameConfig] - The configuration object for your Phaser Game instance.
4848
*/
4949
var Game = new Class({
5050

0 commit comments

Comments
 (0)