@leafer/interface 1.0.0-beta.11 → 1.0.0-beta.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/interface",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.12",
4
4
  "description": "@leafer/interface",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -6,5 +6,4 @@ import { IHitCanvas } from './ILeaferCanvas'
6
6
  export interface IHitCanvasManager extends ICanvasManager {
7
7
  getPathType(leaf: ILeaf): IHitCanvas
8
8
  getImageType(leaf: ILeaf, size: IScreenSizeData): IHitCanvas
9
- destroy(): void
10
9
  }
@@ -12,7 +12,6 @@ export interface ILeaferCanvasConfig extends IAutoBoundsData {
12
12
  pixelRatio?: number
13
13
  smooth?: boolean
14
14
  hittable?: boolean
15
- offscreen?: boolean
16
15
  webgl?: boolean
17
16
  }
18
17
 
@@ -157,8 +156,6 @@ export interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
157
156
 
158
157
  unreal?: boolean
159
158
 
160
- offscreen: boolean
161
-
162
159
  context: ICanvasContext2D
163
160
 
164
161
  recycled?: boolean
@@ -168,7 +165,7 @@ export interface ILeaferCanvas extends ICanvasAttr, ICanvasMethod, IPathDrawer {
168
165
  init(): void
169
166
 
170
167
  toBlob(type?: string, quality?: number): Promise<IBlob>
171
- toDataURL(type?: string, quality?: number): string
168
+ toDataURL(type?: string, quality?: number): string | Promise<string>
172
169
  saveAs(filename: string, quality?: number): Promise<boolean>
173
170
 
174
171
  startAutoLayout(autoBounds: IAutoBounds, listener: IResizeEventListener): void
@@ -209,6 +209,8 @@ export interface ILeaf extends ILeafMask, ILeafRender, ILeafHit, ILeafBounds, IL
209
209
  __parentWait?: IFunction[]
210
210
  __leaferWait?: IFunction[]
211
211
 
212
+ destroyed: boolean
213
+
212
214
  waitParent(item: IFunction): void
213
215
  waitLeafer(item: IFunction): void
214
216
 
@@ -33,7 +33,7 @@ export interface ILeaferImage {
33
33
  config: ILeaferImageConfig
34
34
 
35
35
  load(onSuccess?: ILeaferImageOnLoaded, onError?: ILeaferImageOnError): number
36
- unload(index: number): void
36
+ unload(index: number, stopEvent?: boolean): void
37
37
  getCanvas(width: number, height: number, opacity?: number, _filters?: IObject): unknown
38
38
  destroy(): void
39
39
  }
@@ -20,13 +20,14 @@ export interface IPlatform {
20
20
  realtimeLayout?: boolean
21
21
  origin?: {
22
22
  createCanvas(width: number, height: number, format?: 'svg' | 'pdf'): any
23
- canvasToDataURL(canvas: any, type?: IExportImageType, quality?: number): string
23
+ canvasToDataURL(canvas: any, type?: IExportImageType, quality?: number): string | Promise<string>
24
24
  canvasToBolb(canvas: any, type?: IExportFileType, quality?: number): Promise<any>
25
25
  canvasSaveAs(canvas: any, filename: string, quality?: number): Promise<void>
26
26
  loadImage(url: string): Promise<any>
27
27
  noRepeat?: string // fix: 微信小程序 createPattern 直接使用 no-repeat 有bug,导致无法显示
28
28
  },
29
29
  miniapp?: IMiniapp
30
+ imageSuffix?: string // 需要带上后缀区分dom中image标签的缓存,否则会导致浏览器缓存跨域问题
30
31
  }
31
32
 
32
33