@leafer-ui/interface
Advanced tools
| import { ILeaferCanvas, IBoundsData, ICachedLeaf } from '@leafer/interface' | ||
| export interface ICachedShape extends ICachedLeaf { | ||
| worldCanvas?: ILeaferCanvas | ||
| shapeBounds: IBoundsData | ||
| scaleX: number | ||
| scaleY: number | ||
| } |
| import { IPaint, IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow, IUnitData } from './type/IType' | ||
| import { ILeafStrokePaint, ILeafShadowEffect, ILeafPaint } from './type/IComputedType' | ||
| import { IPaintString, IDashPatternString, IShadowString, IColorString, IStrokeWidthString, ICornerRadiusString } from './type/IStringType' | ||
| // corner--- | ||
| export interface ICornerRadiusAttrData { | ||
| cornerRadius: number | number[] | ICornerRadiusString | ||
| cornerSmoothing: number | ||
| } | ||
| export interface ICornerRadiusInputData { | ||
| cornerRadius?: number | number[] | ICornerRadiusString | ||
| cornerSmoothing?: number | ||
| } | ||
| export interface ICornerRadiusComputedData { | ||
| cornerRadius?: number | ||
| cornerSmoothing?: number | ||
| } | ||
| // fill--- | ||
| export interface IFillAttrData { | ||
| fill: IPaint | IPaint[] | IPaintString | ||
| } | ||
| export interface IFillInputData { | ||
| fill?: IPaint | IPaint[] | IPaintString | ||
| } | ||
| export interface IFillComputedData { | ||
| fill?: IColorString | ILeafPaint[] | ||
| } | ||
| // border | ||
| export interface IBorderComputedData { | ||
| borderWidth?: number | number[] | ||
| borderRadius?: number | number[] | ||
| } | ||
| // stroke--- | ||
| export interface IStrokeAttrData { | ||
| stroke: IPaint | IPaint[] | IPaintString | ||
| strokeAlign: IStrokeAlign | ||
| strokeWidth: number | number[] | IStrokeWidthString | ||
| strokeCap: IStrokeCap | ||
| strokeJoin: IStrokeJoin | ||
| dashPattern: number[] | IDashPatternString | ||
| dashOffset: number | ||
| miterLimit: number | ||
| } | ||
| export interface IStrokeInputData { | ||
| stroke?: IPaint | IPaint[] | IPaintString | ||
| strokeAlign?: IStrokeAlign | ||
| strokeWidth?: number | number[] | IStrokeWidthString | ||
| strokeCap?: IStrokeCap | ||
| strokeJoin?: IStrokeJoin | ||
| dashPattern?: number[] | IDashPatternString | ||
| dashOffset?: number | ||
| miterLimit?: number | ||
| } | ||
| export interface IStrokeComputedData { | ||
| stroke?: IColorString | ILeafStrokePaint[] | ||
| strokeAlign?: IStrokeAlign | ||
| strokeWidth?: number | ||
| strokeWidths?: number[] | ||
| strokeCap?: IStrokeCap | ||
| strokeJoin?: IStrokeJoin | ||
| dashPattern?: number[] | ||
| dashOffset?: number | ||
| miterLimit?: number | ||
| } | ||
| // text--- | ||
| export interface ITextStyleAttrData { | ||
| fontFamily: string | ||
| fontSize: number | ||
| fontWeight: IFontWeight | ||
| italic: boolean | ||
| textCase: ITextCase | ||
| textDecoration: ITextDecoration | ||
| letterSpacing: number | IUnitData | ||
| lineHeight: number | IUnitData | ||
| paraIndent: number | ||
| paraSpacing: number | ||
| textAlign: ITextAlign | ||
| verticalAlign: IVerticalAlign | ||
| textOverflow: IOverflow | string | ||
| } | ||
| export interface ITextStyleInputData { | ||
| fontFamily?: string | ||
| fontSize?: number | ||
| fontWeight?: IFontWeight | ||
| italic?: boolean | ||
| textCase?: ITextCase | ||
| textDecoration?: ITextDecoration | ||
| letterSpacing?: number | IUnitData | ||
| lineHeight?: number | IUnitData | ||
| paraIndent?: number | ||
| paraSpacing?: number | ||
| textAlign?: ITextAlign | ||
| verticalAlign?: IVerticalAlign | ||
| textOverflow?: IOverflow | string | ||
| } | ||
| export interface ITextStyleComputedData { | ||
| fontFamily?: string | ||
| fontSize?: number | ||
| fontWeight?: IFontWeight | ||
| italic?: boolean | ||
| textCase?: ITextCase | ||
| textDecoration?: ITextDecoration | ||
| letterSpacing?: number | ||
| lineHeight?: number | ||
| paraIndent?: number | ||
| paraSpacing?: number | ||
| textAlign?: ITextAlign | ||
| verticalAlign?: IVerticalAlign | ||
| textOverflow?: IOverflow | ||
| } | ||
| // effect--- | ||
| export interface IEffectAttrData { | ||
| shadow: IShadowEffect | IShadowEffect[] | IShadowString | ||
| innerShadow: IShadowEffect | IShadowEffect[] | IShadowString | ||
| blur: number | IBlurEffect | ||
| backgroundBlur: number | IBlurEffect | ||
| grayscale: number | IGrayscaleEffect | ||
| } | ||
| export interface IEffectInputData { | ||
| shadow?: IShadowEffect | IShadowEffect[] | IShadowString | ||
| innerShadow?: IShadowEffect | IShadowEffect[] | IShadowString | ||
| blur?: number | IBlurEffect | ||
| backgroundBlur?: number | IBlurEffect | ||
| grayscale?: number | IGrayscaleEffect | ||
| } | ||
| export interface IEffectComputedData { | ||
| shadow?: ILeafShadowEffect[] | ||
| innerShadow?: ILeafShadowEffect[] | ||
| blur?: number | ||
| backgroundBlur?: number | ||
| grayscale?: number | ||
| } |
+335
| import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IPathDrawer, IPointData, IPath2D, IPathCommandData, IWindingRule, ILeaferImageConfig, IBoundsData, IObject, __Number, IPathString, ILeaferImage, IBlob, IPathCreator } from '@leafer/interface' | ||
| import { | ||
| IFillAttrData, IFillInputData, IFillComputedData, | ||
| IBorderComputedData, | ||
| ICornerRadiusAttrData, ICornerRadiusInputData, ICornerRadiusComputedData, | ||
| IStrokeAttrData, IStrokeComputedData, IStrokeInputData, | ||
| IEffectAttrData, IEffectInputData, IEffectComputedData, | ||
| ITextStyleAttrData, ITextStyleInputData, ITextStyleComputedData | ||
| } from './ICommonAttr' | ||
| import { IOverflow } from './type/IType' | ||
| import { IExportOptions } from './module/IExport' | ||
| // Line | ||
| export interface ILine extends IUI { | ||
| __: ILineData | ||
| toPoint: IPointData | ||
| points: number[] | ||
| curve: boolean | number | ||
| } | ||
| export interface ILineData extends IUIData { } | ||
| export interface ILineInputData extends IUIBaseInputData { | ||
| toPoint?: IPointData | ||
| points?: number[] | ||
| curve?: boolean | number | ||
| } | ||
| // Rect | ||
| export interface IRect extends IUI { | ||
| __: IRectData | ||
| } | ||
| export interface IRectData extends IUIData { } | ||
| export interface IRectInputData extends IUIBaseInputData { } | ||
| // Ellipse | ||
| export interface IEllipse extends IUI { | ||
| __: IEllipseData | ||
| startAngle: number | ||
| endAngle: number | ||
| innerRadius: number | ||
| } | ||
| interface IEllipseAttrData { | ||
| startAngle?: number | ||
| endAngle?: number | ||
| innerRadius?: number | ||
| } | ||
| export interface IEllipseData extends IEllipseAttrData, IUIData { } | ||
| export interface IEllipseInputData extends IEllipseAttrData, IUIBaseInputData { } | ||
| // Polygon | ||
| export interface IPolygon extends IUI { | ||
| __: IPolygonData | ||
| sides: number | ||
| points: number[] | ||
| curve: boolean | number | ||
| } | ||
| interface IPolygonAttrData { | ||
| sides?: number | ||
| points?: number[] | ||
| curve?: boolean | number | ||
| } | ||
| export interface IPolygonData extends IPolygonAttrData, IUIData { } | ||
| export interface IPolygonInputData extends IPolygonAttrData, IUIBaseInputData { } | ||
| // Star | ||
| export interface IStar extends IUI { | ||
| __: IStarData | ||
| corners: number | ||
| innerRadius: number | ||
| } | ||
| interface IStarAttrData { | ||
| corners?: number | ||
| innerRadius?: number | ||
| } | ||
| export interface IStarData extends IStarAttrData, IUIData { } | ||
| export interface IStarInputData extends IStarAttrData, IUIBaseInputData { } | ||
| // Path | ||
| export interface IPath extends IUI { | ||
| __: IPathData | ||
| path: IPathCommandData | IPathString | ||
| windingRule: IWindingRule | ||
| } | ||
| export interface IPathData extends IUIData { | ||
| path?: IPathCommandData | ||
| windingRule?: IWindingRule | ||
| } | ||
| export interface IPathInputData extends IUIBaseInputData { | ||
| path?: IPathCommandData | IPathString | ||
| windingRule?: IWindingRule | ||
| } | ||
| // Pen | ||
| export interface IPen extends IGroup, IPathCreator { | ||
| __: IPenData | ||
| pathElement: IPath | ||
| pathStyle: IPathInputData | ||
| path: IPathCommandData | ||
| paint(): void | ||
| clear(): void | ||
| } | ||
| export interface IPenData extends IGroupData { } | ||
| export interface IPenInputData extends IGroupInputData { } | ||
| // Text | ||
| export interface IText extends ITextStyleAttrData, IUI { | ||
| __: ITextData | ||
| text: string | ||
| } | ||
| interface ITextAttrData { | ||
| text?: string | ||
| } | ||
| export interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIData { | ||
| __baseLine?: number | ||
| __lineHeight?: number | ||
| __letterSpacing?: number | ||
| } | ||
| export interface ITextInputData extends ITextAttrData, ITextStyleInputData, IUIBaseInputData { | ||
| } | ||
| export interface ITextRowData { | ||
| x?: number | ||
| y?: number | ||
| width?: number | ||
| height?: number | ||
| text?: string | ||
| data?: ITextCharData[] | ||
| words?: ITextWordData[] | ||
| paraStart?: boolean // paragraph start | ||
| paraEnd?: boolean // paragraph end | ||
| isOverflow?: boolean | ||
| } | ||
| export interface ITextWordData { | ||
| x?: number | ||
| y?: number | ||
| width?: number | ||
| height?: number | ||
| data?: ITextCharData[] | ||
| } | ||
| export interface ITextCharData { | ||
| x?: number | ||
| y?: number | ||
| width?: number | ||
| height?: number | ||
| char?: string | ||
| } | ||
| export interface ITextDrawData { | ||
| bounds: IBoundsData | ||
| rows: ITextRowData[] | ||
| paraNumber: number | ||
| font: string | ||
| decorationY?: number | ||
| decorationHeight?: number | ||
| overflow?: number // overflowed row number, not index | ||
| } | ||
| // Image | ||
| export interface IImage extends IRect, ILeaferImageConfig { | ||
| __: IImageData | ||
| url: string | ||
| ready: boolean | ||
| image?: ILeaferImage | ||
| } | ||
| interface IImageAttrData { | ||
| url?: string | ||
| } | ||
| export interface IImageData extends IImageAttrData, IRectData { } | ||
| export interface IImageInputData extends IImageAttrData, IUIBaseInputData { } | ||
| export interface ICanvas extends IRect { | ||
| __: ICanvasData | ||
| pixelRatio: number | ||
| smooth: boolean | ||
| canvas: ILeaferCanvas | ||
| __updateSize(): void | ||
| } | ||
| interface ICanvasAttrData { | ||
| pixelRatio?: number | ||
| smooth?: boolean | ||
| } | ||
| export interface ICanvasData extends ICanvasAttrData, IRectData { } | ||
| export interface ICanvasInputData extends ICanvasAttrData, IUIBaseInputData { } | ||
| // Leafer | ||
| export interface ILeaferData extends IGroupData { | ||
| pixelRatio?: number | ||
| } | ||
| export interface ILeaferInputData extends IGroupInputData { | ||
| pixelRatio?: number | ||
| } | ||
| // Frame | ||
| export interface IFrame extends IBox { | ||
| __: IFrameData | ||
| } | ||
| export interface IFrameData extends IBoxData { | ||
| } | ||
| export interface IFrameInputData extends IBoxInputData { | ||
| } | ||
| // Box | ||
| export interface IBox extends IGroup { | ||
| __: IBoxData | ||
| overflow: IOverflow | ||
| __updateRectRenderBounds(): void | ||
| __renderGroup(canvas: ILeaferCanvas, options: IRenderOptions): void | ||
| } | ||
| export interface IBoxData extends IGroupData { | ||
| overflow?: IOverflow | ||
| } | ||
| export interface IBoxInputData extends IGroupInputData { | ||
| overflow?: IOverflow | ||
| } | ||
| // Group | ||
| export interface IGroup extends IUI { | ||
| __: IGroupData | ||
| children: IUI[] | ||
| mask?: IUI | ||
| add(child: IUI, index?: number): void | ||
| addAt(child: IUI, index: number): void | ||
| addAfter(child: IUI, after: IUI): void | ||
| addBefore(child: IUI, before: IUI): void | ||
| remove(child?: IUI): void | ||
| removeAll(): void | ||
| } | ||
| export interface IGroupData extends IUIData { } | ||
| export interface IGroupInputData extends IUIBaseInputData { } | ||
| // UI | ||
| export interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrData, IEffectAttrData, ILeaf { | ||
| __: IUIData | ||
| parent?: IGroup | ||
| set(data: IUIInputData): void | ||
| toJSON(): IUIInputData | ||
| getPath(curve?: boolean): IPathCommandData | ||
| getPathString(curve?: boolean): IPathString | ||
| __drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void | ||
| __drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void | ||
| export(filename: string, options?: IExportOptions | number): Promise<IBlob | string | boolean> | ||
| clone(): IUI | ||
| } | ||
| export interface IUIData extends IUIComputedData, ILeafData { | ||
| padding?: number | number[] | ||
| locked?: boolean | ||
| // 非数据属性, 自动计算的缓存数据 | ||
| __isFills?: boolean | ||
| __isStrokes?: boolean | ||
| __drawAfterFill?: boolean | ||
| __isOverflow?: boolean | ||
| __blendLayer?: boolean | ||
| __isTranslucentFill?: boolean // 半透明的 | ||
| __isTranslucentStroke?: boolean | ||
| __useEffect?: boolean | ||
| // path | ||
| path?: IPathCommandData | ||
| windingRule?: IWindingRule | ||
| __pathForRender?: IPathCommandData | ||
| __path2DForRender?: IPath2D | ||
| __boxStroke?: boolean | ||
| // text | ||
| __font?: string | ||
| __textDrawData?: ITextDrawData | ||
| } | ||
| export interface IUIComputedData extends IFillComputedData, IBorderComputedData, IStrokeComputedData, ITextStyleComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData { | ||
| padding?: number | number[] | ||
| locked?: boolean | ||
| } | ||
| export interface IUIBaseInputData extends IFillInputData, IStrokeInputData, ITextStyleInputData, ICornerRadiusInputData, IEffectInputData, ILeafInputData { | ||
| padding?: number | number[] | ||
| locked?: boolean | ||
| children?: IUIBaseInputData[] | ||
| } | ||
| export type IUITag = | ||
| | 'App' | ||
| | 'Leafer' | ||
| | 'Rect' | ||
| | 'Ellipse' | ||
| | 'Polygon' | ||
| | 'Star' | ||
| | 'Line' | ||
| | 'Path' | ||
| | 'Pen' | ||
| | 'Text' | ||
| | 'Image' | ||
| | 'Canvas' | ||
| | 'Group' | ||
| | 'Frame' | ||
| | 'Box' | ||
| export interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IFrameInputData, IUIBaseInputData, IObject { | ||
| } |
| import { IColor } from '../type/IType' | ||
| export interface IColorConvertModule { | ||
| string?(color: IColor, opacity?: number): string | ||
| } |
| import { ILeaferCanvas, IRenderOptions } from '@leafer/interface' | ||
| import { IUI } from '../IUI' | ||
| import { ICachedShape } from '../ICachedShape' | ||
| export interface IEffectModule { | ||
| shadow?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, options: IRenderOptions): void | ||
| innerShadow?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, options: IRenderOptions): void | ||
| blur?(ui: IUI, current: ILeaferCanvas, origin: ILeaferCanvas, options: IRenderOptions): void | ||
| backgroundBlur?(ui: IUI, current: ILeaferCanvas, shape: ICachedShape, options: IRenderOptions): void | ||
| } |
| import { ILeaf, IExportFileType, IBlob } from '@leafer/interface' | ||
| export interface IExportOptions { | ||
| quality?: number | ||
| blob?: boolean | ||
| } | ||
| export interface IExportResult { | ||
| data: IBlob | string | boolean | ||
| } | ||
| export interface IExportResultFunction { | ||
| (data: IExportResult): void | ||
| } | ||
| export interface IExportModule { | ||
| export?(leaf: ILeaf, filename: IExportFileType | string, options?: IExportOptions | number | boolean): Promise<IExportResult> | ||
| } |
| import { ILeaferCanvas, IRenderOptions, IBooleanMap } from '@leafer/interface' | ||
| import { ILeafPaint } from '../type/IComputedType' | ||
| import { IUI, IUIData } from '../IUI' | ||
| import { ICachedShape } from '../ICachedShape' | ||
| export interface IPaintModule { | ||
| compute?(ui: IUI, attrName: 'fill' | 'stroke'): void | ||
| fill?(ui: IUI, canvas: ILeaferCanvas, fill: string): void | ||
| fills?(ui: IUI, canvas: ILeaferCanvas, fills: ILeafPaint[]): void | ||
| fillText?(ui: IUI, canvas: ILeaferCanvas): void | ||
| stroke?(ui: IUI, canvas: ILeaferCanvas, stroke: string): void | ||
| strokes?(ui: IUI, canvas: ILeaferCanvas, strokes: ILeafPaint[]): void | ||
| strokeText?(ui: IUI, canvas: ILeaferCanvas, stroke: string): void | ||
| strokesText?(ui: IUI, canvas: ILeaferCanvas, strokes: ILeafPaint[]): void | ||
| drawTextStroke?(ui: IUI, canvas: ILeaferCanvas): void | ||
| shape?(ui: IUI, current: ILeaferCanvas, options: IRenderOptions): ICachedShape | ||
| recycleImage?(data: IUIData, attrName: string): IBooleanMap | ||
| } |
| import { ITextData, ITextDrawData } from '../IUI' | ||
| export interface ITextConvertModule { | ||
| getDrawData?(content: string, style: ITextData): ITextDrawData | ||
| } |
| import { ILeafBounds } from '@leafer/interface' | ||
| import { IUI } from '../IUI' | ||
| export type IUIBoundsModule = IUIBounds & ThisType<IUI> | ||
| interface IUIBounds extends ILeafBounds { | ||
| } |
| import { ILeafHit } from '@leafer/interface' | ||
| import { IUI } from '../IUI' | ||
| export type IUIHitModule = ILeafHit & ThisType<IUI> |
| import { ILeafRender, ILeaferCanvas, IRenderOptions } from '@leafer/interface' | ||
| import { IUI, IRect, IImage, IText, IFrame, IGroup } from '../IUI' | ||
| export type IUIRenderModule = IUIRender & ThisType<IUI> | ||
| export interface IUIRender extends ILeafRender { | ||
| __drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void | ||
| } | ||
| export type IRectRenderModule = IRectRender & ThisType<IRect> | ||
| export interface IRectRender extends IUIRender { | ||
| } | ||
| export type IImageRenderModule = IImageRender & ThisType<IImage> | ||
| export interface IImageRender extends IUIRender { | ||
| } | ||
| export type ITextRenderModule = ITextRender & ThisType<IText> | ||
| export interface ITextRender extends IUIRender { | ||
| } | ||
| export type IGroupRenderModule = IGroupRender & ThisType<IGroup> | ||
| export interface IGroupRender extends IUIRender { | ||
| } | ||
| export type IFrameRenderModule = IFrameRender & ThisType<IFrame> | ||
| export interface IFrameRender extends IGroupRender { | ||
| } | ||
| import { IBlendMode, ILeaferImage, IMatrixData } from '@leafer/interface' | ||
| import { IColorString } from './IStringType' | ||
| import { IStrokeAlign, IStrokeJoin, IStrokeCap, IImagePaintMode } from './IType' | ||
| import { IPaintType } from './IType' | ||
| export type ILeafPaintColor = IColorString | CanvasGradient | CanvasPattern | ||
| export interface ILeafPaint { | ||
| type?: IPaintType | ||
| style?: ILeafPaintColor | ||
| transform?: IMatrixData | ||
| blendMode?: IBlendMode | ||
| opacity?: number | ||
| image?: ILeaferImage | ||
| loadId?: number | ||
| patternId?: string | ||
| data?: ILeafPaintPatternData | ||
| } | ||
| export interface ILeafPaintPatternData { | ||
| width?: number | ||
| height?: number | ||
| scaleX?: number | ||
| scaleY?: number | ||
| opacity?: number | ||
| transform?: IMatrixData | ||
| mode?: IImagePaintMode | ||
| } | ||
| export type ILeafFill = ILeafPaint | ||
| export interface ILeafStrokePaint extends ILeafPaint { | ||
| strokeAlign?: IStrokeAlign | ||
| strokeWidth?: number | ||
| strokeCap?: IStrokeCap | ||
| strokeJoin?: IStrokeJoin | ||
| dashPattern?: number[] | ||
| miterLimit?: number | ||
| } | ||
| export interface ILeafShadowEffect { | ||
| x: number | ||
| y: number | ||
| blur: number | ||
| spread?: number | ||
| color: IColorString | ||
| blendMode?: IBlendMode | ||
| box?: boolean | ||
| } |
| export type IPercent = string | ||
| export type IColorString = string | ||
| export type ICornerRadiusString = string | ||
| export type IStrokeWidthString = string | ||
| export type IDashPatternString = string | ||
| export type IPaintString = ISolidPaintString | IGradientPaintString | IImagePaintString | ||
| export type ISolidPaintString = string | ||
| export type IGradientPaintString = string | ||
| export type IImagePaintString = string | ||
| export type IShadowString = string |
| import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType } from '@leafer/interface' | ||
| import { IColorString } from './IStringType' | ||
| export interface IUnitData { | ||
| type: 'percent' | 'px' | ||
| value: number | ||
| } | ||
| export type IPaint = ISolidPaint | IGradientPaint | IImagePaint | ||
| export interface IPaintBase { | ||
| type: IPaintType | ||
| blendMode?: IBlendMode | ||
| visible?: boolean | ||
| opacity?: number | ||
| } | ||
| export type IPaintType = | ||
| | 'image' | ||
| | 'solid' | ||
| | IGradientType | ||
| export type IGradientType = | ||
| | 'linear' | ||
| | 'radial' | ||
| | 'angular' | ||
| // --- | ||
| export interface ISolidPaint extends IPaintBase { | ||
| type: 'solid' | ||
| color: IColor | ||
| } | ||
| export type IColor = IColorString | IRGB | IRGBA | ||
| export interface IRGB { | ||
| r: number | ||
| g: number | ||
| b: number | ||
| a?: number | ||
| } | ||
| export interface IRGBA extends IRGB { | ||
| a: number | ||
| } | ||
| // --- | ||
| export interface IGradientPaint extends IPaintBase { | ||
| type: IGradientType | ||
| from?: IPointData | ||
| to?: IPointData | ||
| stretch?: number | ||
| stops: IColorStop[] | ||
| } | ||
| export interface IColorStop { | ||
| offset: number | ||
| color: IColor | ||
| } | ||
| // --- | ||
| export interface IImagePaint extends IPaintBase { | ||
| type: "image" | ||
| url: string | ||
| mode?: IImagePaintMode | ||
| format?: IExportFileType | ||
| filters?: IImageFilters | ||
| offset?: IPointData | ||
| scale?: number | IPointData | ||
| rotation?: number | ||
| } | ||
| export interface IImageFilters { | ||
| exposure?: number // 曝光 | ||
| contrast?: number // 对比度 | ||
| saturation?: number // 饱和度 | ||
| temperature?: number // 色温 | ||
| tint?: number // 色调 | ||
| highlights?: number // 高光 | ||
| shadows?: number // 阴影 | ||
| } | ||
| export type IImagePaintMode = 'cover' | 'fit' | 'strench' | 'clip' | 'repeat' | ||
| // 描边 | ||
| export type IStrokeAlign = 'inside' | 'outside' | 'center' | ||
| export type IStrokeCap = 'none' | 'round' | 'square' | 'arrow-lines' | 'arrow-equilateral' | ||
| export type IStrokeJoin = 'bevel' | 'round' | 'miter' | ||
| // 文本 | ||
| export type ITextAlign = 'left' | 'center' | 'right' | 'justify' | ||
| export type IVerticalAlign = 'top' | 'middle' | 'bottom' | ||
| export type ITextCase = | 'upper' | 'lower' | 'title' | 'none' | 'small-caps' | ||
| export type IFontWeight = IFontWeightNumer | IFontWeightString | ||
| export type IFontWeightNumer = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | ||
| export type IFontWeightString = | ||
| | 'thin' | ||
| | 'extra-light' | ||
| | 'light' | ||
| | 'normal' | ||
| | 'medium' | ||
| | 'semi-bold' | ||
| | 'bold' | ||
| | 'extra-bold' | ||
| | 'black' | ||
| export type ITextDecoration = 'none' | 'under' | 'delete' | ||
| // 路径 | ||
| export interface IVectorPath { | ||
| rule?: IWindingRule, | ||
| data: string | IPathCommandData | ||
| } | ||
| // 特效 | ||
| export interface IShadowEffect { | ||
| x: number | ||
| y: number | ||
| blur: number | ||
| spread?: number | ||
| color: IColorString | IColor | ||
| blendMode?: IBlendMode | ||
| visible?: boolean | ||
| box?: boolean | ||
| } | ||
| export interface IBlurEffect { | ||
| blur: number | ||
| visible?: boolean | ||
| } | ||
| export interface IGrayscaleEffect { | ||
| grayscale: number | ||
| visible?: boolean | ||
| } | ||
| export type IOverflow = 'show' | 'hide' |
+3
-2
| { | ||
| "name": "@leafer-ui/interface", | ||
| "version": "1.0.0-beta.15", | ||
| "version": "1.0.0-beta.16", | ||
| "description": "@leafer-ui/interface", | ||
@@ -10,2 +10,3 @@ "author": "Chao (Leafer) Wan", | ||
| "files": [ | ||
| "src", | ||
| "types", | ||
@@ -25,4 +26,4 @@ "dist" | ||
| "dependencies": { | ||
| "@leafer/interface": "1.0.0-beta.15" | ||
| "@leafer/interface": "1.0.0-beta.16" | ||
| } | ||
| } |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
43531
92.43%19
280%1265
105.02%0
-100%+ Added
- Removed