@vpmedia/phaser 1.17.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/README.md +1 -1
  2. package/package.json +4 -4
  3. package/src/phaser/core/animation.js +3 -2
  4. package/src/phaser/core/animation_manager.js +3 -2
  5. package/src/phaser/core/cache.js +38 -17
  6. package/src/phaser/core/const.js +66 -0
  7. package/src/phaser/core/device.js +87 -0
  8. package/src/phaser/core/dom.js +13 -8
  9. package/src/phaser/core/event_manager.js +2 -1
  10. package/src/phaser/core/factory.js +11 -11
  11. package/src/phaser/core/game.js +1 -0
  12. package/src/phaser/core/input.js +13 -12
  13. package/src/phaser/core/input_handler.js +2 -1
  14. package/src/phaser/core/input_mouse.js +3 -2
  15. package/src/phaser/core/input_mspointer.js +6 -6
  16. package/src/phaser/core/input_pointer.js +3 -2
  17. package/src/phaser/core/loader.js +70 -69
  18. package/src/phaser/core/scale_manager.js +41 -24
  19. package/src/phaser/core/scene_manager.js +11 -7
  20. package/src/phaser/core/signal_binding.js +16 -7
  21. package/src/phaser/core/sound_manager.js +14 -7
  22. package/src/phaser/core/sound_sprite.js +7 -4
  23. package/src/phaser/core/timer.js +33 -21
  24. package/src/phaser/core/timer_event.js +8 -6
  25. package/src/phaser/core/tween.js +66 -45
  26. package/src/phaser/core/tween_data.js +23 -15
  27. package/src/phaser/core/tween_manager.js +10 -6
  28. package/src/phaser/display/bitmap_text.js +7 -6
  29. package/src/phaser/display/canvas/pool.js +1 -1
  30. package/src/phaser/display/canvas/renderer.js +9 -5
  31. package/src/phaser/display/canvas/util.js +2 -2
  32. package/src/phaser/display/display_object.js +35 -16
  33. package/src/phaser/display/graphics.js +61 -40
  34. package/src/phaser/display/graphics_data.js +7 -7
  35. package/src/phaser/display/image.js +19 -12
  36. package/src/phaser/display/sprite_util.js +3 -2
  37. package/src/phaser/display/text.js +57 -33
  38. package/src/phaser/display/webgl/abstract_filter.js +2 -2
  39. package/src/phaser/display/webgl/base_texture.js +2 -2
  40. package/src/phaser/display/webgl/blend_manager.js +3 -2
  41. package/src/phaser/display/webgl/earcut_node.js +1 -1
  42. package/src/phaser/display/webgl/fast_sprite_batch.js +8 -6
  43. package/src/phaser/display/webgl/filter_manager.js +1 -1
  44. package/src/phaser/display/webgl/filter_texture.js +2 -2
  45. package/src/phaser/display/webgl/graphics.js +6 -6
  46. package/src/phaser/display/webgl/graphics_data.js +1 -1
  47. package/src/phaser/display/webgl/render_texture.js +9 -3
  48. package/src/phaser/display/webgl/renderer.js +13 -6
  49. package/src/phaser/display/webgl/shader/complex.js +1 -1
  50. package/src/phaser/display/webgl/shader/fast.js +1 -1
  51. package/src/phaser/display/webgl/shader/normal.js +2 -2
  52. package/src/phaser/display/webgl/shader/primitive.js +1 -1
  53. package/src/phaser/display/webgl/shader/strip.js +1 -1
  54. package/src/phaser/display/webgl/shader_manager.js +4 -3
  55. package/src/phaser/display/webgl/sprite_batch.js +10 -7
  56. package/src/phaser/display/webgl/stencil_manager.js +12 -10
  57. package/src/phaser/display/webgl/texture.js +8 -6
  58. package/typedefs/global.d.ts +1 -1
  59. package/types/phaser/core/animation.d.ts +5 -4
  60. package/types/phaser/core/animation.d.ts.map +1 -1
  61. package/types/phaser/core/animation_manager.d.ts +7 -6
  62. package/types/phaser/core/animation_manager.d.ts.map +1 -1
  63. package/types/phaser/core/cache.d.ts +69 -45
  64. package/types/phaser/core/cache.d.ts.map +1 -1
  65. package/types/phaser/core/const.d.ts +88 -22
  66. package/types/phaser/core/const.d.ts.map +1 -1
  67. package/types/phaser/core/device.d.ts +87 -0
  68. package/types/phaser/core/device.d.ts.map +1 -1
  69. package/types/phaser/core/dom.d.ts +19 -27
  70. package/types/phaser/core/dom.d.ts.map +1 -1
  71. package/types/phaser/core/event_manager.d.ts +4 -3
  72. package/types/phaser/core/event_manager.d.ts.map +1 -1
  73. package/types/phaser/core/factory.d.ts +15 -15
  74. package/types/phaser/core/factory.d.ts.map +1 -1
  75. package/types/phaser/core/game.d.ts +1 -0
  76. package/types/phaser/core/game.d.ts.map +1 -1
  77. package/types/phaser/core/input.d.ts +22 -21
  78. package/types/phaser/core/input.d.ts.map +1 -1
  79. package/types/phaser/core/input_handler.d.ts +5 -4
  80. package/types/phaser/core/input_handler.d.ts.map +1 -1
  81. package/types/phaser/core/input_mouse.d.ts +1 -1
  82. package/types/phaser/core/input_mouse.d.ts.map +1 -1
  83. package/types/phaser/core/input_mspointer.d.ts +13 -13
  84. package/types/phaser/core/input_mspointer.d.ts.map +1 -1
  85. package/types/phaser/core/input_pointer.d.ts +5 -4
  86. package/types/phaser/core/input_pointer.d.ts.map +1 -1
  87. package/types/phaser/core/loader.d.ts +104 -103
  88. package/types/phaser/core/loader.d.ts.map +1 -1
  89. package/types/phaser/core/scale_manager.d.ts +57 -40
  90. package/types/phaser/core/scale_manager.d.ts.map +1 -1
  91. package/types/phaser/core/scene_manager.d.ts +16 -11
  92. package/types/phaser/core/scene_manager.d.ts.map +1 -1
  93. package/types/phaser/core/signal_binding.d.ts +23 -15
  94. package/types/phaser/core/signal_binding.d.ts.map +1 -1
  95. package/types/phaser/core/sound_manager.d.ts +16 -9
  96. package/types/phaser/core/sound_manager.d.ts.map +1 -1
  97. package/types/phaser/core/sound_sprite.d.ts +10 -7
  98. package/types/phaser/core/sound_sprite.d.ts.map +1 -1
  99. package/types/phaser/core/timer.d.ts +41 -29
  100. package/types/phaser/core/timer.d.ts.map +1 -1
  101. package/types/phaser/core/timer_event.d.ts +12 -11
  102. package/types/phaser/core/timer_event.d.ts.map +1 -1
  103. package/types/phaser/core/tween.d.ts +82 -62
  104. package/types/phaser/core/tween.d.ts.map +1 -1
  105. package/types/phaser/core/tween_data.d.ts +31 -23
  106. package/types/phaser/core/tween_data.d.ts.map +1 -1
  107. package/types/phaser/core/tween_manager.d.ts +16 -12
  108. package/types/phaser/core/tween_manager.d.ts.map +1 -1
  109. package/types/phaser/display/bitmap_text.d.ts +10 -9
  110. package/types/phaser/display/bitmap_text.d.ts.map +1 -1
  111. package/types/phaser/display/button.d.ts +3 -2
  112. package/types/phaser/display/button.d.ts.map +1 -1
  113. package/types/phaser/display/canvas/buffer.d.ts +2 -2
  114. package/types/phaser/display/canvas/buffer.d.ts.map +1 -1
  115. package/types/phaser/display/canvas/pool.d.ts +2 -2
  116. package/types/phaser/display/canvas/pool.d.ts.map +1 -1
  117. package/types/phaser/display/canvas/renderer.d.ts +11 -7
  118. package/types/phaser/display/canvas/renderer.d.ts.map +1 -1
  119. package/types/phaser/display/canvas/util.d.ts +2 -2
  120. package/types/phaser/display/canvas/util.d.ts.map +1 -1
  121. package/types/phaser/display/display_object.d.ts +55 -36
  122. package/types/phaser/display/display_object.d.ts.map +1 -1
  123. package/types/phaser/display/graphics.d.ts +71 -53
  124. package/types/phaser/display/graphics.d.ts.map +1 -1
  125. package/types/phaser/display/graphics_data.d.ts +16 -16
  126. package/types/phaser/display/graphics_data.d.ts.map +1 -1
  127. package/types/phaser/display/image.d.ts +27 -25
  128. package/types/phaser/display/image.d.ts.map +1 -1
  129. package/types/phaser/display/sprite_util.d.ts +5 -4
  130. package/types/phaser/display/sprite_util.d.ts.map +1 -1
  131. package/types/phaser/display/text.d.ts +82 -93
  132. package/types/phaser/display/text.d.ts.map +1 -1
  133. package/types/phaser/display/webgl/abstract_filter.d.ts +4 -4
  134. package/types/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
  135. package/types/phaser/display/webgl/base_texture.d.ts +4 -4
  136. package/types/phaser/display/webgl/base_texture.d.ts.map +1 -1
  137. package/types/phaser/display/webgl/blend_manager.d.ts +6 -5
  138. package/types/phaser/display/webgl/blend_manager.d.ts.map +1 -1
  139. package/types/phaser/display/webgl/earcut_node.d.ts +3 -3
  140. package/types/phaser/display/webgl/earcut_node.d.ts.map +1 -1
  141. package/types/phaser/display/webgl/fast_sprite_batch.d.ts +14 -13
  142. package/types/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
  143. package/types/phaser/display/webgl/filter_manager.d.ts +3 -3
  144. package/types/phaser/display/webgl/filter_manager.d.ts.map +1 -1
  145. package/types/phaser/display/webgl/filter_texture.d.ts +7 -7
  146. package/types/phaser/display/webgl/filter_texture.d.ts.map +1 -1
  147. package/types/phaser/display/webgl/graphics.d.ts +13 -12
  148. package/types/phaser/display/webgl/graphics.d.ts.map +1 -1
  149. package/types/phaser/display/webgl/graphics_data.d.ts +5 -5
  150. package/types/phaser/display/webgl/graphics_data.d.ts.map +1 -1
  151. package/types/phaser/display/webgl/render_texture.d.ts +12 -10
  152. package/types/phaser/display/webgl/render_texture.d.ts.map +1 -1
  153. package/types/phaser/display/webgl/renderer.d.ts +16 -9
  154. package/types/phaser/display/webgl/renderer.d.ts.map +1 -1
  155. package/types/phaser/display/webgl/shader/complex.d.ts +11 -11
  156. package/types/phaser/display/webgl/shader/complex.d.ts.map +1 -1
  157. package/types/phaser/display/webgl/shader/fast.d.ts +15 -15
  158. package/types/phaser/display/webgl/shader/fast.d.ts.map +1 -1
  159. package/types/phaser/display/webgl/shader/normal.d.ts +12 -12
  160. package/types/phaser/display/webgl/shader/normal.d.ts.map +1 -1
  161. package/types/phaser/display/webgl/shader/primitive.d.ts +12 -12
  162. package/types/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
  163. package/types/phaser/display/webgl/shader/strip.d.ts +12 -12
  164. package/types/phaser/display/webgl/shader/strip.d.ts.map +1 -1
  165. package/types/phaser/display/webgl/shader_manager.d.ts +9 -8
  166. package/types/phaser/display/webgl/shader_manager.d.ts.map +1 -1
  167. package/types/phaser/display/webgl/sprite_batch.d.ts +17 -14
  168. package/types/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
  169. package/types/phaser/display/webgl/stencil_manager.d.ts +17 -15
  170. package/types/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
  171. package/types/phaser/display/webgl/texture.d.ts +15 -12
  172. package/types/phaser/display/webgl/texture.d.ts.map +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @vpmedia/phaser
