File tree 6 files changed +29
-14
lines changed
6 files changed +29
-14
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " stage-js " : patch
3
+ ---
4
+
5
+ Patch types
Original file line number Diff line number Diff line change 1
1
{
2
- "printWidth" : 100
2
+ "printWidth" : 100 ,
3
+ "quoteProps" : " preserve"
3
4
}
Original file line number Diff line number Diff line change @@ -111,11 +111,11 @@ export class Anim extends Node {
111
111
return this ;
112
112
}
113
113
114
- moveFrame ( move ) {
114
+ moveFrame ( move : number ) {
115
115
return this . gotoFrame ( this . _index + move ) ;
116
116
}
117
117
118
- repeat ( repeat , callback ) {
118
+ repeat ( repeat : number , callback ?: ( ) => void ) {
119
119
this . _repeat = repeat * this . _frames . length - 1 ;
120
120
this . _callback = callback ;
121
121
this . play ( ) ;
Original file line number Diff line number Diff line change @@ -948,6 +948,7 @@ export class Node implements Pinned {
948
948
949
949
scale ( value : Vec2Value ) : this;
950
950
scale ( x : number , y : number ) : this;
951
+ scale ( s : number ) : this;
951
952
scale ( a ?: Vec2Value | number , b ?: number ) {
952
953
// Pin shortcut, used by Transition and Node
953
954
if ( typeof a === "object" ) {
Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ export class Transition implements Pinned {
237
237
238
238
scale ( value : Vec2Value ) : this;
239
239
scale ( x : number , y : number ) : this;
240
+ scale ( s : number ) : this;
240
241
scale ( a : number | Vec2Value , b ?: number ) {
241
242
// Pin shortcut, used by Transition and Node
242
243
if ( typeof a === "object" ) {
Original file line number Diff line number Diff line change @@ -17,23 +17,26 @@ export interface AtlasTextureDefinition {
17
17
bottom ?: number ;
18
18
}
19
19
20
- type AtlasTextureReferenceOne = AtlasTextureDefinition | string ;
21
- type AtlasTextureReferenceMap = Record < string , AtlasTextureReferenceOne > ;
22
- type AtlasTextureReferenceArray = AtlasTextureReferenceOne [ ] ;
20
+ type MonotypeAtlasTextureDefinition = Record < string , AtlasTextureDefinition | Texture | string > ;
21
+ type AnimAtlasTextureDefinition = ( AtlasTextureDefinition | Texture | string ) [ ] ;
23
22
24
23
export interface AtlasDefinition {
25
24
name ?: string ;
26
- image ?: {
27
- /** @deprecated */
28
- url : string ;
29
- src : string ;
30
- ratio ?: number ;
31
- } ;
25
+ image ?:
26
+ | {
27
+ src : string ;
28
+ ratio ?: number ;
29
+ }
30
+ | {
31
+ /** @deprecated Use src instead of url */
32
+ url : string ;
33
+ ratio ?: number ;
34
+ } ;
32
35
33
36
ppu ?: number ;
34
37
textures ?: Record <
35
38
string ,
36
- AtlasTextureDefinition | AtlasTextureReferenceMap | AtlasTextureReferenceArray
39
+ AtlasTextureDefinition | Texture | MonotypeAtlasTextureDefinition | AnimAtlasTextureDefinition
37
40
> ;
38
41
39
42
map ?: ( texture : AtlasTextureDefinition ) => AtlasTextureDefinition ;
@@ -72,7 +75,11 @@ export class Atlas extends ImageTexture {
72
75
this . _textures = def . textures ;
73
76
74
77
if ( typeof def . image === "object" && isHash ( def . image ) ) {
75
- this . _imageSrc = def . image . src || def . image . url ;
78
+ if ( "src" in def . image ) {
79
+ this . _imageSrc = def . image . src ;
80
+ } else if ( "url" in def . image ) {
81
+ this . _imageSrc = def . image . url ;
82
+ }
76
83
if ( typeof def . image . ratio === "number" ) {
77
84
this . _pixelRatio = def . image . ratio ;
78
85
}
You can’t perform that action at this time.
0 commit comments