You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@leafer-ui/interface

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafer-ui/interface - npm Package Compare versions

Comparing version
1.0.0-rc.6
to
1.0.0-rc.7
+16
src/app/IApp.ts
import { ILeaferConfig } from '@leafer/interface'
import { ILeafer } from './ILeafer'
import { IEditorConfig } from '../editor/IEditor'
export interface IApp extends ILeafer {
children: ILeafer[]
realCanvas: boolean
}
export interface IAppConfig extends ILeaferConfig {
ground?: ILeaferConfig
tree?: ILeaferConfig
sky?: ILeaferConfig
editor?: IEditorConfig
}
import { IControl, ILeaferAttrData, ILeaferConfig } from '@leafer/interface'
import { IApp } from './IApp'
import { IGroup } from '../IUI'
import { IEditorBase } from '../editor/IEditor'
export interface ILeafer extends IGroup, ILeaferAttrData, IControl {
readonly isApp: boolean
readonly app: ILeafer
parent?: IApp
zoomLayer?: IGroup
editor?: IEditorBase
ground?: ILeafer
tree?: ILeafer
sky?: ILeafer
userConfig?: ILeaferConfig
}
import { IGroup, IUI, IRectInputData, ISelectorProxy, IEditSize, ICursorType, IAround, IDragEvent, IRotateEvent, IStroke, IFill, ILeafList, ILeaf, IObject, IBoxInputData } from '@leafer-ui/interface'
export interface IEditorBase extends IGroup, ISelectorProxy {
config: IEditorConfig
hoverTarget: IUI
target: IUI | IUI[] | ILeafList
readonly list: IUI[]
readonly hasTarget: boolean
readonly multiple: boolean
readonly single: boolean
readonly dragging: boolean
element: IUI
buttons: IGroup
selector: IGroup
editBox: IGroup
editTool: IObject
hasItem(item: IUI): boolean
shiftItem(item: IUI): void
addItem(item: IUI): void
removeItem(item: IUI): void
update(): void
updateEditTool(): void
getEditSize(ui: ILeaf): IEditSize
onMove(e: IDragEvent): void
onScale(e: IDragEvent): void
onRotate(e: IDragEvent | IRotateEvent): void
onSkew(e: IDragEvent): void
group(): void
ungroup(): void
lock(): void
unlock(): void
toTop(): void
toBottom(): void
}
export interface IEditorConfig {
editSize?: 'auto' | IEditSize
stroke?: IStroke
strokeWidth?: number
pointFill?: IFill
pointSize?: number
pointRadius?: number
point?: IBoxInputData | IBoxInputData[]
middlePoint?: IBoxInputData | IBoxInputData[]
rotatePoint?: IBoxInputData
rect?: IBoxInputData
area?: IRectInputData
buttonsDirection?: 'top' | 'right' | 'bottom' | 'left'
buttonsFixed?: boolean
buttonsMargin?: number
hideOnMove?: boolean
moveCursor?: ICursorType
resizeCursor?: ICursorType[]
rotateCursor?: ICursorType[]
around?: IAround
lockRatio?: boolean
rotateGap?: number
selector?: boolean
hover?: boolean
boxSelect?: boolean
rotateable?: boolean
resizeable?: boolean
skewable?: boolean
}
+2
-2
{
"name": "@leafer-ui/interface",
"version": "1.0.0-rc.6",
"version": "1.0.0-rc.7",
"description": "@leafer-ui/interface",

@@ -25,4 +25,4 @@ "author": "Chao (Leafer) Wan",

"dependencies": {
"@leafer/interface": "1.0.0-rc.6"
"@leafer/interface": "1.0.0-rc.7"
}
}

@@ -1,4 +0,4 @@

import { IPaint, IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow, IUnitData, ITextWrap } from './type/IType'
import { IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow, IUnitData, ITextWrap, IStroke, IFill } from './type/IType'
import { ILeafStrokePaint, ILeafShadowEffect, ILeafPaint } from './type/IComputedType'
import { IPaintString, IDashPatternString, IShadowString, IColorString, IStrokeWidthString, ICornerRadiusString } from './type/IStringType'
import { IDashPatternString, IShadowString, IColorString, IStrokeWidthString, ICornerRadiusString } from './type/IStringType'

