modern-canvas 0.2.1 → 0.2.2

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
@@ -1682,8 +1682,8 @@ declare class Node extends CoreObject {
1682
1682
  get parent(): Node | undefined;
1683
1683
  set parent(parent: Node | undefined);
1684
1684
  hasParent(): boolean;
1685
- getParent(): Node | undefined;
1686
- setParent(parent: Node | undefined): this;
1685
+ getParent<T extends Node = Node>(): T | undefined;
1686
+ setParent<T extends Node = Node>(parent: T | undefined): this;
1687
1687
  /** Children */
1688
1688
  protected _children: Node[];
1689
1689
  get siblingIndex(): number;
@@ -1776,7 +1776,6 @@ declare class TimelineNode extends Node {
1776
1776
  }
1777
1777
 
1778
1778
  interface CanvasItemProperties extends TimelineNodeProperties {
1779
- visible: boolean;
1780
1779
  style: Partial<CanvasItemStyleProperties>;
1781
1780
  modulate: ColorValue;
1782
1781
  blendMode: WebGLBlendMode;
@@ -1791,7 +1790,6 @@ interface CanvasItem {
1791
1790
  emit: (<K extends keyof CanvasItemEventMap>(type: K, ...args: Parameters<CanvasItemEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
1792
1791
  }
1793
1792
  declare class CanvasItem extends TimelineNode {
1794
- visible: boolean;
1795
1793
  modulate?: ColorValue;
1796
1794
  blendMode?: WebGLBlendMode;
1797
1795
  protected _style: CanvasItemStyle;
@@ -1799,10 +1797,11 @@ declare class CanvasItem extends TimelineNode {
1799
1797
  set style(style: CanvasItemStyle);
1800
1798
  /** @internal */
1801
1799
  opacity: number;
1800
+ visible: boolean;
1802
1801
  protected _parentOpacity?: number;
1802
+ protected _parentVisible?: boolean;
1803
1803
  protected _modulate: Color;
1804
1804
  protected _backgroundImage?: Texture2D;
1805
- _computedVisible: boolean;
1806
1805
  context: CanvasContext;
1807
1806
  protected _resetContext: boolean;
1808
1807
  protected _redrawing: boolean;
@@ -1818,6 +1817,7 @@ declare class CanvasItem extends TimelineNode {
1818
1817
  protected _updateBackgroundColor(): void;
1819
1818
  protected _updateBackgroundImage(): Promise<void>;
1820
1819
  protected _updateOpacity(): void;
1820
+ protected _updateCurrentTime(force?: boolean): void;
1821
1821
  protected _updateVisible(): void;
1822
1822
  show(): void;
1823
1823
  hide(): void;
@@ -2020,8 +2020,6 @@ interface NormalizedKeyframe {
2020
2020
  type AnimationMode = 'parent' | 'sibling';
2021
2021
  interface AnimationProperties extends TimelineNodeProperties {
2022
2022
  animationMode: AnimationMode;
2023
- startTime: number;
2024
- duration: number;
2025
2023
  loop: boolean;
2026
2024
  keyframes: Keyframe[];
2027
2025
  }
@@ -2369,11 +2367,11 @@ declare class AudioWaveform extends Node2D {
2369
2367
  }
2370
2368
 
2371
2369
  type EffectMode = 'before' | 'parent' | 'children' | 'transition';
2372
- interface EffectOptions extends TimelineNodeProperties {
2373
- mode?: EffectMode;
2374
- glsl?: string;
2375
- glslSrc?: string;
2376
- material?: Material;
2370
+ interface EffectProperties extends TimelineNodeProperties {
2371
+ mode: EffectMode;
2372
+ glsl: string;
2373
+ glslSrc: string;
2374
+ material: Material;
2377
2375
  }
2378
2376
  interface EffectContext {
2379
2377
  redraw?: boolean;
@@ -2399,7 +2397,7 @@ declare class Effect extends TimelineNode {
2399
2397
  /** Temporary nodes for transition */
2400
2398
  protected _previousSibling?: Node;
2401
2399
  protected _nextSibling?: Node;
2402
- constructor(options?: EffectOptions);
2400
+ constructor(properties?: Partial<EffectProperties>, children?: Node[]);
2403
2401
  protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2404
2402
  protected _treeEnter(tree: SceneTree): void;
2405
2403
  protected _treeExit(oldTree: SceneTree): void;
@@ -2523,13 +2521,13 @@ declare class LeftEraseEffect extends Effect {
2523
2521
  apply(renderer: WebGLRenderer): void;
2524
2522
  }
2525
2523
 
2526
- interface MaskEffectOptions extends EffectOptions {
2524
+ interface MaskEffectProperties extends EffectProperties {
2527
2525
  src?: string;
2528
2526
  }
2529
2527
  declare class MaskEffect extends Effect {
2530
2528
  texture?: Texture2D<ImageBitmap>;
2531
2529
  src: string;
2532
- constructor(options?: MaskEffectOptions);
2530
+ constructor(properties?: Partial<MaskEffectProperties>, children?: Node[]);
2533
2531
  load(): Promise<void>;
2534
2532
  protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2535
2533
  apply(renderer: WebGLRenderer, source: Viewport, context: EffectContext): void;
@@ -2595,6 +2593,27 @@ declare class Control extends CanvasItem implements Rectangulable {
2595
2593
  getRect(): Rect2;
2596
2594
  }
2597
2595
 
2596
+ interface RangeProperties extends ControlProperties {
2597
+ allowGreater: boolean;
2598
+ allowLesser: boolean;
2599
+ page: number;
2600
+ minValue: number;
2601
+ maxValue: number;
2602
+ step: number;
2603
+ value: number;
2604
+ }
2605
+ declare class Range extends Control {
2606
+ allowGreater: boolean;
2607
+ allowLesser: boolean;
2608
+ page: number;
2609
+ minValue: number;
2610
+ maxValue: number;
2611
+ step: number;
2612
+ value: number;
2613
+ constructor(properties?: Partial<RangeProperties>, children?: Node[]);
2614
+ protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2615
+ }
2616
+
2598
2617
  interface RulerProperties extends ControlProperties {
2599
2618
  offsetX: number;
2600
2619
  offsetY: number;
@@ -2624,22 +2643,36 @@ declare class Ruler extends Control {
2624
2643
  protected _draw(): void;
2625
2644
  }
2626
2645
 
2627
- interface ScrollBarProperties extends ControlProperties {
2646
+ interface ScrollBarProperties extends RangeProperties {
2628
2647
  direction: 'vertical' | 'horizontal';
2629
2648
  }
2630
- declare class ScrollBar extends Control {
2649
+ declare class ScrollBar extends Range {
2631
2650
  direction: 'vertical' | 'horizontal';
2632
- padding: number;
2633
- constructor(properties: Partial<ScrollBarProperties>, children?: Node[]);
2634
- protected _parentUpdateRect(): void;
2651
+ constructor(properties?: Partial<ScrollBarProperties>, children?: Node[]);
2652
+ protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2635
2653
  protected _guiInput(event: InputEvent, key: InputEventKey): void;
2636
2654
  protected _draw(): void;
2637
2655
  }
2638
2656
 
2657
+ interface XScrollBarProperties extends Omit<ScrollBarProperties, 'direction'> {
2658
+ }
2659
+ declare class XScrollBar extends ScrollBar {
2660
+ constructor(properties?: Partial<XScrollBarProperties>, children?: Node[]);
2661
+ }
2662
+
2663
+ interface YScrollBarProperties extends Omit<ScrollBarProperties, 'direction'> {
2664
+ }
2665
+ declare class YScrollBar extends ScrollBar {
2666
+ constructor(properties?: Partial<YScrollBarProperties>, children?: Node[]);
2667
+ }
2668
+
2639
2669
  interface ScalerEventMap extends NodeEventMap {
2640
2670
  updateScale: (scale: number) => void;
2641
2671
  }
2642
2672
  interface ScalerProperties extends NodeProperties {
2673
+ value: number;
2674
+ minValue: number;
2675
+ maxValue: number;
2643
2676
  }
2644
2677
  interface Scaler {
2645
2678
  on: (<K extends keyof ScalerEventMap>(type: K, listener: ScalerEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
@@ -2647,9 +2680,9 @@ interface Scaler {
2647
2680
  emit: (<K extends keyof ScalerEventMap>(type: K, ...args: Parameters<ScalerEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
2648
2681
  }
2649
2682
  declare class Scaler extends Node {
2650
- scale: number;
2651
- min: number;
2652
- max: number;
2683
+ value: number;
2684
+ minValue: number;
2685
+ maxValue: number;
2653
2686
  get target(): CanvasItem | undefined;
2654
2687
  constructor(properties?: Partial<ScalerProperties>, children?: Node[]);
2655
2688
  protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
@@ -2725,8 +2758,8 @@ declare class CanvasEditor extends Control {
2725
2758
  selectionRect: Node2D;
2726
2759
  selector: Node2D;
2727
2760
  scaler: Scaler;
2728
- xScrollBar: ScrollBar;
2729
- yScrollBar: ScrollBar;
2761
+ xScrollBar: XScrollBar;
2762
+ yScrollBar: YScrollBar;
2730
2763
  drawboard: Node2D;
2731
2764
  ruler: Ruler;
2732
2765
  protected _pointerStart?: CanvasItemStyle;
@@ -2736,6 +2769,7 @@ declare class CanvasEditor extends Control {
2736
2769
  };
2737
2770
  selected?: CanvasItem;
2738
2771
  constructor();
2772
+ protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2739
2773
  protected _guiInput(event: InputEvent, key: InputEventKey): void;
2740
2774
  protected _onPointerdown(e: PointerInputEvent): void;
2741
2775
  protected _onPointermove(e: PointerInputEvent): void;
@@ -2810,4 +2844,4 @@ interface RenderOptions {
2810
2844
  }
2811
2845
  declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
2812
2846
 
2813
- export { Animation, type AnimationMode, type AnimationProperties, type AssetHandler, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, type AudioWaveformProperties, type Batchable2D, BlurEffect, type CanvasBatchable, CanvasContext, CanvasEditor, CanvasItem, type CanvasItemEventMap, type CanvasItemProperties, CanvasItemStyle, type CanvasItemStyleFilter, type CanvasItemStyleFilterKey, type CanvasItemStyleProperties, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, type ColorFilterEffectProperties, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, type ColorValue, Control, type ControlEventMap, type ControlProperties, CoreObject, type CoreObjectEventMap, type CssFunction, type CssFunctionArg, type Cursor, DEG_TO_RAD, DEVICE_PIXEL_RATIO, type Easing, Effect, type EffectContext, EffectMaterial, type EffectMode, type EffectOptions, EmbossEffect, Engine, type EngineOptions, EventEmitter, type EventListener, type EventListenerOptions, type EventListenerValue, type FilledGraphics, FontLoader, Geometry, type GeometryOptions, GifLoader, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, type IAudioContext, type IAudioNode, IN_BROWSER, type IPlayOptions, Image2D, type Image2DProperties, Image2DResource, type ImageFrame, ImageTexture, type ImageTextureOptions, IndexBuffer, type IndexBufferOptions, Input, InputEvent, type InputEventKey, type InputEventMap, type InternalMode, JsonLoader, KawaseEffect, type Keyframe, LeftEraseEffect, Loader, Lottie2D, type Lottie2DProperties, LottieLoader, MainLoop, type MainLoopEventMap, type MaskColor, type MaskData, MaskEffect, type MaskEffectOptions, type MaskObject, type MaskRect, type Maskable, Material, type MaterialOptions, Matrix, Matrix2, Matrix3, Matrix4, type MatrixLike, type MatrixOperateOutput, MouseInputEvent, Node, Node2D, type Node2DProperties, type NodeEventMap, type NodeProperties, type NormalizedKeyframe, PI, PI_2, PixelateEffect, PixelsTexture, type PlatformAudio, type PlatformSound, type PointerEvents, PointerInputEvent, type ProcessMode, Projection2D, type PropertyDeclaration, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, RawWeakMap, Rect2, RefCounted, type RefCountedEventMap, type RenderMode, type RenderOptions, type Renderable, Renderer, Resource, type ResourceEventMap, Ruler, type RulerProperties, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, type ScalerEventMap, type ScalerProperties, SceneTree, type SceneTreeEventMap, ScrollBar, type ScrollBarProperties, ShadowEffect, type StrokedGraphics, Text2D, type Text2DProperties, TextLoader, Texture2D, type Texture2DFilterMode, type Texture2DPixelsSource, type Texture2DSource, type Texture2DWrapMode, TextureLoader, TextureRect2D, type TextureRect2DProperties, Ticker, TiltShiftEffect, Timeline, type TimelineEventMap, TimelineNode, type TimelineNodeEventMap, type TimelineNodeProperties, type TimelineProperties, type TimingFunctions, Transform2D, type Transform2DObject, TwistEffect, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, type VectorLike, type VectorOperateOutput, VertexAttribute, type VertexAttributeOptions, VertexBuffer, type VertexBufferOptions, Video2D, type Video2DProperties, VideoLoader, VideoTexture, type VideoTextureOptions, type VideoTextureSource, Viewport, type ViewportEventMap, type ViewportFramebuffer, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, type WebGLBufferMeta, WebGLBufferModule, type WebGLBufferOptions, type WebGLBufferTarget, type WebGLBufferUsage, type WebGLDrawMode, type WebGLDrawOptions, type WebGLExtensions, type WebGLFramebufferMeta, WebGLFramebufferModule, type WebGLFramebufferOptions, WebGLMaskModule, WebGLModule, type WebGLProgramMeta, WebGLProgramModule, type WebGLProgramOptions, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, type WebGLTarget, type WebGLTextureFilterMode, type WebGLTextureLocation, type WebGLTextureMeta, WebGLTextureModule, type WebGLTextureOptions, type WebGLTextureSource, type WebGLTextureTarget, type WebGLTextureWrapMode, WebGLVertexArrayModule, type WebGLVertexArrayObjectMeta, type WebGLVertexArrayObjectOptions, type WebGLVertexAttrib, type WebGLVertexAttribType, type WebGLViewport, WebGLViewportModule, WebSound, WheelInputEvent, ZoomBlurEffect, assets, clamp, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
2847
+ export { Animation, type AnimationMode, type AnimationProperties, type AssetHandler, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, type AudioWaveformProperties, type Batchable2D, BlurEffect, type CanvasBatchable, CanvasContext, CanvasEditor, CanvasItem, type CanvasItemEventMap, type CanvasItemProperties, CanvasItemStyle, type CanvasItemStyleFilter, type CanvasItemStyleFilterKey, type CanvasItemStyleProperties, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, type ColorFilterEffectProperties, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, type ColorValue, Control, type ControlEventMap, type ControlProperties, CoreObject, type CoreObjectEventMap, type CssFunction, type CssFunctionArg, type Cursor, DEG_TO_RAD, DEVICE_PIXEL_RATIO, type Easing, Effect, type EffectContext, EffectMaterial, type EffectMode, type EffectProperties, EmbossEffect, Engine, type EngineOptions, EventEmitter, type EventListener, type EventListenerOptions, type EventListenerValue, type FilledGraphics, FontLoader, Geometry, type GeometryOptions, GifLoader, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, type IAudioContext, type IAudioNode, IN_BROWSER, type IPlayOptions, Image2D, type Image2DProperties, Image2DResource, type ImageFrame, ImageTexture, type ImageTextureOptions, IndexBuffer, type IndexBufferOptions, Input, InputEvent, type InputEventKey, type InputEventMap, type InternalMode, JsonLoader, KawaseEffect, type Keyframe, LeftEraseEffect, Loader, Lottie2D, type Lottie2DProperties, LottieLoader, MainLoop, type MainLoopEventMap, type MaskColor, type MaskData, MaskEffect, type MaskEffectProperties, type MaskObject, type MaskRect, type Maskable, Material, type MaterialOptions, Matrix, Matrix2, Matrix3, Matrix4, type MatrixLike, type MatrixOperateOutput, MouseInputEvent, Node, Node2D, type Node2DProperties, type NodeEventMap, type NodeProperties, type NormalizedKeyframe, PI, PI_2, PixelateEffect, PixelsTexture, type PlatformAudio, type PlatformSound, type PointerEvents, PointerInputEvent, type ProcessMode, Projection2D, type PropertyDeclaration, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, type RangeProperties, RawWeakMap, Rect2, RefCounted, type RefCountedEventMap, type RenderMode, type RenderOptions, type Renderable, Renderer, Resource, type ResourceEventMap, Ruler, type RulerProperties, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, type ScalerEventMap, type ScalerProperties, SceneTree, type SceneTreeEventMap, ScrollBar, type ScrollBarProperties, ShadowEffect, type StrokedGraphics, Text2D, type Text2DProperties, TextLoader, Texture2D, type Texture2DFilterMode, type Texture2DPixelsSource, type Texture2DSource, type Texture2DWrapMode, TextureLoader, TextureRect2D, type TextureRect2DProperties, Ticker, TiltShiftEffect, Timeline, type TimelineEventMap, TimelineNode, type TimelineNodeEventMap, type TimelineNodeProperties, type TimelineProperties, type TimingFunctions, Transform2D, type Transform2DObject, TwistEffect, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, type VectorLike, type VectorOperateOutput, VertexAttribute, type VertexAttributeOptions, VertexBuffer, type VertexBufferOptions, Video2D, type Video2DProperties, VideoLoader, VideoTexture, type VideoTextureOptions, type VideoTextureSource, Viewport, type ViewportEventMap, type ViewportFramebuffer, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, type WebGLBufferMeta, WebGLBufferModule, type WebGLBufferOptions, type WebGLBufferTarget, type WebGLBufferUsage, type WebGLDrawMode, type WebGLDrawOptions, type WebGLExtensions, type WebGLFramebufferMeta, WebGLFramebufferModule, type WebGLFramebufferOptions, WebGLMaskModule, WebGLModule, type WebGLProgramMeta, WebGLProgramModule, type WebGLProgramOptions, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, type WebGLTarget, type WebGLTextureFilterMode, type WebGLTextureLocation, type WebGLTextureMeta, WebGLTextureModule, type WebGLTextureOptions, type WebGLTextureSource, type WebGLTextureTarget, type WebGLTextureWrapMode, WebGLVertexArrayModule, type WebGLVertexArrayObjectMeta, type WebGLVertexArrayObjectOptions, type WebGLVertexAttrib, type WebGLVertexAttribType, type WebGLViewport, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, type XScrollBarProperties, YScrollBar, type YScrollBarProperties, ZoomBlurEffect, assets, clamp, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
package/dist/index.d.mts CHANGED
@@ -1682,8 +1682,8 @@ declare class Node extends CoreObject {
1682
1682
  get parent(): Node | undefined;
1683
1683
  set parent(parent: Node | undefined);
1684
1684
  hasParent(): boolean;
1685
- getParent(): Node | undefined;
1686
- setParent(parent: Node | undefined): this;
1685
+ getParent<T extends Node = Node>(): T | undefined;
1686
+ setParent<T extends Node = Node>(parent: T | undefined): this;
1687
1687
  /** Children */
1688
1688
  protected _children: Node[];
1689
1689
  get siblingIndex(): number;
@@ -1776,7 +1776,6 @@ declare class TimelineNode extends Node {
1776
1776
  }
1777
1777
 
1778
1778
  interface CanvasItemProperties extends TimelineNodeProperties {
1779
- visible: boolean;
1780
1779
  style: Partial<CanvasItemStyleProperties>;
1781
1780
  modulate: ColorValue;
1782
1781
  blendMode: WebGLBlendMode;
@@ -1791,7 +1790,6 @@ interface CanvasItem {
1791
1790
  emit: (<K extends keyof CanvasItemEventMap>(type: K, ...args: Parameters<CanvasItemEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
1792
1791
  }
1793
1792
  declare class CanvasItem extends TimelineNode {
1794
- visible: boolean;
1795
1793
  modulate?: ColorValue;
1796
1794
  blendMode?: WebGLBlendMode;
1797
1795
  protected _style: CanvasItemStyle;
@@ -1799,10 +1797,11 @@ declare class CanvasItem extends TimelineNode {
1799
1797
  set style(style: CanvasItemStyle);
1800
1798
  /** @internal */
1801
1799
  opacity: number;
1800
+ visible: boolean;
1802
1801
  protected _parentOpacity?: number;
1802
+ protected _parentVisible?: boolean;
1803
1803
  protected _modulate: Color;
1804
1804
  protected _backgroundImage?: Texture2D;
1805
- _computedVisible: boolean;
1806
1805
  context: CanvasContext;
1807
1806
  protected _resetContext: boolean;
1808
1807
  protected _redrawing: boolean;
@@ -1818,6 +1817,7 @@ declare class CanvasItem extends TimelineNode {
1818
1817
  protected _updateBackgroundColor(): void;
1819
1818
  protected _updateBackgroundImage(): Promise<void>;
1820
1819
  protected _updateOpacity(): void;
1820
+ protected _updateCurrentTime(force?: boolean): void;
1821
1821
  protected _updateVisible(): void;
1822
1822
  show(): void;
1823
1823
  hide(): void;
@@ -2020,8 +2020,6 @@ interface NormalizedKeyframe {
2020
2020
  type AnimationMode = 'parent' | 'sibling';
2021
2021
  interface AnimationProperties extends TimelineNodeProperties {
2022
2022
  animationMode: AnimationMode;
2023
- startTime: number;
2024
- duration: number;
2025
2023
  loop: boolean;
2026
2024
  keyframes: Keyframe[];
2027
2025
  }
@@ -2369,11 +2367,11 @@ declare class AudioWaveform extends Node2D {
2369
2367
  }
2370
2368
 
2371
2369
  type EffectMode = 'before' | 'parent' | 'children' | 'transition';
2372
- interface EffectOptions extends TimelineNodeProperties {
2373
- mode?: EffectMode;
2374
- glsl?: string;
2375
- glslSrc?: string;
2376
- material?: Material;
2370
+ interface EffectProperties extends TimelineNodeProperties {
2371
+ mode: EffectMode;
2372
+ glsl: string;
2373
+ glslSrc: string;
2374
+ material: Material;
2377
2375
  }
2378
2376
  interface EffectContext {
2379
2377
  redraw?: boolean;
@@ -2399,7 +2397,7 @@ declare class Effect extends TimelineNode {
2399
2397
  /** Temporary nodes for transition */
2400
2398
  protected _previousSibling?: Node;
2401
2399
  protected _nextSibling?: Node;
2402
- constructor(options?: EffectOptions);
2400
+ constructor(properties?: Partial<EffectProperties>, children?: Node[]);
2403
2401
  protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2404
2402
  protected _treeEnter(tree: SceneTree): void;
2405
2403
  protected _treeExit(oldTree: SceneTree): void;
@@ -2523,13 +2521,13 @@ declare class LeftEraseEffect extends Effect {
2523
2521
  apply(renderer: WebGLRenderer): void;
2524
2522
  }
2525
2523
 
2526
- interface MaskEffectOptions extends EffectOptions {
2524
+ interface MaskEffectProperties extends EffectProperties {
2527
2525
  src?: string;
2528
2526
  }
2529
2527
  declare class MaskEffect extends Effect {
2530
2528
  texture?: Texture2D<ImageBitmap>;
2531
2529
  src: string;
2532
- constructor(options?: MaskEffectOptions);
2530
+ constructor(properties?: Partial<MaskEffectProperties>, children?: Node[]);
2533
2531
  load(): Promise<void>;
2534
2532
  protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2535
2533
  apply(renderer: WebGLRenderer, source: Viewport, context: EffectContext): void;
@@ -2595,6 +2593,27 @@ declare class Control extends CanvasItem implements Rectangulable {
2595
2593
  getRect(): Rect2;
2596
2594
  }
2597
2595
 
2596
+ interface RangeProperties extends ControlProperties {
2597
+ allowGreater: boolean;
2598
+ allowLesser: boolean;
2599
+ page: number;
2600
+ minValue: number;
2601
+ maxValue: number;
2602
+ step: number;
2603
+ value: number;
2604
+ }
2605
+ declare class Range extends Control {
2606
+ allowGreater: boolean;
2607
+ allowLesser: boolean;
2608
+ page: number;
2609
+ minValue: number;
2610
+ maxValue: number;
2611
+ step: number;
2612
+ value: number;
2613
+ constructor(properties?: Partial<RangeProperties>, children?: Node[]);
2614
+ protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2615
+ }
2616
+
2598
2617
  interface RulerProperties extends ControlProperties {
2599
2618
  offsetX: number;
2600
2619
  offsetY: number;
@@ -2624,22 +2643,36 @@ declare class Ruler extends Control {
2624
2643
  protected _draw(): void;
2625
2644
  }
2626
2645
 
2627
- interface ScrollBarProperties extends ControlProperties {
2646
+ interface ScrollBarProperties extends RangeProperties {
2628
2647
  direction: 'vertical' | 'horizontal';
2629
2648
  }
2630
- declare class ScrollBar extends Control {
2649
+ declare class ScrollBar extends Range {
2631
2650
  direction: 'vertical' | 'horizontal';
2632
- padding: number;
2633
- constructor(properties: Partial<ScrollBarProperties>, children?: Node[]);
2634
- protected _parentUpdateRect(): void;
2651
+ constructor(properties?: Partial<ScrollBarProperties>, children?: Node[]);
2652
+ protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2635
2653
  protected _guiInput(event: InputEvent, key: InputEventKey): void;
2636
2654
  protected _draw(): void;
2637
2655
  }
2638
2656
 
2657
+ interface XScrollBarProperties extends Omit<ScrollBarProperties, 'direction'> {
2658
+ }
2659
+ declare class XScrollBar extends ScrollBar {
2660
+ constructor(properties?: Partial<XScrollBarProperties>, children?: Node[]);
2661
+ }
2662
+
2663
+ interface YScrollBarProperties extends Omit<ScrollBarProperties, 'direction'> {
2664
+ }
2665
+ declare class YScrollBar extends ScrollBar {
2666
+ constructor(properties?: Partial<YScrollBarProperties>, children?: Node[]);
2667
+ }
2668
+
2639
2669
  interface ScalerEventMap extends NodeEventMap {
2640
2670
  updateScale: (scale: number) => void;
2641
2671
  }
2642
2672
  interface ScalerProperties extends NodeProperties {
2673
+ value: number;
2674
+ minValue: number;
2675
+ maxValue: number;
2643
2676
  }
2644
2677
  interface Scaler {
2645
2678
  on: (<K extends keyof ScalerEventMap>(type: K, listener: ScalerEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
@@ -2647,9 +2680,9 @@ interface Scaler {
2647
2680
  emit: (<K extends keyof ScalerEventMap>(type: K, ...args: Parameters<ScalerEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
2648
2681
  }
2649
2682
  declare class Scaler extends Node {
2650
- scale: number;
2651
- min: number;
2652
- max: number;
2683
+ value: number;
2684
+ minValue: number;
2685
+ maxValue: number;
2653
2686
  get target(): CanvasItem | undefined;
2654
2687
  constructor(properties?: Partial<ScalerProperties>, children?: Node[]);
2655
2688
  protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
@@ -2725,8 +2758,8 @@ declare class CanvasEditor extends Control {
2725
2758
  selectionRect: Node2D;
2726
2759
  selector: Node2D;
2727
2760
  scaler: Scaler;
2728
- xScrollBar: ScrollBar;
2729
- yScrollBar: ScrollBar;
2761
+ xScrollBar: XScrollBar;
2762
+ yScrollBar: YScrollBar;
2730
2763
  drawboard: Node2D;
2731
2764
  ruler: Ruler;
2732
2765
  protected _pointerStart?: CanvasItemStyle;
@@ -2736,6 +2769,7 @@ declare class CanvasEditor extends Control {
2736
2769
  };
2737
2770
  selected?: CanvasItem;
2738
2771
  constructor();
2772
+ protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2739
2773
  protected _guiInput(event: InputEvent, key: InputEventKey): void;
2740
2774
  protected _onPointerdown(e: PointerInputEvent): void;
2741
2775
  protected _onPointermove(e: PointerInputEvent): void;
@@ -2810,4 +2844,4 @@ interface RenderOptions {
2810
2844
  }
2811
2845
  declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
2812
2846
 
2813
- export { Animation, type AnimationMode, type AnimationProperties, type AssetHandler, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, type AudioWaveformProperties, type Batchable2D, BlurEffect, type CanvasBatchable, CanvasContext, CanvasEditor, CanvasItem, type CanvasItemEventMap, type CanvasItemProperties, CanvasItemStyle, type CanvasItemStyleFilter, type CanvasItemStyleFilterKey, type CanvasItemStyleProperties, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, type ColorFilterEffectProperties, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, type ColorValue, Control, type ControlEventMap, type ControlProperties, CoreObject, type CoreObjectEventMap, type CssFunction, type CssFunctionArg, type Cursor, DEG_TO_RAD, DEVICE_PIXEL_RATIO, type Easing, Effect, type EffectContext, EffectMaterial, type EffectMode, type EffectOptions, EmbossEffect, Engine, type EngineOptions, EventEmitter, type EventListener, type EventListenerOptions, type EventListenerValue, type FilledGraphics, FontLoader, Geometry, type GeometryOptions, GifLoader, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, type IAudioContext, type IAudioNode, IN_BROWSER, type IPlayOptions, Image2D, type Image2DProperties, Image2DResource, type ImageFrame, ImageTexture, type ImageTextureOptions, IndexBuffer, type IndexBufferOptions, Input, InputEvent, type InputEventKey, type InputEventMap, type InternalMode, JsonLoader, KawaseEffect, type Keyframe, LeftEraseEffect, Loader, Lottie2D, type Lottie2DProperties, LottieLoader, MainLoop, type MainLoopEventMap, type MaskColor, type MaskData, MaskEffect, type MaskEffectOptions, type MaskObject, type MaskRect, type Maskable, Material, type MaterialOptions, Matrix, Matrix2, Matrix3, Matrix4, type MatrixLike, type MatrixOperateOutput, MouseInputEvent, Node, Node2D, type Node2DProperties, type NodeEventMap, type NodeProperties, type NormalizedKeyframe, PI, PI_2, PixelateEffect, PixelsTexture, type PlatformAudio, type PlatformSound, type PointerEvents, PointerInputEvent, type ProcessMode, Projection2D, type PropertyDeclaration, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, RawWeakMap, Rect2, RefCounted, type RefCountedEventMap, type RenderMode, type RenderOptions, type Renderable, Renderer, Resource, type ResourceEventMap, Ruler, type RulerProperties, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, type ScalerEventMap, type ScalerProperties, SceneTree, type SceneTreeEventMap, ScrollBar, type ScrollBarProperties, ShadowEffect, type StrokedGraphics, Text2D, type Text2DProperties, TextLoader, Texture2D, type Texture2DFilterMode, type Texture2DPixelsSource, type Texture2DSource, type Texture2DWrapMode, TextureLoader, TextureRect2D, type TextureRect2DProperties, Ticker, TiltShiftEffect, Timeline, type TimelineEventMap, TimelineNode, type TimelineNodeEventMap, type TimelineNodeProperties, type TimelineProperties, type TimingFunctions, Transform2D, type Transform2DObject, TwistEffect, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, type VectorLike, type VectorOperateOutput, VertexAttribute, type VertexAttributeOptions, VertexBuffer, type VertexBufferOptions, Video2D, type Video2DProperties, VideoLoader, VideoTexture, type VideoTextureOptions, type VideoTextureSource, Viewport, type ViewportEventMap, type ViewportFramebuffer, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, type WebGLBufferMeta, WebGLBufferModule, type WebGLBufferOptions, type WebGLBufferTarget, type WebGLBufferUsage, type WebGLDrawMode, type WebGLDrawOptions, type WebGLExtensions, type WebGLFramebufferMeta, WebGLFramebufferModule, type WebGLFramebufferOptions, WebGLMaskModule, WebGLModule, type WebGLProgramMeta, WebGLProgramModule, type WebGLProgramOptions, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, type WebGLTarget, type WebGLTextureFilterMode, type WebGLTextureLocation, type WebGLTextureMeta, WebGLTextureModule, type WebGLTextureOptions, type WebGLTextureSource, type WebGLTextureTarget, type WebGLTextureWrapMode, WebGLVertexArrayModule, type WebGLVertexArrayObjectMeta, type WebGLVertexArrayObjectOptions, type WebGLVertexAttrib, type WebGLVertexAttribType, type WebGLViewport, WebGLViewportModule, WebSound, WheelInputEvent, ZoomBlurEffect, assets, clamp, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
2847
+ export { Animation, type AnimationMode, type AnimationProperties, type AssetHandler, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, type AudioWaveformProperties, type Batchable2D, BlurEffect, type CanvasBatchable, CanvasContext, CanvasEditor, CanvasItem, type CanvasItemEventMap, type CanvasItemProperties, CanvasItemStyle, type CanvasItemStyleFilter, type CanvasItemStyleFilterKey, type CanvasItemStyleProperties, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, type ColorFilterEffectProperties, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, type ColorValue, Control, type ControlEventMap, type ControlProperties, CoreObject, type CoreObjectEventMap, type CssFunction, type CssFunctionArg, type Cursor, DEG_TO_RAD, DEVICE_PIXEL_RATIO, type Easing, Effect, type EffectContext, EffectMaterial, type EffectMode, type EffectProperties, EmbossEffect, Engine, type EngineOptions, EventEmitter, type EventListener, type EventListenerOptions, type EventListenerValue, type FilledGraphics, FontLoader, Geometry, type GeometryOptions, GifLoader, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, type IAudioContext, type IAudioNode, IN_BROWSER, type IPlayOptions, Image2D, type Image2DProperties, Image2DResource, type ImageFrame, ImageTexture, type ImageTextureOptions, IndexBuffer, type IndexBufferOptions, Input, InputEvent, type InputEventKey, type InputEventMap, type InternalMode, JsonLoader, KawaseEffect, type Keyframe, LeftEraseEffect, Loader, Lottie2D, type Lottie2DProperties, LottieLoader, MainLoop, type MainLoopEventMap, type MaskColor, type MaskData, MaskEffect, type MaskEffectProperties, type MaskObject, type MaskRect, type Maskable, Material, type MaterialOptions, Matrix, Matrix2, Matrix3, Matrix4, type MatrixLike, type MatrixOperateOutput, MouseInputEvent, Node, Node2D, type Node2DProperties, type NodeEventMap, type NodeProperties, type NormalizedKeyframe, PI, PI_2, PixelateEffect, PixelsTexture, type PlatformAudio, type PlatformSound, type PointerEvents, PointerInputEvent, type ProcessMode, Projection2D, type PropertyDeclaration, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, type RangeProperties, RawWeakMap, Rect2, RefCounted, type RefCountedEventMap, type RenderMode, type RenderOptions, type Renderable, Renderer, Resource, type ResourceEventMap, Ruler, type RulerProperties, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, type ScalerEventMap, type ScalerProperties, SceneTree, type SceneTreeEventMap, ScrollBar, type ScrollBarProperties, ShadowEffect, type StrokedGraphics, Text2D, type Text2DProperties, TextLoader, Texture2D, type Texture2DFilterMode, type Texture2DPixelsSource, type Texture2DSource, type Texture2DWrapMode, TextureLoader, TextureRect2D, type TextureRect2DProperties, Ticker, TiltShiftEffect, Timeline, type TimelineEventMap, TimelineNode, type TimelineNodeEventMap, type TimelineNodeProperties, type TimelineProperties, type TimingFunctions, Transform2D, type Transform2DObject, TwistEffect, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, type VectorLike, type VectorOperateOutput, VertexAttribute, type VertexAttributeOptions, VertexBuffer, type VertexBufferOptions, Video2D, type Video2DProperties, VideoLoader, VideoTexture, type VideoTextureOptions, type VideoTextureSource, Viewport, type ViewportEventMap, type ViewportFramebuffer, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, type WebGLBufferMeta, WebGLBufferModule, type WebGLBufferOptions, type WebGLBufferTarget, type WebGLBufferUsage, type WebGLDrawMode, type WebGLDrawOptions, type WebGLExtensions, type WebGLFramebufferMeta, WebGLFramebufferModule, type WebGLFramebufferOptions, WebGLMaskModule, WebGLModule, type WebGLProgramMeta, WebGLProgramModule, type WebGLProgramOptions, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, type WebGLTarget, type WebGLTextureFilterMode, type WebGLTextureLocation, type WebGLTextureMeta, WebGLTextureModule, type WebGLTextureOptions, type WebGLTextureSource, type WebGLTextureTarget, type WebGLTextureWrapMode, WebGLVertexArrayModule, type WebGLVertexArrayObjectMeta, type WebGLVertexArrayObjectOptions, type WebGLVertexAttrib, type WebGLVertexAttribType, type WebGLViewport, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, type XScrollBarProperties, YScrollBar, type YScrollBarProperties, ZoomBlurEffect, assets, clamp, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
package/dist/index.d.ts CHANGED
@@ -1682,8 +1682,8 @@ declare class Node extends CoreObject {
1682
1682
  get parent(): Node | undefined;
1683
1683
  set parent(parent: Node | undefined);
1684
1684
  hasParent(): boolean;
1685
- getParent(): Node | undefined;
1686
- setParent(parent: Node | undefined): this;
1685
+ getParent<T extends Node = Node>(): T | undefined;
1686
+ setParent<T extends Node = Node>(parent: T | undefined): this;
1687
1687
  /** Children */
1688
1688
  protected _children: Node[];
1689
1689
  get siblingIndex(): number;
@@ -1776,7 +1776,6 @@ declare class TimelineNode extends Node {
1776
1776
  }
1777
1777
 
1778
1778
  interface CanvasItemProperties extends TimelineNodeProperties {
1779
- visible: boolean;
1780
1779
  style: Partial<CanvasItemStyleProperties>;
1781
1780
  modulate: ColorValue;
1782
1781
  blendMode: WebGLBlendMode;
@@ -1791,7 +1790,6 @@ interface CanvasItem {
1791
1790
  emit: (<K extends keyof CanvasItemEventMap>(type: K, ...args: Parameters<CanvasItemEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
1792
1791
  }
1793
1792
  declare class CanvasItem extends TimelineNode {
1794
- visible: boolean;
1795
1793
  modulate?: ColorValue;
1796
1794
  blendMode?: WebGLBlendMode;
1797
1795
  protected _style: CanvasItemStyle;
@@ -1799,10 +1797,11 @@ declare class CanvasItem extends TimelineNode {
1799
1797
  set style(style: CanvasItemStyle);
1800
1798
  /** @internal */
1801
1799
  opacity: number;
1800
+ visible: boolean;
1802
1801
  protected _parentOpacity?: number;
1802
+ protected _parentVisible?: boolean;
1803
1803
  protected _modulate: Color;
1804
1804
  protected _backgroundImage?: Texture2D;
1805
- _computedVisible: boolean;
1806
1805
  context: CanvasContext;
1807
1806
  protected _resetContext: boolean;
1808
1807
  protected _redrawing: boolean;
@@ -1818,6 +1817,7 @@ declare class CanvasItem extends TimelineNode {
1818
1817
  protected _updateBackgroundColor(): void;
1819
1818
  protected _updateBackgroundImage(): Promise<void>;
1820
1819
  protected _updateOpacity(): void;
1820
+ protected _updateCurrentTime(force?: boolean): void;
1821
1821
  protected _updateVisible(): void;
1822
1822
  show(): void;
1823
1823
  hide(): void;
@@ -2020,8 +2020,6 @@ interface NormalizedKeyframe {
2020
2020
  type AnimationMode = 'parent' | 'sibling';
2021
2021
  interface AnimationProperties extends TimelineNodeProperties {
2022
2022
  animationMode: AnimationMode;
2023
- startTime: number;
2024
- duration: number;
2025
2023
  loop: boolean;
2026
2024
  keyframes: Keyframe[];
2027
2025
  }
@@ -2369,11 +2367,11 @@ declare class AudioWaveform extends Node2D {
2369
2367
  }
2370
2368
 
2371
2369
  type EffectMode = 'before' | 'parent' | 'children' | 'transition';
2372
- interface EffectOptions extends TimelineNodeProperties {
2373
- mode?: EffectMode;
2374
- glsl?: string;
2375
- glslSrc?: string;
2376
- material?: Material;
2370
+ interface EffectProperties extends TimelineNodeProperties {
2371
+ mode: EffectMode;
2372
+ glsl: string;
2373
+ glslSrc: string;
2374
+ material: Material;
2377
2375
  }
2378
2376
  interface EffectContext {
2379
2377
  redraw?: boolean;
@@ -2399,7 +2397,7 @@ declare class Effect extends TimelineNode {
2399
2397
  /** Temporary nodes for transition */
2400
2398
  protected _previousSibling?: Node;
2401
2399
  protected _nextSibling?: Node;
2402
- constructor(options?: EffectOptions);
2400
+ constructor(properties?: Partial<EffectProperties>, children?: Node[]);
2403
2401
  protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2404
2402
  protected _treeEnter(tree: SceneTree): void;
2405
2403
  protected _treeExit(oldTree: SceneTree): void;
@@ -2523,13 +2521,13 @@ declare class LeftEraseEffect extends Effect {
2523
2521
  apply(renderer: WebGLRenderer): void;
2524
2522
  }
2525
2523
 
2526
- interface MaskEffectOptions extends EffectOptions {
2524
+ interface MaskEffectProperties extends EffectProperties {
2527
2525
  src?: string;
2528
2526
  }
2529
2527
  declare class MaskEffect extends Effect {
2530
2528
  texture?: Texture2D<ImageBitmap>;
2531
2529
  src: string;
2532
- constructor(options?: MaskEffectOptions);
2530
+ constructor(properties?: Partial<MaskEffectProperties>, children?: Node[]);
2533
2531
  load(): Promise<void>;
2534
2532
  protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2535
2533
  apply(renderer: WebGLRenderer, source: Viewport, context: EffectContext): void;
@@ -2595,6 +2593,27 @@ declare class Control extends CanvasItem implements Rectangulable {
2595
2593
  getRect(): Rect2;
2596
2594
  }
2597
2595
 
2596
+ interface RangeProperties extends ControlProperties {
2597
+ allowGreater: boolean;
2598
+ allowLesser: boolean;
2599
+ page: number;
2600
+ minValue: number;
2601
+ maxValue: number;
2602
+ step: number;
2603
+ value: number;
2604
+ }
2605
+ declare class Range extends Control {
2606
+ allowGreater: boolean;
2607
+ allowLesser: boolean;
2608
+ page: number;
2609
+ minValue: number;
2610
+ maxValue: number;
2611
+ step: number;
2612
+ value: number;
2613
+ constructor(properties?: Partial<RangeProperties>, children?: Node[]);
2614
+ protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2615
+ }
2616
+
2598
2617
  interface RulerProperties extends ControlProperties {
2599
2618
  offsetX: number;
2600
2619
  offsetY: number;
@@ -2624,22 +2643,36 @@ declare class Ruler extends Control {
2624
2643
  protected _draw(): void;
2625
2644
  }
2626
2645
 
2627
- interface ScrollBarProperties extends ControlProperties {
2646
+ interface ScrollBarProperties extends RangeProperties {
2628
2647
  direction: 'vertical' | 'horizontal';
2629
2648
  }
2630
- declare class ScrollBar extends Control {
2649
+ declare class ScrollBar extends Range {
2631
2650
  direction: 'vertical' | 'horizontal';
2632
- padding: number;
2633
- constructor(properties: Partial<ScrollBarProperties>, children?: Node[]);
2634
- protected _parentUpdateRect(): void;
2651
+ constructor(properties?: Partial<ScrollBarProperties>, children?: Node[]);
2652
+ protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2635
2653
  protected _guiInput(event: InputEvent, key: InputEventKey): void;
2636
2654
  protected _draw(): void;
2637
2655
  }
2638
2656
 
2657
+ interface XScrollBarProperties extends Omit<ScrollBarProperties, 'direction'> {
2658
+ }
2659
+ declare class XScrollBar extends ScrollBar {
2660
+ constructor(properties?: Partial<XScrollBarProperties>, children?: Node[]);
2661
+ }
2662
+
2663
+ interface YScrollBarProperties extends Omit<ScrollBarProperties, 'direction'> {
2664
+ }
2665
+ declare class YScrollBar extends ScrollBar {
2666
+ constructor(properties?: Partial<YScrollBarProperties>, children?: Node[]);
2667
+ }
2668
+
2639
2669
  interface ScalerEventMap extends NodeEventMap {
2640
2670
  updateScale: (scale: number) => void;
2641
2671
  }
2642
2672
  interface ScalerProperties extends NodeProperties {
2673
+ value: number;
2674
+ minValue: number;
2675
+ maxValue: number;
2643
2676
  }
2644
2677
  interface Scaler {
2645
2678
  on: (<K extends keyof ScalerEventMap>(type: K, listener: ScalerEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
@@ -2647,9 +2680,9 @@ interface Scaler {
2647
2680
  emit: (<K extends keyof ScalerEventMap>(type: K, ...args: Parameters<ScalerEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
2648
2681
  }
2649
2682
  declare class Scaler extends Node {
2650
- scale: number;
2651
- min: number;
2652
- max: number;
2683
+ value: number;
2684
+ minValue: number;
2685
+ maxValue: number;
2653
2686
  get target(): CanvasItem | undefined;
2654
2687
  constructor(properties?: Partial<ScalerProperties>, children?: Node[]);
2655
2688
  protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
@@ -2725,8 +2758,8 @@ declare class CanvasEditor extends Control {
2725
2758
  selectionRect: Node2D;
2726
2759
  selector: Node2D;
2727
2760
  scaler: Scaler;
2728
- xScrollBar: ScrollBar;
2729
- yScrollBar: ScrollBar;
2761
+ xScrollBar: XScrollBar;
2762
+ yScrollBar: YScrollBar;
2730
2763
  drawboard: Node2D;
2731
2764
  ruler: Ruler;
2732
2765
  protected _pointerStart?: CanvasItemStyle;
@@ -2736,6 +2769,7 @@ declare class CanvasEditor extends Control {
2736
2769
  };
2737
2770
  selected?: CanvasItem;
2738
2771
  constructor();
2772
+ protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
2739
2773
  protected _guiInput(event: InputEvent, key: InputEventKey): void;
2740
2774
  protected _onPointerdown(e: PointerInputEvent): void;
2741
2775
  protected _onPointermove(e: PointerInputEvent): void;
@@ -2810,4 +2844,4 @@ interface RenderOptions {
2810
2844
  }
2811
2845
  declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
2812
2846
 
2813
- export { Animation, type AnimationMode, type AnimationProperties, type AssetHandler, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, type AudioWaveformProperties, type Batchable2D, BlurEffect, type CanvasBatchable, CanvasContext, CanvasEditor, CanvasItem, type CanvasItemEventMap, type CanvasItemProperties, CanvasItemStyle, type CanvasItemStyleFilter, type CanvasItemStyleFilterKey, type CanvasItemStyleProperties, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, type ColorFilterEffectProperties, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, type ColorValue, Control, type ControlEventMap, type ControlProperties, CoreObject, type CoreObjectEventMap, type CssFunction, type CssFunctionArg, type Cursor, DEG_TO_RAD, DEVICE_PIXEL_RATIO, type Easing, Effect, type EffectContext, EffectMaterial, type EffectMode, type EffectOptions, EmbossEffect, Engine, type EngineOptions, EventEmitter, type EventListener, type EventListenerOptions, type EventListenerValue, type FilledGraphics, FontLoader, Geometry, type GeometryOptions, GifLoader, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, type IAudioContext, type IAudioNode, IN_BROWSER, type IPlayOptions, Image2D, type Image2DProperties, Image2DResource, type ImageFrame, ImageTexture, type ImageTextureOptions, IndexBuffer, type IndexBufferOptions, Input, InputEvent, type InputEventKey, type InputEventMap, type InternalMode, JsonLoader, KawaseEffect, type Keyframe, LeftEraseEffect, Loader, Lottie2D, type Lottie2DProperties, LottieLoader, MainLoop, type MainLoopEventMap, type MaskColor, type MaskData, MaskEffect, type MaskEffectOptions, type MaskObject, type MaskRect, type Maskable, Material, type MaterialOptions, Matrix, Matrix2, Matrix3, Matrix4, type MatrixLike, type MatrixOperateOutput, MouseInputEvent, Node, Node2D, type Node2DProperties, type NodeEventMap, type NodeProperties, type NormalizedKeyframe, PI, PI_2, PixelateEffect, PixelsTexture, type PlatformAudio, type PlatformSound, type PointerEvents, PointerInputEvent, type ProcessMode, Projection2D, type PropertyDeclaration, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, RawWeakMap, Rect2, RefCounted, type RefCountedEventMap, type RenderMode, type RenderOptions, type Renderable, Renderer, Resource, type ResourceEventMap, Ruler, type RulerProperties, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, type ScalerEventMap, type ScalerProperties, SceneTree, type SceneTreeEventMap, ScrollBar, type ScrollBarProperties, ShadowEffect, type StrokedGraphics, Text2D, type Text2DProperties, TextLoader, Texture2D, type Texture2DFilterMode, type Texture2DPixelsSource, type Texture2DSource, type Texture2DWrapMode, TextureLoader, TextureRect2D, type TextureRect2DProperties, Ticker, TiltShiftEffect, Timeline, type TimelineEventMap, TimelineNode, type TimelineNodeEventMap, type TimelineNodeProperties, type TimelineProperties, type TimingFunctions, Transform2D, type Transform2DObject, TwistEffect, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, type VectorLike, type VectorOperateOutput, VertexAttribute, type VertexAttributeOptions, VertexBuffer, type VertexBufferOptions, Video2D, type Video2DProperties, VideoLoader, VideoTexture, type VideoTextureOptions, type VideoTextureSource, Viewport, type ViewportEventMap, type ViewportFramebuffer, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, type WebGLBufferMeta, WebGLBufferModule, type WebGLBufferOptions, type WebGLBufferTarget, type WebGLBufferUsage, type WebGLDrawMode, type WebGLDrawOptions, type WebGLExtensions, type WebGLFramebufferMeta, WebGLFramebufferModule, type WebGLFramebufferOptions, WebGLMaskModule, WebGLModule, type WebGLProgramMeta, WebGLProgramModule, type WebGLProgramOptions, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, type WebGLTarget, type WebGLTextureFilterMode, type WebGLTextureLocation, type WebGLTextureMeta, WebGLTextureModule, type WebGLTextureOptions, type WebGLTextureSource, type WebGLTextureTarget, type WebGLTextureWrapMode, WebGLVertexArrayModule, type WebGLVertexArrayObjectMeta, type WebGLVertexArrayObjectOptions, type WebGLVertexAttrib, type WebGLVertexAttribType, type WebGLViewport, WebGLViewportModule, WebSound, WheelInputEvent, ZoomBlurEffect, assets, clamp, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
2847
+ export { Animation, type AnimationMode, type AnimationProperties, type AssetHandler, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, type AudioWaveformProperties, type Batchable2D, BlurEffect, type CanvasBatchable, CanvasContext, CanvasEditor, CanvasItem, type CanvasItemEventMap, type CanvasItemProperties, CanvasItemStyle, type CanvasItemStyleFilter, type CanvasItemStyleFilterKey, type CanvasItemStyleProperties, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, type ColorFilterEffectProperties, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, type ColorValue, Control, type ControlEventMap, type ControlProperties, CoreObject, type CoreObjectEventMap, type CssFunction, type CssFunctionArg, type Cursor, DEG_TO_RAD, DEVICE_PIXEL_RATIO, type Easing, Effect, type EffectContext, EffectMaterial, type EffectMode, type EffectProperties, EmbossEffect, Engine, type EngineOptions, EventEmitter, type EventListener, type EventListenerOptions, type EventListenerValue, type FilledGraphics, FontLoader, Geometry, type GeometryOptions, GifLoader, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, type IAudioContext, type IAudioNode, IN_BROWSER, type IPlayOptions, Image2D, type Image2DProperties, Image2DResource, type ImageFrame, ImageTexture, type ImageTextureOptions, IndexBuffer, type IndexBufferOptions, Input, InputEvent, type InputEventKey, type InputEventMap, type InternalMode, JsonLoader, KawaseEffect, type Keyframe, LeftEraseEffect, Loader, Lottie2D, type Lottie2DProperties, LottieLoader, MainLoop, type MainLoopEventMap, type MaskColor, type MaskData, MaskEffect, type MaskEffectProperties, type MaskObject, type MaskRect, type Maskable, Material, type MaterialOptions, Matrix, Matrix2, Matrix3, Matrix4, type MatrixLike, type MatrixOperateOutput, MouseInputEvent, Node, Node2D, type Node2DProperties, type NodeEventMap, type NodeProperties, type NormalizedKeyframe, PI, PI_2, PixelateEffect, PixelsTexture, type PlatformAudio, type PlatformSound, type PointerEvents, PointerInputEvent, type ProcessMode, Projection2D, type PropertyDeclaration, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, type RangeProperties, RawWeakMap, Rect2, RefCounted, type RefCountedEventMap, type RenderMode, type RenderOptions, type Renderable, Renderer, Resource, type ResourceEventMap, Ruler, type RulerProperties, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, type ScalerEventMap, type ScalerProperties, SceneTree, type SceneTreeEventMap, ScrollBar, type ScrollBarProperties, ShadowEffect, type StrokedGraphics, Text2D, type Text2DProperties, TextLoader, Texture2D, type Texture2DFilterMode, type Texture2DPixelsSource, type Texture2DSource, type Texture2DWrapMode, TextureLoader, TextureRect2D, type TextureRect2DProperties, Ticker, TiltShiftEffect, Timeline, type TimelineEventMap, TimelineNode, type TimelineNodeEventMap, type TimelineNodeProperties, type TimelineProperties, type TimingFunctions, Transform2D, type Transform2DObject, TwistEffect, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, type VectorLike, type VectorOperateOutput, VertexAttribute, type VertexAttributeOptions, VertexBuffer, type VertexBufferOptions, Video2D, type Video2DProperties, VideoLoader, VideoTexture, type VideoTextureOptions, type VideoTextureSource, Viewport, type ViewportEventMap, type ViewportFramebuffer, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, type WebGLBufferMeta, WebGLBufferModule, type WebGLBufferOptions, type WebGLBufferTarget, type WebGLBufferUsage, type WebGLDrawMode, type WebGLDrawOptions, type WebGLExtensions, type WebGLFramebufferMeta, WebGLFramebufferModule, type WebGLFramebufferOptions, WebGLMaskModule, WebGLModule, type WebGLProgramMeta, WebGLProgramModule, type WebGLProgramOptions, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, type WebGLTarget, type WebGLTextureFilterMode, type WebGLTextureLocation, type WebGLTextureMeta, WebGLTextureModule, type WebGLTextureOptions, type WebGLTextureSource, type WebGLTextureTarget, type WebGLTextureWrapMode, WebGLVertexArrayModule, type WebGLVertexArrayObjectMeta, type WebGLVertexArrayObjectOptions, type WebGLVertexAttrib, type WebGLVertexAttribType, type WebGLViewport, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, type XScrollBarProperties, YScrollBar, type YScrollBarProperties, ZoomBlurEffect, assets, clamp, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };