mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 21:24:09 +00:00
TypeScript Definitions. PluginManager.add is now generic. Whatever class you pass in will come back out as an instance. Example var myAStar = this.game.plugins.add(Phaser.Plugin.AStar);
This commit is contained in:
parent
41ff44229a
commit
13d4dfd9e3
1 changed files with 5 additions and 1 deletions
6
typescript/phaser.d.ts
vendored
6
typescript/phaser.d.ts
vendored
|
@ -3575,6 +3575,10 @@ declare module Phaser {
|
|||
}
|
||||
}
|
||||
|
||||
interface PluginConstructorOf<T> {
|
||||
new (...parameters: any[]): T;
|
||||
}
|
||||
|
||||
class PluginManager implements IStateCycle {
|
||||
|
||||
constructor(game: Phaser.Game);
|
||||
|
@ -3582,7 +3586,7 @@ declare module Phaser {
|
|||
game: Phaser.Game;
|
||||
plugins: Phaser.Plugin[];
|
||||
|
||||
add(plugin: Phaser.Plugin | typeof Phaser.Plugin, ...parameter: any[]): Phaser.Plugin;
|
||||
add<T extends Phaser.Plugin>(plugin: PluginConstructorOf<T>, ...parameters: any[]): T;
|
||||
destroy(): void;
|
||||
postRender(): void;
|
||||
postUpdate(): void;
|
||||
|
|
Loading…
Reference in a new issue