Skip to content

Commit f887ee0

Browse files
committed
TypeScript definition updates to help fix for the noimplicitany option (thanks @Waog phaserjs#1088)
1 parent 15378e1 commit f887ee0

3 files changed

Lines changed: 22 additions & 17 deletions

File tree

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Index
44

55
- [About](#about)
6-
- [What's new?](#whats-new)
6+
- [What's New?](#whats-new)
77
- [Getting Started](#getting-started)
88
- [Change Log](#change-log)
99
- [How to Build](#how-to-build)
@@ -69,6 +69,7 @@ Version 2.1.0 - "Cairhien" - -in development-
6969

7070
### Updates
7171

72+
* TypeScript definition updates to help fix for the `noimplicitany` option (thanks @Waog #1088)
7273

7374
### New Features
7475

@@ -84,11 +85,8 @@ Version 2.1.0 - "Cairhien" - -in development-
8485
* Fix for previous PR #1028 where the P2.setBoundsToWorld call was overriding setBoundsToWorld in the P2 constructor (thanks @Dumtard #1028)
8586
* Fix for scale issues in CocoonJS using webgl renderer and screencanvas (thanks @txusinho #1064)
8687
* Resolves issue with pixel perfect click / over detection on Sprites that used trimmed image atlases for animations or frames > 0.
87-
88-
89-
### Migration Guide
90-
91-
There is an extensive [Migration Guide](https://github.com/photonstorm/phaser/blob/master/resources/Migration%20Guide.md) available for those converting from Phaser 1.x to 2.x. In the guide we detail the API breaking changes and approach to our new physics system.
88+
* Group.swap() updates the Z index values properly (thanks @Blank101 #1090)
89+
* Device now recognises ChromeOS as a desktop (thanks @alvinsight #1091)
9290

9391
The full Change Log is at https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md
9492

build/config.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,11 @@
220220
EOL;
221221
}
222222

223+
if ($custom)
224+
{
225+
for ($i = 0; $i < count($custom); $i++)
226+
{
227+
echo ' <script src="' . $custom[$i] . '"></script>' . "\n";
228+
}
229+
}
223230
?>

build/phaser.d.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ declare module Phaser {
10931093
next(quantity?: number): void;
10941094
play(name: string, frameRate?: number, loop?: boolean, killOnComplete?: boolean): Phaser.Animation;
10951095
previous(quantity?: number): void;
1096-
refreshFrame();
1096+
refreshFrame(): any;
10971097
stop(name?: string, resetFrame?: boolean): void;
10981098
update(): boolean;
10991099
validateFrames(frames: Phaser.Frame[], useNumericIndex?: boolean): boolean;
@@ -1118,7 +1118,7 @@ declare module Phaser {
11181118
total: number;
11191119

11201120
add(child: Object): Object;
1121-
callAll(callback: Function, ...parameters: any[]);
1121+
callAll(callback: Function, ...parameters: any[]): any;
11221122
exists(child: Object): boolean;
11231123
getIndex(child: Object): number;
11241124
remove(child: Object): Object;
@@ -1850,7 +1850,7 @@ declare module Phaser {
18501850

18511851
destroy(): void;
18521852
init(...args: any[]): void;
1853-
setResolution(width: number, height: number);
1853+
setResolution(width: number, height: number): any;
18541854
update(pointer?: Phaser.Pointer): void;
18551855

18561856
}
@@ -2158,7 +2158,7 @@ declare module Phaser {
21582158
processButtonDown(value: number): void;
21592159
processButtonFloat(value: number): void;
21602160
processButtonUp(value: number): void;
2161-
reset();
2161+
reset(): any;
21622162
}
21632163

21642164
class Graphics extends PIXI.Graphics {
@@ -3188,7 +3188,7 @@ declare module Phaser {
31883188
collide(object1: any, object2: any, collideCallback?: Function, processCallback?: Function, callbackContext?: Object): boolean;
31893189
convertTilemap(map: Phaser.Tilemap, layer?: any, slopeMap?: Object): Phaser.Physics.Ninja.Tile[];
31903190
enableAABB(object: any, children?: boolean): void;
3191-
enableCircle(object: any, radius: number, children?: boolean);
3191+
enableCircle(object: any, radius: number, children?: boolean): any;
31923192
enableTile(object: any, id: number, children?: boolean): void;
31933193
enable(object: any, type?: number, id?: number, radius?: number, children?: boolean): void;
31943194
enableBody(object: any, type?: number, id?: number, radius?: number): void;
@@ -3339,7 +3339,7 @@ declare module Phaser {
33393339
collideWorldBounds(): void;
33403340
destroy(): void;
33413341
integrate(): void;
3342-
reportCollisionVsWorld(px: number, py: number, dx: number, dy: number, obj: Object);
3342+
reportCollisionVsWorld(px: number, py: number, dx: number, dy: number, obj: Object): void;
33433343
setType(id: number): number;
33443344

33453345
}
@@ -3426,7 +3426,7 @@ declare module Phaser {
34263426
removeBody(body: Phaser.Physics.P2.Body): Phaser.Physics.P2.Body;
34273427
removeBodyNextStep(body: Phaser.Physics.P2.Body): void;
34283428
removeConstraint(constraint: any): any;
3429-
removeContactMaterial(material: Phaser.Physics.P2.ContactMaterial);
3429+
removeContactMaterial(material: Phaser.Physics.P2.ContactMaterial): any;
34303430
removeSpring(spring: Phaser.Physics.P2.Spring): Phaser.Physics.P2.Spring;
34313431
resume(): void;
34323432
setBounds(x: number, y: number, width: number, height: number, left?: Boolean, right?: boolean, top?: boolean, bottom?: boolean, setCollisionGroup?: boolean): void;
@@ -3803,7 +3803,7 @@ declare module Phaser {
38033803

38043804
constructor(game: Phaser.Game, parent: any);
38053805

3806-
addSprite(sprite: Phaser.Sprite);
3806+
addSprite(sprite: Phaser.Sprite): any;
38073807
update(): void;
38083808

38093809
}
@@ -4666,7 +4666,7 @@ declare module Phaser {
46664666
x: number;
46674667
y: number;
46684668

4669-
copy(tile): Phaser.Tile;
4669+
copy(tile: Phaser.Tile): Phaser.Tile;
46704670
containsPoint(x: number, y: number): boolean;
46714671
destroy(): void;
46724672
intersects(x: number, y: number, right: number, bottom: number): boolean;
@@ -4951,7 +4951,7 @@ declare module Phaser {
49514951

49524952
class TimerEvent {
49534953

4954-
constructor(timer: Phaser.Timer, delay: number, tick: number, repeatCount: number, loop: boolean, callback: Function, callbackContext, Object, args: any[]);
4954+
constructor(timer: Phaser.Timer, delay: number, tick: number, repeatCount: number, loop: boolean, callback: Function, callbackContext: any, Object: any, args: any[]);
49554955

49564956
args: any[];
49574957
callback: Function;
@@ -5086,7 +5086,7 @@ declare module Phaser {
50865086
geom(object: any, color?: string, fiiled?: boolean, forceType?: number): void;
50875087
inputInfo(x: number, y: number, color?: string): void;
50885088
lineInfo(line: Phaser.Line, x: number, y: number, color?: string): void;
5089-
key(key: Phaser.Key, x?: number, y?: number, color?: string);
5089+
key(key: Phaser.Key, x?: number, y?: number, color?: string): any;
50905090
line(): void;
50915091
preUpdate(): void;
50925092
pixel(x: number, y: number, color?: string, size?: number): void;

0 commit comments

Comments
 (0)