Skip to content

Commit

Permalink
Migrate jsdoc imports to ES6 modules with extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
vpmedia committed Sep 15, 2023
1 parent 3b35880 commit ece4b45
Show file tree
Hide file tree
Showing 145 changed files with 490 additions and 460 deletions.
6 changes: 3 additions & 3 deletions src/phaser/core/animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ export class Animation {
/**
* TBD.
* @param {import('./game.js').Game} game - TBD.
* @param {import('../display/image').Image} parent - TBD.
* @param {import('../display/image.js').Image} parent - TBD.
* @param {string} name - TBD.
* @param {import('./frame_data').FrameData} frameData - TBD.
* @param {import('./frame_data.js').FrameData} frameData - TBD.
* @param {string[]|number[]} frames - TBD.
* @param {number} frameRate - TBD.
* @param {boolean} loop - TBD.
Expand Down Expand Up @@ -302,7 +302,7 @@ export class Animation {

/**
* TBD.
* @param {import('./frame_data').FrameData} frameData - TBD.
* @param {import('./frame_data.js').FrameData} frameData - TBD.
*/
updateFrameData(frameData) {
this._frameData = frameData;
Expand Down
8 changes: 4 additions & 4 deletions src/phaser/core/animation_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Animation } from './animation.js';
export class AnimationManager {
/**
* TBD.
* @param {import('../display/image').Image} sprite - TBD.
* @param {import('../display/image.js').Image} sprite - TBD.
*/
constructor(sprite) {
this.sprite = sprite;
Expand Down Expand Up @@ -36,7 +36,7 @@ export class AnimationManager {

/**
* TBD.
* @param {import('./frame_data').FrameData} frameData - TBD.
* @param {import('./frame_data.js').FrameData} frameData - TBD.
* @param {string|number} frame - TBD.
* @returns {boolean} TBD.
*/
Expand Down Expand Up @@ -66,7 +66,7 @@ export class AnimationManager {

/**
* TBD.
* @param {import('./frame_data').FrameData} frameData - TBD.
* @param {import('./frame_data.js').FrameData} frameData - TBD.
* @param {string|number} frame - TBD.
* @returns {boolean} TBD.
*/
Expand Down Expand Up @@ -245,7 +245,7 @@ export class AnimationManager {

/**
* TBD.
* @returns {import('./frame_data').FrameData} TBD.
* @returns {import('./frame_data.js').FrameData} TBD.
*/
get frameData() {
return this._frameData;
Expand Down
2 changes: 1 addition & 1 deletion src/phaser/core/event_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Signal } from './signal.js';
export class EventManager {
/**
* TBD.
* @param {import('../display/display_object').DisplayObject} sprite - TBD.
* @param {import('../display/display_object.js').DisplayObject} sprite - TBD.
*/
constructor(sprite) {
this.parent = sprite;
Expand Down
14 changes: 7 additions & 7 deletions src/phaser/core/frame_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class FrameData {
*/
constructor() {
/**
* @type {import('./frame').Frame[]}
* @type {import('./frame.js').Frame[]}
*/
this._frames = [];
/**
Expand All @@ -17,8 +17,8 @@ export class FrameData {

/**
* TBD.
* @param {import('./frame').Frame} frame - TBD.
* @returns {import('./frame').Frame} TBD.
* @param {import('./frame.js').Frame} frame - TBD.
* @returns {import('./frame.js').Frame} TBD.
*/
addFrame(frame) {
frame.index = this._frames.length;
Expand All @@ -32,7 +32,7 @@ export class FrameData {
/**
* TBD.
* @param {number} index - TBD.
* @returns {import('./frame').Frame} TBD.
* @returns {import('./frame.js').Frame} TBD.
*/
getFrame(index = 0) {
if (index >= this._frames.length) {
Expand All @@ -44,7 +44,7 @@ export class FrameData {
/**
* TBD.
* @param {string} name - TBD.
* @returns {import('./frame').Frame} TBD.
* @returns {import('./frame.js').Frame} TBD.
*/
getFrameByName(name) {
if (typeof this._frameNames[name] === 'number') {
Expand Down Expand Up @@ -77,8 +77,8 @@ export class FrameData {
* TBD.
* @param {number} start - TBD.
* @param {number} end - TBD.
* @param {import('./frame').Frame[]} output - TBD.
* @returns {import('./frame').Frame[]} TBD.
* @param {import('./frame.js').Frame[]} output - TBD.
* @returns {import('./frame.js').Frame[]} TBD.
*/
getFrameRange(start, end, output = null) {
const result = output || [];
Expand Down
4 changes: 2 additions & 2 deletions src/phaser/core/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export class Input {

/**
* TBD.
* @param {import('../display/display_object').DisplayObject} displayObject - TBD.
* @param {import('../display/display_object.js').DisplayObject} displayObject - TBD.
* @param {Pointer} pointer - TBD.
* @param {Point} output - TBD.
* @returns {Point} TBD.
Expand All @@ -377,7 +377,7 @@ export class Input {

/**
* TBD.
* @param {import('../display/display_object').DisplayObject} displayObject - TBD.
* @param {import('../display/display_object.js').DisplayObject} displayObject - TBD.
* @param {Pointer} pointer - TBD.
* @param {Point} localPoint - TBD.
* @returns {boolean} TBD.
Expand Down
10 changes: 5 additions & 5 deletions src/phaser/core/input_handler.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Point } from '../geom/point.js';
import { GROUP } from './const.js';
import { distance } from '../util/math.js';
import { GROUP } from './const.js';

export class InputHandler {
/**
* TBD.
* @param {import('../display/image').Image} sprite - TBD.
* @param {import('../display/image.js').Image} sprite - TBD.
*/
constructor(sprite) {
this.sprite = sprite;
Expand Down Expand Up @@ -72,7 +72,7 @@ export class InputHandler {
* TBD.
* @param {number} priority - TBD.
* @param {boolean} useHandCursor - TBD.
* @returns {import('../display/display_object').DisplayObject} TBD.
* @returns {import('../display/display_object.js').DisplayObject} TBD.
*/
start(priority = 0, useHandCursor = false) {
// Turning on
Expand Down Expand Up @@ -766,8 +766,8 @@ export class InputHandler {
* @param {boolean} bringToTop - TBD.
* @param {boolean} pixelPerfect - TBD.
* @param {number} alphaThreshold - TBD.
* @param {import('../geom/rectangle').Rectangle} boundsRect - TBD.
* @param {import('../display/display_object').DisplayObject} boundsSprite - TBD.
* @param {import('../geom/rectangle.js').Rectangle} boundsRect - TBD.
* @param {import('../display/display_object.js').DisplayObject} boundsSprite - TBD.
*/
enableDrag(
lockCenter = false,
Expand Down
2 changes: 1 addition & 1 deletion src/phaser/core/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class Loader {

/**
* TBD.
* @param {import('../display/image').Image} sprite - TBD.
* @param {import('../display/image.js').Image} sprite - TBD.
* @param {number} direction - TBD.
*/
setPreloadSprite(sprite, direction = 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/phaser/core/tween.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TweenData } from './tween_data.js';
export class Tween {
/**
* TBD.
* @param {import('../display/display_object').DisplayObject} target - TBD.
* @param {import('../display/display_object.js').DisplayObject} target - TBD.
* @param {import('./game.js').Game} game - TBD.
* @param {import('./tween_manager').TweenManager} manager - TBD.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/phaser/display/canvas/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ export class CanvasRenderer {

/**
* TBD.
* @param {import('../../display/image').Image} displayObject - TBD.
* @param {import('../../display/image.js').Image} displayObject - TBD.
* @param {CanvasRenderingContext2D} context - TBD.
* @param {import('../../geom/matrix').Matrix} matrix - TBD.
* @param {import('../../geom/matrix.js').Matrix} matrix - TBD.
*/
renderDisplayObject(displayObject, context, matrix) {
this.renderSession.context = context || this.context;
Expand Down
2 changes: 1 addition & 1 deletion src/phaser/display/graphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ export class Graphics extends DisplayObject {

/**
* TBD.
* @param {import('../geom/matrix').Matrix} matrix - TBD.
* @param {import('../geom/matrix.js').Matrix} matrix - TBD.
* @returns {Rectangle} TBD.
*/
getBounds(matrix = null) {
Expand Down
8 changes: 4 additions & 4 deletions src/phaser/display/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class Image extends DisplayObject {

/**
* TBD.
* @param {import('../core/frame').Frame} frame - TBD.
* @param {import('../core/frame.js').Frame} frame - TBD.
*/
setFrame(frame) {
this._frame = frame;
Expand Down Expand Up @@ -343,7 +343,7 @@ export class Image extends DisplayObject {

/**
* TBD.
* @param {import('../geom/matrix').Matrix} matrix - TBD.
* @param {import('../geom/matrix.js').Matrix} matrix - TBD.
* @returns {Rectangle} TBD.
*/
getBounds(matrix = null) {
Expand All @@ -361,7 +361,7 @@ export class Image extends DisplayObject {
/**
* TBD.
* @param {object} renderSession - TBD.
* @param {import('../geom/matrix').Matrix} matrix - TBD.
* @param {import('../geom/matrix.js').Matrix} matrix - TBD.
*/
renderWebGL(renderSession, matrix = null) {
renderWebGL(this, renderSession, matrix);
Expand All @@ -370,7 +370,7 @@ export class Image extends DisplayObject {
/**
* TBD.
* @param {object} renderSession - TBD.
* @param {import('../geom/matrix').Matrix} matrix - TBD.
* @param {import('../geom/matrix.js').Matrix} matrix - TBD.
*/
renderCanvas(renderSession, matrix = null) {
renderCanvas(this, renderSession, matrix);
Expand Down
22 changes: 11 additions & 11 deletions src/phaser/display/sprite_util.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getTintedTexture } from './canvas/tinter.js';
import { getIdentityMatrix } from '../geom/util/matrix.js';
import { SCALE_LINEAR } from '../core/const.js';
import { getIdentityMatrix } from '../geom/util/matrix.js';
import { getTintedTexture } from './canvas/tinter.js';

/**
* TBD.
* @param {import('./image').Image} target - TBD.
* @param {import('./image.js').Image} target - TBD.
* @param {import('./webgl/texture').Texture} texture - TBD.
* @param {boolean} destroyBase - TBD.
*/
Expand All @@ -20,9 +20,9 @@ export function setTexture(target, texture, destroyBase = false) {

/**
* TBD.
* @param {import('./image').Image} target - TBD.
* @param {import('./image.js').Image} target - TBD.
* @param {object} matrix - TBD.
* @returns {import('../geom/rectangle').Rectangle} TBD.
* @returns {import('../geom/rectangle.js').Rectangle} TBD.
*/
export function getBounds(target, matrix = null) {
// TODO verify
Expand Down Expand Up @@ -103,8 +103,8 @@ export function getBounds(target, matrix = null) {

/**
* TBD.
* @param {import('./image').Image} target - TBD.
* @returns {import('../geom/rectangle').Rectangle} TBD.
* @param {import('./image.js').Image} target - TBD.
* @returns {import('../geom/rectangle.js').Rectangle} TBD.
*/
export function getLocalBounds(target) {
const matrixCache = target.worldTransform;
Expand All @@ -123,9 +123,9 @@ export function getLocalBounds(target) {

/**
* TBD.
* @param {import('./image').Image} target - TBD.
* @param {import('./image.js').Image} target - TBD.
* @param {object} renderSession - TBD.
* @param {import('../geom/matrix').Matrix} matrix - TBD.
* @param {import('../geom/matrix.js').Matrix} matrix - TBD.
*/
export function renderWebGL(target, renderSession, matrix) {
// if the sprite is not visible or the alpha is 0 then no need to render this element
Expand Down Expand Up @@ -172,9 +172,9 @@ export function renderWebGL(target, renderSession, matrix) {

/**
* TBD.
* @param {import('./image').Image} target - TBD.
* @param {import('./image.js').Image} target - TBD.
* @param {object} renderSession - TBD.
* @param {import('../geom/matrix').Matrix} matrix - TBD.
* @param {import('../geom/matrix.js').Matrix} matrix - TBD.
*/
export function renderCanvas(target, renderSession, matrix) {
// If the sprite is not visible or the alpha is 0 then no need to render this element
Expand Down
2 changes: 1 addition & 1 deletion src/phaser/display/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ export class Text extends Image {

/**
* TBD.
* @param {import('../geom/matrix').Matrix} matrix - TBD.
* @param {import('../geom/matrix.js').Matrix} matrix - TBD.
* @returns {Rectangle} TBD.
*/
getBounds(matrix = null) {
Expand Down
2 changes: 1 addition & 1 deletion src/phaser/display/webgl/fast_sprite_batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class FastSpriteBatch {

/**
* TBD.
* @param {import('../../display/image').Image} sprite - TBD.
* @param {import('../../display/image.js').Image} sprite - TBD.
*/
renderSprite(sprite) {
if (!sprite.visible) {
Expand Down
4 changes: 2 additions & 2 deletions src/phaser/display/webgl/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ export class WebGLRenderer {

/**
* TBD.
* @param {import('../../display/display_object').DisplayObject} displayObject - TBD.
* @param {import('../../display/display_object.js').DisplayObject} displayObject - TBD.
* @param {Point} projection - TBD.
* @param {object} buffer - TBD.
* @param {import('../../geom/matrix').Matrix} matrix - TBD.
* @param {import('../../geom/matrix.js').Matrix} matrix - TBD.
*/
renderDisplayObject(displayObject, projection, buffer, matrix) {
this.renderSession.blendModeManager.setBlendMode(BLEND_NORMAL);
Expand Down
4 changes: 2 additions & 2 deletions src/phaser/display/webgl/sprite_batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export class WebGLSpriteBatch {

/**
* TBD.
* @param {import('../../display/image').Image} sprite - TBD.
* @param {import('../../geom/matrix').Matrix} matrix - TBD.
* @param {import('../../display/image.js').Image} sprite - TBD.
* @param {import('../../geom/matrix.js').Matrix} matrix - TBD.
*/
render(sprite, matrix) {
const texture = sprite.texture;
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/* Modules */
"module": "ESNext" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "nodenext" /* Specify how TypeScript looks up a file from a given module specifier. */,
"moduleResolution": "esnext" /* Specify how TypeScript looks up a file from a given module specifier. */,
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
Expand Down
Loading

0 comments on commit ece4b45

Please sign in to comment.