modern-canvas 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +443 -378
- package/dist/index.d.cts +75 -48
- package/dist/index.d.mts +75 -48
- package/dist/index.d.ts +75 -48
- package/dist/index.js +29 -29
- package/dist/index.mjs +440 -376
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -162,7 +162,7 @@ declare class EventEmitter {
|
|
|
162
162
|
hasEventListener(event: string): boolean;
|
|
163
163
|
on(type: string, listener: EventListenerValue, options?: EventListenerOptions): any;
|
|
164
164
|
once(type: string, listener: EventListenerValue): this;
|
|
165
|
-
off(type: string, listener
|
|
165
|
+
off(type: string, listener?: EventListenerValue, options?: EventListenerOptions): this;
|
|
166
166
|
emit(type: string, ...args: any[]): boolean;
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -171,7 +171,8 @@ interface CoreObjectEventMap {
|
|
|
171
171
|
}
|
|
172
172
|
interface CoreObject {
|
|
173
173
|
on: (<K extends keyof CoreObjectEventMap>(type: K, listener: CoreObjectEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
174
|
-
|
|
174
|
+
once: (<K extends keyof CoreObjectEventMap>(type: K, listener: CoreObjectEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
175
|
+
off: (<K extends keyof CoreObjectEventMap>(type: K, listener?: CoreObjectEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
175
176
|
emit: (<K extends keyof CoreObjectEventMap>(type: K, ...args: Parameters<CoreObjectEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
176
177
|
}
|
|
177
178
|
declare class CoreObject extends EventEmitter {
|
|
@@ -181,6 +182,7 @@ declare class CoreObject extends EventEmitter {
|
|
|
181
182
|
protected _changedProperties: Set<PropertyKey>;
|
|
182
183
|
protected _updatingPromise: Promise<void>;
|
|
183
184
|
protected _updating: boolean;
|
|
185
|
+
is(target: CoreObject | undefined | null): boolean;
|
|
184
186
|
protected _enqueueUpdate(): Promise<void>;
|
|
185
187
|
protected _performUpdate(): void;
|
|
186
188
|
protected _update(changed: Map<PropertyKey, any>): void;
|
|
@@ -203,7 +205,8 @@ interface RefCountedEventMap extends CoreObjectEventMap {
|
|
|
203
205
|
}
|
|
204
206
|
interface RefCounted {
|
|
205
207
|
on: (<K extends keyof RefCountedEventMap>(type: K, listener: RefCountedEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
206
|
-
|
|
208
|
+
once: (<K extends keyof RefCountedEventMap>(type: K, listener: RefCountedEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
209
|
+
off: (<K extends keyof RefCountedEventMap>(type: K, listener?: RefCountedEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
207
210
|
emit: (<K extends keyof RefCountedEventMap>(type: K, ...args: Parameters<RefCountedEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
208
211
|
}
|
|
209
212
|
declare class RefCounted extends CoreObject {
|
|
@@ -250,7 +253,8 @@ interface InputEventMap {
|
|
|
250
253
|
type InputEventKey = keyof InputEventMap;
|
|
251
254
|
interface Input {
|
|
252
255
|
on: (<K extends keyof InputEventMap>(type: K, listener: InputEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
253
|
-
|
|
256
|
+
once: (<K extends keyof InputEventMap>(type: K, listener: InputEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
257
|
+
off: (<K extends keyof InputEventMap>(type: K, listener?: InputEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
254
258
|
emit: (<K extends keyof InputEventMap>(type: K, ...args: Parameters<InputEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
255
259
|
}
|
|
256
260
|
declare class Input extends EventEmitter {
|
|
@@ -293,7 +297,8 @@ interface ResourceEventMap extends RefCountedEventMap {
|
|
|
293
297
|
}
|
|
294
298
|
interface Resource {
|
|
295
299
|
on: (<K extends keyof ResourceEventMap>(type: K, listener: ResourceEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
296
|
-
|
|
300
|
+
once: (<K extends keyof ResourceEventMap>(type: K, listener: ResourceEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
301
|
+
off: (<K extends keyof ResourceEventMap>(type: K, listener?: ResourceEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
297
302
|
emit: (<K extends keyof ResourceEventMap>(type: K, ...args: Parameters<ResourceEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
298
303
|
}
|
|
299
304
|
declare class Resource extends RefCounted {
|
|
@@ -580,7 +585,8 @@ interface MainLoopEventMap extends CoreObjectEventMap {
|
|
|
580
585
|
}
|
|
581
586
|
interface MainLoop {
|
|
582
587
|
on: (<K extends keyof MainLoopEventMap>(type: K, listener: MainLoopEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
583
|
-
|
|
588
|
+
once: (<K extends keyof MainLoopEventMap>(type: K, listener: MainLoopEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
589
|
+
off: (<K extends keyof MainLoopEventMap>(type: K, listener?: MainLoopEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
584
590
|
emit: (<K extends keyof EventListenerOptions>(type: K, ...args: Parameters<EventListenerOptions[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
585
591
|
}
|
|
586
592
|
declare class MainLoop extends CoreObject {
|
|
@@ -1324,6 +1330,18 @@ declare class Texture2D<T extends Texture2DSource = Texture2DSource> extends Res
|
|
|
1324
1330
|
destroy(): void;
|
|
1325
1331
|
}
|
|
1326
1332
|
|
|
1333
|
+
interface ImageFrame {
|
|
1334
|
+
texture: Texture2D;
|
|
1335
|
+
duration: number;
|
|
1336
|
+
}
|
|
1337
|
+
declare class AnimatedTexture extends Resource {
|
|
1338
|
+
frames: ImageFrame[];
|
|
1339
|
+
duration: number;
|
|
1340
|
+
constructor(source: Texture2D | ImageFrame[]);
|
|
1341
|
+
updateDuration(): this;
|
|
1342
|
+
destroy(): void;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1327
1345
|
declare class CanvasTexture extends Texture2D<HTMLCanvasElement> {
|
|
1328
1346
|
pixelRatio: number;
|
|
1329
1347
|
constructor(source?: HTMLCanvasElement);
|
|
@@ -1488,8 +1506,8 @@ declare class CanvasContext extends Path2D {
|
|
|
1488
1506
|
lineWidth?: number;
|
|
1489
1507
|
miterLimit?: number;
|
|
1490
1508
|
_defaultStyle: Texture2D<Texture2DSource>;
|
|
1491
|
-
|
|
1492
|
-
|
|
1509
|
+
_strokes: StrokedGraphics[];
|
|
1510
|
+
_fills: FilledGraphics[];
|
|
1493
1511
|
stroke(): void;
|
|
1494
1512
|
fillRect(x: number, y: number, width: number, height: number): void;
|
|
1495
1513
|
strokeRect(x: number, y: number, width: number, height: number): void;
|
|
@@ -1525,7 +1543,8 @@ interface TimelineProperties extends NodeProperties {
|
|
|
1525
1543
|
}
|
|
1526
1544
|
interface Timeline {
|
|
1527
1545
|
on: (<K extends keyof TimelineEventMap>(type: K, listener: TimelineEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1528
|
-
|
|
1546
|
+
once: (<K extends keyof TimelineEventMap>(type: K, listener: TimelineEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1547
|
+
off: (<K extends keyof TimelineEventMap>(type: K, listener?: TimelineEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1529
1548
|
emit: (<K extends keyof TimelineEventMap>(type: K, ...args: Parameters<TimelineEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
1530
1549
|
}
|
|
1531
1550
|
declare class Timeline extends Node {
|
|
@@ -1545,7 +1564,8 @@ interface RectangulableEventMap {
|
|
|
1545
1564
|
}
|
|
1546
1565
|
interface Rectangulable {
|
|
1547
1566
|
on: (<K extends keyof RectangulableEventMap>(type: K, listener: RectangulableEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1548
|
-
|
|
1567
|
+
once: (<K extends keyof RectangulableEventMap>(type: K, listener: RectangulableEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1568
|
+
off: (<K extends keyof RectangulableEventMap>(type: K, listener?: RectangulableEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1549
1569
|
emit: (<K extends keyof RectangulableEventMap>(type: K, ...args: Parameters<RectangulableEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
1550
1570
|
}
|
|
1551
1571
|
interface Rectangulable {
|
|
@@ -1560,7 +1580,8 @@ interface ViewportFramebuffer {
|
|
|
1560
1580
|
}
|
|
1561
1581
|
interface Viewport {
|
|
1562
1582
|
on: (<K extends keyof ViewportEventMap>(type: K, listener: ViewportEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1563
|
-
|
|
1583
|
+
once: (<K extends keyof ViewportEventMap>(type: K, listener: ViewportEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1584
|
+
off: (<K extends keyof ViewportEventMap>(type: K, listener?: ViewportEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1564
1585
|
emit: (<K extends keyof ViewportEventMap>(type: K, ...args: Parameters<ViewportEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
1565
1586
|
}
|
|
1566
1587
|
declare class Viewport extends Node implements Rectangulable {
|
|
@@ -1600,7 +1621,8 @@ interface SceneTreeEventMap extends MainLoopEventMap {
|
|
|
1600
1621
|
}
|
|
1601
1622
|
interface SceneTree {
|
|
1602
1623
|
on: (<K extends keyof SceneTreeEventMap>(type: K, listener: SceneTreeEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1603
|
-
|
|
1624
|
+
once: (<K extends keyof SceneTreeEventMap>(type: K, listener: SceneTreeEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1625
|
+
off: (<K extends keyof SceneTreeEventMap>(type: K, listener?: SceneTreeEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1604
1626
|
emit: (<K extends keyof SceneTreeEventMap>(type: K, ...args: Parameters<SceneTreeEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
1605
1627
|
}
|
|
1606
1628
|
declare class SceneTree extends MainLoop {
|
|
@@ -1650,6 +1672,7 @@ interface NodeProperties {
|
|
|
1650
1672
|
}
|
|
1651
1673
|
interface Node {
|
|
1652
1674
|
on: (<K extends keyof NodeEventMap>(type: K, listener: NodeEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1675
|
+
once: (<K extends keyof NodeEventMap>(type: K, listener?: NodeEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1653
1676
|
off: (<K extends keyof NodeEventMap>(type: K, listener: NodeEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1654
1677
|
emit: (<K extends keyof NodeEventMap>(type: K, ...args: Parameters<NodeEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
1655
1678
|
}
|
|
@@ -1722,7 +1745,6 @@ declare class Node extends CoreObject {
|
|
|
1722
1745
|
remove(): void;
|
|
1723
1746
|
forEach(fn: (child: Node) => void): this;
|
|
1724
1747
|
deepForEach(fn: (descendant: Node) => void): this;
|
|
1725
|
-
is(target: Node | undefined | null): boolean;
|
|
1726
1748
|
/** override */
|
|
1727
1749
|
protected _ready(): void;
|
|
1728
1750
|
protected _treeEnter(tree: SceneTree): void;
|
|
@@ -1747,7 +1769,8 @@ interface TimelineNodeEventMap extends NodeEventMap {
|
|
|
1747
1769
|
}
|
|
1748
1770
|
interface TimelineNode {
|
|
1749
1771
|
on: (<K extends keyof TimelineNodeEventMap>(type: K, listener: TimelineNodeEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1750
|
-
|
|
1772
|
+
once: (<K extends keyof TimelineNodeEventMap>(type: K, listener: TimelineNodeEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1773
|
+
off: (<K extends keyof TimelineNodeEventMap>(type: K, listener?: TimelineNodeEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1751
1774
|
emit: (<K extends keyof TimelineNodeEventMap>(type: K, ...args: Parameters<TimelineNodeEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
1752
1775
|
}
|
|
1753
1776
|
declare class TimelineNode extends Node {
|
|
@@ -1783,7 +1806,8 @@ interface CanvasItemEventMap extends TimelineNodeEventMap {
|
|
|
1783
1806
|
}
|
|
1784
1807
|
interface CanvasItem {
|
|
1785
1808
|
on: (<K extends keyof CanvasItemEventMap>(type: K, listener: CanvasItemEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1786
|
-
|
|
1809
|
+
once: (<K extends keyof CanvasItemEventMap>(type: K, listener: CanvasItemEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1810
|
+
off: (<K extends keyof CanvasItemEventMap>(type: K, listener?: CanvasItemEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
1787
1811
|
emit: (<K extends keyof CanvasItemEventMap>(type: K, ...args: Parameters<CanvasItemEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
1788
1812
|
}
|
|
1789
1813
|
declare class CanvasItem extends TimelineNode {
|
|
@@ -1901,7 +1925,7 @@ declare class Node2D extends CanvasItem {
|
|
|
1901
1925
|
transform: Transform2D;
|
|
1902
1926
|
protected _parentTransformDirtyId?: number;
|
|
1903
1927
|
constructor(properties?: Partial<Node2DProperties>, children?: Node[]);
|
|
1904
|
-
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any): void;
|
|
1928
|
+
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1905
1929
|
protected _updateTransform(): void;
|
|
1906
1930
|
getRect(): Rect2;
|
|
1907
1931
|
protected _updateOverflow(): void;
|
|
@@ -1936,24 +1960,12 @@ declare class Graphics2D extends Node2D {
|
|
|
1936
1960
|
drawEllipse(x: number, y: number, width: number, height: number): this;
|
|
1937
1961
|
}
|
|
1938
1962
|
|
|
1939
|
-
interface ImageFrame {
|
|
1940
|
-
texture: Texture2D;
|
|
1941
|
-
duration: number;
|
|
1942
|
-
}
|
|
1943
|
-
declare class Image2DResource extends Resource {
|
|
1944
|
-
frames: ImageFrame[];
|
|
1945
|
-
duration: number;
|
|
1946
|
-
constructor(source: Texture2D | ImageFrame[]);
|
|
1947
|
-
updateDuration(): this;
|
|
1948
|
-
destroy(): void;
|
|
1949
|
-
}
|
|
1950
|
-
|
|
1951
1963
|
interface Image2DProperties extends Node2DProperties {
|
|
1952
1964
|
src: string;
|
|
1953
1965
|
gif: boolean;
|
|
1954
1966
|
}
|
|
1955
1967
|
declare class Image2D extends Node2D {
|
|
1956
|
-
resource?:
|
|
1968
|
+
resource?: AnimatedTexture;
|
|
1957
1969
|
gif: boolean;
|
|
1958
1970
|
src: string;
|
|
1959
1971
|
get currentTexture(): Texture2D | undefined;
|
|
@@ -1967,7 +1979,7 @@ declare class Image2D extends Node2D {
|
|
|
1967
1979
|
constructor(properties?: Partial<Image2DProperties>, children?: Node[]);
|
|
1968
1980
|
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1969
1981
|
decode(): Promise<void>;
|
|
1970
|
-
setResource(source: Texture2D | ImageFrame[] |
|
|
1982
|
+
setResource(source: Texture2D | ImageFrame[] | AnimatedTexture): this;
|
|
1971
1983
|
protected _load(src: string): Promise<void>;
|
|
1972
1984
|
protected _getFrameCurrentTime(): number;
|
|
1973
1985
|
protected _updateFrameIndex(): this;
|
|
@@ -2029,6 +2041,16 @@ declare class Text2D extends TextureRect2D<CanvasTexture> {
|
|
|
2029
2041
|
protected _drawContent(): void;
|
|
2030
2042
|
}
|
|
2031
2043
|
|
|
2044
|
+
interface TransformRect2DProperties extends Node2DProperties {
|
|
2045
|
+
}
|
|
2046
|
+
declare class TransformRect2D extends Node2D implements Rectangulable {
|
|
2047
|
+
size: number;
|
|
2048
|
+
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2049
|
+
protected _drawCircle(x: number, y: number): void;
|
|
2050
|
+
protected _drawEllipse(x: number, y: number): void;
|
|
2051
|
+
protected _draw(): void;
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2032
2054
|
interface Video2DProperties extends TextureRect2DProperties {
|
|
2033
2055
|
src: string;
|
|
2034
2056
|
}
|
|
@@ -2557,7 +2579,8 @@ interface ControlProperties extends CanvasItemProperties {
|
|
|
2557
2579
|
}
|
|
2558
2580
|
interface Control {
|
|
2559
2581
|
on: (<K extends keyof ControlEventMap>(type: K, listener: ControlEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2560
|
-
|
|
2582
|
+
once: (<K extends keyof ControlEventMap>(type: K, listener: ControlEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2583
|
+
off: (<K extends keyof ControlEventMap>(type: K, listener?: ControlEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2561
2584
|
emit: (<K extends keyof ControlEventMap>(type: K, ...args: Parameters<ControlEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
2562
2585
|
}
|
|
2563
2586
|
declare class Control extends CanvasItem implements Rectangulable {
|
|
@@ -2868,7 +2891,8 @@ interface ScalerProperties extends NodeProperties {
|
|
|
2868
2891
|
}
|
|
2869
2892
|
interface Scaler {
|
|
2870
2893
|
on: (<K extends keyof ScalerEventMap>(type: K, listener: ScalerEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2871
|
-
|
|
2894
|
+
once: (<K extends keyof ScalerEventMap>(type: K, listener: ScalerEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2895
|
+
off: (<K extends keyof ScalerEventMap>(type: K, listener?: ScalerEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2872
2896
|
emit: (<K extends keyof ScalerEventMap>(type: K, ...args: Parameters<ScalerEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
2873
2897
|
}
|
|
2874
2898
|
declare class Scaler extends Node {
|
|
@@ -2911,12 +2935,12 @@ declare class TwistTransition extends Transition {
|
|
|
2911
2935
|
apply(renderer: WebGLRenderer, source: Viewport): void;
|
|
2912
2936
|
}
|
|
2913
2937
|
|
|
2914
|
-
declare class
|
|
2915
|
-
load: (url: string) => Promise<
|
|
2938
|
+
declare class GIFLoader extends Loader {
|
|
2939
|
+
load: (url: string) => Promise<AnimatedTexture>;
|
|
2916
2940
|
install(assets: Assets): this;
|
|
2917
2941
|
}
|
|
2918
2942
|
|
|
2919
|
-
declare class
|
|
2943
|
+
declare class JSONLoader extends Loader {
|
|
2920
2944
|
load: (url: string) => Promise<Record<string, any>>;
|
|
2921
2945
|
install(assets: Assets): this;
|
|
2922
2946
|
}
|
|
@@ -2944,8 +2968,8 @@ declare class VideoLoader extends Loader {
|
|
|
2944
2968
|
type AssetHandler = (url: string, options?: any) => any | Promise<any>;
|
|
2945
2969
|
interface Assets {
|
|
2946
2970
|
font: FontLoader;
|
|
2947
|
-
gif:
|
|
2948
|
-
json:
|
|
2971
|
+
gif: GIFLoader;
|
|
2972
|
+
json: JSONLoader;
|
|
2949
2973
|
lottie: LottieLoader;
|
|
2950
2974
|
text: TextLoader;
|
|
2951
2975
|
texture: TextureLoader;
|
|
@@ -2973,27 +2997,29 @@ declare class Assets {
|
|
|
2973
2997
|
declare const assets: Assets;
|
|
2974
2998
|
|
|
2975
2999
|
declare class CanvasItemEditor extends Control {
|
|
2976
|
-
hover: Node2D;
|
|
2977
|
-
selectionRect: Node2D;
|
|
2978
|
-
selector: Node2D;
|
|
2979
|
-
scaler: Scaler;
|
|
2980
|
-
xScrollBar: XScrollBar;
|
|
2981
|
-
yScrollBar: YScrollBar;
|
|
2982
|
-
drawboard: Node2D;
|
|
2983
|
-
ruler: Ruler;
|
|
2984
3000
|
protected _pointerStart?: CanvasItemStyle;
|
|
2985
3001
|
protected _pointerOffset?: {
|
|
2986
3002
|
x: number;
|
|
2987
3003
|
y: number;
|
|
2988
3004
|
};
|
|
2989
3005
|
selected?: CanvasItem;
|
|
3006
|
+
dragging?: CanvasItem;
|
|
3007
|
+
hovered?: CanvasItem;
|
|
3008
|
+
hover: Node2D;
|
|
3009
|
+
transformRect: TransformRect2D;
|
|
3010
|
+
scaler: Scaler;
|
|
3011
|
+
xScrollBar: XScrollBar;
|
|
3012
|
+
yScrollBar: YScrollBar;
|
|
3013
|
+
drawboard: Node2D;
|
|
3014
|
+
ruler: Ruler;
|
|
2990
3015
|
constructor();
|
|
2991
3016
|
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2992
3017
|
protected _guiInput(event: InputEvent, key: InputEventKey): void;
|
|
2993
3018
|
protected _onPointerdown(e: PointerInputEvent): void;
|
|
2994
3019
|
protected _onPointermove(e: PointerInputEvent): void;
|
|
2995
3020
|
protected _onPointerup(): void;
|
|
2996
|
-
protected
|
|
3021
|
+
protected _updateHover(): void;
|
|
3022
|
+
protected _updateSelectionRect(): void;
|
|
2997
3023
|
protected _updateScrollbars(): void;
|
|
2998
3024
|
}
|
|
2999
3025
|
|
|
@@ -3024,7 +3050,8 @@ declare const defaultOptions: {
|
|
|
3024
3050
|
};
|
|
3025
3051
|
interface Engine {
|
|
3026
3052
|
on: (<K extends keyof EngineEventMap>(type: K, listener: EngineEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
3027
|
-
|
|
3053
|
+
once: (<K extends keyof EngineEventMap>(type: K, listener: EngineEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
3054
|
+
off: (<K extends keyof EngineEventMap>(type: K, listener?: EngineEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
3028
3055
|
emit: (<K extends keyof EngineEventMap>(type: K, ...args: Parameters<EngineEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
3029
3056
|
}
|
|
3030
3057
|
declare class Engine extends SceneTree {
|
|
@@ -3064,4 +3091,4 @@ interface RenderOptions {
|
|
|
3064
3091
|
}
|
|
3065
3092
|
declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
|
|
3066
3093
|
|
|
3067
|
-
export { Animation, type AnimationEffectMode, type AnimationProperties, type AssetHandler, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, type AudioWaveformProperties, type Batchable2D, BlurEffect, type CanvasBatchable, CanvasContext, CanvasItem, CanvasItemEditor, type CanvasItemEventMap, type CanvasItemProperties, CanvasItemStyle, type CanvasItemStyleFilter, type CanvasItemStyleFilterKey, type CanvasItemStyleProperties, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, type ColorFilterEffectProperties, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, type ColorValue, Control, type ControlEventMap, type ControlProperties, CoreObject, type CoreObjectEventMap, type CssFunction, type CssFunctionArg, type Cursor, DEG_TO_RAD, DEVICE_PIXEL_RATIO, type Easing, Effect, type EffectContext, EffectMaterial, type EffectMode, type EffectProperties, Element$1 as Element, type ElementProperties, ElementStyle, type ElementStyleFilter, type ElementStyleFilterKey, type ElementStyleProperties, EmbossEffect, Engine, type EngineOptions, EventEmitter, type EventListener, type EventListenerOptions, type EventListenerValue, type FilledGraphics, FontLoader, Geometry, type GeometryOptions,
|
|
3094
|
+
export { AnimatedTexture, Animation, type AnimationEffectMode, type AnimationProperties, type AssetHandler, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, type AudioWaveformProperties, type Batchable2D, BlurEffect, type CanvasBatchable, CanvasContext, CanvasItem, CanvasItemEditor, type CanvasItemEventMap, type CanvasItemProperties, CanvasItemStyle, type CanvasItemStyleFilter, type CanvasItemStyleFilterKey, type CanvasItemStyleProperties, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, type ColorFilterEffectProperties, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, type ColorValue, Control, type ControlEventMap, type ControlProperties, CoreObject, type CoreObjectEventMap, type CssFunction, type CssFunctionArg, type Cursor, DEG_TO_RAD, DEVICE_PIXEL_RATIO, type Easing, Effect, type EffectContext, EffectMaterial, type EffectMode, type EffectProperties, Element$1 as Element, type ElementProperties, ElementStyle, type ElementStyleFilter, type ElementStyleFilterKey, type ElementStyleProperties, EmbossEffect, Engine, type EngineOptions, EventEmitter, type EventListener, type EventListenerOptions, type EventListenerValue, type FilledGraphics, FontLoader, GIFLoader, Geometry, type GeometryOptions, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, type IAudioContext, type IAudioNode, type IDOCLayoutStyleDeclaration, IN_BROWSER, type IPlayOptions, Image2D, type Image2DProperties, type ImageFrame, ImageTexture, type ImageTextureOptions, IndexBuffer, type IndexBufferOptions, Input, InputEvent, type InputEventKey, type InputEventMap, type InternalMode, JSONLoader, KawaseTransition, type Keyframe, LeftEraseTransition, Loader, Lottie2D, type Lottie2DProperties, LottieLoader, MainLoop, type MainLoopEventMap, type MaskColor, type MaskData, MaskEffect, type MaskEffectProperties, type MaskObject, type MaskRect, type Maskable, Material, type MaterialOptions, Matrix, Matrix2, Matrix3, Matrix4, type MatrixLike, type MatrixOperateOutput, MouseInputEvent, Node, Node2D, type Node2DProperties, type NodeEventMap, type NodeProperties, type NormalizedKeyframe, PI, PI_2, PixelateEffect, PixelsTexture, type PlatformAudio, type PlatformSound, type PointerEvents$1 as PointerEvents, PointerInputEvent, type ProcessMode, Projection2D, type PropertyDeclaration, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, type RangeProperties, RawWeakMap, Rect2, RefCounted, type RefCountedEventMap, type RenderMode, type RenderOptions, type Renderable, Renderer, Resource, type ResourceEventMap, Ruler, type RulerProperties, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, type ScalerEventMap, type ScalerProperties, SceneTree, type SceneTreeEventMap, ScrollBar, type ScrollBarProperties, ShadowEffect, type StrokedGraphics, Text2D, type Text2DProperties, TextLoader, Texture2D, type Texture2DFilterMode, type Texture2DPixelsSource, type Texture2DSource, type Texture2DWrapMode, TextureLoader, TextureRect2D, type TextureRect2DProperties, Ticker, TiltShiftTransition, Timeline, type TimelineEventMap, TimelineNode, type TimelineNodeEventMap, type TimelineNodeProperties, type TimelineProperties, type TimingFunctions, Transform2D, type Transform2DObject, TransformRect2D, type TransformRect2DProperties, Transition, type TransitionProperties, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, type VectorLike, type VectorOperateOutput, VertexAttribute, type VertexAttributeOptions, VertexBuffer, type VertexBufferOptions, Video2D, type Video2DProperties, VideoLoader, VideoTexture, type VideoTextureOptions, type VideoTextureSource, Viewport, type ViewportEventMap, type ViewportFramebuffer, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, type WebGLBufferMeta, WebGLBufferModule, type WebGLBufferOptions, type WebGLBufferTarget, type WebGLBufferUsage, type WebGLDrawMode, type WebGLDrawOptions, type WebGLExtensions, type WebGLFramebufferMeta, WebGLFramebufferModule, type WebGLFramebufferOptions, WebGLMaskModule, WebGLModule, type WebGLProgramMeta, WebGLProgramModule, type WebGLProgramOptions, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, type WebGLTarget, type WebGLTextureFilterMode, type WebGLTextureLocation, type WebGLTextureMeta, WebGLTextureModule, type WebGLTextureOptions, type WebGLTextureSource, type WebGLTextureTarget, type WebGLTextureWrapMode, WebGLVertexArrayModule, type WebGLVertexArrayObjectMeta, type WebGLVertexArrayObjectOptions, type WebGLVertexAttrib, type WebGLVertexAttribType, type WebGLViewport, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, type XScrollBarProperties, YScrollBar, type YScrollBarProperties, ZoomBlurEffect, assets, clamp, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
|