Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@leafer/interface

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafer/interface - npm Package Compare versions

Comparing version
1.0.0-rc.19
to
1.0.0-rc.20
+1
-1
package.json
{
"name": "@leafer/interface",
"version": "1.0.0-rc.19",
"version": "1.0.0-rc.20",
"description": "@leafer/interface",

@@ -5,0 +5,0 @@ "author": "Chao (Leafer) Wan",

@@ -8,3 +8,3 @@ import { ILeaf, ICursorType } from '../display/ILeaf'

import { IWatcher, IWatcherConfig } from '../watcher/IWatcher'
import { IAutoBounds, IBoundsData, IPointData, IScreenSizeData } from '../math/IMath'
import { IAutoBounds, IBoundsData, IPointData, IScreenSizeData, IBounds } from '../math/IMath'
import { ICanvasManager } from '../canvas/ICanvasManager'

@@ -26,2 +26,3 @@ import { IHitCanvasManager } from '../canvas/IHitCanvasManager'

realCanvas?: boolean
lazySpeard?: IFourNumber
}

@@ -55,2 +56,3 @@

autoLayout?: IAutoBounds
lazyBounds: IBounds

@@ -83,3 +85,4 @@ config: ILeaferConfig

zoom(zoomType: IZoomType, padding?: IFourNumber, fixedScale?: boolean): IBoundsData
validScale(changeScale: number): number
getValidMove(moveX: number, moveY: number): IPointData
getValidScale(changeScale: number): number
}

@@ -86,0 +89,0 @@

@@ -128,3 +128,3 @@ type GlobalCompositeOperation = 'color' | 'color-burn' | 'color-dodge' | 'copy' | 'darken' | 'destination-atop' | 'destination-in' | 'destination-out' | 'destination-over' | 'difference' | 'exclusion' | 'hard-light' | 'hue' | 'lighten' | 'lighter' | 'luminosity' | 'multiply' | 'overlay' | 'saturation' | 'screen' | 'soft-light' | 'source-atop' | 'source-in' | 'source-out' | 'source-over' | 'xor'

type PredefinedColorSpace = 'display-p3' | 'srgb'
interface CanvasRenderingContext2DSettings {
interface ICanvasRenderingContext2DSettings {
alpha?: boolean

@@ -135,5 +135,8 @@ colorSpace?: PredefinedColorSpace

}
export type ICanvasContext2DSettings = ICanvasRenderingContext2DSettings
export interface ICanvasContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform, CanvasUserInterface {
readonly canvas: HTMLCanvasElement
getContextAttributes(): CanvasRenderingContext2DSettings
getContextAttributes(): ICanvasRenderingContext2DSettings
}

@@ -140,0 +143,0 @@

import { ILeaf } from '../display/ILeaf'
import { IScreenSizeData } from '../math/IMath'
import { ICanvasManager } from './ICanvasManager'
import { IHitCanvas } from './ILeaferCanvas'
import { IHitCanvas, ILeaferCanvasConfig } from './ILeaferCanvas'
export interface IHitCanvasManager extends ICanvasManager {
maxTotal: number // 最多缓存多少张画布
getPathType(leaf: ILeaf): IHitCanvas
getImageType(leaf: ILeaf, size: IScreenSizeData): IHitCanvas
getPixelType(leaf: ILeaf, config: ILeaferCanvasConfig): IHitCanvas
}
import { IObject } from '../data/IData'
import { IBounds, IMatrixData, IBoundsData, IAutoBoundsData, IAutoBounds, IScreenSizeData, IMatrixWithBoundsData, IPointData } from '../math/IMath'
import { ICanvasContext2D, IWindingRule, IPath2D, ITextMetrics, CanvasGradient, CanvasPattern } from './ICanvas'
import { IBounds, IMatrixData, IBoundsData, IAutoBoundsData, IAutoBounds, IScreenSizeData, IMatrixWithBoundsData, IPointData, IRadiusPointData } from '../math/IMath'
import { ICanvasContext2D, IWindingRule, IPath2D, ITextMetrics, CanvasGradient, CanvasPattern, ICanvasContext2DSettings } from './ICanvas'
import { IResizeEventListener } from '../event/IEvent'

@@ -18,2 +18,3 @@ import { IPathDrawer } from '../path/IPathDrawer'

webgl?: boolean
contextSettings?: ICanvasContext2DSettings
}

@@ -115,3 +116,5 @@

hitStroke(point: IPointData, strokeWidth?: number): boolean
hitPixel(radiusPoint: IRadiusPointData, offset?: IPointData, scale?: number): boolean
setStroke(strokeStyle: string | object, strokeWidth: number, options?: ICanvasStrokeOptions): void

@@ -204,3 +207,3 @@ setStrokeOptions(options: ICanvasStrokeOptions): void

export interface IHitCanvas extends ILeaferCanvas {
hitScale?: number
}

@@ -207,0 +210,0 @@

