@leafer-ui/interface
Advanced tools
+2
-2
| { | ||
| "name": "@leafer-ui/interface", | ||
| "version": "1.0.0-alpha.23", | ||
| "version": "1.0.0-alpha.30", | ||
| "description": "@leafer-ui/interface", | ||
@@ -22,4 +22,4 @@ "author": "Chao (Leafer) Wan", | ||
| "dependencies": { | ||
| "@leafer/interface": "1.0.0-alpha.23" | ||
| "@leafer/interface": "1.0.0-alpha.30" | ||
| } | ||
| } |
+16
-11
@@ -1,2 +0,2 @@ | ||
| import { IPaint, IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign } from './type/IType' | ||
| 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' | ||
@@ -80,10 +80,12 @@ import { IPaintString, IDashPatternString, IPercent, IShadowString, IStringColor, IStrokeWidthString, ICornerRadiusString } from './type/IStringType' | ||
| textDecoration: ITextDecoration | ||
| letterSpacing: number | IPercent | ||
| lineHeight: number | IPercent | ||
| letterSpacing: number | IUnitData | ||
| lineHeight: number | IUnitData | ||
| paragraphIndent: number | ||
| paragraphSpacing: number | ||
| paraIndent: number | ||
| paraSpacing: number | ||
| textAlign: ITextAlign | ||
| verticalAlign: IVerticalAlign | ||
| textOverflow: IOverflow | string | ||
| } | ||
@@ -97,10 +99,12 @@ export interface ITextStyleInputData { | ||
| textDecoration?: ITextDecoration | ||
| letterSpacing?: number | IPercent | ||
| lineHeight?: number | IPercent | ||
| letterSpacing?: number | IUnitData | ||
| lineHeight?: number | IUnitData | ||
| paragraphIndent?: number | ||
| paragraphSpacing?: number | ||
| paraIndent?: number | ||
| paraSpacing?: number | ||
| textAlign?: ITextAlign | ||
| verticalAlign?: IVerticalAlign | ||
| textOverflow?: IOverflow | string | ||
| } | ||
@@ -117,7 +121,8 @@ export interface ITextStyleComputedData { | ||
| paragraphIndent?: number | ||
| paragraphSpacing?: number | ||
| paraIndent?: number | ||
| paraSpacing?: number | ||
| textAlign?: ITextAlign | ||
| verticalAlign?: IVerticalAlign | ||
| textOverflow?: IOverflow | ||
| } | ||
@@ -124,0 +129,0 @@ |
+7
-2
@@ -0,1 +1,2 @@ | ||
| import { ITextStyleComputedData } from './ICommonAttr' | ||
| export * from '@leafer/interface' | ||
@@ -10,11 +11,15 @@ | ||
| IPath, IPathInputData, IPathData, | ||
| IPen, IPenInputData, IPenData, | ||
| IVector, IVectorInputData, IVectorData, | ||
| IText, ITextInputData, ITextData, ITextRowData, ITextDrawData, | ||
| IText, ITextInputData, ITextData, ITextRowData, ITextWordData, ITextCharData, ITextDrawData, | ||
| IImage, IImageInputData, IImageData, | ||
| ICanvas, ICanvasInputData, ICanvasData, | ||
| IFrame, IFrameInputData, IFrameData, | ||
| IBox, IBoxInputData, IBoxData, | ||
| IGroup, IGroupInputData, IGroupData, | ||
| ILeaferInputData, ILeaferData, | ||
| IUI, IUIInputData, IUIData, | ||
| IUITag, IUITagInputData | ||
| } from './IUI' | ||
| export { IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IColor, IColorStop, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, ITextCase, ITextDecoration, ITextAlign, IVerticalAlign } from './type/IType' | ||
| export { IUnitData, IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IRGB, IRGBA, IColor, IColorStop, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, ITextCase, ITextDecoration, ITextAlign, IVerticalAlign, IOverflow } from './type/IType' | ||
| export { ICornerRadiusString, IStrokeWidthString, IPaintString, IShadowString, IPercent, IDashPatternString, IPathString, IVectorPathString, IStringColor } from './type/IStringType' | ||
@@ -21,0 +26,0 @@ export { ILeafFill, ILeafPaint, ILeafPaintColor, ILeafStrokePaint, ILeafShadowEffect } from './type/IComputedType' |
+124
-25
| import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IPathDrawer, IPointData, IPath2D, IPathCommandData, IWindingRule, ILeaferImageConfig, IBoundsData, IObject, __Number, ILeaferImage } from '@leafer/interface' | ||
| import { IPathString, IVectorPathString } from './type/IStringType' | ||
| import { IVectorPath } from './type/IType' | ||
| import { IOverflow, IUnitData, IVectorPath } from './type/IType' | ||
@@ -82,2 +82,4 @@ import { | ||
| windingRule: IWindingRule | ||
| getCurvePath(): IPathCommandData | ||
| getStringPath(curve?: boolean): IPathString | ||
| } | ||
@@ -93,3 +95,30 @@ export interface IPathData extends IUIData { | ||
| // Pen | ||
| export interface IPen extends IGroup { | ||
| __: IPenData | ||
| path: IPath | ||
| pathStyle: IPathInputData | ||
| pathData: IPathCommandData | ||
| moveTo(x: number, y: number): IPen | ||
| lineTo(x: number, y: number): IPen | ||
| bezierCurveTo(x1: number, y1: number, x2: number, y2: number, x: number, y: number): IPen | ||
| quadraticCurveTo(x1: number, y1: number, x: number, y: number): IPen | ||
| rect(x: number, y: number, width: number, height: number): IPen | ||
| roundRect(x: number, y: number, width: number, height: number, cornerRadius: number | number[]): IPen | ||
| ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation?: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean): IPen | ||
| arc(x: number, y: number, radius: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean): IPen | ||
| arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): IPen | ||
| close(): IPen | ||
| clear(): IPen | ||
| paint(): void | ||
| } | ||
| export interface IPenData extends IGroupData { } | ||
| export interface IPenInputData extends IGroupInputData { } | ||
| // Vector | ||
@@ -111,8 +140,17 @@ export interface IVector extends IUI { | ||
| __: ITextData | ||
| content: string | ||
| text: string | ||
| } | ||
| interface ITextAttrData { | ||
| content?: string | ||
| text?: string | ||
| } | ||
| export interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIData { | ||
| __baseLine?: number | ||
| __lineHeight?: number | ||
| __letterSpacing?: number | ||
| } | ||
| export interface ITextInputData extends ITextAttrData, ITextStyleInputData, IUIInputData { | ||
| } | ||
| export interface ITextRowData { | ||
@@ -123,20 +161,37 @@ x?: number | ||
| height?: number | ||
| text: string | ||
| text?: string | ||
| data?: ITextCharData[] | ||
| words?: ITextWordData[] | ||
| paraStart?: boolean // paragraph start | ||
| paraEnd?: boolean // paragraph end | ||
| isOverflow?: boolean | ||
| } | ||
| export interface ITextDrawData extends IBoundsData { | ||
| list: ITextRowData[] | ||
| 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 | ||
| } | ||
| export interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIData { | ||
| } | ||
| export interface ITextInputData extends ITextAttrData, ITextStyleInputData, IUIInputData { | ||
| } | ||
| // Image | ||
@@ -155,17 +210,50 @@ export interface IImage extends IRect, ILeaferImageConfig { | ||
| export interface ICanvas extends IRect { | ||
| __: ICanvasData | ||
| pixelRatio: number | ||
| smooth: boolean | ||
| canvas: ILeaferCanvas | ||
| } | ||
| interface ICanvasAttrData { | ||
| pixelRatio?: number | ||
| smooth?: boolean | ||
| } | ||
| export interface ICanvasData extends ICanvasAttrData, IRectData { } | ||
| export interface ICanvasInputData extends ICanvasAttrData, IUIInputData { } | ||
| // Leafer | ||
| export interface ILeaferData extends IGroupData { | ||
| pixelRatio?: number | ||
| } | ||
| export interface ILeaferInputData extends IGroupInputData { | ||
| pixelRatio?: number | ||
| } | ||
| // Frame | ||
| export interface IFrame extends IGroup { | ||
| export interface IFrame extends IBox { | ||
| __: IFrameData | ||
| clip: boolean | ||
| __updateRectBoxBounds(): void | ||
| __updateRectStrokeBounds(): void | ||
| } | ||
| export interface IFrameData extends IBoxData { | ||
| } | ||
| export interface IFrameInputData extends IBoxInputData { | ||
| } | ||
| // Box | ||
| export interface IBox extends IGroup { | ||
| __: IBoxData | ||
| overflow: IOverflow | ||
| __updateRectRenderBounds(): void | ||
| __renderRect(canvas: ILeaferCanvas, options: IRenderOptions): void | ||
| __renderGroup(canvas: ILeaferCanvas, options: IRenderOptions): void | ||
| } | ||
| export interface IFrameData extends IGroupData { | ||
| clip?: boolean | ||
| export interface IBoxData extends IGroupData { | ||
| overflow?: IOverflow | ||
| } | ||
| export interface IFrameInputData extends IGroupInputData { | ||
| clip?: boolean | ||
| export interface IBoxInputData extends IGroupInputData { | ||
| overflow?: IOverflow | ||
| } | ||
@@ -197,8 +285,15 @@ | ||
| __drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void | ||
| __drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void | ||
| } | ||
| export interface IUIData extends IUIComputedData, ILeafData { | ||
| padding?: number | number[] | ||
| locked?: boolean | ||
| // 非数据属性, 自动计算的缓存数据 | ||
| __isFills?: boolean | ||
| __isStrokes?: boolean | ||
| __drawAfterFill?: boolean | ||
| __isOverflow?: boolean | ||
@@ -220,9 +315,13 @@ __isTranslucentFill?: boolean // 半透明的 | ||
| // text | ||
| __font?: string | ||
| __textDrawData?: ITextDrawData | ||
| } | ||
| export interface IUIComputedData extends IFillComputedData, IBorderComputedData, IStrokeComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData { | ||
| export interface IUIComputedData extends IFillComputedData, IBorderComputedData, IStrokeComputedData, ITextStyleComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData { | ||
| padding?: number | number[] | ||
| locked?: boolean | ||
| } | ||
| export interface IUIInputData extends IFillInputData, IStrokeInputData, ICornerRadiusInputData, IEffectInputData, ILeafInputData { | ||
| export interface IUIInputData extends IFillInputData, IStrokeInputData, ITextStyleInputData, ICornerRadiusInputData, IEffectInputData, ILeafInputData { | ||
| padding?: number | number[] | ||
| locked?: boolean | ||
@@ -229,0 +328,0 @@ } |
@@ -14,6 +14,13 @@ import { ILeaferCanvas, IRenderOptions } from '@leafer/interface' | ||
| drawText?(ui: IUI, canvas: ILeaferCanvas): void | ||
| stroke?(ui: IUI, canvas: ILeaferCanvas, stroke: string | object): void | ||
| strokes?(ui: IUI, canvas: ILeaferCanvas, strokes: ILeafPaint[]): void | ||
| strokeText?(ui: IUI, canvas: ILeaferCanvas, stroke: string | object): void | ||
| strokesText?(ui: IUI, canvas: ILeaferCanvas, strokes: ILeafPaint[]): void | ||
| drawTextStroke?(ui: IUI, canvas: ILeaferCanvas): void | ||
| shape?(ui: IUI, current: ILeaferCanvas, options: IRenderOptions): ICachedShape | ||
| } |
@@ -1,2 +0,2 @@ | ||
| import { ILeafRender } from '@leafer/interface' | ||
| import { ILeafRender, ILeaferCanvas, IRenderOptions } from '@leafer/interface' | ||
@@ -8,2 +8,3 @@ import { IUI, IRect, IImage, IText, IFrame, IGroup } from '../IUI' | ||
| export interface IUIRender extends ILeafRender { | ||
| __drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void | ||
| } | ||
@@ -10,0 +11,0 @@ |
+12
-6
@@ -1,4 +0,8 @@ | ||
| import { IMatrixData, IPointData, IPathCommandData, IWindingRule, IBlendMode } from '@leafer/interface' | ||
| import { IPointData, IPathCommandData, IWindingRule, IBlendMode } from '@leafer/interface' | ||
| import { IStringColor } from './IStringType' | ||
| export interface IUnitData { | ||
| type: 'percent' | 'px' | ||
| value: number | ||
| } | ||
@@ -86,5 +90,5 @@ export type IPaint = ISolidPaint | IGradientPaint | IImagePaint | ||
| export type IVerticalAlign = 'top' | 'middle' | 'bottom' | ||
| export type ITextCase = | 'upper' | 'lower' | 'title' | 'original' | 'small-caps' | 'small-caps-forced' | ||
| export type IFontWeight = IFontWeightNumerical | IFontWeightString | ||
| export type IFontWeightNumerical = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | ||
| export type ITextCase = | 'upper' | 'lower' | 'title' | 'none' | 'small-caps' | 'small-caps-forced' | ||
| export type IFontWeight = IFontWeightNumer | IFontWeightString | ||
| export type IFontWeightNumer = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | ||
| export type IFontWeightString = | ||
@@ -100,3 +104,3 @@ | 'thin' | ||
| | 'black' | ||
| export type ITextDecoration = 'none' | 'strikethrough' | 'underline' | ||
| export type ITextDecoration = 'none' | 'delete' | 'underline' | ||
@@ -129,2 +133,4 @@ // 路径 | ||
| visible?: boolean | ||
| } | ||
| } | ||
| export type IOverflow = 'show' | 'hide' |
23861
17.13%650
17.97%+ Added
- Removed