Skip to content

Commit 69bbb05

Browse files
committed
Add TypeScript definition files
1 parent bc60546 commit 69bbb05

363 files changed

Lines changed: 3408 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

v3/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"license": "MIT",
1111
"licenseUrl": "http://www.opensource.org/licenses/mit-license.php",
1212
"main": "./build/phaser.js",
13+
"typings": "./typings/index.d.ts",
1314
"repository": {
1415
"type": "git",
1516
"url": "https://photonstorm@github.com/photonstorm/phaser.git"

v3/typings/boot/Config.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
export default class Config {
2+
private static defaultBannerColor;
3+
private static defaultBannerTextColor;
4+
width: any;
5+
height: any;
6+
resolution: any;
7+
renderType: any;
8+
parent: any;
9+
canvas: any;
10+
canvasStyle: any;
11+
stateConfig: any;
12+
seed: any;
13+
gameTitle: any;
14+
gameURL: any;
15+
gameVersion: any;
16+
hideBanner: any;
17+
hidePhaser: any;
18+
bannerTextColor: any;
19+
bannerBackgroundColor: any;
20+
forceSetTimeOut: any;
21+
transparent: any;
22+
pixelArt: any;
23+
preBoot: any;
24+
postBoot: any;
25+
constructor(config: any);
26+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Game from './Game';
2+
/**
3+
* Checks if the device is capable of using the requested renderer and sets it up or an alternative if not.
4+
*
5+
* @method Phaser.Game#setUpRenderer
6+
* @protected
7+
*/
8+
export default function (game: Game): void;

v3/typings/boot/DebugHeader.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Game from './Game';
2+
export default function (game: Game): void;

v3/typings/boot/Game.d.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2016 Photon Storm Ltd.
4+
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5+
*/
6+
import Config from './Config';
7+
import * as Device from '../device';
8+
import RequestAnimationFrame from '../dom/RequestAnimationFrame';
9+
import RandomDataGenerator from '../math/random-data-generator/RandomDataGenerator';
10+
import StateManager from '../state/StateManager';
11+
export default class Game {
12+
config: Config;
13+
renderer: any;
14+
canvas: any;
15+
context: any;
16+
isBooted: boolean;
17+
isRunning: boolean;
18+
raf: RequestAnimationFrame;
19+
textures: any;
20+
input: any;
21+
state: StateManager;
22+
device: typeof Device;
23+
rnd: RandomDataGenerator;
24+
constructor(config: any);
25+
boot(): void;
26+
update(timestamp: any): void;
27+
}

v3/typings/cache/BaseCache.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default class BaseCache {
2+
entries: Map<any, any>;
3+
constructor();
4+
add(key: any, data: any): void;
5+
has(key: any): boolean;
6+
get(key: any): any;
7+
remove(key: any): void;
8+
destroy(): void;
9+
}

v3/typings/cache/CacheEntry.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default class CacheEntry {
2+
key: any;
3+
url: any;
4+
data: any;
5+
constructor(key: any, url: any, data: any);
6+
}

v3/typings/camera/Camera.d.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
export default class Camera {
2+
state: any;
3+
game: any;
4+
viewportWidth: any;
5+
viewportHeight: any;
6+
transform: any;
7+
atLimit: any;
8+
bounds: any;
9+
view: any;
10+
width: any;
11+
height: any;
12+
private _shake;
13+
/**
14+
* A Camera is your view into the game world. It has a position and size and renders only those objects within its field of view.
15+
* The game automatically creates a single Stage sized camera on boot. Move the camera around the world with Phaser.Camera.x/y
16+
*
17+
* @class Phaser.Camera
18+
* @constructor
19+
* @param {Phaser.Game} game - Game reference to the currently running game.
20+
* @param {number} id - Not being used at the moment, will be when Phaser supports multiple camera
21+
* @param {number} x - Position of the camera on the X axis
22+
* @param {number} y - Position of the camera on the Y axis
23+
* @param {number} width - The width of the view rectangle
24+
* @param {number} height - The height of the view rectangle
25+
*/
26+
constructor(state: any, x: any, y: any, viewportWidth: any, viewportHeight: any);
27+
/**
28+
* Method called to ensure the camera doesn't venture outside of the game world.
29+
* Called automatically by Camera.update.
30+
*
31+
* @method Phaser.Camera#checkBounds
32+
* @protected
33+
*/
34+
protected checkBounds(): void;
35+
x: any;
36+
y: any;
37+
readonly right: any;
38+
readonly bottom: any;
39+
scale: any;
40+
scaleX: any;
41+
scaleY: any;
42+
pivotX: any;
43+
pivotY: any;
44+
angle: any;
45+
rotation: any;
46+
}

v3/typings/checksum.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export declare const build = "e6b7eb20-dc31-11e6-8e93-3b4cafb8aa53";
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* A BaseTransform class that you can use when extending Game Objects.
3+
* Hides away the 'private' stuff and exposes only the useful getters and setters
4+
*
5+
* @class
6+
*/
7+
export default class BaseTransform {
8+
transform: any;
9+
constructor(x: any, y: any);
10+
x: any;
11+
y: any;
12+
scale: any;
13+
scaleX: any;
14+
scaleY: any;
15+
anchor: any;
16+
anchorX: any;
17+
anchorY: any;
18+
pivotX: any;
19+
pivotY: any;
20+
angle: any;
21+
rotation: any;
22+
}

0 commit comments

Comments
 (0)