From 7ab2f762b6a85b8964c4c28e66676052d83980d6 Mon Sep 17 00:00:00 2001 From: Yuval Greenfield Date: Mon, 3 Oct 2022 22:29:47 -0700 Subject: [PATCH] Scene types now can be an array of unions `SettingsConfig | CreateSceneFromObjectConfig` is a valid scene type. Now it will be allowed in GameConfig. --- types/phaser.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/types/phaser.d.ts b/types/phaser.d.ts index 7c9b0e9ef..25567aec9 100644 --- a/types/phaser.d.ts +++ b/types/phaser.d.ts @@ -12,6 +12,8 @@ declare type EachContainerCallback = (item: any, ...args: any[])=>void; declare type LightForEach = (light: Phaser.GameObjects.Light)=>void; +declare type SceneType = Phaser.Scene | Phaser.Types.Scenes.SettingsConfig | Phaser.Types.Scenes.CreateSceneFromObjectConfig | Function; + /** * A custom function that will be responsible for wrapping the text. */ @@ -61583,7 +61585,7 @@ declare namespace Phaser { /** * 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`. */ - scene?: Phaser.Scene | Phaser.Scene[] | Phaser.Types.Scenes.SettingsConfig | Phaser.Types.Scenes.SettingsConfig[] | Phaser.Types.Scenes.CreateSceneFromObjectConfig | Phaser.Types.Scenes.CreateSceneFromObjectConfig[] | Function | Function[]; + scene?: SceneType | SceneType[]; /** * Seed for the random number generator. */ @@ -87818,7 +87820,7 @@ declare namespace Phaser { * @param autoStart If `true` the Scene will be started immediately after being added. Default false. * @param data Optional data object. This will be set as `Scene.settings.data` and passed to `Scene.init`, and `Scene.create`. */ - add(key: string, sceneConfig: Phaser.Scene | Phaser.Types.Scenes.SettingsConfig | Phaser.Types.Scenes.CreateSceneFromObjectConfig | Function, autoStart?: boolean, data?: object): Phaser.Scene | null; + add(key: string, sceneConfig: SceneType, autoStart?: boolean, data?: object): Phaser.Scene | null; /** * Removes a Scene from the SceneManager. @@ -88138,7 +88140,7 @@ declare namespace Phaser { * @param autoStart If `true` the Scene will be started immediately after being added. Default false. * @param data Optional data object. This will be set as `Scene.settings.data` and passed to `Scene.init`, and `Scene.create`. */ - add(key: string, sceneConfig: Phaser.Scene | Phaser.Types.Scenes.SettingsConfig | Phaser.Types.Scenes.CreateSceneFromObjectConfig | Function, autoStart?: boolean, data?: object): Phaser.Scene | null; + add(key: string, sceneConfig: SceneType, autoStart?: boolean, data?: object): Phaser.Scene | null; /** * Launch the given Scene and run it in parallel with this one.