modern-canvas 0.8.9 → 0.9.0

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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Font } from 'modern-font';
2
- import { EventListenerOptions as EventListenerOptions$1, EventListenerValue, EventEmitter, PropertyDeclaration, ReactiveObject, ReactiveObjectPropertyAccessorContext, Color as Color$1, RawWeakMap as RawWeakMap$1, LinearGradient, RadialGradient, NormalizedFill, Fill, NormalizedBackground, Background, NormalizedForeground, Foreground, NormalizedOutline, Outline, NormalizedShadow, Shadow, NormalizedShape, Shape, FullStyle, Text as Text$1, TextContent, Style, ImageFillCropRect } from 'modern-idoc';
2
+ import { ObservableEvents, Observable, ReactivableEvents, Reactivable, Color as Color$1, RawWeakMap as RawWeakMap$1, LinearGradient, RadialGradient, NormalizedFill, Fill, NormalizedBackground, Background, NormalizedForeground, Foreground, NormalizedOutline, Outline, NormalizedShadow, Shadow, NormalizedShape, Shape, FullStyle, Text as Text$1, TextContent, Style, ImageFillCropRect } from 'modern-idoc';
3
3
  export { Color as ColorValue } from 'modern-idoc';
4
4
  import { AnimationItem } from 'lottie-web';
5
5
  import { Colord, RgbaColor, HslaColor, HsvaColor } from 'colord';
@@ -190,7 +190,7 @@ declare class WheelInputEvent extends MouseInputEvent implements WheelEvent {
190
190
  readonly DOM_DELTA_PAGE = 2;
191
191
  }
192
192
 
