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

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.
Files changed (44) hide show
  1. package/package.json +4 -2
  2. package/src/index.ts +2 -2
  3. package/types/index.d.ts +1672 -0
  4. package/src/app/IApp.ts +0 -6
  5. package/src/app/ILeafer.ts +0 -96
  6. package/src/canvas/ICanvas.ts +0 -334
  7. package/src/canvas/ICanvasManager.ts +0 -10
  8. package/src/canvas/IHitCanvasManager.ts +0 -10
  9. package/src/canvas/ILeaferCanvas.ts +0 -201
  10. package/src/canvas/ISkiaCanvas.ts +0 -20
  11. package/src/control/IControl.ts +0 -5
  12. package/src/data/IData.ts +0 -29
  13. package/src/data/ILeafData.ts +0 -27
  14. package/src/data/IList.ts +0 -45
  15. package/src/display/IBranch.ts +0 -9
  16. package/src/display/ILeaf.ts +0 -293
  17. package/src/display/IView.ts +0 -10
  18. package/src/display/module/IBranchRender.ts +0 -10
  19. package/src/display/module/ILeafBounds.ts +0 -21
  20. package/src/display/module/ILeafDataProxy.ts +0 -10
  21. package/src/display/module/ILeafEventer.ts +0 -18
  22. package/src/display/module/ILeafHit.ts +0 -12
  23. package/src/display/module/ILeafMask.ts +0 -12
  24. package/src/display/module/ILeafMatrix.ts +0 -8
  25. package/src/display/module/ILeafRender.ts +0 -16
  26. package/src/event/IEvent.ts +0 -111
  27. package/src/event/IEventer.ts +0 -43
  28. package/src/event/IUIEvent.ts +0 -85
  29. package/src/file/IFileType.ts +0 -2
  30. package/src/function/IFunction.ts +0 -13
  31. package/src/image/IImageManager.ts +0 -18
  32. package/src/image/ILeaferImage.ts +0 -41
  33. package/src/interaction/IInteraction.ts +0 -92
  34. package/src/layout/ILeafLayout.ts +0 -95
  35. package/src/layouter/ILayouter.ts +0 -60
  36. package/src/math/IMath.ts +0 -183
  37. package/src/path/IPathCommand.ts +0 -50
  38. package/src/path/IPathDrawer.ts +0 -36
  39. package/src/platform/IPlatform.ts +0 -46
  40. package/src/plugin/IPlugin.ts +0 -10
  41. package/src/renderer/IRenderer.ts +0 -53
  42. package/src/selector/ISelector.ts +0 -35
  43. package/src/task/ITaskProcessor.ts +0 -44
  44. package/src/watcher/IWatcher.ts +0 -30