@@ -69,5 +69,7 @@ import { ILeaferBase } from '../app/ILeafer'

windingRule: IWindingRule
closed: boolean
editable: IBoolean
editSize: IEditSize
editorStyle: IObject

@@ -239,5 +241,7 @@ hittable: IBoolean

windingRule?: IWindingRule
closed?: boolean
editable?: IBoolean
editSize?: IEditSize
editorStyle?: IObject

@@ -302,2 +306,3 @@ hittable?: IBoolean

windingRule?: IWindingRule
closed?: boolean

@@ -308,2 +313,3 @@ draggable?: boolean

editSize?: IEditSize
editorStyle?: IObject

@@ -404,3 +410,2 @@ hittable?: boolean

readonly pathInputed: boolean
pathClosed: boolean

@@ -430,3 +435,3 @@ __parentWait?: IFunction[]

// ILeafData ->
__setAttr(attrName: string, newValue: IValue): void
__setAttr(attrName: string, newValue: IValue, checkFiniteNumber?: boolean): boolean
__getAttr(attrName: string): IValue

@@ -521,4 +526,5 @@ setProxyAttr(name: string, newValue: IValue): void

__hit(local: IRadiusPointData): boolean
__hitFill(inner: IRadiusPointData, windingRule?: string): boolean
__hitFill(inner: IRadiusPointData): boolean
__hitStroke(inner: IRadiusPointData, strokeWidth: number): boolean
__hitPixel(inner: IRadiusPointData): boolean
__drawHitPath(canvas: ILeaferCanvas): void

@@ -533,3 +539,3 @@ __updateHitCanvas(): void

__clip(canvas: ILeaferCanvas, options: IRenderOptions): void
__renderShape(canvas: ILeaferCanvas, options: IRenderOptions): void
__renderShape(canvas: ILeaferCanvas, options: IRenderOptions, ignoreFill?: boolean, ignoreStroke?: boolean): void

@@ -554,2 +560,8 @@ __updateWorldOpacity(): void

dropTo(parent: ILeaf, index?: number, resize?: boolean): void
}
}
export type ILeafAttrDescriptor = IObject & ThisType<ILeaf>
export interface ILeafAttrDescriptorFn {
(key: string): ILeafAttrDescriptor
}

@@ -7,3 +7,3 @@ import { ILeaf } from '../ILeaf'

export interface ILeafDataProxy {
__setAttr?(name: string, newValue: IValue): void
__setAttr?(name: string, newValue: IValue): boolean
__getAttr?(name: string): IValue

@@ -10,0 +10,0 @@ setProxyAttr?(name: string, newValue: IValue): void

@@ -10,6 +10,7 @@ import { IRadiusPointData } from '../../math/IMath'

__hit?(inner: IRadiusPointData): boolean
__hitFill?(inner: IRadiusPointData, windingRule?: string): boolean
__hitFill?(inner: IRadiusPointData): boolean
__hitStroke?(inner: IRadiusPointData, strokeWidth: number): boolean
__hitPixel(inner: IRadiusPointData): boolean
__drawHitPath?(canvas: ILeaferCanvas): void
__updateHitCanvas?(): void
}

@@ -13,3 +13,3 @@ import { ILeaferCanvas } from '../../canvas/ILeaferCanvas'

__clip?(_canvas: ILeaferCanvas, _options: IRenderOptions): void
__renderShape?(canvas: ILeaferCanvas, options: IRenderOptions): void
__renderShape?(canvas: ILeaferCanvas, options: IRenderOptions, ignoreFill?: boolean, ignoreStroke?: boolean): void

@@ -16,0 +16,0 @@ __updateWorldOpacity?(): void

@@ -41,2 +41,3 @@ import { IObject } from '../data/IData'

twist?: number
isCancel?: boolean
}

@@ -43,0 +44,0 @@ export type PointerType = 'mouse' | 'pen' | 'touch'

@@ -14,2 +14,3 @@ import { ILeaferImage, ILeaferImageConfig } from './ILeaferImage'

patternTasker: ITaskProcessor
patternLocked?: boolean // 锁定pattern不更新, 一般用于创建碰撞位图 UIHit.ts
readonly isComplete: boolean

@@ -16,0 +17,0 @@ get(config: ILeaferImageConfig): ILeaferImage

export { IAppBase } from './app/IApp'
export { ILeaferBase, ILeaferAttrData, ILeaferType, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, ILeaferConfig, ICreator, IUICreator, IZoomType } from './app/ILeafer'
export { ILeaf, ILeafAttrData, ILeafComputedData, ILeafInputData, ICachedLeaf, IHitType, IMaskType, IBlendMode, IEditSize, IImageCursor, ICursorType, IStateStyleType, IAround } from './display/ILeaf'
export { ILeaf, ILeafAttrData, ILeafComputedData, ILeafInputData, ICachedLeaf, IHitType, IMaskType, IBlendMode, IEditSize, IImageCursor, ICursorType, IStateStyleType, IAround, ILeafAttrDescriptor, ILeafAttrDescriptorFn } from './display/ILeaf'
export { IBranch } from './display/IBranch'

