Merge pull request #6238 from ubershmekel/master

Introduce `SceneType` for ease and correctness
This commit is contained in:
Richard Davey 2022-11-29 14:33:39 +00:00 committed by GitHub
commit 4346113fee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 4 deletions

View file

@ -46,7 +46,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

@ -456,7 +456,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.60.0
*/