modern-canvas 0.8.10 → 0.9.1

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.cts 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,12 +1606,12 @@ 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
1617
  declare class Children<T extends Node = Node> {
@@ -1650,11 +1621,11 @@ declare class Children<T extends Node = Node> {
1650
1621
  get internal(): T[];
1651
1622
  constructor(...items: T[]);
1652
1623
  set(items: T[]): this;
1653
- getInternal(includeInternal: InternalMode): T[];
1624
+ getInternal(includeInternal?: InternalMode): T[];
1654
1625
  toJSON(): T[];
1655
1626
  }
1656
1627
 
1657
- interface NodeEventMap extends CoreObjectEventMap, InputEventMap {
1628
+ interface NodeEvents extends CoreObjectEvents, InputEvents {
1658
1629
  treeEnter: (tree: SceneTree) => void;
1659
1630
  treeEntered: (tree: SceneTree) => void;
1660
1631
  treePostEnter: (tree: SceneTree) => void;
@@ -1689,10 +1660,10 @@ interface NodeProperties {
1689
1660
  meta: Record<string, any>;
1690
1661
  }
1691
1662
  interface Node {
1692
- on: (<K extends keyof NodeEventMap>(type: K, listener: NodeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1693
- once: (<K extends keyof NodeEventMap>(type: K, listener?: NodeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1694
- off: (<K extends keyof NodeEventMap>(type: K, listener: NodeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1695
- 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;
1696
1667
  }
1697
1668
  declare class Node extends CoreObject {
1698
1669
  readonly is: string;
@@ -1732,7 +1703,7 @@ declare class Node extends CoreObject {
1732
1703
  protected _children: Children<Node>;
1733
1704
  get children(): Node[];
1734
1705
  set children(value: Node[]);
1735
- getChildren(includeInternal: InternalMode): Node[];
1706
+ getChildren(internalMode?: InternalMode | true): Node[];
1736
1707
  getChild<T extends Node = Node>(index?: number): T | undefined;
1737
1708
  get siblingIndex(): number;
1738
1709
  set siblingIndex(toIndex: number);
@@ -1743,7 +1714,6 @@ declare class Node extends CoreObject {
1743
1714
  canProcess(): boolean;
1744
1715
  canInput(): boolean;
1745
1716
  canRender(): boolean;
1746
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1747
1717
  protected _onTreeEnter(tree: SceneTree): void;
1748
1718
  protected _onTreeExit(oldTree: SceneTree): void;
1749
1719
  protected _onParented(parent: Node): void;
@@ -1782,6 +1752,7 @@ declare class Node extends CoreObject {
1782
1752
  protected _process(delta: number): void;
1783
1753
  protected _input(event: InputEvent, key: InputEventKey): void;
1784
1754
  protected _render(renderer: WebGLRenderer): void;
1755
+ destroy(): void;
1785
1756
  clone(): this;
1786
1757
  toJSON(): Record<string, any>;
1787
1758
  static parse(value: any): any;
@@ -1792,14 +1763,14 @@ interface TimelineNodeProperties extends NodeProperties {
1792
1763
  duration: number;
1793
1764
  paused: boolean;
1794
1765
  }
1795
- interface TimelineNodeEventMap extends NodeEventMap {
1766
+ interface TimelineNodeEvents extends NodeEvents {
1796
1767
  updateCurrentTime: (currentTime: number) => void;
1797
1768
  }
1798
1769
  interface TimelineNode {
1799
- on: (<K extends keyof TimelineNodeEventMap>(type: K, listener: TimelineNodeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1800
- once: (<K extends keyof TimelineNodeEventMap>(type: K, listener: TimelineNodeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1801
- off: (<K extends keyof TimelineNodeEventMap>(type: K, listener?: TimelineNodeEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1802
- 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;
1803
1774
  }
1804
1775
  declare class TimelineNode extends Node {
1805
1776
  delay: number;
@@ -1828,14 +1799,14 @@ interface CanvasItemProperties extends TimelineNodeProperties {
1828
1799
  modulate: Color$1;
1829
1800
  blendMode: WebGLBlendMode;
1830
1801
  }
1831
- interface CanvasItemEventMap extends TimelineNodeEventMap {
1802
+ interface CanvasItemEvents extends TimelineNodeEvents {
1832
1803
  draw: () => void;
1833
1804
  }
1834
1805
  interface CanvasItem {
1835
- on: (<K extends keyof CanvasItemEventMap>(type: K, listener: CanvasItemEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1836
- once: (<K extends keyof CanvasItemEventMap>(type: K, listener: CanvasItemEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1837
- off: (<K extends keyof CanvasItemEventMap>(type: K, listener?: CanvasItemEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
1838
- 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;
1839
1810
  }
1840
1811
  declare class CanvasItem extends TimelineNode {
1841
1812
  modulate: Color$1 | undefined;
@@ -1858,7 +1829,7 @@ declare class CanvasItem extends TimelineNode {
1858
1829
  protected _layoutedBatchables: CanvasBatchable[];
1859
1830
  protected _batchables: CanvasBatchable[];
1860
1831
  constructor(properties?: Partial<CanvasItemProperties>, nodes?: Node[]);
1861
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1832
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1862
1833
  show(): void;
1863
1834
  hide(): void;
1864
1835
  isVisibleInTree(): boolean;
@@ -1909,7 +1880,7 @@ declare class Effect extends TimelineNode {
1909
1880
  protected _previousSibling?: Node;
1910
1881
  protected _nextSibling?: Node;
1911
1882
  constructor(properties?: Partial<EffectProperties>, children?: Node[]);
1912
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1883
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1913
1884
  protected _treeEnter(tree: SceneTree): void;
1914
1885
  protected _treeExit(oldTree: SceneTree): void;
1915
1886
  protected _onProcessing(): void;
@@ -1933,13 +1904,13 @@ declare class Transition extends Effect {
1933
1904
 
1934
1905
  interface Node2DProperties extends CanvasItemProperties {
1935
1906
  }
1936
- interface Node2DEventMap extends CanvasItemEventMap {
1907
+ interface Node2DEvents extends CanvasItemEvents {
1937
1908
  }
1938
1909
  interface Node2D {
1939
- on: (<K extends keyof Node2DEventMap>(type: K, listener: Node2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
1940
- once: (<K extends keyof Node2DEventMap>(type: K, listener: Node2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
1941
- off: (<K extends keyof Node2DEventMap>(type: K, listener?: Node2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
1942
- 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;
1943
1914
  }
1944
1915
  declare class Node2D extends CanvasItem {
1945
1916
  rotation: number;
@@ -1954,7 +1925,7 @@ declare class Node2D extends CanvasItem {
1954
1925
  readonly globalTransform: Transform2D;
1955
1926
  protected _parentTransformDirtyId?: number;
1956
1927
  constructor(properties?: Partial<Node2DProperties>, nodes?: Node[]);
1957
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1928
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
1958
1929
  getTransformOrigin(): Vector2;
1959
1930
  updateTransform(cb?: (transform: Transform2D) => void): void;
1960
1931
  updateGlobalTransform(): void;
@@ -1967,14 +1938,14 @@ declare class Node2D extends CanvasItem {
1967
1938
 
1968
1939
  interface Camera2DProperties extends Node2DProperties {
1969
1940
  }
1970
- interface Camera2DEventMap extends Node2DEventMap {
1941
+ interface Camera2DEvents extends Node2DEvents {
1971
1942
  updateCanvasTransform: () => void;
1972
1943
  }
1973
1944
  interface Camera2D {
1974
- on: (<K extends keyof Camera2DEventMap>(type: K, listener: Camera2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
1975
- once: (<K extends keyof Camera2DEventMap>(type: K, listener: Camera2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
1976
- off: (<K extends keyof Camera2DEventMap>(type: K, listener?: Camera2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
1977
- 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;
1978
1949
  }
1979
1950
  declare class Camera2D extends Node2D {
1980
1951
  readonly zoom: Vector2;
@@ -2014,9 +1985,9 @@ declare class BaseElement2DFill extends CoreObject {
2014
1985
  opacity: NormalizedFill['opacity'];
2015
1986
  protected _texture?: Texture2D;
2016
1987
  constructor(parent: BaseElement2D);
2017
- protected _setProperties(properties?: Fill): this;
1988
+ protected _setProperties(properties?: NormalizedFill): this;
2018
1989
  setProperties(properties?: Fill): this;
2019
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
1990
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2020
1991
  loadTexture(): Promise<Texture2D | undefined>;
2021
1992
  protected _updateTexture(): Promise<void>;
2022
1993
  canDraw(): boolean;
@@ -2026,13 +1997,13 @@ declare class BaseElement2DFill extends CoreObject {
2026
1997
  declare class BaseElement2DBackground extends BaseElement2DFill {
2027
1998
  fillWithShape: NormalizedBackground['fillWithShape'];
2028
1999
  setProperties(properties?: Background): this;
2029
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2000
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2030
2001
  }
2031
2002
 
2032
2003
  declare class BaseElement2DForeground extends BaseElement2DFill {
2033
2004
  fillWithShape: NormalizedForeground['fillWithShape'];
2034
2005
  setProperties(properties?: Foreground): this;
2035
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2006
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2036
2007
  }
2037
2008
 
2038
2009
  declare class BaseElement2DOutline extends BaseElement2DFill {
@@ -2042,7 +2013,7 @@ declare class BaseElement2DOutline extends BaseElement2DFill {
2042
2013
  lineCap: NormalizedOutline['lineCap'];
2043
2014
  lineJoin: NormalizedOutline['lineJoin'];
2044
2015
  setProperties(properties?: Outline): this;
2045
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2016
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2046
2017
  canDraw(): boolean;
2047
2018
  draw(): void;
2048
2019
  }
@@ -2056,7 +2027,7 @@ declare class BaseElement2DShadow extends CoreObject {
2056
2027
  offsetX: NormalizedShadow['offsetY'];
2057
2028
  constructor(parent: BaseElement2D);
2058
2029
  setProperties(properties?: Shadow): this;
2059
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2030
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2060
2031
  updateEffect(): void;
2061
2032
  }
2062
2033
 
@@ -2070,7 +2041,7 @@ declare class BaseElement2DShape extends CoreObject {
2070
2041
  protected _path2DSet: Path2DSet;
2071
2042
  constructor(parent: BaseElement2D);
2072
2043
  setProperties(properties?: Shape): this;
2073
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2044
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2074
2045
  protected _updatePath2DSet(): void;
2075
2046
  draw(): void;
2076
2047
  drawRect(): void;
@@ -2105,7 +2076,7 @@ declare class BaseElement2DText extends CoreObject {
2105
2076
  }>;
2106
2077
  constructor(parent: BaseElement2D);
2107
2078
  setProperties(properties?: Text$1): this;
2108
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2079
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2109
2080
  protected _update(): void;
2110
2081
  protected _updateTextureMap(): void;
2111
2082
  protected _updateTexture(key: string, fill: NormalizedFill | undefined, box: any): Promise<void>;
@@ -2118,8 +2089,8 @@ declare class BaseElement2DText extends CoreObject {
2118
2089
  draw(): void;
2119
2090
  }
2120
2091
 
2121
- interface BaseElement2DEventMap extends CanvasItemEventMap {
2122
- updateStyleProperty: (key: string, value: any, oldValue: any, declaration?: PropertyDeclaration) => void;
2092
+ interface BaseElement2DEvents extends Node2DEvents {
2093
+ updateStyleProperty: (key: string, value: any, oldValue: any) => void;
2123
2094
  }
2124
2095
  interface BaseElement2DProperties extends Node2DProperties {
2125
2096
  modulate: Color$1;
@@ -2134,10 +2105,10 @@ interface BaseElement2DProperties extends Node2DProperties {
2134
2105
  shadow: Shadow;
2135
2106
  }
2136
2107
  interface BaseElement2D {
2137
- on: (<K extends keyof BaseElement2DEventMap>(type: K, listener: BaseElement2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2138
- once: (<K extends keyof BaseElement2DEventMap>(type: K, listener: BaseElement2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2139
- off: (<K extends keyof BaseElement2DEventMap>(type: K, listener?: BaseElement2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2140
- 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;
2141
2112
  }
2142
2113
  declare class BaseElement2D extends Node2D implements Rectangulable {
2143
2114
  readonly size: Vector2;
@@ -2167,7 +2138,7 @@ declare class BaseElement2D extends Node2D implements Rectangulable {
2167
2138
  set shadow(value: Shadow);
2168
2139
  constructor(properties?: Partial<BaseElement2DProperties>, nodes?: Node[]);
2169
2140
  setProperties(properties?: Record<string, any>): this;
2170
- protected _updateStyleProperty(key: string, value: any, oldValue: any, _declaration?: PropertyDeclaration): void;
2141
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
2171
2142
  protected _updateMaskImage(): void;
2172
2143
  getTransformOrigin(): Vector2;
2173
2144
  updateTransform(cb?: (transform: Transform2D) => void): void;
@@ -2215,23 +2186,23 @@ declare class FlexElement2DStyle extends BaseElement2DStyle {
2215
2186
  constructor(properties?: Partial<FlexElement2DStyleProperties>);
2216
2187
  }
2217
2188
 
2218
- interface Element2DEventMap extends BaseElement2DEventMap {
2189
+ interface Element2DEvents extends BaseElement2DEvents {
2219
2190
  }
2220
2191
  interface Element2DProperties extends BaseElement2DProperties {
2221
2192
  style: Partial<Element2DStyleProperties>;
2222
2193
  }
2223
2194
  interface Element2D {
2224
- on: (<K extends keyof Element2DEventMap>(type: K, listener: Element2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2225
- once: (<K extends keyof Element2DEventMap>(type: K, listener: Element2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2226
- off: (<K extends keyof Element2DEventMap>(type: K, listener?: Element2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2227
- 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;
2228
2199
  }
2229
2200
  declare class Element2D extends BaseElement2D {
2230
2201
  protected _style: Element2DStyle;
2231
2202
  get style(): Element2DStyle;
2232
2203
  set style(style: Element2DStyle);
2233
2204
  constructor(properties?: Partial<Element2DProperties>, nodes?: Node[]);
2234
- protected _updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2205
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
2235
2206
  }
2236
2207
 
2237
2208
  declare const edgeMap: {
@@ -2325,20 +2296,20 @@ declare class FlexLayout {
2325
2296
  constructor(_element: FlexElement2D);
2326
2297
  calculateLayout(width?: number | 'auto', height?: number | 'auto', direction?: typeof displayMap[keyof typeof displayMap]): void;
2327
2298
  getComputedLayout(): ComputedLayout;
2328
- updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2299
+ updateStyleProperty(key: string, value: any, oldValue: any): void;
2329
2300
  }
2330
2301
 
2331
- interface FlexBaseElement2DEventMap extends BaseElement2DEventMap {
2332
- updateStyleProperty: (key: string, value: any, oldValue: any, declaration?: PropertyDeclaration) => void;
2302
+ interface FlexBaseElement2DEvents extends BaseElement2DEvents {
2303
+ updateStyleProperty: (key: string, value: any, oldValue: any) => void;
2333
2304
  }
2334
2305
  interface FlexElement2DProperties extends BaseElement2DProperties {
2335
2306
  style: Partial<FlexElement2DStyleProperties>;
2336
2307
  }
2337
2308
  interface FlexElement2D {
2338
- on: (<K extends keyof FlexBaseElement2DEventMap>(type: K, listener: FlexBaseElement2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2339
- once: (<K extends keyof FlexBaseElement2DEventMap>(type: K, listener: FlexBaseElement2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2340
- off: (<K extends keyof FlexBaseElement2DEventMap>(type: K, listener?: FlexBaseElement2DEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
2341
- 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;
2342
2313
  }
2343
2314
  declare class FlexElement2D extends BaseElement2D implements Rectangulable {
2344
2315
  protected _style: FlexElement2DStyle;
@@ -2352,7 +2323,7 @@ declare class FlexElement2D extends BaseElement2D implements Rectangulable {
2352
2323
  constructor(properties?: Partial<FlexElement2DProperties>, nodes?: Node[]);
2353
2324
  protected _parented(parent: Node): void;
2354
2325
  protected _unparented(oldParent: Node): void;
2355
- protected _updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2326
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
2356
2327
  updateTransform(): void;
2357
2328
  calculateLayout(width?: number | 'auto', height?: number | 'auto', direction?: typeof directionMap[keyof typeof directionMap]): void;
2358
2329
  }
@@ -2376,7 +2347,7 @@ declare class Image2D extends Element2D {
2376
2347
  protected _complete: boolean;
2377
2348
  protected _wait: Promise<void>;
2378
2349
  constructor(properties?: Partial<Image2DProperties>, children?: Node[]);
2379
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2350
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2380
2351
  decode(): Promise<void>;
2381
2352
  setResource(source: Texture2D | ImageFrame[] | AnimatedTexture): this;
2382
2353
  protected _load(src: string): Promise<void>;
@@ -2403,7 +2374,7 @@ declare class Lottie2D extends TextureRect2D {
2403
2374
  readonly texture: CanvasTexture;
2404
2375
  animation?: AnimationItem;
2405
2376
  constructor(properties?: Partial<Lottie2DProperties>, children?: Node[]);
2406
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2377
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2407
2378
  protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
2408
2379
  protected _load(): Promise<void>;
2409
2380
  protected _process(delta: number): void;
@@ -2414,7 +2385,7 @@ interface TransformRect2DProperties extends BaseElement2DProperties {
2414
2385
  declare class TransformRect2D extends Element2D {
2415
2386
  handleSize: number;
2416
2387
  constructor(properties?: Partial<TransformRect2DProperties>, nodes?: Node[]);
2417
- protected _updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2388
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
2418
2389
  protected _drawCircle(x: number, y: number): void;
2419
2390
  protected _drawEllipse(x: number, y: number): void;
2420
2391
  protected _draw(): void;
@@ -2428,7 +2399,7 @@ declare class Video2D extends TextureRect2D<VideoTexture> {
2428
2399
  get videoDuration(): number;
2429
2400
  protected _wait: Promise<void>;
2430
2401
  constructor(properties?: Partial<Video2DProperties>, children?: Node[]);
2431
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2402
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2432
2403
  waitLoad(): Promise<void>;
2433
2404
  protected _load(src: string): Promise<void>;
2434
2405
  protected _updateVideoCurrentTime(): void;
@@ -2479,7 +2450,7 @@ declare class Animation extends TimelineNode {
2479
2450
  protected _parented(parent: Node): void;
2480
2451
  protected _unparented(oldParent: Node): void;
2481
2452
  protected _process(): void;
2482
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2453
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2483
2454
  protected _getTargets(): any[];
2484
2455
  protected _updateKeyframes(): void;
2485
2456
  commitStyles(): void;
@@ -2503,7 +2474,7 @@ declare abstract class AudioProcessor {
2503
2474
  disconnect(): void;
2504
2475
  }
2505
2476
 
2506
- declare class AudioPipeline extends EventEmitter {
2477
+ declare class AudioPipeline extends Observable {
2507
2478
  protected _input: IAudioNode;
2508
2479
  protected _output: IAudioNode;
2509
2480
  protected _processers: AudioProcessor[];
@@ -2540,7 +2511,7 @@ interface IPlayOptions {
2540
2511
  multiple?: boolean;
2541
2512
  }
2542
2513
 
2543
- declare class HTMLAudioContext extends EventEmitter implements IAudioContext {
2514
+ declare class HTMLAudioContext extends Observable implements IAudioContext {
2544
2515
  protected static _instance?: HTMLAudioContext;
2545
2516
  static get instance(): HTMLAudioContext;
2546
2517
  playbackRate: number;
@@ -2554,10 +2525,9 @@ declare class HTMLAudioContext extends EventEmitter implements IAudioContext {
2554
2525
  get audioContext(): AudioContext;
2555
2526
  toggleMute(): boolean;
2556
2527
  togglePause(): boolean;
2557
- free(): void;
2558
2528
  }
2559
2529
 
2560
- declare class HTMLSound extends EventEmitter {
2530
+ declare class HTMLSound extends Observable {
2561
2531
  static readonly PADDING = 0.1;
2562
2532
  protected _source: HTMLAudioElement | null;
2563
2533
  protected _audio: HTMLAudio | null;
@@ -2600,7 +2570,7 @@ declare class HTMLSound extends EventEmitter {
2600
2570
  play(options?: IPlayOptions): void;
2601
2571
  protected _onUpdate: () => void;
2602
2572
  protected _onComplete(): void;
2603
- free(): void;
2573
+ destroy(): void;
2604
2574
  }
2605
2575
 
2606
2576
  declare class HTMLAudio {
@@ -2656,7 +2626,7 @@ declare class WebAudioContext extends AudioPipeline implements IAudioContext {
2656
2626
  setParamValue(param: AudioParam, value: number): void;
2657
2627
  }
2658
2628
 
2659
- declare class WebSound extends EventEmitter {
2629
+ declare class WebSound extends Observable {
2660
2630
  protected _audio: WebAudio | null;
2661
2631
  protected _sourceNode: AudioBufferSourceNode | null;
2662
2632
  protected _gain: GainNode | null;
@@ -2702,7 +2672,7 @@ declare class WebSound extends EventEmitter {
2702
2672
  protected _onComplete: () => void;
2703
2673
  protected _updateListener: () => void;
2704
2674
  protected _enableTicker(enabled: boolean): void;
2705
- free(): void;
2675
+ destroy(): void;
2706
2676
  }
2707
2677
 
2708
2678
  declare class WebAudio extends AudioPipeline {
@@ -2769,7 +2739,7 @@ declare class Audio extends TimelineNode {
2769
2739
  start: number;
2770
2740
  end: number;
2771
2741
  constructor(src?: string);
2772
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2742
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2773
2743
  load(): Promise<this>;
2774
2744
  pause(): this;
2775
2745
  resume(): this;
@@ -2803,7 +2773,7 @@ declare class AudioWaveform extends Element2D {
2803
2773
  protected _src: Texture2D<HTMLCanvasElement> | undefined;
2804
2774
  protected _needsUpdateTexture: boolean;
2805
2775
  constructor(options?: Partial<AudioWaveformProperties>);
2806
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2776
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
2807
2777
  _loadSrc(src: string): Promise<void>;
2808
2778
  syncTexture(force?: boolean): void;
2809
2779
  protected _process(delta: number): void;
@@ -2996,7 +2966,7 @@ declare class KawaseBlurEffect extends Effect {
2996
2966
  pixelSize: [number, number];
2997
2967
  protected _kernels: number[];
2998
2968
  constructor(properties?: Partial<KawaseBlurEffectProperties>, children?: Node[]);
2999
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2969
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
3000
2970
  /** Auto generate kernels by blur & quality */
3001
2971
  protected _generateKernels(): void;
3002
2972
  apply(renderer: WebGLRenderer, source: Viewport): void;
@@ -3011,7 +2981,7 @@ declare class MaskEffect extends Effect {
3011
2981
  src: string;
3012
2982
  constructor(properties?: Partial<MaskEffectProperties>, children?: Node[]);
3013
2983
  load(): Promise<void>;
3014
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2984
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
3015
2985
  apply(renderer: WebGLRenderer, source: Viewport, context: EffectContext): void;
3016
2986
  }
3017
2987
 
@@ -3066,15 +3036,15 @@ declare class ZoomBlurEffect extends Effect {
3066
3036
  apply(renderer: WebGLRenderer, source: Viewport, context: EffectContext): void;
3067
3037
  }
3068
3038
 
3069
- interface ControlEventMap extends CanvasItemEventMap, RectangulableEventMap {
3039
+ interface ControlEvents extends CanvasItemEvents, RectangulableEvents {
3070
3040
  }
3071
3041
  interface ControlProperties extends BaseElement2DProperties {
3072
3042
  }
3073
3043
  interface Control {
3074
- on: (<K extends keyof ControlEventMap>(type: K, listener: ControlEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3075
- once: (<K extends keyof ControlEventMap>(type: K, listener: ControlEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3076
- off: (<K extends keyof ControlEventMap>(type: K, listener?: ControlEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3077
- 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;
3078
3048
  }
3079
3049
  declare class Control extends Element2D implements Rectangulable {
3080
3050
  constructor(properties?: Partial<ControlProperties>, children?: Node[]);
@@ -3082,7 +3052,7 @@ declare class Control extends Element2D implements Rectangulable {
3082
3052
  protected _unparented(oldParent: any): void;
3083
3053
  protected _parentUpdateRect(): void;
3084
3054
  protected _input(event: InputEvent, key: InputEventKey): void;
3085
- protected _updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
3055
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
3086
3056
  protected _guiInput(event: InputEvent, key: InputEventKey): void;
3087
3057
  }
3088
3058
 
@@ -3104,7 +3074,7 @@ declare class Range extends Control {
3104
3074
  step: number;
3105
3075
  value: number;
3106
3076
  constructor(properties?: Partial<RangeProperties>, children?: Node[]);
3107
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
3077
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
3108
3078
  }
3109
3079
 
3110
3080
  interface RulerProperties extends ControlProperties {
@@ -3130,8 +3100,8 @@ declare class Ruler extends Control {
3130
3100
  gapScale: number;
3131
3101
  texture: CanvasTexture;
3132
3102
  constructor(properties?: Partial<RulerProperties>, children?: Node[]);
3133
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
3134
- 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;
3135
3105
  protected _drawTexture(): void;
3136
3106
  protected _draw(): void;
3137
3107
  }
@@ -3142,7 +3112,7 @@ interface ScrollBarProperties extends RangeProperties {
3142
3112
  declare class ScrollBar extends Range {
3143
3113
  direction: 'vertical' | 'horizontal';
3144
3114
  constructor(properties?: Partial<ScrollBarProperties>, children?: Node[]);
3145
- protected _updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
3115
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
3146
3116
  protected _rect(): {
3147
3117
  left: number;
3148
3118
  top: number;
@@ -3169,7 +3139,7 @@ declare class YScrollBar extends ScrollBar {
3169
3139
  constructor(properties?: Partial<YScrollBarProperties>, children?: Node[]);
3170
3140
  }
3171
3141
 
3172
- interface ScalerEventMap extends NodeEventMap {
3142
+ interface ScalerEvents extends NodeEvents {
3173
3143
  updateScale: (scale: number) => void;
3174
3144
  }
3175
3145
  interface ScalerProperties extends NodeProperties {
@@ -3178,10 +3148,10 @@ interface ScalerProperties extends NodeProperties {
3178
3148
  maxScale: number;
3179
3149
  }
3180
3150
  interface Scaler {
3181
- on: (<K extends keyof ScalerEventMap>(type: K, listener: ScalerEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3182
- once: (<K extends keyof ScalerEventMap>(type: K, listener: ScalerEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3183
- off: (<K extends keyof ScalerEventMap>(type: K, listener?: ScalerEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3184
- 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;
3185
3155
  }
3186
3156
  declare class Scaler extends Node {
3187
3157
  translateX: number;
@@ -3191,7 +3161,7 @@ declare class Scaler extends Node {
3191
3161
  maxScale: number;
3192
3162
  get target(): Element2D | undefined;
3193
3163
  constructor(properties?: Partial<ScalerProperties>, children?: Node[]);
3194
- protected _updateProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
3164
+ protected _updateProperty(key: string, value: any, oldValue: any): void;
3195
3165
  protected _updateTarget(): void;
3196
3166
  protected _onWheel(e: WheelInputEvent): void;
3197
3167
  protected _input(event: InputEvent, key: InputEventKey): void;
@@ -3311,7 +3281,7 @@ declare class CanvasItemEditor extends Control {
3311
3281
  drawboard: Element2D;
3312
3282
  ruler: Ruler;
3313
3283
  constructor();
3314
- protected _updateStyleProperty(key: string, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
3284
+ protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
3315
3285
  protected _guiInput(event: InputEvent, key: InputEventKey): void;
3316
3286
  protected _onPointerdown(e: PointerInputEvent): void;
3317
3287
  protected _onPointermove(e: PointerInputEvent): void;
@@ -3333,7 +3303,7 @@ interface EngineOptions extends WebGLContextAttributes {
3333
3303
  autoStart?: boolean;
3334
3304
  timeline?: Timeline;
3335
3305
  }
3336
- interface EngineEventMap extends SceneTreeEventMap {
3306
+ interface EngineEvents extends SceneTreeEvents {
3337
3307
  pointerdown: (ev: PointerInputEvent) => void;
3338
3308
  pointerover: (ev: PointerInputEvent) => void;
3339
3309
  pointermove: (ev: PointerInputEvent) => void;
@@ -3349,10 +3319,10 @@ declare const defaultOptions: {
3349
3319
  readonly powerPreference: "default";
3350
3320
  };
3351
3321
  interface Engine {
3352
- on: (<K extends keyof EngineEventMap>(type: K, listener: EngineEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3353
- once: (<K extends keyof EngineEventMap>(type: K, listener: EngineEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3354
- off: (<K extends keyof EngineEventMap>(type: K, listener?: EngineEventMap[K], options?: EventListenerOptions$1) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions$1) => this);
3355
- 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;
3356
3326
  }
3357
3327
  declare class Engine extends SceneTree {
3358
3328
  readonly renderer: WebGLRenderer;
@@ -3378,7 +3348,7 @@ declare class Engine extends SceneTree {
3378
3348
  waitAndRender(delta?: number): Promise<void>;
3379
3349
  render(delta?: number): void;
3380
3350
  start(): Promise<void>;
3381
- free(): void;
3351
+ destroy(): void;
3382
3352
  toPixels(): Uint8ClampedArray<ArrayBuffer>;
3383
3353
  toImageData(): ImageData;
3384
3354
  toCanvas2D(): HTMLCanvasElement;
@@ -3395,4 +3365,4 @@ interface RenderOptions {
3395
3365
  declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
3396
3366
 
3397
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 };
3398
- 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 };