@@ -21,6 +21,6 @@ // corner---

export interface IFillAttrData {
fill: IPaint | IPaint[] | IPaintString
fill: IFill
}
export interface IFillInputData {
fill?: IPaint | IPaint[] | IPaintString
fill?: IFill
}

@@ -39,3 +39,3 @@ export interface IFillComputedData {

export interface IStrokeAttrData {
stroke: IPaint | IPaint[] | IPaintString
stroke: IStroke

@@ -51,3 +51,3 @@ strokeAlign: IStrokeAlign

export interface IStrokeInputData {
stroke?: IPaint | IPaint[] | IPaintString
stroke?: IStroke

@@ -54,0 +54,0 @@ strokeAlign?: IStrokeAlign

export * from '@leafer/interface'
export { IApp, IAppConfig } from './app/IApp'
export { ILeafer } from './app/ILeafer'
export {

@@ -18,6 +21,8 @@ ILine, ILineInputData, ILineData,

ILeaferInputData, ILeaferData,
IUI, IUIBaseInputData, IUIData,
IAppInputData, IAppData,
IUI, IUIBaseInputData, IUIData, IFindUIMethod,
IUITag, IUIInputData
} from './IUI'
export { IUnitData, IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IRGB, IRGBA, IColor, IColorStop, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, ITextCase, ITextDecoration, ITextAlign, IVerticalAlign, IOverflow, ITextWrap } from './type/IType'
export { IUnitData, IVectorPath, IShadowEffect, IBlurEffect, IGrayscaleEffect, IFill, IStroke, IStrokeAlign, IStrokeJoin, IStrokeCap, IRGB, IRGBA, IColor, IColorStop, IPaint, IGradientPaint, IImagePaint, IImagePaintMode, IFontWeight, ITextCase, ITextDecoration, ITextAlign, IVerticalAlign, IOverflow, ITextWrap } from './type/IType'
export { ICornerRadiusString, IStrokeWidthString, IPaintString, IShadowString, IPercent, IDashPatternString, IColorString as IStringColor } from './type/IStringType'

@@ -33,5 +38,6 @@ export { ILeafFill, ILeafPaint, ILeafPaintPatternData, ILeafPaintColor, ILeafStrokePaint, ILeafShadowEffect } from './type/IComputedType'

export { IPaintModule } from './module/IPaint'
export { IEffectModule } from './module/IEffect'
export { ICachedShape } from './ICachedShape'
export { ICachedShape } from './ICachedShape'
export { IEditorBase, IEditorConfig } from './editor/IEditor'

@@ -1,2 +0,2 @@

import { ILeaf, ILeafComputedData, ILeafData, ILeafDataOptions, ILeafInputData, ILeaferCanvas, IRenderOptions, IPathDrawer, IPointData, IPath2D, IPathCommandData, IWindingRule, ILeaferImageConfig, IBoundsData, IObject, __Number, IPathString, ILeaferImage, IBlob, IPathCreator, IFindMethod } from '@leafer/interface'
import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IPathDrawer, IPointData, IPath2D, IPathCommandData, IWindingRule, ILeaferImageConfig, IBoundsData, IObject, IPathString, ILeaferImage, IBlob, IPathCreator, AnswerType } from '@leafer/interface'

@@ -13,2 +13,3 @@ import {

import { IExportOptions } from './module/IExport'
import { ILeafer } from './app/ILeafer'

@@ -23,4 +24,4 @@

}
export interface ILineData extends IUIData { }
export interface ILineInputData extends IUIBaseInputData {
interface ILineAttrData {
toPoint?: IPointData

@@ -30,2 +31,4 @@ points?: number[]

}
export interface ILineData extends ILineAttrData, IUIData { }
export interface ILineInputData extends ILineAttrData, IUIBaseInputData { }

@@ -218,3 +221,9 @@

export interface IAppData extends ILeaferData {
}
export interface IAppInputData extends ILeaferInputData {
}
// Frame

@@ -256,2 +265,3 @@ export interface IFrame extends IBox {

addBefore(child: IUI, before: IUI): void
addMany(...children: ILeaf[]): void
remove(child?: IUI): void

@@ -266,16 +276,23 @@ removeAll(): void

__: IUIData
readonly app: ILeafer
leafer?: ILeafer
parent?: IGroup
isFrame?: boolean
proxyData?: IUIInputData
__proxyData?: IUIInputData
reset(_data?: IUIInputData): void
children?: IUI[]
reset(data?: IUIInputData): void
set(data: IUIInputData): void
toJSON(): IUIInputData
get(options?: ILeafDataOptions): IUIInputData
getProxyData(): IUIInputData
get(): IUIInputData
createProxyData(): IUIInputData
find(condition: number | string | IFindMethod): IUI[]
findOne(condition: number | string | IFindMethod): IUI
find(condition: number | string | IFindUIMethod, options?: any): IUI[]
findOne(condition: number | string | IFindUIMethod, options?: any): IUI

@@ -286,2 +303,3 @@ getPath(curve?: boolean): IPathCommandData

__drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void
__drawPathByBox(drawer: IPathDrawer): void
__drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void

@@ -291,3 +309,6 @@

clone(): IUI
}
export interface IFindUIMethod {
(leaf: IUI, options?: any): AnswerType
}

@@ -316,2 +337,6 @@

__autoWidth: boolean
__autoHeight: boolean
__autoBounds: boolean
// path

@@ -340,3 +365,3 @@ path?: IPathCommandData

locked?: boolean
children?: IUIBaseInputData[]
children?: IUIInputData[]
}

@@ -364,3 +389,3 @@

export interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IFrameInputData, IUIBaseInputData, IObject {
children?: IUIInputData[]
}

@@ -18,3 +18,4 @@ import { ILeaf, IExportFileType, IBlob } from '@leafer/interface'

export interface IExportModule {
running?: boolean
export?(leaf: ILeaf, filename: IExportFileType | string, options?: IExportOptions | number | boolean): Promise<IExportResult>
}
import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType } from '@leafer/interface'
import { IColorString } from './IStringType'
import { IColorString, IPaintString } from './IStringType'

@@ -11,2 +11,6 @@ export interface IUnitData {

export type IFill = IPaint | IPaint[] | IPaintString
export type IStroke = IPaint | IPaint[] | IPaintString
export interface IPaintBase {

@@ -13,0 +17,0 @@ type: IPaintType

@@ -1,3 +0,4 @@

import { IPointData, IExportFileType, IWindingRule, IPathCommandData, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, IBlob, ILeaf, IPathString, IPathCreator, IBoundsData, ILeaferImageConfig, ILeaferCanvas, IRenderOptions, ILeafDataOptions, IFindMethod, IPathDrawer, ILeafData, IPath2D, ILeafComputedData, ILeafInputData, IObject, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap } from '@leafer/interface';
import { IPointData, IExportFileType, IWindingRule, IPathCommandData, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, IBlob, ILeaf, IPathString, IPathCreator, IBoundsData, ILeaferImageConfig, ILeaferCanvas, IRenderOptions, IPathDrawer, AnswerType, ILeafData, IPath2D, ILeafComputedData, ILeafInputData, IObject, ILeaferAttrData, IControl, ILeaferConfig, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap } from '@leafer/interface';
export * from '@leafer/interface';
import { IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, ILeafList, IObject as IObject$1, ILeaf as ILeaf$1, IEditSize, IDragEvent, IRotateEvent, IStroke as IStroke$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, ICursorType, IAround } from '@leafer-ui/interface';

@@ -20,2 +21,4 @@ type IPercent = string;

type IPaint = ISolidPaint | IGradientPaint | IImagePaint;
type IFill = IPaint | IPaint[] | IPaintString;
type IStroke = IPaint | IPaint[] | IPaintString;
interface IPaintBase {

@@ -163,6 +166,6 @@ type: IPaintType;

interface IFillAttrData {
fill: IPaint | IPaint[] | IPaintString;
fill: IFill;
}
interface IFillInputData {
fill?: IPaint | IPaint[] | IPaintString;
fill?: IFill;
}

@@ -177,3 +180,3 @@ interface IFillComputedData {

interface IStrokeAttrData {
stroke: IPaint | IPaint[] | IPaintString;
stroke: IStroke;
strokeAlign: IStrokeAlign;

@@ -188,3 +191,3 @@ strokeWidth: number | number[] | IStrokeWidthString;

interface IStrokeInputData {
stroke?: IPaint | IPaint[] | IPaintString;
stroke?: IStroke;
strokeAlign?: IStrokeAlign;

@@ -290,2 +293,3 @@ strokeWidth?: number | number[] | IStrokeWidthString;

interface IExportModule {
running?: boolean;
export?(leaf: ILeaf, filename: IExportFileType | string, options?: IExportOptions | number | boolean): Promise<IExportResult>;

@@ -300,5 +304,3 @@ }

}
interface ILineData extends IUIData {
}
interface ILineInputData extends IUIBaseInputData {
interface ILineAttrData {
toPoint?: IPointData;

@@ -308,2 +310,6 @@ points?: number[];

}
interface ILineData extends ILineAttrData, IUIData {
}
interface ILineInputData extends ILineAttrData, IUIBaseInputData {
}
interface IRect extends IUI {

@@ -472,2 +478,6 @@ __: IRectData;

}
interface IAppData extends ILeaferData {
}
interface IAppInputData extends ILeaferInputData {
}
interface IFrame extends IBox {

@@ -500,2 +510,3 @@ __: IFrameData;

addBefore(child: IUI, before: IUI): void;
addMany(...children: ILeaf[]): void;
remove(child?: IUI): void;

@@ -510,14 +521,20 @@ removeAll(): void;

__: IUIData;
readonly app: ILeafer;
leafer?: ILeafer;
parent?: IGroup;
isFrame?: boolean;
proxyData?: IUIInputData;
reset(_data?: IUIInputData): void;
__proxyData?: IUIInputData;
children?: IUI[];
reset(data?: IUIInputData): void;
set(data: IUIInputData): void;
toJSON(): IUIInputData;
get(options?: ILeafDataOptions): IUIInputData;
getProxyData(): IUIInputData;
find(condition: number | string | IFindMethod): IUI[];
findOne(condition: number | string | IFindMethod): IUI;
get(): IUIInputData;
createProxyData(): IUIInputData;
find(condition: number | string | IFindUIMethod, options?: any): IUI[];
findOne(condition: number | string | IFindUIMethod, options?: any): IUI;
getPath(curve?: boolean): IPathCommandData;
getPathString(curve?: boolean): IPathString;
__drawPathByData(drawer: IPathDrawer, data: IPathCommandData): void;
__drawPathByBox(drawer: IPathDrawer): void;
__drawAfterFill?(canvas: ILeaferCanvas, options: IRenderOptions): void;

@@ -527,2 +544,5 @@ export(filename: string, options?: IExportOptions | number): Promise<IBlob | string | boolean>;

}
interface IFindUIMethod {
(leaf: IUI, options?: any): AnswerType;
}
interface IUIData extends IUIComputedData, ILeafData {

@@ -541,2 +561,5 @@ padding?: number | number[];

__useEffect?: boolean;
__autoWidth: boolean;
__autoHeight: boolean;
__autoBounds: boolean;
path?: IPathCommandData;

@@ -557,8 +580,94 @@ windingRule?: IWindingRule;

locked?: boolean;
children?: IUIBaseInputData[];
children?: IUIInputData[];
}
type IUITag = 'App' | 'Leafer' | 'Rect' | 'Ellipse' | 'Polygon' | 'Star' | 'Line' | 'Path' | 'Pen' | 'Text' | 'Image' | 'Canvas' | 'Group' | 'Frame' | 'Box';
interface IUIInputData extends IRectInputData, IEllipseInputData, IPolygonInputData, IStarInputData, ILineInputData, IPathInputData, ITextInputData, IImageInputData, IGroupInputData, IFrameInputData, IUIBaseInputData, IObject {
children?: IUIInputData[];
}
interface IEditorBase extends IGroup$1, ISelectorProxy {
config: IEditorConfig;
hoverTarget: IUI$1;
target: IUI$1 | IUI$1[] | ILeafList;
readonly list: IUI$1[];
readonly hasTarget: boolean;
readonly multiple: boolean;
readonly single: boolean;
readonly dragging: boolean;
element: IUI$1;
buttons: IGroup$1;
selector: IGroup$1;
editBox: IGroup$1;
editTool: IObject$1;
hasItem(item: IUI$1): boolean;
shiftItem(item: IUI$1): void;
addItem(item: IUI$1): void;
removeItem(item: IUI$1): void;
update(): void;
updateEditTool(): void;
getEditSize(ui: ILeaf$1): IEditSize;
onMove(e: IDragEvent): void;
onScale(e: IDragEvent): void;
onRotate(e: IDragEvent | IRotateEvent): void;
onSkew(e: IDragEvent): void;
group(): void;
ungroup(): void;
lock(): void;
unlock(): void;
toTop(): void;
toBottom(): void;
}
interface IEditorConfig {
editSize?: 'auto' | IEditSize;
stroke?: IStroke$1;
strokeWidth?: number;
pointFill?: IFill$1;
pointSize?: number;
pointRadius?: number;
point?: IBoxInputData$1 | IBoxInputData$1[];
middlePoint?: IBoxInputData$1 | IBoxInputData$1[];
rotatePoint?: IBoxInputData$1;
rect?: IBoxInputData$1;
area?: IRectInputData$1;
buttonsDirection?: 'top' | 'right' | 'bottom' | 'left';
buttonsFixed?: boolean;
buttonsMargin?: number;
hideOnMove?: boolean;
moveCursor?: ICursorType;
resizeCursor?: ICursorType[];
rotateCursor?: ICursorType[];
around?: IAround;
lockRatio?: boolean;
rotateGap?: number;
selector?: boolean;
hover?: boolean;
boxSelect?: boolean;
rotateable?: boolean;
resizeable?: boolean;
skewable?: boolean;
}
interface ILeafer extends IGroup, ILeaferAttrData, IControl {
readonly isApp: boolean;
readonly app: ILeafer;
parent?: IApp;
zoomLayer?: IGroup;
editor?: IEditorBase;
ground?: ILeafer;
tree?: ILeafer;
sky?: ILeafer;
userConfig?: ILeaferConfig;
}
interface IApp extends ILeafer {
children: ILeafer[];
realCanvas: boolean;
}
interface IAppConfig extends ILeaferConfig {
ground?: ILeaferConfig;
tree?: ILeaferConfig;
sky?: ILeaferConfig;
editor?: IEditorConfig;
}
type IUIRenderModule = IUIRender & ThisType<IUI>;

@@ -626,2 +735,2 @@ interface IUIRender extends ILeafRender {

export type { IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, ICornerRadiusString, IDashPatternString, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IExportOptions, IExportResult, IExportResultFunction, IFontWeight, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGradientPaint, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintModule, IPaintString, IPath, IPathData, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IColorString as IStringColor, IStrokeAlign, IStrokeCap, IStrokeJoin, IStrokeWidthString, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextWordData, ITextWrap, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIRenderModule, IUITag, IUnitData, IVectorPath, IVerticalAlign };
export type { IApp, IAppConfig, IAppData, IAppInputData, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, ICornerRadiusString, IDashPatternString, IEditorBase, IEditorConfig, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IExportOptions, IExportResult, IExportResultFunction, IFill, IFindUIMethod, IFontWeight, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGradientPaint, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintModule, IPaintString, IPath, IPathData, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IColorString as IStringColor, IStroke, IStrokeAlign, IStrokeCap, IStrokeJoin, IStrokeWidthString, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextWordData, ITextWrap, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIRenderModule, IUITag, IUnitData, IVectorPath, IVerticalAlign };