From d8dc7fb4d7cad3bc18de685ad7a462cf666e0a10 Mon Sep 17 00:00:00 2001 From: "J.C" <1571995@qq.com> Date: Mon, 2 Mar 2020 20:14:25 +0800 Subject: [PATCH] TS def improvements --- src/data/DataManager.js | 2 +- src/math/easing/linear/Linear.js | 2 +- src/math/easing/linear/index.js | 4 ---- src/tweens/typedefs/NumberTweenBuilderConfig.js | 8 ++++---- src/tweens/typedefs/TweenBuilderConfig.js | 8 ++++---- src/utils/object/Extend.js | 2 ++ src/utils/string/Pad.js | 2 +- 7 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/data/DataManager.js b/src/data/DataManager.js index 5bc295e8d..08cd33a2f 100644 --- a/src/data/DataManager.js +++ b/src/data/DataManager.js @@ -28,7 +28,7 @@ var Events = require('./events'); * @since 3.0.0 * * @param {object} parent - The object that this DataManager belongs to. - * @param {Phaser.Events.EventEmitter} eventEmitter - The DataManager's event emitter. + * @param {Phaser.Events.EventEmitter} [eventEmitter] - The DataManager's event emitter. */ var DataManager = new Class({ diff --git a/src/math/easing/linear/Linear.js b/src/math/easing/linear/Linear.js index 939f63997..1e491b361 100644 --- a/src/math/easing/linear/Linear.js +++ b/src/math/easing/linear/Linear.js @@ -7,7 +7,7 @@ /** * Linear easing (no variation). * - * @function Phaser.Math.Easing.Linear.Linear + * @function Phaser.Math.Easing.Linear * @since 3.0.0 * * @param {number} v - The value to be tweened. diff --git a/src/math/easing/linear/index.js b/src/math/easing/linear/index.js index 776bc03a2..88a270caa 100644 --- a/src/math/easing/linear/index.js +++ b/src/math/easing/linear/index.js @@ -4,8 +4,4 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * @namespace Phaser.Math.Easing.Linear - */ - module.exports = require('./Linear'); diff --git a/src/tweens/typedefs/NumberTweenBuilderConfig.js b/src/tweens/typedefs/NumberTweenBuilderConfig.js index 69a26770e..50aa9dfbc 100644 --- a/src/tweens/typedefs/NumberTweenBuilderConfig.js +++ b/src/tweens/typedefs/NumberTweenBuilderConfig.js @@ -12,10 +12,10 @@ * @property {number} [repeat=0] - The number of times to repeat the tween. * @property {number} [repeatDelay=0] - The number of milliseconds to pause before a tween will repeat. * @property {boolean} [yoyo=false] - Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. - * @property {number|function|object|array} [offset=null] - Used when the Tween is part of a Timeline. - * @property {number|function|object|array} [completeDelay=0] - The time the tween will wait before the onComplete event is dispatched once it has completed, in ms. - * @property {number|function|object|array} [loop=0] - The number of times the tween will repeat. (A value of 1 means the tween will play twice, as it repeated once.) The first loop starts after every property tween has completed once. - * @property {number|function|object|array} [loopDelay=0] - The time the tween will pause before starting either a yoyo or returning to the start for a repeat. + * @property {string|number|function|object|array} [offset=null] - Used when the Tween is part of a Timeline. + * @property {string|number|function|object|array} [completeDelay=0] - The time the tween will wait before the onComplete event is dispatched once it has completed, in ms. + * @property {string|number|function|object|array} [loop=0] - The number of times the tween will repeat. (A value of 1 means the tween will play twice, as it repeated once.) The first loop starts after every property tween has completed once. + * @property {string|number|function|object|array} [loopDelay=0] - The time the tween will pause before starting either a yoyo or returning to the start for a repeat. * @property {boolean} [paused=false] - Does the tween start in a paused state (true) or playing (false)? * @property {boolean} [useFrames=false] - Use frames or milliseconds? * @property {any} [callbackScope] - Scope (this) for the callbacks. The default scope is the tween. diff --git a/src/tweens/typedefs/TweenBuilderConfig.js b/src/tweens/typedefs/TweenBuilderConfig.js index a764b5cce..646670ee7 100644 --- a/src/tweens/typedefs/TweenBuilderConfig.js +++ b/src/tweens/typedefs/TweenBuilderConfig.js @@ -13,10 +13,10 @@ * @property {boolean} [yoyo=false] - Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. * @property {boolean} [flipX=false] - Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. * @property {boolean} [flipY=false] - Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property. - * @property {number|function|object|array} [offset=null] - Used when the Tween is part of a Timeline. - * @property {number|function|object|array} [completeDelay=0] - The time the tween will wait before the onComplete event is dispatched once it has completed, in ms. - * @property {number|function|object|array} [loop=0] - The number of times the tween will repeat. (A value of 1 means the tween will play twice, as it repeated once.) The first loop starts after every property tween has completed once. - * @property {number|function|object|array} [loopDelay=0] - The time the tween will pause before starting either a yoyo or returning to the start for a repeat. + * @property {string|number|function|object|array} [offset=null] - Used when the Tween is part of a Timeline. + * @property {string|number|function|object|array} [completeDelay=0] - The time the tween will wait before the onComplete event is dispatched once it has completed, in ms. + * @property {string|number|function|object|array} [loop=0] - The number of times the tween will repeat. (A value of 1 means the tween will play twice, as it repeated once.) The first loop starts after every property tween has completed once. + * @property {string|number|function|object|array} [loopDelay=0] - The time the tween will pause before starting either a yoyo or returning to the start for a repeat. * @property {boolean} [paused=false] - Does the tween start in a paused state (true) or playing (false)? * @property {Object.} [props] - The properties to tween. * @property {boolean} [useFrames=false] - Use frames or milliseconds? diff --git a/src/utils/object/Extend.js b/src/utils/object/Extend.js index 53641ee0f..77be93611 100644 --- a/src/utils/object/Extend.js +++ b/src/utils/object/Extend.js @@ -16,6 +16,8 @@ var IsPlainObject = require('./IsPlainObject'); * @function Phaser.Utils.Objects.Extend * @since 3.0.0 * + * @param {...*} [args] - The objects that will be mixed. + * * @return {object} The extended object. */ var Extend = function () diff --git a/src/utils/string/Pad.js b/src/utils/string/Pad.js index d8e5c609e..49addbccc 100644 --- a/src/utils/string/Pad.js +++ b/src/utils/string/Pad.js @@ -27,7 +27,7 @@ * @function Phaser.Utils.String.Pad * @since 3.0.0 * - * @param {string} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. + * @param {string|number|object} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. * @param {integer} [len=0] - The number of characters to be added. * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). * @param {integer} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both).