modern-canvas 0.4.12 → 0.4.13
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 +58 -100
- package/dist/index.d.cts +11 -60
- package/dist/index.d.mts +11 -60
- package/dist/index.d.ts +11 -60
- package/dist/index.js +31 -31
- package/dist/index.mjs +59 -101
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Font } from 'modern-font';
|
|
|
2
2
|
import { AnimationItem } from 'lottie-web';
|
|
3
3
|
import { AnyColor, Colord } from 'colord';
|
|
4
4
|
import { Path2D, LineCap, LineJoin, LineStyle } from 'modern-path2d';
|
|
5
|
-
import {
|
|
5
|
+
import { StyleDeclaration, ImageSource, ImageSourceRect } from 'modern-idoc';
|
|
6
6
|
import { Node as Node$1, Direction } from 'yoga-layout/load';
|
|
7
7
|
import { TextOptions, Text, MeasureResult } from 'modern-text';
|
|
8
8
|
|
|
@@ -1864,14 +1864,14 @@ declare class Transition extends Effect {
|
|
|
1864
1864
|
constructor(properties?: Partial<TransitionProperties>, children?: Node[]);
|
|
1865
1865
|
}
|
|
1866
1866
|
|
|
1867
|
-
interface BaseElement2DStyleProperties extends
|
|
1867
|
+
interface BaseElement2DStyleProperties extends Omit<StyleDeclaration, 'left' | 'top' | 'width' | 'height' | 'backgroundColor' | 'borderColor' | 'outlineColor'> {
|
|
1868
|
+
left: number;
|
|
1869
|
+
top: number;
|
|
1870
|
+
width: number;
|
|
1871
|
+
height: number;
|
|
1868
1872
|
backgroundColor: 'none' | ColorValue;
|
|
1869
|
-
maskImage: 'none' | string;
|
|
1870
1873
|
borderColor: 'none' | ColorValue;
|
|
1871
|
-
outlineWidth: number;
|
|
1872
|
-
outlineOffset: number;
|
|
1873
1874
|
outlineColor: 'none' | ColorValue;
|
|
1874
|
-
outlineStyle: string;
|
|
1875
1875
|
}
|
|
1876
1876
|
interface BaseElement2DStyle extends BaseElement2DStyleProperties {
|
|
1877
1877
|
}
|
|
@@ -1988,56 +1988,7 @@ declare class Element2D extends BaseElement2D {
|
|
|
1988
1988
|
protected _updateStyleProperty(key: PropertyKey, value: any, oldValue: any, declaration?: PropertyDeclaration): void;
|
|
1989
1989
|
}
|
|
1990
1990
|
|
|
1991
|
-
|
|
1992
|
-
type FlexDirection = 'column' | 'column-reverse' | 'row' | 'row-reverse';
|
|
1993
|
-
type FlexWrap = 'nowrap' | 'wrap' | 'Wrap-reverse';
|
|
1994
|
-
type Justify = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
1995
|
-
type Position = 'static' | 'relative' | 'absolute';
|
|
1996
|
-
type BoxSizing = 'border-box' | 'content-box';
|
|
1997
|
-
interface LayoutStyleDeclaration {
|
|
1998
|
-
alignContent: Align;
|
|
1999
|
-
alignItems: Align;
|
|
2000
|
-
alignSelf: Align;
|
|
2001
|
-
borderTop: string;
|
|
2002
|
-
borderLeft: string;
|
|
2003
|
-
borderRight: string;
|
|
2004
|
-
borderBottom: string;
|
|
2005
|
-
borderWidth: number;
|
|
2006
|
-
border: string;
|
|
2007
|
-
direction: 'inherit' | 'ltr' | 'rtl';
|
|
2008
|
-
display: 'none' | 'flex' | 'contents';
|
|
2009
|
-
flex: number;
|
|
2010
|
-
flexBasis: number | 'auto' | `${number}%`;
|
|
2011
|
-
flexDirection: FlexDirection;
|
|
2012
|
-
flexGrow: number;
|
|
2013
|
-
flexShrink: number;
|
|
2014
|
-
flexWrap: FlexWrap;
|
|
2015
|
-
height: number | 'auto' | `${number}%`;
|
|
2016
|
-
justifyContent: Justify;
|
|
2017
|
-
gap: number | `${number}%`;
|
|
2018
|
-
marginTop: number | 'auto' | `${number}%`;
|
|
2019
|
-
marginLeft: number | 'auto' | `${number}%`;
|
|
2020
|
-
marginRight: number | 'auto' | `${number}%`;
|
|
2021
|
-
marginBottom: number | 'auto' | `${number}%`;
|
|
2022
|
-
margin: number | 'auto' | `${number}%`;
|
|
2023
|
-
maxHeight: number | `${number}%`;
|
|
2024
|
-
maxWidth: number | `${number}%`;
|
|
2025
|
-
minHeight: number | `${number}%`;
|
|
2026
|
-
minWidth: number | `${number}%`;
|
|
2027
|
-
paddingTop: number | `${number}%`;
|
|
2028
|
-
paddingLeft: number | `${number}%`;
|
|
2029
|
-
paddingRight: number | `${number}%`;
|
|
2030
|
-
paddingBottom: number | `${number}%`;
|
|
2031
|
-
padding: number | `${number}%`;
|
|
2032
|
-
top: number | `${number}%`;
|
|
2033
|
-
bottom: number | `${number}%`;
|
|
2034
|
-
left: number | `${number}%`;
|
|
2035
|
-
right: number | `${number}%`;
|
|
2036
|
-
position: Position;
|
|
2037
|
-
boxSizing: BoxSizing;
|
|
2038
|
-
width: number | 'auto' | `${number}%`;
|
|
2039
|
-
}
|
|
2040
|
-
interface FlexElement2DStyleProperties extends BaseElement2DStyleProperties, LayoutStyleDeclaration {
|
|
1991
|
+
interface FlexElement2DStyleProperties extends BaseElement2DStyleProperties {
|
|
2041
1992
|
}
|
|
2042
1993
|
interface FlexElement2DStyle extends FlexElement2DStyleProperties {
|
|
2043
1994
|
}
|
|
@@ -2123,13 +2074,13 @@ declare class Graphics2D extends Node2D {
|
|
|
2123
2074
|
}
|
|
2124
2075
|
|
|
2125
2076
|
interface Image2DProperties extends Element2DProperties {
|
|
2126
|
-
src:
|
|
2127
|
-
srcRect:
|
|
2077
|
+
src: ImageSource;
|
|
2078
|
+
srcRect: ImageSourceRect;
|
|
2128
2079
|
gif: boolean;
|
|
2129
2080
|
}
|
|
2130
2081
|
declare class Image2D extends Element2D {
|
|
2131
2082
|
texture?: AnimatedTexture;
|
|
2132
|
-
srcRect:
|
|
2083
|
+
srcRect: ImageSourceRect;
|
|
2133
2084
|
src: string;
|
|
2134
2085
|
gif: boolean;
|
|
2135
2086
|
get currentFrameTexture(): Texture2D | undefined;
|
|
@@ -3066,4 +3017,4 @@ interface RenderOptions {
|
|
|
3066
3017
|
}
|
|
3067
3018
|
declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
|
|
3068
3019
|
|
|
3069
|
-
export {
|
|
3020
|
+
export { AnimatedTexture, Animation, type AnimationEffectMode, type AnimationProperties, type AssetHandler, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, type AudioWaveformProperties, BaseElement2D, type BaseElement2DEventMap, type BaseElement2DProperties, BaseElement2DStyle, type BaseElement2DStyleProperties, type Batchable2D, BlurEffect, type CSSFilterKey, type CSSFilters, type CanvasBatchable, CanvasContext, CanvasItem, CanvasItemEditor, type CanvasItemEventMap, type CanvasItemProperties, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, type ColorFilterEffectProperties, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, type ColorValue, type ComputedLayout, 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, Element2D, type Element2DEventMap, type Element2DProperties, Element2DStyle, type Element2DStyleProperties, EmbossEffect, Engine, type EngineOptions, EventEmitter, type EventListener, type EventListenerOptions, type EventListenerValue, type FillDraw, type FlexBaseElement2DEventMap, FlexElement2D, type FlexElement2DProperties, FlexElement2DStyle, type FlexElement2DStyleProperties, FlexLayout, FontLoader, GIFLoader, Geometry, type GeometryOptions, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, type IAudioContext, type IAudioNode, IN_BROWSER, type IPlayOptions, Image2D, type Image2DProperties, 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, PointerInputEvent, type ProcessMode, Projection2D, type PropertyDeclaration, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, type RangeProperties, RawWeakMap, Rect2, type Rectangulable, type RectangulableEventMap, 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 StrokeDraw, 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, TransformRect2D, type TransformRect2DProperties, 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, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
|