@leafer/interface 1.0.0-beta → 1.0.0-beta.4

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",
3
+ "version": "1.0.0-beta.4",
4
4
  "description": "@leafer/interface",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -57,12 +57,16 @@ export interface ILeafer extends IZoomView, IControl {
57
57
  __eventIds: IEventListenerId[]
58
58
 
59
59
  init(userConfig?: ILeaferConfig, parentApp?: IApp): void
60
-
61
60
  forceFullRender(): void
62
-
63
61
  resize(size: IScreenSizeData): void
64
62
  }
65
63
 
64
+ export interface ILeaferTypeCreator {
65
+ list: ILeaferTypeList
66
+ register(name: string, fn: ILeaferTypeFunction): void
67
+ run(name: string, leafer: ILeafer): void
68
+ }
69
+
66
70
  export interface ILeaferTypeFunction {
67
71
  (leafer: ILeafer): void
68
72
  }
@@ -71,7 +75,6 @@ export interface ILeaferTypeList {
71
75
  [key: string]: ILeaferTypeFunction
72
76
  }
73
77
 
74
-
75
78
  export interface ICreator {
76
79
  image?(options?: ILeaferImageConfig): ILeaferImage
77
80
  canvas?(options?: ILeaferCanvasConfig, manager?: ICanvasManager): ILeaferCanvas
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { IApp } from './app/IApp'
2
- export { ILeafer, ILeaferType, ILeaferTypeFunction, ILeaferTypeList, ILeaferConfig, ICreator, IUICreator } from './app/ILeafer'
2
+ export { ILeafer, ILeaferType, ILeaferTypeCreator, ILeaferTypeFunction, ILeaferTypeList, ILeaferConfig, ICreator, IUICreator } from './app/ILeafer'
3
3
  export { ILeaf, ILeafAttrData, ILeafComputedData, ILeafInputData, ICachedLeaf, IHitType, IBlendMode } from './display/ILeaf'
4
4
  export { IBranch } from './display/IBranch'
5
5
  export { IZoomView } from './display/IView'
@@ -12,4 +12,16 @@ export interface IPlatform {
12
12
  conicGradientRotate90?: boolean // fixfox need rotate
13
13
  fullImageShadow?: boolean // safari need
14
14
  layout(target: ILeaf): void
15
+ origin?: {
16
+ createCanvas: ICreateCanvasFunction,
17
+ loadImage: ILoadImageFunction
18
+ }
19
+ }
20
+
21
+ interface ICreateCanvasFunction {
22
+ (width: number, height: number, format?: 'svg' | 'pdf'): any
23
+ }
24
+
25
+ interface ILoadImageFunction {
26
+ (url: string): Promise<any>
15
27
  }
@@ -1,11 +1,8 @@
1
1
  import { IObject } from '../data/IData'
2
2
 
3
- export interface IPlugin {
4
- name: string
5
- version: string
6
- author: string
7
- license: string
8
- description: string
9
- dependencies: string[]
10
- run(params: IObject): void
3
+ export interface IPlugin extends IObject {
4
+ name?: string
5
+ importVersion: string
6
+ import: string[]
7
+ run(LeaferUI: IObject): void
11
8
  }