modern-canvas 0.4.27 → 0.4.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +23 -18
- package/dist/index.d.cts +14 -4
- package/dist/index.d.mts +14 -4
- package/dist/index.d.ts +14 -4
- package/dist/index.js +45 -45
- package/dist/index.mjs +23 -18
- package/package.json +11 -11
package/dist/index.cjs
CHANGED
|
@@ -10449,13 +10449,18 @@ exports.Text2D = class Text2D extends TextureRect2D {
|
|
|
10449
10449
|
measureDom;
|
|
10450
10450
|
fonts;
|
|
10451
10451
|
texture = new CanvasTexture();
|
|
10452
|
-
|
|
10452
|
+
base = new modernText.Text();
|
|
10453
10453
|
measureResult;
|
|
10454
10454
|
_subTextsCount = 0;
|
|
10455
10455
|
constructor(properties, children = []) {
|
|
10456
10456
|
super();
|
|
10457
10457
|
this.setProperties(properties);
|
|
10458
10458
|
this.append(children);
|
|
10459
|
+
if (properties?.plugins) {
|
|
10460
|
+
properties.plugins.forEach((plugin) => {
|
|
10461
|
+
this.base.use(plugin);
|
|
10462
|
+
});
|
|
10463
|
+
}
|
|
10459
10464
|
}
|
|
10460
10465
|
_updateProperty(key, value, oldValue, declaration) {
|
|
10461
10466
|
super._updateProperty(key, value, oldValue, declaration);
|
|
@@ -10475,13 +10480,14 @@ exports.Text2D = class Text2D extends TextureRect2D {
|
|
|
10475
10480
|
});
|
|
10476
10481
|
}
|
|
10477
10482
|
}
|
|
10478
|
-
|
|
10479
|
-
this.
|
|
10480
|
-
this.
|
|
10481
|
-
this.
|
|
10482
|
-
this.
|
|
10483
|
-
this.
|
|
10484
|
-
this.
|
|
10483
|
+
_updateBase() {
|
|
10484
|
+
this.base.style = this.style.toJSON();
|
|
10485
|
+
this.base.content = this.content ?? "";
|
|
10486
|
+
this.base.effects = this.effects;
|
|
10487
|
+
this.base.fonts = this.fonts;
|
|
10488
|
+
this.base.measureDom = this.measureDom;
|
|
10489
|
+
this.emit("updateBase", this.base);
|
|
10490
|
+
this.base.requestUpdate();
|
|
10485
10491
|
}
|
|
10486
10492
|
_updateStyleProperty(key, value, oldValue) {
|
|
10487
10493
|
switch (key) {
|
|
@@ -10533,18 +10539,17 @@ exports.Text2D = class Text2D extends TextureRect2D {
|
|
|
10533
10539
|
}
|
|
10534
10540
|
}
|
|
10535
10541
|
measure() {
|
|
10536
|
-
this.
|
|
10537
|
-
return this.
|
|
10542
|
+
this._updateBase();
|
|
10543
|
+
return this.base.measure();
|
|
10538
10544
|
}
|
|
10539
10545
|
updateMeasure() {
|
|
10540
10546
|
this.measureResult = this.measure();
|
|
10541
|
-
const
|
|
10542
|
-
const
|
|
10543
|
-
|
|
10544
|
-
this.position.
|
|
10545
|
-
this.
|
|
10546
|
-
this.size.
|
|
10547
|
-
this.size.height = textHeight;
|
|
10547
|
+
const { boundingBox } = this.measureResult;
|
|
10548
|
+
const { left, top } = this.style;
|
|
10549
|
+
this.position.x = left + Math.min(0, boundingBox.left);
|
|
10550
|
+
this.position.y = top + Math.min(0, boundingBox.top);
|
|
10551
|
+
this.size.width = boundingBox.width;
|
|
10552
|
+
this.size.height = boundingBox.height;
|
|
10548
10553
|
return this;
|
|
10549
10554
|
}
|
|
10550
10555
|
_updateSplit() {
|
|
@@ -10586,7 +10591,7 @@ exports.Text2D = class Text2D extends TextureRect2D {
|
|
|
10586
10591
|
if (onText2DRender) {
|
|
10587
10592
|
onText2DRender();
|
|
10588
10593
|
} else {
|
|
10589
|
-
this.
|
|
10594
|
+
this.base.render({
|
|
10590
10595
|
pixelRatio: this.texture.pixelRatio,
|
|
10591
10596
|
view: this.texture.source
|
|
10592
10597
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -2192,9 +2192,18 @@ declare class Lottie2D extends TextureRect2D {
|
|
|
2192
2192
|
protected _process(delta: number): void;
|
|
2193
2193
|
}
|
|
2194
2194
|
|
|
2195
|
+
interface Text2DEventMap extends Element2DEventMap {
|
|
2196
|
+
updateBase: (base: Text) => void;
|
|
2197
|
+
}
|
|
2195
2198
|
interface Text2DProperties extends TextureRect2DProperties, Omit<TextOptions, 'style'> {
|
|
2196
2199
|
split: boolean;
|
|
2197
2200
|
}
|
|
2201
|
+
interface Text2D {
|
|
2202
|
+
on: (<K extends keyof Text2DEventMap>(type: K, listener: Text2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2203
|
+
once: (<K extends keyof Text2DEventMap>(type: K, listener: Text2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2204
|
+
off: (<K extends keyof Text2DEventMap>(type: K, listener?: Text2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2205
|
+
emit: (<K extends keyof Text2DEventMap>(type: K, ...args: Parameters<Text2DEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
2206
|
+
}
|
|
2198
2207
|
/**
|
|
2199
2208
|
* @example
|
|
2200
2209
|
*
|
|
@@ -2212,12 +2221,12 @@ declare class Text2D extends TextureRect2D<CanvasTexture> {
|
|
|
2212
2221
|
measureDom?: TextOptions['measureDom'];
|
|
2213
2222
|
fonts?: TextOptions['fonts'];
|
|
2214
2223
|
texture: CanvasTexture;
|
|
2215
|
-
|
|
2224
|
+
base: Text;
|
|
2216
2225
|
measureResult?: MeasureResult;
|
|
2217
2226
|
protected _subTextsCount: number;
|
|
2218
2227
|
constructor(properties?: Partial<Text2DProperties>, children?: Node[]);
|
|
2219
2228
|
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2220
|
-
protected
|
|
2229
|
+
protected _updateBase(): void;
|
|
2221
2230
|
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any): void;
|
|
2222
2231
|
protected _getSubTexts(): Text2D[];
|
|
2223
2232
|
protected _updateSubTexts(): void;
|
|
@@ -2555,7 +2564,7 @@ declare class Audio extends TimelineNode {
|
|
|
2555
2564
|
protected static _soundPool: PlatformSound[];
|
|
2556
2565
|
protected _sounds: PlatformSound[];
|
|
2557
2566
|
/** PlatformAudio */
|
|
2558
|
-
protected _platformAudio:
|
|
2567
|
+
protected _platformAudio: WebAudio | HTMLAudio;
|
|
2559
2568
|
get platformAudio(): PlatformAudio;
|
|
2560
2569
|
/** Src */
|
|
2561
2570
|
protected _src: string;
|
|
@@ -3213,4 +3222,5 @@ interface RenderOptions {
|
|
|
3213
3222
|
}
|
|
3214
3223
|
declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
|
|
3215
3224
|
|
|
3216
|
-
export { AnimatedTexture, Animation,
|
|
3225
|
+
export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DFill, BaseElement2DGeometry, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DStyle, BaseElement2DText, CanvasContext, CanvasItem, CanvasItemEditor, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, Control, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, EventEmitter, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GIFLoader, GaussianBlurEffect, Geometry, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JSONLoader, KawaseBlurEffect, KawaseTransition, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, RawWeakMap, Rect2, RefCounted, Renderer, Resource, Ruler, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, ScrollBar, Text2D, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, YScrollBar, ZoomBlurEffect, assets, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, frag, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
|
|
3226
|
+
export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEventMap, BaseElement2DFillProperties, BaseElement2DGeometryProperties, BaseElement2DOutlineProperties, BaseElement2DProperties, BaseElement2DShadowProperties, BaseElement2DStyleProperties, BaseElement2DTextProperties, Batchable2D, CSSFilterKey, CSSFilters, CanvasBatchable, CanvasItemEventMap, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ColorValue, ComputedLayout, ControlEventMap, ControlProperties, CoreObjectEventMap, CssFunction, CssFunctionArg, Cursor, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEventMap, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineOptions, EventListener, EventListenerOptions, EventListenerValue, FillDraw, FlexBaseElement2DEventMap, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEventMap, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEventMap, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DProperties, NodeEventMap, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, PropertyDeclaration, RangeProperties, Rectangulable, RectangulableEventMap, RefCountedEventMap, RenderMode, RenderOptions, Renderable, ResourceEventMap, RulerProperties, ScalerEventMap, ScalerProperties, SceneTreeEventMap, ScrollBarProperties, StrokeDraw, Text2DEventMap, Text2DProperties, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEventMap, TimelineNodeEventMap, TimelineNodeProperties, TimelineProperties, TimingFunctions, Transform2DObject, TransformRect2DProperties, TransitionProperties, VectorLike, VectorOperateOutput, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEventMap, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, XScrollBarProperties, YScrollBarProperties, ZoomBlurEffectProperties };
|
package/dist/index.d.mts
CHANGED
|
@@ -2192,9 +2192,18 @@ declare class Lottie2D extends TextureRect2D {
|
|
|
2192
2192
|
protected _process(delta: number): void;
|
|
2193
2193
|
}
|
|
2194
2194
|
|
|
2195
|
+
interface Text2DEventMap extends Element2DEventMap {
|
|
2196
|
+
updateBase: (base: Text) => void;
|
|
2197
|
+
}
|
|
2195
2198
|
interface Text2DProperties extends TextureRect2DProperties, Omit<TextOptions, 'style'> {
|
|
2196
2199
|
split: boolean;
|
|
2197
2200
|
}
|
|
2201
|
+
interface Text2D {
|
|
2202
|
+
on: (<K extends keyof Text2DEventMap>(type: K, listener: Text2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2203
|
+
once: (<K extends keyof Text2DEventMap>(type: K, listener: Text2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2204
|
+
off: (<K extends keyof Text2DEventMap>(type: K, listener?: Text2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2205
|
+
emit: (<K extends keyof Text2DEventMap>(type: K, ...args: Parameters<Text2DEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
2206
|
+
}
|
|
2198
2207
|
/**
|
|
2199
2208
|
* @example
|
|
2200
2209
|
*
|
|
@@ -2212,12 +2221,12 @@ declare class Text2D extends TextureRect2D<CanvasTexture> {
|
|
|
2212
2221
|
measureDom?: TextOptions['measureDom'];
|
|
2213
2222
|
fonts?: TextOptions['fonts'];
|
|
2214
2223
|
texture: CanvasTexture;
|
|
2215
|
-
|
|
2224
|
+
base: Text;
|
|
2216
2225
|
measureResult?: MeasureResult;
|
|
2217
2226
|
protected _subTextsCount: number;
|
|
2218
2227
|
constructor(properties?: Partial<Text2DProperties>, children?: Node[]);
|
|
2219
2228
|
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2220
|
-
protected
|
|
2229
|
+
protected _updateBase(): void;
|
|
2221
2230
|
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any): void;
|
|
2222
2231
|
protected _getSubTexts(): Text2D[];
|
|
2223
2232
|
protected _updateSubTexts(): void;
|
|
@@ -2555,7 +2564,7 @@ declare class Audio extends TimelineNode {
|
|
|
2555
2564
|
protected static _soundPool: PlatformSound[];
|
|
2556
2565
|
protected _sounds: PlatformSound[];
|
|
2557
2566
|
/** PlatformAudio */
|
|
2558
|
-
protected _platformAudio:
|
|
2567
|
+
protected _platformAudio: WebAudio | HTMLAudio;
|
|
2559
2568
|
get platformAudio(): PlatformAudio;
|
|
2560
2569
|
/** Src */
|
|
2561
2570
|
protected _src: string;
|
|
@@ -3213,4 +3222,5 @@ interface RenderOptions {
|
|
|
3213
3222
|
}
|
|
3214
3223
|
declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
|
|
3215
3224
|
|
|
3216
|
-
export { AnimatedTexture, Animation,
|
|
3225
|
+
export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DFill, BaseElement2DGeometry, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DStyle, BaseElement2DText, CanvasContext, CanvasItem, CanvasItemEditor, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, Control, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, EventEmitter, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GIFLoader, GaussianBlurEffect, Geometry, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JSONLoader, KawaseBlurEffect, KawaseTransition, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, RawWeakMap, Rect2, RefCounted, Renderer, Resource, Ruler, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, ScrollBar, Text2D, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, YScrollBar, ZoomBlurEffect, assets, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, frag, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
|
|
3226
|
+
export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEventMap, BaseElement2DFillProperties, BaseElement2DGeometryProperties, BaseElement2DOutlineProperties, BaseElement2DProperties, BaseElement2DShadowProperties, BaseElement2DStyleProperties, BaseElement2DTextProperties, Batchable2D, CSSFilterKey, CSSFilters, CanvasBatchable, CanvasItemEventMap, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ColorValue, ComputedLayout, ControlEventMap, ControlProperties, CoreObjectEventMap, CssFunction, CssFunctionArg, Cursor, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEventMap, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineOptions, EventListener, EventListenerOptions, EventListenerValue, FillDraw, FlexBaseElement2DEventMap, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEventMap, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEventMap, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DProperties, NodeEventMap, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, PropertyDeclaration, RangeProperties, Rectangulable, RectangulableEventMap, RefCountedEventMap, RenderMode, RenderOptions, Renderable, ResourceEventMap, RulerProperties, ScalerEventMap, ScalerProperties, SceneTreeEventMap, ScrollBarProperties, StrokeDraw, Text2DEventMap, Text2DProperties, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEventMap, TimelineNodeEventMap, TimelineNodeProperties, TimelineProperties, TimingFunctions, Transform2DObject, TransformRect2DProperties, TransitionProperties, VectorLike, VectorOperateOutput, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEventMap, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, XScrollBarProperties, YScrollBarProperties, ZoomBlurEffectProperties };
|
package/dist/index.d.ts
CHANGED
|
@@ -2192,9 +2192,18 @@ declare class Lottie2D extends TextureRect2D {
|
|
|
2192
2192
|
protected _process(delta: number): void;
|
|
2193
2193
|
}
|
|
2194
2194
|
|
|
2195
|
+
interface Text2DEventMap extends Element2DEventMap {
|
|
2196
|
+
updateBase: (base: Text) => void;
|
|
2197
|
+
}
|
|
2195
2198
|
interface Text2DProperties extends TextureRect2DProperties, Omit<TextOptions, 'style'> {
|
|
2196
2199
|
split: boolean;
|
|
2197
2200
|
}
|
|
2201
|
+
interface Text2D {
|
|
2202
|
+
on: (<K extends keyof Text2DEventMap>(type: K, listener: Text2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2203
|
+
once: (<K extends keyof Text2DEventMap>(type: K, listener: Text2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2204
|
+
off: (<K extends keyof Text2DEventMap>(type: K, listener?: Text2DEventMap[K], options?: EventListenerOptions) => this) & ((type: string, listener: EventListenerValue, options?: EventListenerOptions) => this);
|
|
2205
|
+
emit: (<K extends keyof Text2DEventMap>(type: K, ...args: Parameters<Text2DEventMap[K]>) => boolean) & ((type: string, ...args: any[]) => boolean);
|
|
2206
|
+
}
|
|
2198
2207
|
/**
|
|
2199
2208
|
* @example
|
|
2200
2209
|
*
|
|
@@ -2212,12 +2221,12 @@ declare class Text2D extends TextureRect2D<CanvasTexture> {
|
|
|
2212
2221
|
measureDom?: TextOptions['measureDom'];
|
|
2213
2222
|
fonts?: TextOptions['fonts'];
|
|
2214
2223
|
texture: CanvasTexture;
|
|
2215
|
-
|
|
2224
|
+
base: Text;
|
|
2216
2225
|
measureResult?: MeasureResult;
|
|
2217
2226
|
protected _subTextsCount: number;
|
|
2218
2227
|
constructor(properties?: Partial<Text2DProperties>, children?: Node[]);
|
|
2219
2228
|
protected _updateProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
2220
|
-
protected
|
|
2229
|
+
protected _updateBase(): void;
|
|
2221
2230
|
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any): void;
|
|
2222
2231
|
protected _getSubTexts(): Text2D[];
|
|
2223
2232
|
protected _updateSubTexts(): void;
|
|
@@ -2555,7 +2564,7 @@ declare class Audio extends TimelineNode {
|
|
|
2555
2564
|
protected static _soundPool: PlatformSound[];
|
|
2556
2565
|
protected _sounds: PlatformSound[];
|
|
2557
2566
|
/** PlatformAudio */
|
|
2558
|
-
protected _platformAudio:
|
|
2567
|
+
protected _platformAudio: WebAudio | HTMLAudio;
|
|
2559
2568
|
get platformAudio(): PlatformAudio;
|
|
2560
2569
|
/** Src */
|
|
2561
2570
|
protected _src: string;
|
|
@@ -3213,4 +3222,5 @@ interface RenderOptions {
|
|
|
3213
3222
|
}
|
|
3214
3223
|
declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
|
|
3215
3224
|
|
|
3216
|
-
export { AnimatedTexture, Animation,
|
|
3225
|
+
export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DFill, BaseElement2DGeometry, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DStyle, BaseElement2DText, CanvasContext, CanvasItem, CanvasItemEditor, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, Control, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, EventEmitter, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GIFLoader, GaussianBlurEffect, Geometry, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JSONLoader, KawaseBlurEffect, KawaseTransition, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, RawWeakMap, Rect2, RefCounted, Renderer, Resource, Ruler, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, ScrollBar, Text2D, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, YScrollBar, ZoomBlurEffect, assets, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, frag, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
|
|
3226
|
+
export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEventMap, BaseElement2DFillProperties, BaseElement2DGeometryProperties, BaseElement2DOutlineProperties, BaseElement2DProperties, BaseElement2DShadowProperties, BaseElement2DStyleProperties, BaseElement2DTextProperties, Batchable2D, CSSFilterKey, CSSFilters, CanvasBatchable, CanvasItemEventMap, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ColorValue, ComputedLayout, ControlEventMap, ControlProperties, CoreObjectEventMap, CssFunction, CssFunctionArg, Cursor, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEventMap, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineOptions, EventListener, EventListenerOptions, EventListenerValue, FillDraw, FlexBaseElement2DEventMap, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEventMap, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEventMap, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DProperties, NodeEventMap, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, PropertyDeclaration, RangeProperties, Rectangulable, RectangulableEventMap, RefCountedEventMap, RenderMode, RenderOptions, Renderable, ResourceEventMap, RulerProperties, ScalerEventMap, ScalerProperties, SceneTreeEventMap, ScrollBarProperties, StrokeDraw, Text2DEventMap, Text2DProperties, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEventMap, TimelineNodeEventMap, TimelineNodeProperties, TimelineProperties, TimingFunctions, Transform2DObject, TransformRect2DProperties, TransitionProperties, VectorLike, VectorOperateOutput, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEventMap, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, XScrollBarProperties, YScrollBarProperties, ZoomBlurEffectProperties };
|