如何在Typescript中使用Phaser 3.17 GameConfig对象?

时间:2019-05-23 15:41:56

标签: typescript phaser-framework typescript-definitions

将Phaser更新为3.17之后

npm install phaser@3.17.0

我现在收到以下Typescript错误:

const config: GameConfig = {
    scene: [BootScene, StartScene, GameScene, GameOver],
    input: {
        keyboard: true
    }
}
  

找不到名称'GameConfig'

在查看.d.ts文件时,我想我现在必须使用:

const config: Phaser.Types.Core.GameConfig = {
    scene: [BootScene, StartScene, GameScene, GameOver],
    input: {
        keyboard: true
    }
}

但是现在scene不再被视为GameConfig的一部分!

  

期望的类型来自属性'scene',该属性在此处声明为'GameConfig'

我不知道这意味着什么……这是.d.ts文件中的错误吗?

0 个答案:

没有答案