-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
centralize module typing overrides (#1786)
* optimize typings with declaration file
- Loading branch information
1 parent
d15c013
commit 872f05d
Showing
3 changed files
with
69 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import "phaser"; | ||
|
||
declare module "phaser" { | ||
namespace GameObjects { | ||
interface GameObject { | ||
width: number; | ||
|
||
height: number; | ||
|
||
originX: number; | ||
|
||
originY: number; | ||
|
||
x: number; | ||
|
||
y: number; | ||
} | ||
|
||
interface Container { | ||
/** | ||
* Sets this object's position relative to another object with a given offset | ||
*/ | ||
setPositionRelative(guideObject: any, x: number, y: number): void; | ||
} | ||
interface Sprite { | ||
/** | ||
* Sets this object's position relative to another object with a given offset | ||
*/ | ||
setPositionRelative(guideObject: any, x: number, y: number): void; | ||
} | ||
interface Image { | ||
/** | ||
* Sets this object's position relative to another object with a given offset | ||
*/ | ||
setPositionRelative(guideObject: any, x: number, y: number): void; | ||
} | ||
interface NineSlice { | ||
/** | ||
* Sets this object's position relative to another object with a given offset | ||
*/ | ||
setPositionRelative(guideObject: any, x: number, y: number): void; | ||
} | ||
interface Text { | ||
/** | ||
* Sets this object's position relative to another object with a given offset | ||
*/ | ||
setPositionRelative(guideObject: any, x: number, y: number): void; | ||
} | ||
interface Rectangle { | ||
/** | ||
* Sets this object's position relative to another object with a given offset | ||
*/ | ||
setPositionRelative(guideObject: any, x: number, y: number): void; | ||
} | ||
} | ||
|
||
namespace Input { | ||
namespace Gamepad { | ||
interface GamepadPlugin { | ||
/** | ||
* Refreshes the list of connected Gamepads. | ||
* This is called automatically when a gamepad is connected or disconnected, and during the update loop. | ||
*/ | ||
refreshPads(): void; | ||
} | ||
} | ||
} | ||
} |