2
2
 
3
- [![npm version](https://badge.fury.io/js/@vpmedia%2Fphaser.svg?v=1.17.0)](https://badge.fury.io/js/@vpmedia%2Fphaser)
3
+ [![npm version](https://badge.fury.io/js/@vpmedia%2Fphaser.svg?v=1.19.0)](https://badge.fury.io/js/@vpmedia%2Fphaser)
4
4
  [![Node.js CI](https://github.com/vpmedia/phaser/actions/workflows/node.js.yml/badge.svg)](https://github.com/vpmedia/phaser/actions/workflows/node.js.yml)
5
5
 
6
6
  @vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vpmedia/phaser",
3
- "version": "1.17.0",
3
+ "version": "1.19.0",
4
4
  "description": "@vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2",
5
5
  "author": "Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)",
6
6
  "license": "MIT",
@@ -22,16 +22,16 @@
22
22
  "main": "./src/index.js",
23
23
  "types": "./types/index.d.ts",
24
24
  "devDependencies": {
25
- "eslint": "^8.38.0",
25
+ "eslint": "^8.39.0",
26
26
  "eslint-config-prettier": "^8.8.0",
27
27
  "eslint-plugin-import": "^2.27.5",
28
28
  "eslint-plugin-jest": "^27.2.1",
29
- "eslint-plugin-jsdoc": "^43.0.6",
29
+ "eslint-plugin-jsdoc": "^43.0.7",
30
30
  "eslint-plugin-prettier": "^4.2.1",
31
31
  "husky": "^8.0.3",
32
32
  "jest": "^29.5.0",
33
33
  "lint-staged": "^13.2.1",
34
- "prettier": "^2.8.7",
34
+ "prettier": "^2.8.8",
35
35
  "typescript": "^5.0.4"
36
36
  },
37
37
  "scripts": {
@@ -1,15 +1,16 @@
1
1
  import { Game } from './game';
2
2
  import { Signal } from './signal';
3
3
  import { FrameData } from './frame_data';
4
+ import { Image } from '../display/image';
4
5
 
5
6
  export class Animation {
6
7
  /**
7
8
  * TBD.
8
9
  * @param {Game} game - TBD.
9
- * @param parent - TBD.
10
+ * @param {Image} parent - TBD.
10
11
  * @param {string} name - TBD.
11
12
  * @param {FrameData} frameData - TBD.
12
- * @param frames - TBD.
13
+ * @param {string[]|number[]} frames - TBD.
13
14
  * @param {number} frameRate - TBD.
14
15
  * @param {boolean} loop - TBD.
15
16
  */
@@ -1,10 +1,11 @@
1
1
  import { Animation } from './animation';
2
2
  import { FrameData } from './frame_data';
3
+ import { Image } from '../display/image';
3
4
 
4
5
  export class AnimationManager {
5
6
  /**
6
7
  * TBD.
7
- * @param sprite - TBD.
8
+ * @param {Image} sprite - TBD.
8
9
  */
9
10
  constructor(sprite) {
10
11
  this.sprite = sprite;
@@ -131,7 +132,7 @@ export class AnimationManager {
131
132
 
132
133
  /**
133
134
  * TBD.
134
- * @param {number[]} frames - TBD.
135
+ * @param {string[]|number[]} frames - TBD.
135
136
  * @param {boolean} useNumericIndex - TBD.
136
137
  * @returns {boolean} TBD.
137
138
  */
@@ -1,5 +1,6 @@
1
1
  import { Texture } from '../display/webgl/texture';
2
2
  import { BaseTexture } from '../display/webgl/base_texture';
3
+ import { RenderTexture } from '../display/webgl/render_texture';
3
4
  import { Signal } from './signal';
4
5
  import { Frame } from './frame';
5
6
  import { FrameData } from './frame_data';
@@ -84,7 +85,7 @@ export class Cache {
84
85
  * TBD.
85
86
  * @param {string} key - TBD.
86
87
  * @param {string} url - TBD.
87
- * @param data - TBD.
88
+ * @param {HTMLImageElement} data - TBD.
88
89
  * @returns {object} TBD.
89
90
  */
90
91
  addImage(key, url, data) {
@@ -112,8 +113,8 @@ export class Cache {
112
113
  * TBD.
113
114
  * @param {string} key - TBD.
114
115
  * @param {string} url - TBD.
115
- * @param data - TBD.
116
- * @param atlasData - TBD.
116
+ * @param {HTMLCanvasElement} data - TBD.
117
+ * @param {object} atlasData - TBD.
117
118
  */
118
119
  addTextureAtlas(key, url, data, atlasData) {
119
120
  const obj = {
@@ -131,7 +132,7 @@ export class Cache {
131
132
  * TBD.
132
133
  * @param {string} key - TBD.
133
134
  * @param {string} url - TBD.
134
- * @param data - TBD.
135
+ * @param {object} data - TBD.
135
136
  */
136
137
  addSound(key, url, data) {
137
138
  this._cache.sound[key] = {
@@ -148,7 +149,7 @@ export class Cache {
148
149
  * TBD.
149
150
  * @param {string} key - TBD.
150
151
  * @param {string} url - TBD.
151
- * @param data - TBD.
152
+ * @param {string} data - TBD.
152
153
  */
153
154
  addText(key, url, data) {
154
155
  this._cache.text[key] = { url, data };
@@ -159,11 +160,11 @@ export class Cache {
159
160
  * TBD.
160
161
  * @param {string} key - TBD.
161
162
  * @param {string} url - TBD.
162
- * @param data - TBD.
163
- * @param atlasData - TBD.
164
- * @param atlasType - TBD.
165
- * @param xSpacing - TBD.
166
- * @param ySpacing - TBD.
163
+ * @param {HTMLCanvasElement} data - TBD.
164
+ * @param {object} atlasData - TBD.
165
+ * @param {string} atlasType - TBD.
166
+ * @param {number} xSpacing - TBD.
167
+ * @param {number} ySpacing - TBD.
167
168
  */
168
169
  addBitmapFont(key, url, data, atlasData, atlasType, xSpacing = 0, ySpacing = 0) {
169
170
  const obj = {
@@ -185,7 +186,7 @@ export class Cache {
185
186
  * TBD.
186
187
  * @param {string} key - TBD.
187
188
  * @param {string} url - TBD.
188
- * @param data - TBD.
189
+ * @param {object} data - TBD.
189
190
  */
190
191
  addJSON(key, url, data) {
191
192
  this._cache.json[key] = { url, data };
@@ -196,7 +197,7 @@ export class Cache {
196
197
  * TBD.
197
198
  * @param {string} key - TBD.
198
199
  * @param {string} url - TBD.
199
- * @param data - TBD.
200
+ * @param {XMLDocument} data - TBD.
200
201
  */
201
202
  addXML(key, url, data) {
202
203
  this._cache.xml[key] = { url, data };
@@ -235,7 +236,7 @@ export class Cache {
235
236
  * TBD.
236
237
  * @param {string} key - TBD.
237
238
  * @param {string} property - TBD.
238
- * @param value - TBD.
239
+ * @param {any} value - TBD.
239
240
  */
240
241
  updateSound(key, property, value) {
241
242
  const sound = this.getSound(key);
@@ -247,7 +248,7 @@ export class Cache {
247
248
  /**
248
249
  * TBD.
249
250
  * @param {string} key - TBD.
250
- * @param data - TBD.
251
+ * @param {object} data - TBD.
251
252
  */
252
253
  decodedSound(key, data) {
253
254
  const sound = this.getSound(key);
@@ -413,6 +414,7 @@ export class Cache {
413
414
  /**
414
415
  * TBD.
415
416
  * @param {string} key - TBD.
417
+ * @returns {HTMLCanvasElement} TBD.
416
418
  */
417
419
  getCanvas(key) {
418
420
  return this.getItem(key, CANVAS, 'getCanvas', 'canvas');
@@ -421,7 +423,8 @@ export class Cache {
421
423
  /**
422
424
  * TBD.
423
425
  * @param {string} key - TBD.
424
- * @param full - TBD.
426
+ * @param {boolean} full - TBD.
427
+ * @returns {HTMLImageElement} TBD.
425
428
  */
426
429
  getImage(key = '__default', full = false) {
427
430
  let img = this.getItem(key, IMAGE, 'getImage');
@@ -437,6 +440,7 @@ export class Cache {
437
440
  /**
438
441
  * TBD.
439
442
  * @param {string} key - TBD.
443
+ * @returns {object} TBD.
440
444
  */
441
445
  getTextureFrame(key) {
442
446
  return this.getItem(key, TEXTURE, 'getTextureFrame', 'frame');
@@ -445,6 +449,7 @@ export class Cache {
445
449
  /**
446
450
  * TBD.
447
451
  * @param {string} key - TBD.
452
+ * @returns {object} TBD.
448
453
  */
449
454
  getSound(key) {
450
455
  return this.getItem(key, SOUND, 'getSound');
@@ -453,6 +458,7 @@ export class Cache {
453
458
  /**
454
459
  * TBD.
455
460
  * @param {string} key - TBD.
461
+ * @returns {object} TBD.
456
462
  */
457
463
  getSoundData(key) {
458
464
  return this.getItem(key, SOUND, 'getSoundData', 'data');
@@ -461,6 +467,7 @@ export class Cache {
461
467
  /**
462
468
  * TBD.
463
469
  * @param {string} key - TBD.
470
+ * @returns {object} TBD.
464
471
  */
465
472
  getText(key) {
466
473
  return this.getItem(key, TEXT, 'getText', 'data');
@@ -469,6 +476,7 @@ export class Cache {
469
476
  /**
470
477
  * TBD.
471
478
  * @param {string} key - TBD.
479
+ * @returns {object} TBD.
472
480
  */
473
481
  getBitmapData(key) {
474
482
  return this.getItem(key, BITMAPDATA, 'getBitmapData', 'data');
@@ -477,6 +485,7 @@ export class Cache {
477
485
  /**
478
486
  * TBD.
479
487
  * @param {string} key - TBD.
488
+ * @returns {object} TBD.
480
489
  */
481
490
  getBitmapFont(key) {
482
491
  return this.getItem(key, BITMAPFONT, 'getBitmapFont');
@@ -486,6 +495,7 @@ export class Cache {
486
495
  * TBD.
487
496
  * @param {string} key - TBD.
488
497
  * @param {boolean} isClone - TBD.
498
+ * @returns {object} TBD.
489
499
  */
490
500
  getJSON(key, isClone = false) {
491
501
  const data = this.getItem(key, JSON, 'getJSON', 'data');
@@ -495,6 +505,7 @@ export class Cache {
495
505
  /**
496
506
  * TBD.
497
507
  * @param {string} key - TBD.
508
+ * @returns {XMLDocument} TBD.
498
509
  */
499
510
  getXML(key) {
500
511
  return this.getItem(key, XML, 'getXML', 'data');
@@ -503,6 +514,7 @@ export class Cache {
503
514
  /**
504
515
  * TBD.
505
516
  * @param {string} key - TBD.
517
+ * @returns {RenderTexture} TBD.
506
518
  */
507
519
  getRenderTexture(key) {
508
520
  return this.getItem(key, RENDER_TEXTURE, 'getRenderTexture');
@@ -514,6 +526,7 @@ export class Cache {
514
526
  * TBD.
515
527
  * @param {string} key - TBD.
516
528
  * @param {number} cache - TBD.
529
+ * @returns {BaseTexture} TBD.
517
530
  */
518
531
  getBaseTexture(key, cache = IMAGE) {
519
532
  return this.getItem(key, cache, 'getBaseTexture', 'base');
@@ -523,6 +536,7 @@ export class Cache {
523
536
  * TBD.
524
537
  * @param {string} key - TBD.
525
538
  * @param {number} cache - TBD.
539
+ * @returns {Frame} TBD.
526
540
  */
527
541
  getFrame(key, cache = IMAGE) {
528
542
  return this.getItem(key, cache, 'getFrame', 'frame');
@@ -532,6 +546,7 @@ export class Cache {
532
546
  * TBD.
533
547
  * @param {string} key - TBD.
534
548
  * @param {number} cache - TBD.
549
+ * @returns {number} TBD.
535
550
  */
536
551
  getFrameCount(key, cache = IMAGE) {
537
552
  const data = this.getFrameData(key, cache);
@@ -545,6 +560,7 @@ export class Cache {
545
560
  * TBD.
546
561
  * @param {string} key - TBD.
547
562
  * @param {number} cache - TBD.
563
+ * @returns {FrameData} TBD.
548
564
  */
549
565
  getFrameData(key, cache = IMAGE) {
550
566
  return this.getItem(key, cache, 'getFrameData', 'frameData');
@@ -554,6 +570,7 @@ export class Cache {
554
570
  * TBD.
555
571
  * @param {string} key - TBD.
556
572
  * @param {number} cache - TBD.
573
+ * @returns {boolean} TBD.
557
574
  */
558
575
  hasFrameData(key, cache = IMAGE) {
559
576
  return this.getItem(key, cache, '', 'frameData') !== null;
@@ -562,7 +579,7 @@ export class Cache {
562
579
  /**
563
580
  * TBD.
564
581
  * @param {string} key - TBD.
565
- * @param frameData - TBD.
582
+ * @param {FrameData} frameData - TBD.
566
583
  * @param {number} cache - TBD.
567
584
  */
568
585
  updateFrameData(key, frameData, cache = IMAGE) {
@@ -576,6 +593,7 @@ export class Cache {
576
593
  * @param {string} key - TBD.
577
594
  * @param {number} index - TBD.
578
595
  * @param {number} cache - TBD.
596
+ * @returns {Frame} TBD.
579
597
  */
580
598
  getFrameByIndex(key, index, cache = IMAGE) {
581
599
  const data = this.getFrameData(key, cache);
@@ -590,6 +608,7 @@ export class Cache {
590
608
  * @param {string} key - TBD.
591
609
  * @param {string} name - TBD.
592
610
  * @param {number} cache - TBD.
611
+ * @returns {Frame} TBD.
593
612
  */
594
613
  getFrameByName(key, name, cache = IMAGE) {
595
614
  const data = this.getFrameData(key, cache);
@@ -602,6 +621,7 @@ export class Cache {
602
621
  /**
603
622
  * TBD.
604
623
  * @param {string} url - TBD.
624
+ * @returns {string} TBD.
605
625
  */
606
626
  getURL(url) {
607
627
  const resolvedURL = this._resolveURL(url);
@@ -615,6 +635,7 @@ export class Cache {
615
635
  /**
616
636
  * TBD.
617
637
  * @param {object} cache - TBD.
638
+ * @returns {string[]} TBD.
618
639
  */
619
640
  getKeys(cache = IMAGE) {
620
641
  const result = [];
@@ -739,7 +760,7 @@ export class Cache {
739
760
  /**
740
761
  * TBD.
741
762
  * @param {string} url - TBD.
742
- * @param data - TBD.
763
+ * @param {object} data - TBD.
743
764
  * @returns {string} TBD.
744
765
  */
745
766
  _resolveURL(url, data) {
@@ -169,25 +169,91 @@ export const TOUCH_OVERRIDES_MOUSE = 1;
169
169
  */
170
170
  export const MOUSE_TOUCH_COMBINE = 2;
171
171
  // game objects
172
+ /**
173
+ * @type {number}
174
+ */
172
175
  export const GROUP = 7;
176
+ /**
177
+ * @type {number}
178
+ */
173
179
  export const SPRITE = 0;
180
+ /**
181
+ * @type {number}
182
+ */
174
183
  export const SPRITE_BATCH = 17;
184
+ /**
185
+ * @type {number}
186
+ */
175
187
  export const BUTTON = 1;
188
+ /**
189
+ * @type {number}
190
+ */
176
191
  export const IMAGE = 2;
192
+ /**
193
+ * @type {number}
194
+ */
177
195
  export const GRAPHICS = 3;
196
+ /**
197
+ * @type {number}
198
+ */
178
199
  export const TEXT = 4;
200
+ /**
201
+ * @type {number}
202
+ */
179
203
  export const BITMAP_TEXT = 6;
204
+ /**
205
+ * @type {number}
206
+ */
180
207
  export const TILE_SPRITE = 5;
208
+ /**
209
+ * @type {number}
210
+ */
181
211
  export const RENDER_TEXTURE = 8;
212
+ /**
213
+ * @type {number}
214
+ */
182
215
  export const FILTER_CANVAS = 14;
216
+ /**
217
+ * @type {number}
218
+ */
183
219
  export const FILTER_WEBGL = 15;
220
+ /**
221
+ * @type {number}
222
+ */
184
223
  export const POINTER = 19;
224
+ /**
225
+ * @type {number}
226
+ */
185
227
  export const GEOM_POLYGON = 12;
228
+ /**
229
+ * @type {number}
230
+ */
186
231
  export const GEOM_RECTANGLE = 22;
232
+ /**
233
+ * @type {number}
234
+ */
187
235
  export const GEOM_CIRCLE = 21;
236
+ /**
237
+ * @type {number}
238
+ */
188
239
  export const GEOM_ELLIPSE = 16;
240
+ /**
241
+ * @type {number}
242
+ */
189
243
  export const GEOM_ROUNDED_RECTANGLE = 26;
244
+ /**
245
+ * @type {number}
246
+ */
190
247
  export const GEOM_LINE = 23;
248
+ /**
249
+ * @type {number}
250
+ */
191
251
  export const GEOM_MATRIX = 24;
252
+ /**
253
+ * @type {number}
254
+ */
192
255
  export const GEOM_POINT = 25;
256
+ /**
257
+ * @type {number}
258
+ */
193
259
  export const PENDING_ATLAS = -1;
@@ -3,35 +3,122 @@ export class Device {
3
3
  * TBD.
4
4
  */
5
5
  constructor() {
6
+ /**
7
+ * @type {boolean}
8
+ */
6
9
  this.desktop = false;
10
+ /**
11
+ * @type {boolean}
12
+ */
7
13
  this.iOS = false;
14
+ /**
15
+ * @type {boolean}
16
+ */
8
17
  this.android = false;
18
+ /**
19
+ * @type {boolean}
20
+ */
9
21
  this.chromeOS = false;
22
+ /**
23
+ * @type {boolean}
24
+ */
10
25
  this.linux = false;
26
+ /**
27
+ * @type {boolean}
28
+ */
11
29
  this.macOS = false;
30
+ /**
31
+ * @type {boolean}
32
+ */
12
33
  this.windows = false;
34
+ /**
35
+ * @type {boolean}
36
+ */
13
37
  this.windowsPhone = false;
38
+ /**
39
+ * @type {boolean}
40
+ */
14
41
  this.canvas = false;
42
+ /**
43
+ * @type {boolean}
44
+ */
15
45
  this.touch = false;
46
+ /**
47
+ * @type {boolean}
48
+ */
16
49
  this.mspointer = false;
17
50
  this.wheelEvent = null;
51
+ /**
52
+ * @type {boolean}
53
+ */
18
54
  this.chrome = false;
55
+ /**
56
+ * @type {boolean}
57
+ */
19
58
  this.firefox = false;
59
+ /**
60
+ * @type {boolean}
61
+ */
20
62
  this.edge = false;
63
+ /**
64
+ * @type {boolean}
65
+ */
21
66
  this.safari = false;
67
+ /**
68
+ * @type {boolean}
69
+ */
22
70
  this.silk = false;
71
+ /**
72
+ * @type {boolean}
73
+ */
23
74
  this.ogg = false;
75
+ /**
76
+ * @type {boolean}
77
+ */
24
78
  this.opus = false;
79
+ /**
80
+ * @type {boolean}
81
+ */
25
82
  this.mp3 = false;
83
+ /**
84
+ * @type {boolean}
85
+ */
26
86
  this.wav = false;
87
+ /**
88
+ * @type {boolean}
89
+ */
27
90
  this.m4a = false;
91
+ /**
92
+ * @type {boolean}
93
+ */
28
94
  this.webm = false;
95
+ /**
96
+ * @type {boolean}
97
+ */
29
98
  this.dolby = false;
99
+ /**
100
+ * @type {boolean}
101
+ */
30
102
  this.avif = false;
103
+ /**
104
+ * @type {boolean}
105
+ */
31
106
  this.webp = false;
107
+ /**
108
+ * @type {boolean}
109
+ */
32
110
  this.fullscreen = false;
111
+ /**
112
+ * @type {string}
113
+ */
33
114
  this.requestFullscreen = '';
115
+ /**
116
+ * @type {string}
117
+ */
34
118
  this.cancelFullscreen = '';
119
+ /**
120
+ * @type {boolean}
121
+ */
35
122
  this.fullscreenKeyboard = false;
36
123
  }
37
124
  }
@@ -1,4 +1,5 @@
1
1
  import { Point } from '../geom/point';
2
+ import { Device } from './device';
2
3
 
3
4
  class VisualBoundsDesktopRectangle {
4
5
  /**
@@ -182,7 +183,7 @@ class DocumentBoundsRectangle {
182
183
  export class DOM {
183
184
  /**
184
185
  * TBD.
185
- * @param device
186
+ * @param {Device} device - TBD.
186
187
  */
187
188
  constructor(device) {
188
189
  this.treatAsDesktop =
@@ -200,8 +201,9 @@ export class DOM {
200
201
 
201
202
  /**
202
203
  * TBD.
203
- * @param element
204
- * @param point
204
+ * @param {HTMLCanvasElement} element - TBD.
205
+ * @param {Point} point - TBD.
206
+ * @returns {Point} TBD.
205
207
  */
206
208
  getOffset(element, point = null) {
207
209
  point = point || new Point();
@@ -217,8 +219,9 @@ export class DOM {
217
219
 
218
220
  /**
219
221
  * TBD.
220
- * @param element
221
- * @param cushion
222
+ * @param {HTMLCanvasElement} element - TBD.
223
+ * @param {number} cushion - TBD.
224
+ * @returns {boolean} TBD.
222
225
  */
223
226
  getBounds(element, cushion = 0) {
224
227
  element = element && !element.nodeType ? element[0] : element;
@@ -230,8 +233,9 @@ export class DOM {
230
233
 
231
234
  /**
232
235
  * TBD.
233
- * @param coords
234
- * @param cushion
236
+ * @param {DOMRect} coords - TBD.
237
+ * @param {number} cushion - TBD.
238
+ * @returns {object} TBD.
235
239
  */
236
240
  calibrate(coords, cushion = 0) {
237
241
  const output = {
@@ -249,7 +253,8 @@ export class DOM {
249
253
 
250
254
  /**
251
255
  * TBD.
252
- * @param primaryFallback
256
+ * @param {string} primaryFallback - TBD.
257
+ * @returns {string} TBD.
253
258
  */
254
259
  getScreenOrientation(primaryFallback) {
255
260
  const screen = window.screen;
@@ -1,9 +1,10 @@
1
1
  import { Signal } from './signal';
2
+ import { DisplayObject } from '../display/display_object';
2
3
 
3
4
  export class EventManager {
4
5
  /**
5
6
  * TBD.
6
- * @param sprite - TBD.
7
+ * @param {DisplayObject} sprite - TBD.
7
8
  */
8
9
  constructor(sprite) {
9
10
  this.parent = sprite;
@@ -20,7 +20,7 @@ export class GameObjectFactory {
20
20
  * @param {number} x - TBD.
21
21
  * @param {number} y - TBD.
22
22
  * @param {string} key - TBD.
23
- * @param frame - TBD.
23
+ * @param {string} frame - TBD.
24
24
  * @param {Group} group - TBD.
25
25
  * @returns {Image} TBD.
26
26
  */
@@ -46,8 +46,8 @@ export class GameObjectFactory {
46
46
  * TBD.
47
47
  * @param {number} x - TBD.
48
48
  * @param {number} y - TBD.
49
- * @param text - TBD.
50
- * @param style - TBD.
49
+ * @param {string} text - TBD.
50
+ * @param {object} style - TBD.
51
51
  * @param {Group} group - TBD.
52
52
  * @returns {Text} TBD.
53
53
  */
@@ -63,10 +63,10 @@ export class GameObjectFactory {
63
63
  * @param {string} key - TBD.
64
64
  * @param {Function} callback - TBD.
65
65
  * @param {object} callbackContext - TBD.
66
- * @param overFrame - TBD.
67
- * @param outFrame - TBD.
68
- * @param downFrame - TBD.
69
- * @param upFrame - TBD.
66
+ * @param {string} overFrame - TBD.
67
+ * @param {string} outFrame - TBD.
68
+ * @param {string} downFrame - TBD.
69
+ * @param {string} upFrame - TBD.
70
70
  * @param {Group} group - TBD.
71
71
  * @returns {Button} TBD.
72
72
  */
@@ -93,11 +93,11 @@ export class GameObjectFactory {
93
93
  * TBD.
94
94
  * @param {number} x - TBD.
95
95
  * @param {number} y - TBD.
96
- * @param font - TBD.
97
- * @param text - TBD.
98
- * @param size - TBD.
96
+ * @param {string} font - TBD.
97
+ * @param {string} text - TBD.
98
+ * @param {number} size - TBD.
99
99
  * @param {Group} group - TBD.
100
- * @param align - TBD.
100
+ * @param {string} align - TBD.
101
101
  * @returns {BitmapText} TBD.
102
102
  */
103
103
  bitmapText(x, y, font, text, size, group = null, align = 'left') {
@@ -35,6 +35,7 @@ export class Game {
35
35
  this.renderer = null;
36
36
  this.state = null;
37
37
  this.isBooted = false;
38
+ this.paused = false;
38
39
  this.raf = null;
39
40
  this.add = null;
40
41
  this.cache = null;