Fix the typescript types in the js

This generates the desired phaser.d.ts
This commit is contained in:
Yuval Greenfield 2022-10-04 10:48:21 -07:00
parent 7ab2f762b6
commit 7a4dd97793
8 changed files with 15741 additions and 13753 deletions

View file

@ -25,7 +25,7 @@ class Parser {
}
emit() {
let ignored = [];
let result = '/// <reference types="./matter" />\n\n';
let result = '// DO NOT EDIT THIS FILE! It was generated by running `npm run tsgen`\n/// <reference types="./matter" />\n\n';
result = result.concat(this.topLevel.reduce((out, obj) => {
return out + dom.emit(obj);
}, ''));

File diff suppressed because one or more lines are too long

View file

@ -41,7 +41,7 @@ export class Parser {
let ignored = [];
let result = '/// <reference types="./matter" />\n\n';
let result = '// DO NOT EDIT THIS FILE! It was generated by running `npm run tsgen`\n/// <reference types="./matter" />\n\n';
result = result.concat(this.topLevel.reduce((out: string, obj: dom.TopLevelDeclaration) => {
return out + dom.emit(obj);

View file

@ -12,7 +12,7 @@
* @property {string} [canvasStyle=null] - CSS styles to apply to the game canvas instead of Phasers default styles.
* @property {boolean}[customEnvironment=false] - Is Phaser running under a custom (non-native web) environment? If so, set this to `true` to skip internal Feature detection. If `true` the `renderType` cannot be left as `AUTO`.
* @property {CanvasRenderingContext2D} [context] - Provide your own Canvas Context for Phaser to use, instead of creating one.
* @property {(Phaser.Scene|Phaser.Scene[]|Phaser.Types.Scenes.SettingsConfig|Phaser.Types.Scenes.SettingsConfig[]|Phaser.Types.Scenes.CreateSceneFromObjectConfig|Phaser.Types.Scenes.CreateSceneFromObjectConfig[]|function|function[])} [scene=null] - A scene or scenes to add to the game. If several are given, the first is started; the remainder are started only if they have `{ active: true }`. See the `sceneConfig` argument in `Phaser.Scenes.SceneManager#add`.
* @property {(Phaser.Types.Scenes.SceneType|Phaser.Types.Scenes.SceneType[])} [scene=null] - A scene or scenes to add to the game. If several are given, the first is started; the remainder are started only if they have `{ active: true }`. See the `sceneConfig` argument in `Phaser.Scenes.SceneManager#add`.
* @property {string[]} [seed] - Seed for the random number generator.
* @property {string} [title=''] - The title of the game. Shown in the browser console.
* @property {string} [url='https://phaser.io'] - The URL of the game. Shown in the browser console.

View file

@ -333,7 +333,7 @@ var SceneManager = new Class({
* @since 3.0.0
*
* @param {string} key - A unique key used to reference the Scene, i.e. `MainMenu` or `Level1`.
* @param {(Phaser.Scene|Phaser.Types.Scenes.SettingsConfig|Phaser.Types.Scenes.CreateSceneFromObjectConfig|function)} sceneConfig - The config for the Scene
* @param {(Phaser.Types.Scenes.SceneType)} sceneConfig - The config for the Scene
* @param {boolean} [autoStart=false] - If `true` the Scene will be started immediately after being added.
* @param {object} [data] - Optional data object. This will be set as `Scene.settings.data` and passed to `Scene.init`, and `Scene.create`.
*

View file

@ -444,7 +444,7 @@ var ScenePlugin = new Class({
* @since 3.0.0
*
* @param {string} key - A unique key used to reference the Scene, i.e. `MainMenu` or `Level1`.
* @param {(Phaser.Scene|Phaser.Types.Scenes.SettingsConfig|Phaser.Types.Scenes.CreateSceneFromObjectConfig|function)} sceneConfig - The config for the Scene
* @param {(Phaser.Types.Scenes.SceneType)} sceneConfig - The config for the Scene
* @param {boolean} [autoStart=false] - If `true` the Scene will be started immediately after being added.
* @param {object} [data] - Optional data object. This will be set as `Scene.settings.data` and passed to `Scene.init`, and `Scene.create`.
*

View file

@ -0,0 +1,4 @@
/**
* @typedef {(Phaser.Scene|Phaser.Types.Scenes.SettingsConfig|Phaser.Types.Scenes.CreateSceneFromObjectConfig|function)} Phaser.Types.Scenes.SceneType
* @since 3.18.0
*/

29478
types/phaser.d.ts vendored

File diff suppressed because it is too large Load diff