193
- interface InputEventMap {
193
+ interface InputEvents extends ObservableEvents {
194
194
  pointerdown: (ev: PointerInputEvent) => void;
195
195
  pointerover: (ev: PointerInputEvent) => void;
196
196
  pointermove: (ev: PointerInputEvent) => void;
@@ -200,14 +200,14 @@ interface InputEventMap {
200
200
  keypress: (ev: KeyboardInputEvent) => void;
201
201
  keyup: (ev: KeyboardInputEvent) => void;
202
202
  }
203
- type InputEventKey = keyof InputEventMap;
203
+ type InputEventKey = keyof InputEvents;
204
204
  interface Input {
205
- on: (<K extends keyof InputEventMap>(type: K, listener: InputEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
206
- once: (<K extends keyof InputEventMap>(type: K, listener: InputEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
207
- off: (<K extends keyof InputEventMap>(type: K, listener?: InputEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
208
- emit: (<K extends keyof InputEventMap>(type: K, ...args: Parameters<InputEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
205
+ on: <K extends keyof InputEvents & string>(event: K, listener: InputEvents[K]) => this;
206
+ once: <K extends keyof InputEvents & string>(event: K, listener: InputEvents[K]) => this;
207
+ off: <K extends keyof InputEvents & string>(event: K, listener: InputEvents[K]) => this;
208
+ emit: <K extends keyof InputEvents & string>(event: K, ...args: Parameters<InputEvents[K]>) => this;
209
209
  }
210
- declare class Input extends EventEmitter {
210
+ declare class Input extends Observable {
211
211
  /**
212
212
  * Current event
213
213
  */
@@ -245,68 +245,38 @@ declare class Input extends EventEmitter {
245
245
  protected _onWheel: (nativeEvent: WheelEvent) => void;
246
246
  }
247
247
 
248
- interface CoreObjectEventMap {
249
- updateProperty: (key: string, newValue: any, oldValue: any, declaration?: PropertyDeclaration) => void;
250
- }
251
- interface CustomPropertyAccessor {
252
- get: (key: string, fallback: () => any) => any;
253
- set: (key: string, value: any) => void;
248
+ interface CoreObjectEvents extends ReactivableEvents {
254
249
  }
255
250
  interface CoreObject {
256
- on: (<K extends keyof CoreObjectEventMap>(type: K, listener: CoreObjectEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
257
- once: (<K extends keyof CoreObjectEventMap>(type: K, listener: CoreObjectEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
258
- off: (<K extends keyof CoreObjectEventMap>(type: K, listener?: CoreObjectEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
259
- emit: (<K extends keyof CoreObjectEventMap>(type: K, ...args: Parameters<CoreObjectEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
251
+ on: <K extends keyof CoreObjectEvents & string>(event: K, listener: CoreObjectEvents[K]) => this;
252
+ once: <K extends keyof CoreObjectEvents & string>(event: K, listener: CoreObjectEvents[K]) => this;
253
+ off: <K extends keyof CoreObjectEvents & string>(event: K, listener: CoreObjectEvents[K]) => this;
254
+ emit: <K extends keyof CoreObjectEvents & string>(event: K, ...args: Parameters<CoreObjectEvents[K]>) => this;
260
255
  }
261
- declare class CoreObject extends EventEmitter implements Required<ReactiveObject> {
256
+ declare class CoreObject extends Reactivable {
262
257
  readonly instanceId: number;
263
- protected _propertyAccessor?: CustomPropertyAccessor;
264
- protected _properties: Map<string, unknown>;
265
- protected _updatedProperties: Map<string, unknown>;
266
- protected _changedProperties: Set<string>;
267
- protected _updatingPromise: Promise<void>;
268
- protected _updating: boolean;
269
- useCustomPropertyAccessor(accessor: CustomPropertyAccessor): this;
270
- getter(key: string, context?: ReactiveObjectPropertyAccessorContext): any;
271
- setter(key: string, value: any, context?: ReactiveObjectPropertyAccessorContext): void;
258
+ protected _nextTick(): Promise<void>;
272
259
  equal(target: CoreObject | undefined | null): boolean;
273
- protected _enqueueUpdate(): Promise<void>;
274
- update(): void;
275
- protected _update(changed: Map<string, any>): void;
276
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
277
- isDirty(key: string): boolean;
278
- getPropertyDeclarations(): Map<string, PropertyDeclaration>;
279
- getPropertyDeclaration(key: string): PropertyDeclaration | undefined;
280
- getProperty(key: string): any | undefined;
281
- setProperty(key: string, value: any): this;
282
- getProperties(keys?: string[]): Record<string, any>;
283
- setProperties(properties?: any): this;
284
- resetProperties(): this;
285
- onUpdateProperty(key: string, newValue: unknown, oldValue: unknown, declaration: PropertyDeclaration): void;
286
- requestUpdate(key?: string, newValue?: unknown, oldValue?: unknown, declaration?: PropertyDeclaration): void;
287
- toJSON(): Record<string, any>;
288
- clone(): this;
289
- free(): void;
290
260
  }
291
261
 
292
- interface RefCountedEventMap extends CoreObjectEventMap {
262
+ interface RefCountedEvents extends CoreObjectEvents {
293
263
  }
294
264
  interface RefCounted {
295
- on: (<K extends keyof RefCountedEventMap>(type: K, listener: RefCountedEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
296
- once: (<K extends keyof RefCountedEventMap>(type: K, listener: RefCountedEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
297
- off: (<K extends keyof RefCountedEventMap>(type: K, listener?: RefCountedEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
298
- emit: (<K extends keyof RefCountedEventMap>(type: K, ...args: Parameters<RefCountedEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
265
+ on: <K extends keyof RefCountedEvents & string>(event: K, listener: RefCountedEvents[K]) => this;
266
+ once: <K extends keyof RefCountedEvents & string>(event: K, listener: RefCountedEvents[K]) => this;
267
+ off: <K extends keyof RefCountedEvents & string>(event: K, listener: RefCountedEvents[K]) => this;
268
+ emit: <K extends keyof RefCountedEvents & string>(event: K, ...args: Parameters<RefCountedEvents[K]>) => this;
299
269
  }
300
270
  declare class RefCounted extends CoreObject {
301
271
  }
302
272
 
303
- interface ResourceEventMap extends RefCountedEventMap {
273
+ interface ResourceEvents extends RefCountedEvents {
304
274
  }
305
275
  interface Resource {
306
- on: (<K extends keyof ResourceEventMap>(type: K, listener: ResourceEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
307
- once: (<K extends keyof ResourceEventMap>(type: K, listener: ResourceEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
308
- off: (<K extends keyof ResourceEventMap>(type: K, listener?: ResourceEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
309
- emit: (<K extends keyof ResourceEventMap>(type: K, ...args: Parameters<ResourceEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
276
+ on: <K extends keyof ResourceEvents & string>(event: K, listener: ResourceEvents[K]) => this;
277
+ once: <K extends keyof ResourceEvents & string>(event: K, listener: ResourceEvents[K]) => this;
278
+ off: <K extends keyof ResourceEvents & string>(event: K, listener: ResourceEvents[K]) => this;
279
+ emit: <K extends keyof ResourceEvents & string>(event: K, ...args: Parameters<ResourceEvents[K]>) => this;
310
280
  }
311
281
  declare class Resource extends RefCounted {
312
282
  }
@@ -341,7 +311,7 @@ declare class Color {
341
311
 
342
312
  type VectorLike = number | number[] | Matrix | Vector;
343
313
  type VectorOperateOutput = number[] | Vector;
344
- declare abstract class Vector extends EventEmitter {
314
+ declare abstract class Vector extends Observable {
345
315
  readonly dim: number;
346
316
  protected _array: number[];
347
317
  get length(): number;
@@ -364,7 +334,7 @@ declare abstract class Vector extends EventEmitter {
364
334
 
365
335
  type MatrixLike = number | number[] | Matrix;
366
336
  type MatrixOperateOutput = number[] | Matrix | Vector;
367
- declare abstract class Matrix extends EventEmitter {
337
+ declare abstract class Matrix extends Observable {
368
338
  readonly rows: number;
369
339
  readonly cols: number;
370
340
  protected _array: number[];
@@ -610,27 +580,28 @@ declare class Vector3 extends Vector {
610
580
  constructor();
611
581
  }
612
582
 
613
- interface MainLoopEventMap extends CoreObjectEventMap {
583
+ interface MainLoopEvents extends CoreObjectEvents {
614
584
  process: (delta: number) => void;
615
585
  }
616
586
  interface MainLoop {
617
- on: (<K extends keyof MainLoopEventMap>(type: K, listener: MainLoopEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
618
- once: (<K extends keyof MainLoopEventMap>(type: K, listener: MainLoopEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
619
- off: (<K extends keyof MainLoopEventMap>(type: K, listener?: MainLoopEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
620
- emit: (<K extends keyof EventListenerOptions$1>(type: K, ...args: Parameters<EventListenerOptions$1[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
587
+ on: <K extends keyof MainLoopEvents & string>(event: K, listener: MainLoopEvents[K]) => this;
588
+ once: <K extends keyof MainLoopEvents & string>(event: K, listener: MainLoopEvents[K]) => this;
589
+ off: <K extends keyof MainLoopEvents & string>(event: K, listener: MainLoopEvents[K]) => this;
590
+ emit: <K extends keyof MainLoopEvents & string>(event: K, ...args: Parameters<MainLoopEvents[K]>) => this;
621
591
  }
622
592
  declare class MainLoop extends CoreObject {
623
593
  fps: number;
624
594
  speed: number;
625
595
  protected _starting: boolean;
626
596
  protected _nextDeltaTime: number;
597
+ protected _startedProcess?: (delta: number) => void;
627
598
  get starting(): boolean;
628
599
  get spf(): number;
629
600
  constructor();
630
601
  start(process: (delta: number) => void): void;
631
602
  stop(): void;
632
603
  protected _onNextTick(): void;
633
- free(): void;
604
+ destroy(): void;
634
605
  }
635
606
 
636
607
  interface CssFunctionArg {
@@ -893,7 +864,7 @@ declare class WebGLRenderer extends Renderer {
893
864
  draw(options?: WebGLDrawOptions): void;
894
865
  reset(): void;
895
866
  flush(): void;
896
- free(): void;
867
+ destroy(): void;
897
868
  toPixels(x?: number, y?: number, width?: number, height?: number): Uint8ClampedArray<ArrayBuffer>;
898
869
  }
899
870
 
@@ -929,7 +900,7 @@ declare abstract class WebGLModule {
929
900
  onUpdateContext(): void;
930
901
  flush(): void;
931
902
  reset(): void;
932
- free(): void;
903
+ destroy(): void;
933
904
  }
934
905
 
935
906
  interface WebGLState {
@@ -1117,7 +1088,7 @@ declare class WebGLProgramModule extends WebGLModule {
1117
1088
  updateUniforms(program: WebGLProgram, uniforms: Record<string, any>): void;
1118
1089
  updateUniforms(uniforms: Record<string, any>): void;
1119
1090
  reset(): void;
1120
- free(): void;
1091
+ destroy(): void;
1121
1092
  }
1122
1093
 
1123
1094
  declare class WebGLScissorModule extends WebGLModule {
@@ -1200,11 +1171,11 @@ declare class Material extends Resource {
1200
1171
  }
1201
1172
 
1202
1173
  interface IndexBufferOptions {
1203
- data?: Uint16Array | null;
1174
+ data?: Uint16Array<ArrayBuffer> | null;
1204
1175
  dynamic?: boolean;
1205
1176
  }
1206
1177
  declare class IndexBuffer extends Resource {
1207
- data: Uint16Array | null;
1178
+ data: Uint16Array<ArrayBuffer> | null;
1208
1179
  dynamic: boolean;
1209
1180
  needsUpload: boolean;
1210
1181
  constructor(options?: IndexBufferOptions);
@@ -1212,7 +1183,7 @@ declare class IndexBuffer extends Resource {
1212
1183
  _glBufferOptions(): WebGLBufferOptions;
1213
1184
  /** @internal */
1214
1185
  _glBuffer(renderer: WebGLRenderer): WebGLBuffer;
1215
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1186
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1216
1187
  upload(renderer: WebGLRenderer): boolean;
1217
1188
  }
1218
1189
 
@@ -1229,7 +1200,7 @@ declare class VertexBuffer extends Resource {
1229
1200
  _glBufferOptions(): WebGLBufferOptions;
1230
1201
  /** @internal */
1231
1202
  _glBuffer(renderer: WebGLRenderer): WebGLBuffer;
1232
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1203
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1233
1204
  upload(renderer: WebGLRenderer): boolean;
1234
1205
  }
1235
1206
 
@@ -1252,7 +1223,7 @@ declare class VertexAttribute extends Resource {
1252
1223
  divisor: number | undefined;
1253
1224
  needsUpload: boolean;
1254
1225
  constructor(options?: VertexAttributeOptions);
1255
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1226
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1256
1227
  upload(): boolean;
1257
1228
  }
1258
1229
 
@@ -1350,14 +1321,14 @@ declare class Texture2D<T extends Texture2DSource = Texture2DSource> extends Res
1350
1321
  _glTextureOptions(renderer: WebGLRenderer, options?: Partial<WebGLTextureOptions>): WebGLTextureOptions;
1351
1322
  /** @internal */
1352
1323
  _glTexture(renderer: WebGLRenderer, options?: Partial<WebGLTextureOptions>): WebGLTexture;
1353
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1324
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1354
1325
  protected _updatePOT(): void;
1355
1326
  protected _updateSize(): void;
1356
1327
  requestUpload(): void;
1357
1328
  upload(renderer: WebGLRenderer, options?: Partial<WebGLTextureOptions>): boolean;
1358
1329
  activate(renderer: WebGLRenderer, location?: number): boolean;
1359
1330
  inactivate(renderer: WebGLRenderer): void;
1360
- free(): void;
1331
+ destroy(): void;
1361
1332
  }
1362
1333
 
1363
1334
  interface ImageFrame {
@@ -1369,13 +1340,13 @@ declare class AnimatedTexture extends Resource {
1369
1340
  duration: number;
1370
1341
  constructor(source: Texture2D | ImageFrame[]);
1371
1342
  updateDuration(): this;
1372
- free(): void;
1343
+ destroy(): void;
1373
1344
  }
1374
1345
 
1375
1346
  declare class CanvasTexture extends Texture2D<HTMLCanvasElement> {
1376
1347
  pixelRatio: number;
1377
1348
  constructor(source?: HTMLCanvasElement);
1378
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1349
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1379
1350
  }
1380
1351
 
1381
1352
  declare class ColorTexture extends Texture2D {
@@ -1411,7 +1382,7 @@ declare class ImageTexture extends Texture2D<HTMLImageElement> {
1411
1382
 
1412
1383
  declare class PixelsTexture extends Texture2D<Texture2DPixelsSource> {
1413
1384
  constructor(pixels?: number[] | ArrayBufferLike | ArrayBufferView | null, width?: number, height?: number);
1414
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1385
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1415
1386
  }
1416
1387
 
1417
1388
  interface VideoTextureOptions {
@@ -1446,7 +1417,7 @@ declare class VideoTexture extends Texture2D<HTMLVideoElement> {
1446
1417
  protected _resolve?: (val: this) => void;
1447
1418
  protected _reject?: (event: ErrorEvent) => void;
1448
1419
  constructor(source: HTMLVideoElement | (string | VideoTextureSource)[] | string, options?: VideoTextureOptions);
1449
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1420
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1450
1421
  protected _onPlayStart: () => void;
1451
1422
  protected _onPlayStop: () => void;
1452
1423
  protected _onCanPlay: () => void;
@@ -1457,7 +1428,7 @@ declare class VideoTexture extends Texture2D<HTMLVideoElement> {
1457
1428
  protected _videoFrameRequestCallback: () => void;
1458
1429
  requestUpload: () => void;
1459
1430
  load(): Promise<this>;
1460
- free(): void;
1431
+ destroy(): void;
1461
1432
  }
1462
1433
 
1463
1434
  declare class ViewportTexture extends PixelsTexture {
@@ -1507,30 +1478,30 @@ declare class CanvasContext extends Path2D {
1507
1478
  toBatchables(): CanvasBatchable[];
1508
1479
  }
1509
1480
 
1510
- interface RectangulableEventMap {
1481
+ interface RectangulableEvents {
1511
1482
  updateRect: () => void;
1512
1483
  }
1513
1484
  interface Rectangulable {
1514
- on: (<K extends keyof RectangulableEventMap>(type: K, listener: RectangulableEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1515
- once: (<K extends keyof RectangulableEventMap>(type: K, listener: RectangulableEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1516
- off: (<K extends keyof RectangulableEventMap>(type: K, listener?: RectangulableEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1517
- emit: (<K extends keyof RectangulableEventMap>(type: K, ...args: Parameters<RectangulableEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
1485
+ on: <K extends keyof RectangulableEvents & string>(event: K, listener: RectangulableEvents[K]) => this;
1486
+ once: <K extends keyof RectangulableEvents & string>(event: K, listener: RectangulableEvents[K]) => this;
1487
+ off: <K extends keyof RectangulableEvents & string>(event: K, listener: RectangulableEvents[K]) => this;
1488
+ emit: <K extends keyof RectangulableEvents & string>(event: K, ...args: Parameters<RectangulableEvents[K]>) => this;
1518
1489
  }
1519
1490
  interface Rectangulable {
1520
1491
  getRect: () => Rect2;
1521
1492
  }
1522
1493
 
1523
- interface ViewportEventMap extends NodeEventMap, RectangulableEventMap {
1494
+ interface ViewportEvents extends NodeEvents, RectangulableEvents {
1524
1495
  }
1525
1496
  interface ViewportFramebuffer {
1526
1497
  texture: ViewportTexture;
1527
1498
  needsUpload: boolean;
1528
1499
  }
1529
1500
  interface Viewport {
1530
- on: (<K extends keyof ViewportEventMap>(type: K, listener: ViewportEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1531
- once: (<K extends keyof ViewportEventMap>(type: K, listener: ViewportEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1532
- off: (<K extends keyof ViewportEventMap>(type: K, listener?: ViewportEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1533
- emit: (<K extends keyof ViewportEventMap>(type: K, ...args: Parameters<ViewportEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
1501
+ on: <K extends keyof ViewportEvents & string>(event: K, listener: ViewportEvents[K]) => this;
1502
+ once: <K extends keyof ViewportEvents & string>(event: K, listener: ViewportEvents[K]) => this;
1503
+ off: <K extends keyof ViewportEvents & string>(event: K, listener: ViewportEvents[K]) => this;
1504
+ emit: <K extends keyof ViewportEvents & string>(event: K, ...args: Parameters<ViewportEvents[K]>) => this;
1534
1505
  }
1535
1506
  declare class Viewport extends Node implements Rectangulable {
1536
1507
  flipY: boolean;
@@ -1551,7 +1522,7 @@ declare class Viewport extends Node implements Rectangulable {
1551
1522
  _glFramebufferOptions(renderer: WebGLRenderer): WebGLFramebufferOptions;
1552
1523
  /** @internal */
1553
1524
  _glFramebuffer(renderer: WebGLRenderer): WebGLFramebuffer;
1554
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1525
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1555
1526
  requestUpload(): void;
1556
1527
  resize(width: number, height: number): void;
1557
1528
  upload(renderer: WebGLRenderer): boolean;
@@ -1578,7 +1549,7 @@ declare class RenderStack {
1578
1549
  render(renderer: WebGLRenderer): void;
1579
1550
  }
1580
1551
 
1581
- interface TimelineEventMap extends NodeEventMap {
1552
+ interface TimelineEvents extends NodeEvents {
1582
1553
  updateCurrentTime: (current: number, delta: number) => void;
1583
1554
  }
1584
1555
  interface TimelineProperties extends NodeProperties {
@@ -1588,10 +1559,10 @@ interface TimelineProperties extends NodeProperties {
1588
1559
  loop: boolean;
1589
1560
  }
1590
1561
  interface Timeline {
1591
- on: (<K extends keyof TimelineEventMap>(type: K, listener: TimelineEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1592
- once: (<K extends keyof TimelineEventMap>(type: K, listener: TimelineEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1593
- off: (<K extends keyof TimelineEventMap>(type: K, listener?: TimelineEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1594
- emit: (<K extends keyof TimelineEventMap>(type: K, ...args: Parameters<TimelineEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
1562
+ on: <K extends keyof TimelineEvents & string>(event: K, listener: TimelineEvents[K]) => this;
1563
+ once: <K extends keyof TimelineEvents & string>(event: K, listener: TimelineEvents[K]) => this;
1564
+ off: <K extends keyof TimelineEvents & string>(event: K, listener: TimelineEvents[K]) => this;
1565
+ emit: <K extends keyof TimelineEvents & string>(event: K, ...args: Parameters<TimelineEvents[K]>) => this;
1595
1566
  }
1596
1567
  declare class Timeline extends Node {
1597
1568
  startTime: number;
@@ -1608,7 +1579,7 @@ declare class Timeline extends Node {
1608
1579
  declare class Window extends Viewport {
1609
1580
  }
1610
1581
 
1611
- interface SceneTreeEventMap extends MainLoopEventMap {
1582
+ interface SceneTreeEvents extends MainLoopEvents {
1612
1583
  processing: () => void;
1613
1584
  processed: () => void;
1614
1585
  rendering: () => void;
@@ -1617,10 +1588,10 @@ interface SceneTreeEventMap extends MainLoopEventMap {
1617
1588
  nodeProcessed: (node: Node) => void;
1618
1589
  }
1619
1590
  interface SceneTree {
1620
- on: (<K extends keyof SceneTreeEventMap>(type: K, listener: SceneTreeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1621
- once: (<K extends keyof SceneTreeEventMap>(type: K, listener: SceneTreeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1622
- off: (<K extends keyof SceneTreeEventMap>(type: K, listener?: SceneTreeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1623
- emit: (<K extends keyof SceneTreeEventMap>(type: K, ...args: Parameters<SceneTreeEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
1591
+ on: <K extends keyof SceneTreeEvents & string>(event: K, listener: SceneTreeEvents[K]) => this;
1592
+ once: <K extends keyof SceneTreeEvents & string>(event: K, listener: SceneTreeEvents[K]) => this;
1593
+ off: <K extends keyof SceneTreeEvents & string>(event: K, listener: SceneTreeEvents[K]) => this;
1594
+ emit: <K extends keyof SceneTreeEvents & string>(event: K, ...args: Parameters<SceneTreeEvents[K]>) => this;
1624
1595
  }
1625
1596
  declare class SceneTree extends MainLoop {
1626
1597
  processPaused: boolean;
@@ -1635,25 +1606,26 @@ declare class SceneTree extends MainLoop {
1635
1606
  getCurrentViewport(): Viewport | undefined;
1636
1607
  setCurrentViewport(viewport: Viewport | undefined): void;
1637
1608
  constructor(timeline?: Timeline);
1638
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1609
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1639
1610
  log(...args: any[]): void;
1640
1611
  protected _process(delta?: number): void;
1641
1612
  protected _render(renderer: WebGLRenderer): void;
1642
1613
  protected _renderScreen(renderer: WebGLRenderer): void;
1643
- free(): void;
1614
+ destroy(): void;
1644
1615
  }
1645
1616
 
1646
- declare class Children<T extends Node = Node> extends Array<T> {
1647
- readonly front: T[];
1648
- readonly back: T[];
1617
+ declare class Children<T extends Node = Node> {
1618
+ front: T[];
1619
+ default: T[];
1620
+ back: T[];
1649
1621
  get internal(): T[];
1650
1622
  constructor(...items: T[]);
1651
1623
  set(items: T[]): this;
1652
- getInternal(includeInternal: InternalMode): T[];
1624
+ getInternal(includeInternal?: InternalMode): T[];
1653
1625
  toJSON(): T[];
1654
1626
  }
1655
1627
 
1656
- interface NodeEventMap extends CoreObjectEventMap, InputEventMap {
1628
+ interface NodeEvents extends CoreObjectEvents, InputEvents {
1657
1629
  treeEnter: (tree: SceneTree) => void;
1658
1630
  treeEntered: (tree: SceneTree) => void;
1659
1631
  treePostEnter: (tree: SceneTree) => void;
@@ -1688,10 +1660,10 @@ interface NodeProperties {
1688
1660
  meta: Record<string, any>;
1689
1661
  }
1690
1662
  interface Node {
1691
- on: (<K extends keyof NodeEventMap>(type: K, listener: NodeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1692
- once: (<K extends keyof NodeEventMap>(type: K, listener?: NodeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1693
- off: (<K extends keyof NodeEventMap>(type: K, listener: NodeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1694
- emit: (<K extends keyof NodeEventMap>(type: K, ...args: Parameters<NodeEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
1663
+ on: <K extends keyof NodeEvents & string>(event: K, listener: NodeEvents[K]) => this;
1664
+ once: <K extends keyof NodeEvents & string>(event: K, listener: NodeEvents[K]) => this;
1665
+ off: <K extends keyof NodeEvents & string>(event: K, listener: NodeEvents[K]) => this;
1666
+ emit: <K extends keyof NodeEvents & string>(event: K, ...args: Parameters<NodeEvents[K]>) => this;
1695
1667
  }
1696
1668
  declare class Node extends CoreObject {
1697
1669
  readonly is: string;
@@ -1729,8 +1701,9 @@ declare class Node extends CoreObject {
1729
1701
  setParent<T extends Node = Node>(parent: T | undefined): this;
1730
1702
  /** Children */
1731
1703
  protected _children: Children<Node>;
1732
- get children(): Children;
1733
- set children(value: Node[] | Children);
1704
+ get children(): Node[];
1705
+ set children(value: Node[]);
1706
+ getChildren(internalMode?: InternalMode | true): Node[];
1734
1707
  getChild<T extends Node = Node>(index?: number): T | undefined;
1735
1708
  get siblingIndex(): number;
1736
1709
  set siblingIndex(toIndex: number);
@@ -1741,7 +1714,6 @@ declare class Node extends CoreObject {
1741
1714
  canProcess(): boolean;
1742
1715
  canInput(): boolean;
1743
1716
  canRender(): boolean;
1744
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1745
1717
  protected _onTreeEnter(tree: SceneTree): void;
1746
1718
  protected _onTreeExit(oldTree: SceneTree): void;
1747
1719
  protected _onParented(parent: Node): void;
@@ -1780,6 +1752,7 @@ declare class Node extends CoreObject {
1780
1752
  protected _process(delta: number): void;
1781
1753
  protected _input(event: InputEvent, key: InputEventKey): void;
1782
1754
  protected _render(renderer: WebGLRenderer): void;
1755
+ destroy(): void;
1783
1756
  clone(): this;
1784
1757
  toJSON(): Record<string, any>;
1785
1758
  static parse(value: any): any;
@@ -1790,14 +1763,14 @@ interface TimelineNodeProperties extends NodeProperties {
1790
1763
  duration: number;
1791
1764
  paused: boolean;
1792
1765
  }
1793
- interface TimelineNodeEventMap extends NodeEventMap {
1766
+ interface TimelineNodeEvents extends NodeEvents {
1794
1767
  updateCurrentTime: (currentTime: number) => void;
1795
1768
  }
1796
1769
  interface TimelineNode {
1797
- on: (<K extends keyof TimelineNodeEventMap>(type: K, listener: TimelineNodeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1798
- once: (<K extends keyof TimelineNodeEventMap>(type: K, listener: TimelineNodeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1799
- off: (<K extends keyof TimelineNodeEventMap>(type: K, listener?: TimelineNodeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1800
- emit: (<K extends keyof TimelineNodeEventMap>(type: K, ...args: Parameters<TimelineNodeEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
1770
+ on: <K extends keyof TimelineNodeEvents & string>(event: K, listener: TimelineNodeEvents[K]) => this;
1771
+ once: <K extends keyof TimelineNodeEvents & string>(event: K, listener: TimelineNodeEvents[K]) => this;
1772
+ off: <K extends keyof TimelineNodeEvents & string>(event: K, listener: TimelineNodeEvents[K]) => this;
1773
+ emit: <K extends keyof TimelineNodeEvents & string>(event: K, ...args: Parameters<TimelineNodeEvents[K]>) => this;
1801
1774
  }
1802
1775
  declare class TimelineNode extends Node {
1803
1776
  delay: number;
@@ -1826,14 +1799,14 @@ interface CanvasItemProperties extends TimelineNodeProperties {
1826
1799
  modulate: Color$1;
1827
1800
  blendMode: WebGLBlendMode;
1828
1801
  }
1829
- interface CanvasItemEventMap extends TimelineNodeEventMap {
1802
+ interface CanvasItemEvents extends TimelineNodeEvents {
1830
1803
  draw: () => void;
1831
1804
  }
1832
1805
  interface CanvasItem {
1833
- on: (<K extends keyof CanvasItemEventMap>(type: K, listener: CanvasItemEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1834
- once: (<K extends keyof CanvasItemEventMap>(type: K, listener: CanvasItemEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1835
- off: (<K extends keyof CanvasItemEventMap>(type: K, listener?: CanvasItemEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1836
- emit: (<K extends keyof CanvasItemEventMap>(type: K, ...args: Parameters<CanvasItemEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
1806
+ on: <K extends keyof CanvasItemEvents & string>(event: K, listener: CanvasItemEvents[K]) => this;
1807
+ once: <K extends keyof CanvasItemEvents & string>(event: K, listener: CanvasItemEvents[K]) => this;
1808
+ off: <K extends keyof CanvasItemEvents & string>(event: K, listener: CanvasItemEvents[K]) => this;
1809
+ emit: <K extends keyof CanvasItemEvents & string>(event: K, ...args: Parameters<CanvasItemEvents[K]>) => this;
1837
1810
  }
1838
1811
  declare class CanvasItem extends TimelineNode {
1839
1812
  modulate: Color$1 | undefined;
@@ -1856,7 +1829,7 @@ declare class CanvasItem extends TimelineNode {
1856
1829
  protected _layoutedBatchables: CanvasBatchable[];
1857
1830
  protected _batchables: CanvasBatchable[];
1858
1831
  constructor(properties?: Partial<CanvasItemProperties>, nodes?: Node[]);
1859
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1832
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1860
1833
  show(): void;
1861
1834
  hide(): void;
1862
1835
  isVisibleInTree(): boolean;
@@ -1907,7 +1880,7 @@ declare class Effect extends TimelineNode {
1907
1880
  protected _previousSibling?: Node;
1908
1881
  protected _nextSibling?: Node;
1909
1882
  constructor(properties?: Partial<EffectProperties>, children?: Node[]);
1910
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1883
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1911
1884
  protected _treeEnter(tree: SceneTree): void;
1912
1885
  protected _treeExit(oldTree: SceneTree): void;
1913
1886
  protected _onProcessing(): void;
@@ -1931,13 +1904,13 @@ declare class Transition extends Effect {
1931
1904
 
1932
1905
  interface Node2DProperties extends CanvasItemProperties {
1933
1906
  }
1934
- interface Node2DEventMap extends CanvasItemEventMap {
1907
+ interface Node2DEvents extends CanvasItemEvents {
1935
1908
  }
1936
1909
  interface Node2D {
1937
- on: (<K extends keyof Node2DEventMap>(type: K, listener: Node2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
1938
- once: (<K extends keyof Node2DEventMap>(type: K, listener: Node2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
1939
- off: (<K extends keyof Node2DEventMap>(type: K, listener?: Node2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
1940
- emit: (<K extends keyof Node2DEventMap>(type: K, ...args: Parameters<Node2DEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
1910
+ on: <K extends keyof Node2DEvents & string>(event: K, listener: Node2DEvents[K]) => this;
1911
+ once: <K extends keyof Node2DEvents & string>(event: K, listener: Node2DEvents[K]) => this;
1912
+ off: <K extends keyof Node2DEvents & string>(event: K, listener: Node2DEvents[K]) => this;
1913
+ emit: <K extends keyof Node2DEvents & string>(event: K, ...args: Parameters<Node2DEvents[K]>) => this;
1941
1914
  }
1942
1915
  declare class Node2D extends CanvasItem {
1943
1916
  rotation: number;
@@ -1952,7 +1925,7 @@ declare class Node2D extends CanvasItem {
1952
1925
  readonly globalTransform: Transform2D;
1953
1926
  protected _parentTransformDirtyId?: number;
1954
1927
  constructor(properties?: Partial<Node2DProperties>, nodes?: Node[]);
1955
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1928
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1956
1929
  getTransformOrigin(): Vector2;
1957
1930
  updateTransform(cb?: (transform: Transform2D) => void): void;
1958
1931
  updateGlobalTransform(): void;
@@ -1965,14 +1938,14 @@ declare class Node2D extends CanvasItem {
1965
1938
 
1966
1939
  interface Camera2DProperties extends Node2DProperties {
1967
1940
  }
1968
- interface Camera2DEventMap extends Node2DEventMap {
1941
+ interface Camera2DEvents extends Node2DEvents {
1969
1942
  updateCanvasTransform: () => void;
1970
1943
  }
1971
1944
  interface Camera2D {
1972
- on: (<K extends keyof Camera2DEventMap>(type: K, listener: Camera2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
1973
- once: (<K extends keyof Camera2DEventMap>(type: K, listener: Camera2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
1974
- off: (<K extends keyof Camera2DEventMap>(type: K, listener?: Camera2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
1975
- emit: (<K extends keyof Camera2DEventMap>(type: K, ...args: Parameters<Camera2DEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
1945
+ on: <K extends keyof Camera2DEvents & string>(event: K, listener: Camera2DEvents[K]) => this;
1946
+ once: <K extends keyof Camera2DEvents & string>(event: K, listener: Camera2DEvents[K]) => this;
1947
+ off: <K extends keyof Camera2DEvents & string>(event: K, listener: Camera2DEvents[K]) => this;
1948
+ emit: <K extends keyof Camera2DEvents & string>(event: K, ...args: Parameters<Camera2DEvents[K]>) => this;
1976
1949
  }
1977
1950
  declare class Camera2D extends Node2D {
1978
1951
  readonly zoom: Vector2;
@@ -2014,7 +1987,7 @@ declare class BaseElement2DFill extends CoreObject {
2014
1987
  constructor(parent: BaseElement2D);
2015
1988
  protected _setProperties(properties?: Fill): this;
2016
1989
  setProperties(properties?: Fill): this;
2017
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1990
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2018
1991
  loadTexture(): Promise<Texture2D | undefined>;
2019
1992
  protected _updateTexture(): Promise<void>;
2020
1993
  canDraw(): boolean;
@@ -2024,13 +1997,13 @@ declare class BaseElement2DFill extends CoreObject {
2024
1997
  declare class BaseElement2DBackground extends BaseElement2DFill {
2025
1998
  fillWithShape: NormalizedBackground['fillWithShape'];
2026
1999
  setProperties(properties?: Background): this;
2027
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2000
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2028
2001
  }
2029
2002
 
2030
2003
  declare class BaseElement2DForeground extends BaseElement2DFill {
2031
2004
  fillWithShape: NormalizedForeground['fillWithShape'];
2032
2005
  setProperties(properties?: Foreground): this;
2033
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2006
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2034
2007
  }
2035
2008
 
2036
2009
  declare class BaseElement2DOutline extends BaseElement2DFill {
@@ -2040,7 +2013,7 @@ declare class BaseElement2DOutline extends BaseElement2DFill {
2040
2013
  lineCap: NormalizedOutline['lineCap'];
2041
2014
  lineJoin: NormalizedOutline['lineJoin'];
2042
2015
  setProperties(properties?: Outline): this;
2043
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2016
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2044
2017
  canDraw(): boolean;
2045
2018
  draw(): void;
2046
2019
  }
@@ -2054,7 +2027,7 @@ declare class BaseElement2DShadow extends CoreObject {
2054
2027
  offsetX: NormalizedShadow['offsetY'];
2055
2028
  constructor(parent: BaseElement2D);
2056
2029
  setProperties(properties?: Shadow): this;
2057
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2030
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2058
2031
  updateEffect(): void;
2059
2032
  }
2060
2033
 
@@ -2068,7 +2041,7 @@ declare class BaseElement2DShape extends CoreObject {
2068
2041
  protected _path2DSet: Path2DSet;
2069
2042
  constructor(parent: BaseElement2D);
2070
2043
  setProperties(properties?: Shape): this;
2071
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2044
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2072
2045
  protected _updatePath2DSet(): void;
2073
2046
  draw(): void;
2074
2047
  drawRect(): void;
@@ -2103,7 +2076,7 @@ declare class BaseElement2DText extends CoreObject {
2103
2076
  }>;
2104
2077
  constructor(parent: BaseElement2D);
2105
2078
  setProperties(properties?: Text$1): this;
2106
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2079
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2107
2080
  protected _update(): void;
2108
2081
  protected _updateTextureMap(): void;
2109
2082
  protected _updateTexture(key: string, fill: NormalizedFill | undefined, box: any): Promise<void>;
@@ -2116,8 +2089,8 @@ declare class BaseElement2DText extends CoreObject {
2116
2089
  draw(): void;
2117
2090
  }
2118
2091
 
2119
- interface BaseElement2DEventMap extends CanvasItemEventMap {
2120
- updateStyleProperty: (key: string, value: any, oldValue: any, declaration?: PropertyDeclaration) => void;
2092
+ interface BaseElement2DEvents extends Node2DEvents {
2093
+ updateStyleProperty: (key: string, value: any, oldValue: any) => void;
2121
2094
  }
2122
2095
  interface BaseElement2DProperties extends Node2DProperties {
2123
2096
  modulate: Color$1;
@@ -2132,10 +2105,10 @@ interface BaseElement2DProperties extends Node2DProperties {
2132
2105
  shadow: Shadow;
2133
2106
  }
2134
2107
  interface BaseElement2D {
2135
- on: (<K extends keyof BaseElement2DEventMap>(type: K, listener: BaseElement2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2136
- once: (<K extends keyof BaseElement2DEventMap>(type: K, listener: BaseElement2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2137
- off: (<K extends keyof BaseElement2DEventMap>(type: K, listener?: BaseElement2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2138
- emit: (<K extends keyof BaseElement2DEventMap>(type: K, ...args: Parameters<BaseElement2DEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
2108
+ on: <K extends keyof BaseElement2DEvents & string>(event: K, listener: BaseElement2DEvents[K]) => this;
2109
+ once: <K extends keyof BaseElement2DEvents & string>(event: K, listener: BaseElement2DEvents[K]) => this;
2110
+ off: <K extends keyof BaseElement2DEvents & string>(event: K, listener: BaseElement2DEvents[K]) => this;
2111
+ emit: <K extends keyof BaseElement2DEvents & string>(event: K, ...args: Parameters<BaseElement2DEvents[K]>) => this;
2139
2112
  }
2140
2113
  declare class BaseElement2D extends Node2D implements Rectangulable {
2141
2114
  readonly size: Vector2;
@@ -2165,7 +2138,7 @@ declare class BaseElement2D extends Node2D implements Rectangulable {
2165
2138
  set shadow(value: Shadow);
2166
2139
  constructor(properties?: Partial<BaseElement2DProperties>, nodes?: Node[]);
2167
2140
  setProperties(properties?: Record<string, any>): this;
2168
- protected _updateStyleProperty(key: string, value: any, oldValue: any, _declaration?: PropertyDeclaration): void;
2141
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
2169
2142
  protected _updateMaskImage(): void;
2170
2143
  getTransformOrigin(): Vector2;
2171
2144
  updateTransform(cb?: (transform: Transform2D) => void): void;
@@ -2213,23 +2186,23 @@ declare class FlexElement2DStyle extends BaseElement2DStyle {
2213
2186
  constructor(properties?: Partial<FlexElement2DStyleProperties>);
2214
2187
  }
2215
2188
 
2216
- interface Element2DEventMap extends BaseElement2DEventMap {
2189
+ interface Element2DEvents extends BaseElement2DEvents {
2217
2190
  }
2218
2191
  interface Element2DProperties extends BaseElement2DProperties {
2219
2192
  style: Partial<Element2DStyleProperties>;
2220
2193
  }
2221
2194
  interface Element2D {
2222
- on: (<K extends keyof Element2DEventMap>(type: K, listener: Element2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2223
- once: (<K extends keyof Element2DEventMap>(type: K, listener: Element2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2224
- off: (<K extends keyof Element2DEventMap>(type: K, listener?: Element2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2225
- emit: (<K extends keyof Element2DEventMap>(type: K, ...args: Parameters<Element2DEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
2195
+ on: <K extends keyof Element2DEvents & string>(event: K, listener: Element2DEvents[K]) => this;
2196
+ once: <K extends keyof Element2DEvents & string>(event: K, listener: Element2DEvents[K]) => this;
2197
+ off: <K extends keyof Element2DEvents & string>(event: K, listener: Element2DEvents[K]) => this;
2198
+ emit: <K extends keyof Element2DEvents & string>(event: K, ...args: Parameters<Element2DEvents[K]>) => this;
2226
2199
  }
2227
2200
  declare class Element2D extends BaseElement2D {
2228
2201
  protected _style: Element2DStyle;
2229
2202
  get style(): Element2DStyle;
2230
2203
  set style(style: Element2DStyle);
2231
2204
  constructor(properties?: Partial<Element2DProperties>, nodes?: Node[]);
2232
- protected _updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2205
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
2233
2206
  }
2234
2207
 
2235
2208
  declare const edgeMap: {
@@ -2323,20 +2296,20 @@ declare class FlexLayout {
2323
2296
  constructor(_element: FlexElement2D);
2324
2297
  calculateLayout(width?: number | 'auto', height?: number | 'auto', direction?: typeof displayMap[keyof typeof displayMap]): void;
2325
2298
  getComputedLayout(): ComputedLayout;
2326
- updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2299
+ updateStyleProperty(key: string, value: any, oldValue: any): void;
2327
2300
  }
2328
2301
 
2329
- interface FlexBaseElement2DEventMap extends BaseElement2DEventMap {
2330
- updateStyleProperty: (key: string, value: any, oldValue: any, declaration?: PropertyDeclaration) => void;
2302
+ interface FlexBaseElement2DEvents extends BaseElement2DEvents {
2303
+ updateStyleProperty: (key: string, value: any, oldValue: any) => void;
2331
2304
  }
2332
2305
  interface FlexElement2DProperties extends BaseElement2DProperties {
2333
2306
  style: Partial<FlexElement2DStyleProperties>;
2334
2307
  }
2335
2308
  interface FlexElement2D {
2336
- on: (<K extends keyof FlexBaseElement2DEventMap>(type: K, listener: FlexBaseElement2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2337
- once: (<K extends keyof FlexBaseElement2DEventMap>(type: K, listener: FlexBaseElement2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2338
- off: (<K extends keyof FlexBaseElement2DEventMap>(type: K, listener?: FlexBaseElement2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2339
- emit: (<K extends keyof FlexBaseElement2DEventMap>(type: K, ...args: Parameters<FlexBaseElement2DEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
2309
+ on: <K extends keyof FlexBaseElement2DEvents & string>(event: K, listener: FlexBaseElement2DEvents[K]) => this;
2310
+ once: <K extends keyof FlexBaseElement2DEvents & string>(event: K, listener: FlexBaseElement2DEvents[K]) => this;
2311
+ off: <K extends keyof FlexBaseElement2DEvents & string>(event: K, listener: FlexBaseElement2DEvents[K]) => this;
2312
+ emit: <K extends keyof FlexBaseElement2DEvents & string>(event: K, ...args: Parameters<FlexBaseElement2DEvents[K]>) => this;
2340
2313
  }
2341
2314
  declare class FlexElement2D extends BaseElement2D implements Rectangulable {
2342
2315
  protected _style: FlexElement2DStyle;
@@ -2350,7 +2323,7 @@ declare class FlexElement2D extends BaseElement2D implements Rectangulable {
2350
2323
  constructor(properties?: Partial<FlexElement2DProperties>, nodes?: Node[]);
2351
2324
  protected _parented(parent: Node): void;
2352
2325
  protected _unparented(oldParent: Node): void;
2353
- protected _updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2326
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
2354
2327
  updateTransform(): void;
2355
2328
  calculateLayout(width?: number | 'auto', height?: number | 'auto', direction?: typeof directionMap[keyof typeof directionMap]): void;
2356
2329
  }
@@ -2374,7 +2347,7 @@ declare class Image2D extends Element2D {
2374
2347
  protected _complete: boolean;
2375
2348
  protected _wait: Promise<void>;
2376
2349
  constructor(properties?: Partial<Image2DProperties>, children?: Node[]);
2377
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2350
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2378
2351
  decode(): Promise<void>;
2379
2352
  setResource(source: Texture2D | ImageFrame[] | AnimatedTexture): this;
2380
2353
  protected _load(src: string): Promise<void>;
@@ -2401,7 +2374,7 @@ declare class Lottie2D extends TextureRect2D {
2401
2374
  readonly texture: CanvasTexture;
2402
2375
  animation?: AnimationItem;
2403
2376
  constructor(properties?: Partial<Lottie2DProperties>, children?: Node[]);
2404
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2377
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2405
2378
  protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
2406
2379
  protected _load(): Promise<void>;
2407
2380
  protected _process(delta: number): void;
@@ -2412,7 +2385,7 @@ interface TransformRect2DProperties extends BaseElement2DProperties {
2412
2385
  declare class TransformRect2D extends Element2D {
2413
2386
  handleSize: number;
2414
2387
  constructor(properties?: Partial<TransformRect2DProperties>, nodes?: Node[]);
2415
- protected _updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2388
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
2416
2389
  protected _drawCircle(x: number, y: number): void;
2417
2390
  protected _drawEllipse(x: number, y: number): void;
2418
2391
  protected _draw(): void;
@@ -2426,7 +2399,7 @@ declare class Video2D extends TextureRect2D<VideoTexture> {
2426
2399
  get videoDuration(): number;
2427
2400
  protected _wait: Promise<void>;
2428
2401
  constructor(properties?: Partial<Video2DProperties>, children?: Node[]);
2429
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2402
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2430
2403
  waitLoad(): Promise<void>;
2431
2404
  protected _load(src: string): Promise<void>;
2432
2405
  protected _updateVideoCurrentTime(): void;
@@ -2477,7 +2450,7 @@ declare class Animation extends TimelineNode {
2477
2450
  protected _parented(parent: Node): void;
2478
2451
  protected _unparented(oldParent: Node): void;
2479
2452
  protected _process(): void;
2480
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2453
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2481
2454
  protected _getTargets(): any[];
2482
2455
  protected _updateKeyframes(): void;
2483
2456
  commitStyles(): void;
@@ -2501,7 +2474,7 @@ declare abstract class AudioProcessor {
2501
2474
  disconnect(): void;
2502
2475
  }
2503
2476
 
2504
- declare class AudioPipeline extends EventEmitter {
2477
+ declare class AudioPipeline extends Observable {
2505
2478
  protected _input: IAudioNode;
2506
2479
  protected _output: IAudioNode;
2507
2480
  protected _processers: AudioProcessor[];
@@ -2538,7 +2511,7 @@ interface IPlayOptions {
2538
2511
  multiple?: boolean;
2539
2512
  }
2540
2513
 
2541
- declare class HTMLAudioContext extends EventEmitter implements IAudioContext {
2514
+ declare class HTMLAudioContext extends Observable implements IAudioContext {
2542
2515
  protected static _instance?: HTMLAudioContext;
2543
2516
  static get instance(): HTMLAudioContext;
2544
2517
  playbackRate: number;
@@ -2552,10 +2525,9 @@ declare class HTMLAudioContext extends EventEmitter implements IAudioContext {
2552
2525
  get audioContext(): AudioContext;
2553
2526
  toggleMute(): boolean;
2554
2527
  togglePause(): boolean;
2555
- free(): void;
2556
2528
  }
2557
2529
 
2558
- declare class HTMLSound extends EventEmitter {
2530
+ declare class HTMLSound extends Observable {
2559
2531
  static readonly PADDING = 0.1;
2560
2532
  protected _source: HTMLAudioElement | null;
2561
2533
  protected _audio: HTMLAudio | null;
@@ -2598,7 +2570,7 @@ declare class HTMLSound extends EventEmitter {
2598
2570
  play(options?: IPlayOptions): void;
2599
2571
  protected _onUpdate: () => void;
2600
2572
  protected _onComplete(): void;
2601
- free(): void;
2573
+ destroy(): void;
2602
2574
  }
2603
2575
 
2604
2576
  declare class HTMLAudio {
@@ -2654,7 +2626,7 @@ declare class WebAudioContext extends AudioPipeline implements IAudioContext {
2654
2626
  setParamValue(param: AudioParam, value: number): void;
2655
2627
  }
2656
2628
 
2657
- declare class WebSound extends EventEmitter {
2629
+ declare class WebSound extends Observable {
2658
2630
  protected _audio: WebAudio | null;
2659
2631
  protected _sourceNode: AudioBufferSourceNode | null;
2660
2632
  protected _gain: GainNode | null;
@@ -2700,7 +2672,7 @@ declare class WebSound extends EventEmitter {
2700
2672
  protected _onComplete: () => void;
2701
2673
  protected _updateListener: () => void;
2702
2674
  protected _enableTicker(enabled: boolean): void;
2703
- free(): void;
2675
+ destroy(): void;
2704
2676
  }
2705
2677
 
2706
2678
  declare class WebAudio extends AudioPipeline {
@@ -2767,7 +2739,7 @@ declare class Audio extends TimelineNode {
2767
2739
  start: number;
2768
2740
  end: number;
2769
2741
  constructor(src?: string);
2770
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2742
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2771
2743
  load(): Promise<this>;
2772
2744
  pause(): this;
2773
2745
  resume(): this;
@@ -2801,7 +2773,7 @@ declare class AudioWaveform extends Element2D {
2801
2773
  protected _src: Texture2D<HTMLCanvasElement> | undefined;
2802
2774
  protected _needsUpdateTexture: boolean;
2803
2775
  constructor(options?: Partial<AudioWaveformProperties>);
2804
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2776
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2805
2777
  _loadSrc(src: string): Promise<void>;
2806
2778
  syncTexture(force?: boolean): void;
2807
2779
  protected _process(delta: number): void;
@@ -2994,7 +2966,7 @@ declare class KawaseBlurEffect extends Effect {
2994
2966
  pixelSize: [number, number];
2995
2967
  protected _kernels: number[];
2996
2968
  constructor(properties?: Partial<KawaseBlurEffectProperties>, children?: Node[]);
2997
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2969
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2998
2970
  /** Auto generate kernels by blur & quality */
2999
2971
  protected _generateKernels(): void;
3000
2972
  apply(renderer: WebGLRenderer, source: Viewport): void;
@@ -3009,7 +2981,7 @@ declare class MaskEffect extends Effect {
3009
2981
  src: string;
3010
2982
  constructor(properties?: Partial<MaskEffectProperties>, children?: Node[]);
3011
2983
  load(): Promise<void>;
3012
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2984
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
3013
2985
  apply(renderer: WebGLRenderer, source: Viewport, context: EffectContext): void;
3014
2986
  }
3015
2987
 
@@ -3064,15 +3036,15 @@ declare class ZoomBlurEffect extends Effect {
3064
3036
  apply(renderer: WebGLRenderer, source: Viewport, context: EffectContext): void;
3065
3037
  }
3066
3038
 
3067
- interface ControlEventMap extends CanvasItemEventMap, RectangulableEventMap {
3039
+ interface ControlEvents extends CanvasItemEvents, RectangulableEvents {
3068
3040
  }
3069
3041
  interface ControlProperties extends BaseElement2DProperties {
3070
3042
  }
3071
3043
  interface Control {
3072
- on: (<K extends keyof ControlEventMap>(type: K, listener: ControlEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3073
- once: (<K extends keyof ControlEventMap>(type: K, listener: ControlEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3074
- off: (<K extends keyof ControlEventMap>(type: K, listener?: ControlEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3075
- emit: (<K extends keyof ControlEventMap>(type: K, ...args: Parameters<ControlEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
3044
+ on: <K extends keyof ControlEvents & string>(event: K, listener: ControlEvents[K]) => this;
3045
+ once: <K extends keyof ControlEvents & string>(event: K, listener: ControlEvents[K]) => this;
3046
+ off: <K extends keyof ControlEvents & string>(event: K, listener: ControlEvents[K]) => this;
3047
+ emit: <K extends keyof ControlEvents & string>(event: K, ...args: Parameters<ControlEvents[K]>) => this;
3076
3048
  }
3077
3049
  declare class Control extends Element2D implements Rectangulable {
3078
3050
  constructor(properties?: Partial<ControlProperties>, children?: Node[]);
@@ -3080,7 +3052,7 @@ declare class Control extends Element2D implements Rectangulable {
3080
3052
  protected _unparented(oldParent: any): void;
3081
3053
  protected _parentUpdateRect(): void;
3082
3054
  protected _input(event: InputEvent, key: InputEventKey): void;
3083
- protected _updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
3055
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
3084
3056
  protected _guiInput(event: InputEvent, key: InputEventKey): void;
3085
3057
  }
3086
3058
 
@@ -3102,7 +3074,7 @@ declare class Range extends Control {
3102
3074
  step: number;
3103
3075
  value: number;
3104
3076
  constructor(properties?: Partial<RangeProperties>, children?: Node[]);
3105
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
3077
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
3106
3078
  }
3107
3079
 
3108
3080
  interface RulerProperties extends ControlProperties {
@@ -3128,8 +3100,8 @@ declare class Ruler extends Control {
3128
3100
  gapScale: number;
3129
3101
  texture: CanvasTexture;
3130
3102
  constructor(properties?: Partial<RulerProperties>, children?: Node[]);
3131
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
3132
- protected _updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
3103
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
3104
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
3133
3105
  protected _drawTexture(): void;
3134
3106
  protected _draw(): void;
3135
3107
  }
@@ -3140,7 +3112,7 @@ interface ScrollBarProperties extends RangeProperties {
3140
3112
  declare class ScrollBar extends Range {
3141
3113
  direction: 'vertical' | 'horizontal';
3142
3114
  constructor(properties?: Partial<ScrollBarProperties>, children?: Node[]);
3143
- protected _updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
3115
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
3144
3116
  protected _rect(): {
3145
3117
  left: number;
3146
3118
  top: number;
@@ -3167,7 +3139,7 @@ declare class YScrollBar extends ScrollBar {
3167
3139
  constructor(properties?: Partial<YScrollBarProperties>, children?: Node[]);
3168
3140
  }
3169
3141
 
3170
- interface ScalerEventMap extends NodeEventMap {
3142
+ interface ScalerEvents extends NodeEvents {
3171
3143
  updateScale: (scale: number) => void;
3172
3144
  }
3173
3145
  interface ScalerProperties extends NodeProperties {
@@ -3176,10 +3148,10 @@ interface ScalerProperties extends NodeProperties {
3176
3148
  maxScale: number;
3177
3149
  }
3178
3150
  interface Scaler {
3179
- on: (<K extends keyof ScalerEventMap>(type: K, listener: ScalerEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3180
- once: (<K extends keyof ScalerEventMap>(type: K, listener: ScalerEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3181
- off: (<K extends keyof ScalerEventMap>(type: K, listener?: ScalerEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3182
- emit: (<K extends keyof ScalerEventMap>(type: K, ...args: Parameters<ScalerEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
3151
+ on: <K extends keyof ScalerEvents & string>(event: K, listener: ScalerEvents[K]) => this;
3152
+ once: <K extends keyof ScalerEvents & string>(event: K, listener: ScalerEvents[K]) => this;
3153
+ off: <K extends keyof ScalerEvents & string>(event: K, listener: ScalerEvents[K]) => this;
3154
+ emit: <K extends keyof ScalerEvents & string>(event: K, ...args: Parameters<ScalerEvents[K]>) => this;
3183
3155
  }
3184
3156
  declare class Scaler extends Node {
3185
3157
  translateX: number;
@@ -3189,7 +3161,7 @@ declare class Scaler extends Node {
3189
3161
  maxScale: number;
3190
3162
  get target(): Element2D | undefined;
3191
3163
  constructor(properties?: Partial<ScalerProperties>, children?: Node[]);
3192
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
3164
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
3193
3165
  protected _updateTarget(): void;
3194
3166
  protected _onWheel(e: WheelInputEvent): void;
3195
3167
  protected _input(event: InputEvent, key: InputEventKey): void;
@@ -3309,7 +3281,7 @@ declare class CanvasItemEditor extends Control {
3309
3281
  drawboard: Element2D;
3310
3282
  ruler: Ruler;
3311
3283
  constructor();
3312
- protected _updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
3284
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
3313
3285
  protected _guiInput(event: InputEvent, key: InputEventKey): void;
3314
3286
  protected _onPointerdown(e: PointerInputEvent): void;
3315
3287
  protected _onPointermove(e: PointerInputEvent): void;
@@ -3331,7 +3303,7 @@ interface EngineOptions extends WebGLContextAttributes {
3331
3303
  autoStart?: boolean;
3332
3304
  timeline?: Timeline;
3333
3305
  }
3334
- interface EngineEventMap extends SceneTreeEventMap {
3306
+ interface EngineEvents extends SceneTreeEvents {
3335
3307
  pointerdown: (ev: PointerInputEvent) => void;
3336
3308
  pointerover: (ev: PointerInputEvent) => void;
3337
3309
  pointermove: (ev: PointerInputEvent) => void;
@@ -3347,10 +3319,10 @@ declare const defaultOptions: {
3347
3319
  readonly powerPreference: "default";
3348
3320
  };
3349
3321
  interface Engine {
3350
- on: (<K extends keyof EngineEventMap>(type: K, listener: EngineEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3351
- once: (<K extends keyof EngineEventMap>(type: K, listener: EngineEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3352
- off: (<K extends keyof EngineEventMap>(type: K, listener?: EngineEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3353
- emit: (<K extends keyof EngineEventMap>(type: K, ...args: Parameters<EngineEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
3322
+ on: <K extends keyof EngineEvents>(event: K, listener: EngineEvents[K]) => this;
3323
+ once: <K extends keyof EngineEvents>(event: K, listener: EngineEvents[K]) => this;
3324
+ off: <K extends keyof EngineEvents>(event: K, listener: EngineEvents[K]) => this;
3325
+ emit: <K extends keyof EngineEvents>(event: K, ...args: Parameters<EngineEvents[K]>) => this;
3354
3326
  }
3355
3327
  declare class Engine extends SceneTree {
3356
3328
  readonly renderer: WebGLRenderer;
@@ -3376,7 +3348,7 @@ declare class Engine extends SceneTree {
3376
3348
  waitAndRender(delta?: number): Promise<void>;
3377
3349
  render(delta?: number): void;
3378
3350
  start(): Promise<void>;
3379
- free(): void;
3351
+ destroy(): void;
3380
3352
  toPixels(): Uint8ClampedArray<ArrayBuffer>;
3381
3353
  toImageData(): ImageData;
3382
3354
  toCanvas2D(): HTMLCanvasElement;
@@ -3393,4 +3365,4 @@ interface RenderOptions {
3393
3365
  declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
3394
3366
 
3395
3367
  export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DShape, BaseElement2DStyle, BaseElement2DText, Camera2D, CanvasContext, CanvasItem, CanvasItemEditor, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, Control, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GaussianBlurEffect, Geometry, GifLoader, GlitchEffect, GodrayEffect, GradientTexture, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseBlurEffect, KawaseTransition, KeyboardInputEvent, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, RawWeakMap, Rect2, RefCounted, Renderer, Resource, Ruler, 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, SceneTree, ScrollBar, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, Window, XScrollBar, YScrollBar, ZoomBlurEffect, alignMap, assets, boxSizingMap, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, determineCrossOrigin, directionMap, displayMap, ease, easeIn, easeInOut, easeOut, edgeMap, flexDirectionMap, flexWrapMap, frag, getDefaultCssPropertyValue, gutterMap, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, justifyMap, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, overflowMap, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, positionTypeMap, render, timingFunctions, uid };
3396
- export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEventMap, BaseElement2DProperties, BaseElement2DStyleProperties, Batchable2D, CSSFilterKey, CSSFilters, Camera2DEventMap, Camera2DProperties, CanvasBatchable, CanvasItemEventMap, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ComputedLayout, ControlEventMap, ControlProperties, CoreObjectEventMap, CssFunction, CssFunctionArg, Cursor, CustomPropertyAccessor, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEventMap, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineOptions, FillDraw, FlexBaseElement2DEventMap, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEventMap, InputMode, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEventMap, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DEventMap, Node2DProperties, NodeEventMap, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, RangeProperties, Rectangulable, RectangulableEventMap, RefCountedEventMap, RenderMode, RenderOptions, Renderable, ResourceEventMap, RulerProperties, ScalerEventMap, ScalerProperties, SceneTreeEventMap, ScrollBarProperties, StrokeDraw, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEventMap, TimelineNodeEventMap, TimelineNodeProperties, TimelineProperties, TimingFunctions, TransformObject, TransformRect2DProperties, TransformableObject, TransitionProperties, UvTransform, Vector2Data, VectorLike, VectorOperateOutput, VertTransform, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEventMap, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, XScrollBarProperties, YScrollBarProperties, ZoomBlurEffectProperties };
3368
+ export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEvents, BaseElement2DProperties, BaseElement2DStyleProperties, Batchable2D, CSSFilterKey, CSSFilters, Camera2DEvents, Camera2DProperties, CanvasBatchable, CanvasItemEvents, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ComputedLayout, ControlEvents, ControlProperties, CoreObjectEvents, CssFunction, CssFunctionArg, Cursor, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEvents, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineOptions, FillDraw, FlexBaseElement2DEvents, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEvents, InputMode, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEvents, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DEvents, Node2DProperties, NodeEvents, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, RangeProperties, Rectangulable, RectangulableEvents, RefCountedEvents, RenderMode, RenderOptions, Renderable, ResourceEvents, RulerProperties, ScalerEvents, ScalerProperties, SceneTreeEvents, ScrollBarProperties, StrokeDraw, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEvents, TimelineNodeEvents, TimelineNodeProperties, TimelineProperties, TimingFunctions, TransformObject, TransformRect2DProperties, TransformableObject, TransitionProperties, UvTransform, Vector2Data, VectorLike, VectorOperateOutput, VertTransform, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEvents, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, XScrollBarProperties, YScrollBarProperties, ZoomBlurEffectProperties };