@@ -39,3 +39,3 @@ export { IZoomView } from './display/IView'

export { IPathDrawer, IPathCreator } from './path/IPathDrawer'
export { IWindingRule, ICanvasContext2D, ITextMetrics, IPath2D, ICanvasPattern } from './canvas/ICanvas'
export { IWindingRule, ICanvasContext2D, ICanvasContext2DSettings, ITextMetrics, IPath2D, ICanvasPattern } from './canvas/ICanvas'
export { CanvasPathCommand, IPathCommandData, MCommandData, HCommandData, VCommandData, LCommandData, CCommandData, SCommandData, QCommandData, TCommandData, ZCommandData, ACommandData, RectCommandData, RoundRectCommandData, EllipseCommandData, ArcCommandData, ArcToCommandData } from './path/IPathCommand'

@@ -42,0 +42,0 @@

@@ -55,2 +55,3 @@ import { INumberFunction, IPointDataFunction } from '../function/IFunction'

isRootPath(data: IPointerEvent): boolean
isTreePath(data: IPointerEvent): boolean
canMove(data: IPointerEvent): boolean

@@ -88,2 +89,3 @@

export interface IZoomConfig {
disabled?: boolean
min?: number

@@ -94,6 +96,7 @@ max?: number

export interface IMoveConfig {
disabled?: boolean
holdSpaceKey?: boolean
holdMiddleKey?: boolean
holdRightKey?: boolean
scroll?: boolean
scroll?: boolean | 'limit'
drag?: boolean

@@ -124,2 +127,3 @@ dragAnimate?: boolean

transformTime?: number
hover?: boolean
dragHover?: boolean

@@ -126,0 +130,0 @@ dragDistance?: number

@@ -61,3 +61,3 @@ import { IBoundsData, IMatrixData, ILayoutBoundsData, IPointData } from '../math/IMath'

strokeSpread: number
renderSpread: number
renderSpread: number // -1 表示监视变化,不影响实际renderBounds,目前用在Box上
strokeBoxSpread: number

@@ -64,0 +64,0 @@ renderShapeSpread: number

@@ -71,3 +71,3 @@ import { IFourNumber, IObject } from '../data/IData'

toInnerOf(matrix: IMatrixData, to?: IBoundsData): IBounds
getFitMatrix(put: IBoundsData): IMatrix
getFitMatrix(put: IBoundsData, baseScale?: number): IMatrix

@@ -87,2 +87,3 @@ spread(fourNumber: IFourNumber, spreadY?: number): IBounds

setPoints(points: IPointData[]): IBounds
addPoint(point: IPointData): IBounds
getPoints(): IPointData[] // topLeft, topRight, bottomRight, bottomLeft

@@ -167,5 +168,6 @@

}
export interface IMatrix extends IMatrixData {
export interface IMatrix extends IMatrixWithScaleData {
set(a: number | IMatrixData, b: number, c: number, d: number, e: number, f: number): IMatrix
setWith(dataWithScale: IMatrixWithScaleData): IMatrix // set scaleX scaleY
get(): IMatrixData

@@ -178,2 +180,3 @@ clone(): IMatrix

scale(x: number, y?: number): IMatrix
scaleWith(x: number, y?: number): IMatrix // change scaleX scaleY
scaleOfOuter(origin: IPointData, x: number, y?: number): IMatrix

@@ -196,2 +199,3 @@ scaleOfInner(origin: IPointData, x: number, y?: number): IMatrix

invert(): IMatrix
invertWith(): IMatrix // change scaleX scaleY

@@ -198,0 +202,0 @@ toOuterPoint(inner: IPointData, to?: IPointData, distance?: boolean): void

@@ -19,3 +19,3 @@ import { IPathCommandData } from './IPathCommand'

export interface IPathCreator {
export interface IPathCreator extends IPathDrawer {
path: IPathCommandData

@@ -43,2 +43,4 @@ __path: IPathCommandData

drawPoints(points: number[], curve?: boolean | number, close?: boolean): IPathCreator
clearPath(): IPathCreator
}

@@ -29,2 +29,3 @@ import { IFunction } from '../function/IFunction'

canvasSaveAs(canvas: any, filename: string, quality?: number): Promise<void>
download(url: string, filename: string): Promise<void>
loadImage(url: string): Promise<any>

@@ -42,2 +43,3 @@ noRepeat?: string // fix: 微信小程序 createPattern 直接使用 no-repeat 有bug,导致无法显示

image: {
hitCanvasSize: number // 图片生成碰撞画布的最大尺寸(单边)
maxCacheSize: number // 最大等级缓存,一般取当前屏幕大小,默认2k: 2560 * 1600

@@ -44,0 +46,0 @@ maxPatternSize: number // 最大repeat pattern缓存, 默认4k: 4096 * 2160

Sorry, the diff of this file is too big to display