modern-canvas 0.2.3 → 0.2.5
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/README.md +49 -2
- package/dist/index.cjs +1000 -969
- package/dist/index.d.cts +91 -83
- package/dist/index.d.mts +91 -83
- package/dist/index.d.ts +91 -83
- package/dist/index.js +155 -155
- package/dist/index.mjs +1001 -970
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1637,9 +1637,9 @@ interface NodeEventMap extends CoreObjectEventMap, InputEventMap {
|
|
|
1637
1637
|
removeChild: (child: Node, index: number) => void;
|
|
1638
1638
|
moveChild: (child: Node, newIndex: number, oldIndex: number) => void;
|
|
1639
1639
|
}
|
|
1640
|
-
type InternalMode = 'default' | 'front' | 'back';
|
|
1641
1640
|
type ProcessMode = 'inherit' | 'pausable' | 'when_paused' | 'always' | 'disabled';
|
|
1642
1641
|
type RenderMode = 'inherit' | 'always' | 'disabled';
|
|
1642
|
+
type InternalMode = 'default' | 'front' | 'back';
|
|
1643
1643
|
interface NodeProperties {
|
|
1644
1644
|
name: string;
|
|
1645
1645
|
processMode: ProcessMode;
|
|
@@ -1840,6 +1840,60 @@ declare class CanvasItem extends TimelineNode {
|
|
|
1840
1840
|
toJSON(): Record<string, any>;
|
|
1841
1841
|
}
|
|
1842
1842
|
|
|
1843
|
+
type EffectMode = 'before' | 'parent' | 'children' | 'transition';
|
|
1844
|
+
interface EffectProperties extends TimelineNodeProperties {
|
|
1845
|
+
effectMode: EffectMode;
|
|
1846
|
+
glsl: string;
|
|
1847
|
+
glslSrc: string;
|
|
1848
|
+
material: Material;
|
|
1849
|
+
}
|
|
1850
|
+
interface EffectContext {
|
|
1851
|
+
redraw?: boolean;
|
|
1852
|
+
/** parent redraw */
|
|
1853
|
+
target?: Node;
|
|
1854
|
+
targetArea?: [number, number, number, number];
|
|
1855
|
+
/** transition */
|
|
1856
|
+
from?: Viewport;
|
|
1857
|
+
to?: Viewport;
|
|
1858
|
+
}
|
|
1859
|
+
declare class Effect extends TimelineNode {
|
|
1860
|
+
material?: Material;
|
|
1861
|
+
effectMode?: EffectMode;
|
|
1862
|
+
glsl: string;
|
|
1863
|
+
glslSrc: string;
|
|
1864
|
+
protected get _effectMode(): EffectMode;
|
|
1865
|
+
/** Viewports */
|
|
1866
|
+
readonly viewport1: Viewport;
|
|
1867
|
+
readonly viewport2: Viewport;
|
|
1868
|
+
/** Render call */
|
|
1869
|
+
protected _renderId: number;
|
|
1870
|
+
protected _renderViewport?: Viewport;
|
|
1871
|
+
/** Temporary nodes for transition */
|
|
1872
|
+
protected _previousSibling?: Node;
|
|
1873
|
+
protected _nextSibling?: Node;
|
|
1874
|
+
constructor(properties?: Partial<EffectProperties>, children?: Node[]);
|
|
1875
|
+
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1876
|
+
protected _treeEnter(tree: SceneTree): void;
|
|
1877
|
+
protected _treeExit(oldTree: SceneTree): void;
|
|
1878
|
+
protected _onProcessing(): void;
|
|
1879
|
+
protected _onNodeProcessed(node: Node): void;
|
|
1880
|
+
protected _processParent(): void;
|
|
1881
|
+
protected _processChildren(): void;
|
|
1882
|
+
_onProcess(delta?: number): void;
|
|
1883
|
+
protected _renderBefore(renderer: WebGLRenderer): void;
|
|
1884
|
+
protected _renderTransition(renderer: WebGLRenderer): void;
|
|
1885
|
+
protected _renderParentOrChildren(renderer: WebGLRenderer): void;
|
|
1886
|
+
protected _parseTargetArea(): number[] | undefined;
|
|
1887
|
+
protected _render(renderer: WebGLRenderer): void;
|
|
1888
|
+
apply(renderer: WebGLRenderer, viewport: Viewport, context?: EffectContext): void;
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
interface TransitionProperties extends Omit<EffectProperties, 'effectMode' | 'processMode'> {
|
|
1892
|
+
}
|
|
1893
|
+
declare class Transition extends Effect {
|
|
1894
|
+
constructor(properties?: Partial<TransitionProperties>, children?: Node[]);
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1843
1897
|
interface Node2DProperties extends CanvasItemProperties {
|
|
1844
1898
|
}
|
|
1845
1899
|
declare class Node2D extends CanvasItem {
|
|
@@ -2014,14 +2068,14 @@ interface NormalizedKeyframe {
|
|
|
2014
2068
|
offset: number;
|
|
2015
2069
|
props: Record<string, any>;
|
|
2016
2070
|
}
|
|
2017
|
-
type
|
|
2018
|
-
interface AnimationProperties extends TimelineNodeProperties {
|
|
2019
|
-
|
|
2071
|
+
type AnimationEffectMode = 'parent' | 'sibling';
|
|
2072
|
+
interface AnimationProperties extends Omit<TimelineNodeProperties, 'renderMode' | 'processMode'> {
|
|
2073
|
+
effectMode: AnimationEffectMode;
|
|
2020
2074
|
loop: boolean;
|
|
2021
2075
|
keyframes: Keyframe[];
|
|
2022
2076
|
}
|
|
2023
2077
|
declare class Animation extends TimelineNode {
|
|
2024
|
-
|
|
2078
|
+
effectMode: AnimationEffectMode;
|
|
2025
2079
|
loop: boolean;
|
|
2026
2080
|
keyframes: Keyframe[];
|
|
2027
2081
|
easing?: Easing;
|
|
@@ -2032,6 +2086,8 @@ declare class Animation extends TimelineNode {
|
|
|
2032
2086
|
constructor(properties?: Partial<AnimationProperties>, children?: Node[]);
|
|
2033
2087
|
protected _treeEnter(tree: SceneTree): void;
|
|
2034
2088
|
protected _treeExit(oldTree: SceneTree): void;
|
|
2089
|
+
protected _onProcess(): void;
|
|
2090
|
+
protected _process(): void;
|
|
2035
2091
|
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2036
2092
|
protected _getTargets(): any[];
|
|
2037
2093
|
protected _updateKeyframes(): void;
|
|
@@ -2363,54 +2419,6 @@ declare class AudioWaveform extends Node2D {
|
|
|
2363
2419
|
protected _drawSrc(): void;
|
|
2364
2420
|
}
|
|
2365
2421
|
|
|
2366
|
-
type EffectMode = 'before' | 'parent' | 'children' | 'transition';
|
|
2367
|
-
interface EffectProperties extends TimelineNodeProperties {
|
|
2368
|
-
mode: EffectMode;
|
|
2369
|
-
glsl: string;
|
|
2370
|
-
glslSrc: string;
|
|
2371
|
-
material: Material;
|
|
2372
|
-
}
|
|
2373
|
-
interface EffectContext {
|
|
2374
|
-
redraw?: boolean;
|
|
2375
|
-
/** parent redraw */
|
|
2376
|
-
target?: Node;
|
|
2377
|
-
targetArea?: [number, number, number, number];
|
|
2378
|
-
/** transition */
|
|
2379
|
-
from?: Viewport;
|
|
2380
|
-
to?: Viewport;
|
|
2381
|
-
}
|
|
2382
|
-
declare class Effect extends TimelineNode {
|
|
2383
|
-
material?: Material;
|
|
2384
|
-
mode?: EffectMode;
|
|
2385
|
-
glsl: string;
|
|
2386
|
-
glslSrc: string;
|
|
2387
|
-
protected get _mode(): EffectMode;
|
|
2388
|
-
/** Viewports */
|
|
2389
|
-
readonly viewport1: Viewport;
|
|
2390
|
-
readonly viewport2: Viewport;
|
|
2391
|
-
/** Render call */
|
|
2392
|
-
protected _renderId: number;
|
|
2393
|
-
protected _renderViewport?: Viewport;
|
|
2394
|
-
/** Temporary nodes for transition */
|
|
2395
|
-
protected _previousSibling?: Node;
|
|
2396
|
-
protected _nextSibling?: Node;
|
|
2397
|
-
constructor(properties?: Partial<EffectProperties>, children?: Node[]);
|
|
2398
|
-
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2399
|
-
protected _treeEnter(tree: SceneTree): void;
|
|
2400
|
-
protected _treeExit(oldTree: SceneTree): void;
|
|
2401
|
-
protected _onProcessing(): void;
|
|
2402
|
-
protected _onNodeProcessed(node: Node): void;
|
|
2403
|
-
protected _processParent(): void;
|
|
2404
|
-
protected _processChildren(): void;
|
|
2405
|
-
_onProcess(delta?: number): void;
|
|
2406
|
-
protected _renderBefore(renderer: WebGLRenderer): void;
|
|
2407
|
-
protected _renderTransition(renderer: WebGLRenderer): void;
|
|
2408
|
-
protected _renderParentOrChildren(renderer: WebGLRenderer): void;
|
|
2409
|
-
protected _parseTargetArea(): number[] | undefined;
|
|
2410
|
-
protected _render(renderer: WebGLRenderer): void;
|
|
2411
|
-
apply(renderer: WebGLRenderer, viewport: Viewport, context?: EffectContext): void;
|
|
2412
|
-
}
|
|
2413
|
-
|
|
2414
2422
|
declare class BlurEffect extends Effect {
|
|
2415
2423
|
static materialX: Material;
|
|
2416
2424
|
static materialY: Material;
|
|
@@ -2506,18 +2514,6 @@ declare class GodrayEffect extends Effect {
|
|
|
2506
2514
|
apply(renderer: WebGLRenderer, source: Viewport): void;
|
|
2507
2515
|
}
|
|
2508
2516
|
|
|
2509
|
-
declare class KawaseEffect extends Effect {
|
|
2510
|
-
static material: Material;
|
|
2511
|
-
blur: number;
|
|
2512
|
-
quality: number;
|
|
2513
|
-
apply(renderer: WebGLRenderer, target: Viewport): void;
|
|
2514
|
-
}
|
|
2515
|
-
|
|
2516
|
-
declare class LeftEraseEffect extends Effect {
|
|
2517
|
-
static material: Material;
|
|
2518
|
-
apply(renderer: WebGLRenderer): void;
|
|
2519
|
-
}
|
|
2520
|
-
|
|
2521
2517
|
interface MaskEffectProperties extends EffectProperties {
|
|
2522
2518
|
src?: string;
|
|
2523
2519
|
}
|
|
@@ -2545,28 +2541,12 @@ declare class ShadowEffect extends Effect {
|
|
|
2545
2541
|
apply(renderer: WebGLRenderer, source: Viewport): void;
|
|
2546
2542
|
}
|
|
2547
2543
|
|
|
2548
|
-
declare class TiltShiftEffect extends Effect {
|
|
2549
|
-
static material: Material;
|
|
2550
|
-
blur: number;
|
|
2551
|
-
gradientBlur: number;
|
|
2552
|
-
apply(renderer: WebGLRenderer, target: Viewport): void;
|
|
2553
|
-
}
|
|
2554
|
-
|
|
2555
|
-
declare class TwistEffect extends Effect {
|
|
2556
|
-
static material: Material;
|
|
2557
|
-
radius?: number;
|
|
2558
|
-
angle: number;
|
|
2559
|
-
padding: number;
|
|
2560
|
-
offset?: number;
|
|
2561
|
-
apply(renderer: WebGLRenderer, source: Viewport): void;
|
|
2562
|
-
}
|
|
2563
|
-
|
|
2564
2544
|
declare class ZoomBlurEffect extends Effect {
|
|
2565
|
-
static material: Material;
|
|
2566
2545
|
center?: number[];
|
|
2567
2546
|
innerRadius: number;
|
|
2568
2547
|
radius: number;
|
|
2569
2548
|
strength: number;
|
|
2549
|
+
static material: Material;
|
|
2570
2550
|
apply(renderer: WebGLRenderer, source: Viewport): void;
|
|
2571
2551
|
}
|
|
2572
2552
|
|
|
@@ -2688,6 +2668,34 @@ declare class Scaler extends Node {
|
|
|
2688
2668
|
protected _input(event: InputEvent, key: InputEventKey): void;
|
|
2689
2669
|
}
|
|
2690
2670
|
|
|
2671
|
+
declare class KawaseTransition extends Transition {
|
|
2672
|
+
blur: number;
|
|
2673
|
+
quality: number;
|
|
2674
|
+
static material: Material;
|
|
2675
|
+
apply(renderer: WebGLRenderer, target: Viewport): void;
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2678
|
+
declare class LeftEraseTransition extends Transition {
|
|
2679
|
+
static material: Material;
|
|
2680
|
+
apply(renderer: WebGLRenderer): void;
|
|
2681
|
+
}
|
|
2682
|
+
|
|
2683
|
+
declare class TiltShiftTransition extends Transition {
|
|
2684
|
+
blur: number;
|
|
2685
|
+
gradientBlur: number;
|
|
2686
|
+
static material: Material;
|
|
2687
|
+
apply(renderer: WebGLRenderer, target: Viewport): void;
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
declare class TwistTransition extends Transition {
|
|
2691
|
+
radius?: number;
|
|
2692
|
+
angle: number;
|
|
2693
|
+
padding: number;
|
|
2694
|
+
offset?: number;
|
|
2695
|
+
static material: Material;
|
|
2696
|
+
apply(renderer: WebGLRenderer, source: Viewport): void;
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2691
2699
|
declare class GifLoader extends Loader {
|
|
2692
2700
|
load: (url: string) => Promise<Image2DResource>;
|
|
2693
2701
|
install(assets: Assets): this;
|
|
@@ -2841,4 +2849,4 @@ interface RenderOptions {
|
|
|
2841
2849
|
}
|
|
2842
2850
|
declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
|
|
2843
2851
|
|
|
2844
|
-
export { Animation, type
|
|
2852
|
+
export { Animation, type AnimationEffectMode, 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, KawaseTransition, type Keyframe, LeftEraseTransition, Loader, Lottie2D, type Lottie2DProperties, LottieLoader, MainLoop, type MainLoopEventMap, type MaskColor, type MaskData, MaskEffect, type MaskEffectProperties, type MaskObject, type MaskRect, type Maskable, Material, type MaterialOptions, Matrix, Matrix2, Matrix3, Matrix4, type MatrixLike, type MatrixOperateOutput, MouseInputEvent, Node, Node2D, type Node2DProperties, type NodeEventMap, type NodeProperties, type NormalizedKeyframe, PI, PI_2, PixelateEffect, PixelsTexture, type PlatformAudio, type PlatformSound, type PointerEvents, PointerInputEvent, type ProcessMode, Projection2D, type PropertyDeclaration, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, type RangeProperties, RawWeakMap, Rect2, RefCounted, type RefCountedEventMap, type RenderMode, type RenderOptions, type Renderable, Renderer, Resource, type ResourceEventMap, Ruler, type RulerProperties, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, type ScalerEventMap, type ScalerProperties, SceneTree, type SceneTreeEventMap, ScrollBar, type ScrollBarProperties, ShadowEffect, type StrokedGraphics, Text2D, type Text2DProperties, TextLoader, Texture2D, type Texture2DFilterMode, type Texture2DPixelsSource, type Texture2DSource, type Texture2DWrapMode, TextureLoader, TextureRect2D, type TextureRect2DProperties, Ticker, TiltShiftTransition, Timeline, type TimelineEventMap, TimelineNode, type TimelineNodeEventMap, type TimelineNodeProperties, type TimelineProperties, type TimingFunctions, Transform2D, type Transform2DObject, Transition, type TransitionProperties, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, type VectorLike, type VectorOperateOutput, VertexAttribute, type VertexAttributeOptions, VertexBuffer, type VertexBufferOptions, Video2D, type Video2DProperties, VideoLoader, VideoTexture, type VideoTextureOptions, type VideoTextureSource, Viewport, type ViewportEventMap, type ViewportFramebuffer, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, type WebGLBufferMeta, WebGLBufferModule, type WebGLBufferOptions, type WebGLBufferTarget, type WebGLBufferUsage, type WebGLDrawMode, type WebGLDrawOptions, type WebGLExtensions, type WebGLFramebufferMeta, WebGLFramebufferModule, type WebGLFramebufferOptions, WebGLMaskModule, WebGLModule, type WebGLProgramMeta, WebGLProgramModule, type WebGLProgramOptions, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, type WebGLTarget, type WebGLTextureFilterMode, type WebGLTextureLocation, type WebGLTextureMeta, WebGLTextureModule, type WebGLTextureOptions, type WebGLTextureSource, type WebGLTextureTarget, type WebGLTextureWrapMode, WebGLVertexArrayModule, type WebGLVertexArrayObjectMeta, type WebGLVertexArrayObjectOptions, type WebGLVertexAttrib, type WebGLVertexAttribType, type WebGLViewport, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, type XScrollBarProperties, YScrollBar, type YScrollBarProperties, ZoomBlurEffect, assets, clamp, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
|
package/dist/index.d.mts
CHANGED
|
@@ -1637,9 +1637,9 @@ interface NodeEventMap extends CoreObjectEventMap, InputEventMap {
|
|
|
1637
1637
|
removeChild: (child: Node, index: number) => void;
|
|
1638
1638
|
moveChild: (child: Node, newIndex: number, oldIndex: number) => void;
|
|
1639
1639
|
}
|
|
1640
|
-
type InternalMode = 'default' | 'front' | 'back';
|
|
1641
1640
|
type ProcessMode = 'inherit' | 'pausable' | 'when_paused' | 'always' | 'disabled';
|
|
1642
1641
|
type RenderMode = 'inherit' | 'always' | 'disabled';
|
|
1642
|
+
type InternalMode = 'default' | 'front' | 'back';
|
|
1643
1643
|
interface NodeProperties {
|
|
1644
1644
|
name: string;
|
|
1645
1645
|
processMode: ProcessMode;
|
|
@@ -1840,6 +1840,60 @@ declare class CanvasItem extends TimelineNode {
|
|
|
1840
1840
|
toJSON(): Record<string, any>;
|
|
1841
1841
|
}
|
|
1842
1842
|
|
|
1843
|
+
type EffectMode = 'before' | 'parent' | 'children' | 'transition';
|
|
1844
|
+
interface EffectProperties extends TimelineNodeProperties {
|
|
1845
|
+
effectMode: EffectMode;
|
|
1846
|
+
glsl: string;
|
|
1847
|
+
glslSrc: string;
|
|
1848
|
+
material: Material;
|
|
1849
|
+
}
|
|
1850
|
+
interface EffectContext {
|
|
1851
|
+
redraw?: boolean;
|
|
1852
|
+
/** parent redraw */
|
|
1853
|
+
target?: Node;
|
|
1854
|
+
targetArea?: [number, number, number, number];
|
|
1855
|
+
/** transition */
|
|
1856
|
+
from?: Viewport;
|
|
1857
|
+
to?: Viewport;
|
|
1858
|
+
}
|
|
1859
|
+
declare class Effect extends TimelineNode {
|
|
1860
|
+
material?: Material;
|
|
1861
|
+
effectMode?: EffectMode;
|
|
1862
|
+
glsl: string;
|
|
1863
|
+
glslSrc: string;
|
|
1864
|
+
protected get _effectMode(): EffectMode;
|
|
1865
|
+
/** Viewports */
|
|
1866
|
+
readonly viewport1: Viewport;
|
|
1867
|
+
readonly viewport2: Viewport;
|
|
1868
|
+
/** Render call */
|
|
1869
|
+
protected _renderId: number;
|
|
1870
|
+
protected _renderViewport?: Viewport;
|
|
1871
|
+
/** Temporary nodes for transition */
|
|
1872
|
+
protected _previousSibling?: Node;
|
|
1873
|
+
protected _nextSibling?: Node;
|
|
1874
|
+
constructor(properties?: Partial<EffectProperties>, children?: Node[]);
|
|
1875
|
+
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1876
|
+
protected _treeEnter(tree: SceneTree): void;
|
|
1877
|
+
protected _treeExit(oldTree: SceneTree): void;
|
|
1878
|
+
protected _onProcessing(): void;
|
|
1879
|
+
protected _onNodeProcessed(node: Node): void;
|
|
1880
|
+
protected _processParent(): void;
|
|
1881
|
+
protected _processChildren(): void;
|
|
1882
|
+
_onProcess(delta?: number): void;
|
|
1883
|
+
protected _renderBefore(renderer: WebGLRenderer): void;
|
|
1884
|
+
protected _renderTransition(renderer: WebGLRenderer): void;
|
|
1885
|
+
protected _renderParentOrChildren(renderer: WebGLRenderer): void;
|
|
1886
|
+
protected _parseTargetArea(): number[] | undefined;
|
|
1887
|
+
protected _render(renderer: WebGLRenderer): void;
|
|
1888
|
+
apply(renderer: WebGLRenderer, viewport: Viewport, context?: EffectContext): void;
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
interface TransitionProperties extends Omit<EffectProperties, 'effectMode' | 'processMode'> {
|
|
1892
|
+
}
|
|
1893
|
+
declare class Transition extends Effect {
|
|
1894
|
+
constructor(properties?: Partial<TransitionProperties>, children?: Node[]);
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1843
1897
|
interface Node2DProperties extends CanvasItemProperties {
|
|
1844
1898
|
}
|
|
1845
1899
|
declare class Node2D extends CanvasItem {
|
|
@@ -2014,14 +2068,14 @@ interface NormalizedKeyframe {
|
|
|
2014
2068
|
offset: number;
|
|
2015
2069
|
props: Record<string, any>;
|
|
2016
2070
|
}
|
|
2017
|
-
type
|
|
2018
|
-
interface AnimationProperties extends TimelineNodeProperties {
|
|
2019
|
-
|
|
2071
|
+
type AnimationEffectMode = 'parent' | 'sibling';
|
|
2072
|
+
interface AnimationProperties extends Omit<TimelineNodeProperties, 'renderMode' | 'processMode'> {
|
|
2073
|
+
effectMode: AnimationEffectMode;
|
|
2020
2074
|
loop: boolean;
|
|
2021
2075
|
keyframes: Keyframe[];
|
|
2022
2076
|
}
|
|
2023
2077
|
declare class Animation extends TimelineNode {
|
|
2024
|
-
|
|
2078
|
+
effectMode: AnimationEffectMode;
|
|
2025
2079
|
loop: boolean;
|
|
2026
2080
|
keyframes: Keyframe[];
|
|
2027
2081
|
easing?: Easing;
|
|
@@ -2032,6 +2086,8 @@ declare class Animation extends TimelineNode {
|
|
|
2032
2086
|
constructor(properties?: Partial<AnimationProperties>, children?: Node[]);
|
|
2033
2087
|
protected _treeEnter(tree: SceneTree): void;
|
|
2034
2088
|
protected _treeExit(oldTree: SceneTree): void;
|
|
2089
|
+
protected _onProcess(): void;
|
|
2090
|
+
protected _process(): void;
|
|
2035
2091
|
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2036
2092
|
protected _getTargets(): any[];
|
|
2037
2093
|
protected _updateKeyframes(): void;
|
|
@@ -2363,54 +2419,6 @@ declare class AudioWaveform extends Node2D {
|
|
|
2363
2419
|
protected _drawSrc(): void;
|
|
2364
2420
|
}
|
|
2365
2421
|
|
|
2366
|
-
type EffectMode = 'before' | 'parent' | 'children' | 'transition';
|
|
2367
|
-
interface EffectProperties extends TimelineNodeProperties {
|
|
2368
|
-
mode: EffectMode;
|
|
2369
|
-
glsl: string;
|
|
2370
|
-
glslSrc: string;
|
|
2371
|
-
material: Material;
|
|
2372
|
-
}
|
|
2373
|
-
interface EffectContext {
|
|
2374
|
-
redraw?: boolean;
|
|
2375
|
-
/** parent redraw */
|
|
2376
|
-
target?: Node;
|
|
2377
|
-
targetArea?: [number, number, number, number];
|
|
2378
|
-
/** transition */
|
|
2379
|
-
from?: Viewport;
|
|
2380
|
-
to?: Viewport;
|
|
2381
|
-
}
|
|
2382
|
-
declare class Effect extends TimelineNode {
|
|
2383
|
-
material?: Material;
|
|
2384
|
-
mode?: EffectMode;
|
|
2385
|
-
glsl: string;
|
|
2386
|
-
glslSrc: string;
|
|
2387
|
-
protected get _mode(): EffectMode;
|
|
2388
|
-
/** Viewports */
|
|
2389
|
-
readonly viewport1: Viewport;
|
|
2390
|
-
readonly viewport2: Viewport;
|
|
2391
|
-
/** Render call */
|
|
2392
|
-
protected _renderId: number;
|
|
2393
|
-
protected _renderViewport?: Viewport;
|
|
2394
|
-
/** Temporary nodes for transition */
|
|
2395
|
-
protected _previousSibling?: Node;
|
|
2396
|
-
protected _nextSibling?: Node;
|
|
2397
|
-
constructor(properties?: Partial<EffectProperties>, children?: Node[]);
|
|
2398
|
-
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2399
|
-
protected _treeEnter(tree: SceneTree): void;
|
|
2400
|
-
protected _treeExit(oldTree: SceneTree): void;
|
|
2401
|
-
protected _onProcessing(): void;
|
|
2402
|
-
protected _onNodeProcessed(node: Node): void;
|
|
2403
|
-
protected _processParent(): void;
|
|
2404
|
-
protected _processChildren(): void;
|
|
2405
|
-
_onProcess(delta?: number): void;
|
|
2406
|
-
protected _renderBefore(renderer: WebGLRenderer): void;
|
|
2407
|
-
protected _renderTransition(renderer: WebGLRenderer): void;
|
|
2408
|
-
protected _renderParentOrChildren(renderer: WebGLRenderer): void;
|
|
2409
|
-
protected _parseTargetArea(): number[] | undefined;
|
|
2410
|
-
protected _render(renderer: WebGLRenderer): void;
|
|
2411
|
-
apply(renderer: WebGLRenderer, viewport: Viewport, context?: EffectContext): void;
|
|
2412
|
-
}
|
|
2413
|
-
|
|
2414
2422
|
declare class BlurEffect extends Effect {
|
|
2415
2423
|
static materialX: Material;
|
|
2416
2424
|
static materialY: Material;
|
|
@@ -2506,18 +2514,6 @@ declare class GodrayEffect extends Effect {
|
|
|
2506
2514
|
apply(renderer: WebGLRenderer, source: Viewport): void;
|
|
2507
2515
|
}
|
|
2508
2516
|
|
|
2509
|
-
declare class KawaseEffect extends Effect {
|
|
2510
|
-
static material: Material;
|
|
2511
|
-
blur: number;
|
|
2512
|
-
quality: number;
|
|
2513
|
-
apply(renderer: WebGLRenderer, target: Viewport): void;
|
|
2514
|
-
}
|
|
2515
|
-
|
|
2516
|
-
declare class LeftEraseEffect extends Effect {
|
|
2517
|
-
static material: Material;
|
|
2518
|
-
apply(renderer: WebGLRenderer): void;
|
|
2519
|
-
}
|
|
2520
|
-
|
|
2521
2517
|
interface MaskEffectProperties extends EffectProperties {
|
|
2522
2518
|
src?: string;
|
|
2523
2519
|
}
|
|
@@ -2545,28 +2541,12 @@ declare class ShadowEffect extends Effect {
|
|
|
2545
2541
|
apply(renderer: WebGLRenderer, source: Viewport): void;
|
|
2546
2542
|
}
|
|
2547
2543
|
|
|
2548
|
-
declare class TiltShiftEffect extends Effect {
|
|
2549
|
-
static material: Material;
|
|
2550
|
-
blur: number;
|
|
2551
|
-
gradientBlur: number;
|
|
2552
|
-
apply(renderer: WebGLRenderer, target: Viewport): void;
|
|
2553
|
-
}
|
|
2554
|
-
|
|
2555
|
-
declare class TwistEffect extends Effect {
|
|
2556
|
-
static material: Material;
|
|
2557
|
-
radius?: number;
|
|
2558
|
-
angle: number;
|
|
2559
|
-
padding: number;
|
|
2560
|
-
offset?: number;
|
|
2561
|
-
apply(renderer: WebGLRenderer, source: Viewport): void;
|
|
2562
|
-
}
|
|
2563
|
-
|
|
2564
2544
|
declare class ZoomBlurEffect extends Effect {
|
|
2565
|
-
static material: Material;
|
|
2566
2545
|
center?: number[];
|
|
2567
2546
|
innerRadius: number;
|
|
2568
2547
|
radius: number;
|
|
2569
2548
|
strength: number;
|
|
2549
|
+
static material: Material;
|
|
2570
2550
|
apply(renderer: WebGLRenderer, source: Viewport): void;
|
|
2571
2551
|
}
|
|
2572
2552
|
|
|
@@ -2688,6 +2668,34 @@ declare class Scaler extends Node {
|
|
|
2688
2668
|
protected _input(event: InputEvent, key: InputEventKey): void;
|
|
2689
2669
|
}
|
|
2690
2670
|
|
|
2671
|
+
declare class KawaseTransition extends Transition {
|
|
2672
|
+
blur: number;
|
|
2673
|
+
quality: number;
|
|
2674
|
+
static material: Material;
|
|
2675
|
+
apply(renderer: WebGLRenderer, target: Viewport): void;
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2678
|
+
declare class LeftEraseTransition extends Transition {
|
|
2679
|
+
static material: Material;
|
|
2680
|
+
apply(renderer: WebGLRenderer): void;
|
|
2681
|
+
}
|
|
2682
|
+
|
|
2683
|
+
declare class TiltShiftTransition extends Transition {
|
|
2684
|
+
blur: number;
|
|
2685
|
+
gradientBlur: number;
|
|
2686
|
+
static material: Material;
|
|
2687
|
+
apply(renderer: WebGLRenderer, target: Viewport): void;
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
declare class TwistTransition extends Transition {
|
|
2691
|
+
radius?: number;
|
|
2692
|
+
angle: number;
|
|
2693
|
+
padding: number;
|
|
2694
|
+
offset?: number;
|
|
2695
|
+
static material: Material;
|
|
2696
|
+
apply(renderer: WebGLRenderer, source: Viewport): void;
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2691
2699
|
declare class GifLoader extends Loader {
|
|
2692
2700
|
load: (url: string) => Promise<Image2DResource>;
|
|
2693
2701
|
install(assets: Assets): this;
|
|
@@ -2841,4 +2849,4 @@ interface RenderOptions {
|
|
|
2841
2849
|
}
|
|
2842
2850
|
declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
|
|
2843
2851
|
|
|
2844
|
-
export { Animation, type
|
|
2852
|
+
export { Animation, type AnimationEffectMode, 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, KawaseTransition, type Keyframe, LeftEraseTransition, Loader, Lottie2D, type Lottie2DProperties, LottieLoader, MainLoop, type MainLoopEventMap, type MaskColor, type MaskData, MaskEffect, type MaskEffectProperties, type MaskObject, type MaskRect, type Maskable, Material, type MaterialOptions, Matrix, Matrix2, Matrix3, Matrix4, type MatrixLike, type MatrixOperateOutput, MouseInputEvent, Node, Node2D, type Node2DProperties, type NodeEventMap, type NodeProperties, type NormalizedKeyframe, PI, PI_2, PixelateEffect, PixelsTexture, type PlatformAudio, type PlatformSound, type PointerEvents, PointerInputEvent, type ProcessMode, Projection2D, type PropertyDeclaration, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, type RangeProperties, RawWeakMap, Rect2, RefCounted, type RefCountedEventMap, type RenderMode, type RenderOptions, type Renderable, Renderer, Resource, type ResourceEventMap, Ruler, type RulerProperties, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, type ScalerEventMap, type ScalerProperties, SceneTree, type SceneTreeEventMap, ScrollBar, type ScrollBarProperties, ShadowEffect, type StrokedGraphics, Text2D, type Text2DProperties, TextLoader, Texture2D, type Texture2DFilterMode, type Texture2DPixelsSource, type Texture2DSource, type Texture2DWrapMode, TextureLoader, TextureRect2D, type TextureRect2DProperties, Ticker, TiltShiftTransition, Timeline, type TimelineEventMap, TimelineNode, type TimelineNodeEventMap, type TimelineNodeProperties, type TimelineProperties, type TimingFunctions, Transform2D, type Transform2DObject, Transition, type TransitionProperties, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, type VectorLike, type VectorOperateOutput, VertexAttribute, type VertexAttributeOptions, VertexBuffer, type VertexBufferOptions, Video2D, type Video2DProperties, VideoLoader, VideoTexture, type VideoTextureOptions, type VideoTextureSource, Viewport, type ViewportEventMap, type ViewportFramebuffer, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, type WebGLBufferMeta, WebGLBufferModule, type WebGLBufferOptions, type WebGLBufferTarget, type WebGLBufferUsage, type WebGLDrawMode, type WebGLDrawOptions, type WebGLExtensions, type WebGLFramebufferMeta, WebGLFramebufferModule, type WebGLFramebufferOptions, WebGLMaskModule, WebGLModule, type WebGLProgramMeta, WebGLProgramModule, type WebGLProgramOptions, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, type WebGLTarget, type WebGLTextureFilterMode, type WebGLTextureLocation, type WebGLTextureMeta, WebGLTextureModule, type WebGLTextureOptions, type WebGLTextureSource, type WebGLTextureTarget, type WebGLTextureWrapMode, WebGLVertexArrayModule, type WebGLVertexArrayObjectMeta, type WebGLVertexArrayObjectOptions, type WebGLVertexAttrib, type WebGLVertexAttribType, type WebGLViewport, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, type XScrollBarProperties, YScrollBar, type YScrollBarProperties, ZoomBlurEffect, assets, clamp, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
|