@@ -1,46 +0,0 @@
1
- import { IFunction } from '../function/IFunction'
2
- import { ILeaferCanvas } from '../canvas/ILeaferCanvas'
3
- import { ILeaf } from '../display/ILeaf'
4
- import { IExportFileType, IExportImageType } from '../file/IFileType'
5
- import { IBoundsData, ISizeData } from '../math/IMath'
6
- import { IObject } from '../data/IData'
7
-
8
- export interface IPlatform {
9
- name?: 'web' | 'node' | 'miniapp'
10
- os?: 'Mac' | 'Windows' | 'Linux'
11
- requestRender?(render: IFunction): void
12
- canvas?: ILeaferCanvas
13
- isWorker?: boolean
14
- devicePixelRatio?: number
15
- intWheelDeltaY?: boolean // firxfox / Windows need
16
- conicGradientSupport?: boolean
17
- conicGradientRotate90?: boolean // fixfox need rotate
18
- fullImageShadow?: boolean // safari need
19
- layout?(target: ILeaf): void
20
- realtimeLayout?: boolean
21
- origin?: {
22
- createCanvas(width: number, height: number, format?: 'svg' | 'pdf'): any
23
- canvasToDataURL(canvas: any, type?: IExportImageType, quality?: number): string
24
- canvasToBolb(canvas: any, type?: IExportFileType, quality?: number): Promise<any>
25
- canvasSaveAs(canvas: any, filename: string, quality?: number): Promise<void>
26
- loadImage(url: string): Promise<any>
27
- noRepeat?: string // fix: 微信小程序 createPattern 直接使用 no-repeat 有bug,导致无法显示
28
- },
29
- miniapp?: IMiniapp
30
- }
31
-
32
-
33
- export interface IMiniappSelect extends IObject { }
34
-
35
- export interface IMiniappSizeView extends ISizeData {
36
- view: any
37
- }
38
-
39
- export interface IMiniapp {
40
- select(name: string): IMiniappSelect
41
- getBounds(select: IMiniappSelect): Promise<IBoundsData>
42
- getSizeView(select: IMiniappSelect): Promise<IMiniappSizeView>
43
- onWindowResize(fun: IFunction): void
44
- offWindowResize(fun: IFunction): void
45
- saveToAlbum(path: string): Promise<any>
46
- }
@@ -1,10 +0,0 @@
1
- import { ILeafer } from '../app/ILeafer'
2
- import { IObject } from '../data/IData'
3
-
4
- export interface IPlugin extends IObject {
5
- name?: string
6
- importVersion: string
7
- import: string[]
8
- run(LeaferUI: IObject, config: IObject): void
9
- onLeafer?(leafer: ILeafer): void
10
- }
@@ -1,53 +0,0 @@
1
- import { ILeaferCanvas } from '../canvas/ILeaferCanvas'
2
- import { ILeaf } from '../display/ILeaf'
3
- import { IBounds, IMatrix } from '../math/IMath'
4
- import { IFunction } from '../function/IFunction'
5
- import { IControl } from '../control/IControl'
6
-
7
- export interface IRenderOptions {
8
- bounds?: IBounds,
9
- hideBounds?: IBounds,
10
- matrix?: IMatrix,
11
- inCamera?: boolean
12
- }
13
-
14
- export interface IRendererConfig {
15
- usePartRender?: boolean
16
- maxFPS?: number
17
- fill?: string
18
- }
19
-
20
- export interface IRenderer extends IControl {
21
- target: ILeaf
22
- canvas: ILeaferCanvas
23
- updateBlocks: IBounds[]
24
-
25
- FPS: number
26
- totalTimes: number
27
- times: number
28
-
29
- running: boolean
30
- rendering: boolean
31
-
32
- waitAgain: boolean
33
- changed: boolean
34
-
35
- config: IRendererConfig
36
-
37
- update(): void
38
-
39
- requestLayout(): void
40
-
41
- render(callback?: IFunction): void
42
- renderAgain(): void
43
- renderOnce(callback?: IFunction): void
44
- partRender(): void
45
- clipRender(bounds: IBounds): void
46
- fullRender(): void
47
-
48
- renderHitView(options: IRenderOptions): void
49
- renderBoundsView(options: IRenderOptions): void
50
-
51
- addBlock(block: IBounds): void
52
- mergeBlocks(): void
53
- }
@@ -1,35 +0,0 @@
1
- import { ILeaf } from '../display/ILeaf'
2
- import { ILeafList } from '../data/IList'
3
- import { IPointData } from '../math/IMath'
4
-
5
- export interface ISelectPathResult {
6
- leaf: ILeaf
7
- path: ILeafList
8
- throughPath?: ILeafList
9
- }
10
-
11
- export interface ISelectPathOptions {
12
- name?: string
13
- through?: boolean
14
- exclude?: ILeafList
15
- ignoreHittable?: boolean
16
- }
17
-
18
- export interface ISelectorConfig {
19
-
20
- }
21
-
22
- export interface ISelector {
23
- target: ILeaf
24
-
25
- config: ISelectorConfig
26
-
27
- getByPoint(hitPoint: IPointData, hitRadius: number, options?: ISelectPathOptions): ISelectPathResult
28
-
29
- find(name: number | string, branch?: ILeaf): ILeaf | ILeaf[]
30
- getByInnerId(name: number, branch?: ILeaf): ILeaf
31
- getById(name: string, branch?: ILeaf): ILeaf
32
- getByClassName(name: string, branch?: ILeaf): ILeaf[]
33
- getByTagName(name: string, branch?: ILeaf): ILeaf[]
34
- destroy(): void
35
- }
@@ -1,44 +0,0 @@
1
- import { IFunction } from '../function/IFunction'
2
-
3
- export interface ITaskProcessorConfig {
4
- onComplete?: IFunction
5
- onTask?: IFunction
6
- onError?: IFunction
7
- parallel?: number
8
- }
9
-
10
- export interface ITaskProcessor {
11
- config: ITaskProcessorConfig
12
- running: boolean
13
- isComplete: boolean
14
- percent: number
15
- total: number
16
- index: number
17
- finishedIndex: number
18
- remain: number
19
- start(): void
20
- pause(): void
21
- resume(): void
22
- skip(): void
23
- stop(): void
24
- add(taskCallback: IFunction, options?: ITaskOptions | number): ITaskItem
25
- destroy(): void
26
- }
27
-
28
- export interface ITaskItem {
29
- parent: ITaskProcessor
30
- parallel: boolean
31
- isComplete: boolean
32
- isCancel: boolean
33
- time: number
34
- run(): Promise<void>
35
- complete(): void
36
- cancel(): void
37
- }
38
-
39
- export interface ITaskOptions {
40
- start?: boolean // default true
41
- time?: number // default 1
42
- parallel?: boolean // default true
43
- delay?: number // default 0
44
- }
@@ -1,30 +0,0 @@
1
- import { ILeaf } from '../display/ILeaf'
2
- import { ILeafList } from '../data/IList'
3
- import { IControl } from '../control/IControl'
4
-
5
- export interface IWatchEventData {
6
- updatedList: ILeafList
7
- }
8
-
9
- export interface IWatcherConfig {
10
-
11
- }
12
-
13
- export interface IWatcher extends IControl {
14
- target: ILeaf
15
-
16
- totalTimes: number
17
-
18
- disabled: boolean
19
- running: boolean
20
- changed: boolean
21
- hasRemoved: boolean
22
-
23
- config: IWatcherConfig
24
-
25
- updatedList: ILeafList
26
-
27
- disable(): void
28
-
29
- update(): void
30
- }