@leafer/interface 1.3.1 → 1.3.3

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.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "@leafer/interface",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -23,6 +23,9 @@ export interface ILeaferConfig extends IRendererConfig, ILeaferCanvasConfig, IIn
23
23
  type?: ILeaferType
24
24
  mobile?: boolean
25
25
  realCanvas?: boolean
26
+ grow?: boolean | 'box' | 'render'
27
+ growWidth?: boolean
28
+ growHeight?: boolean
26
29
  lazySpeard?: IFourNumber
27
30
  }
28
31
 
@@ -549,6 +549,8 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
549
549
  forceUpdate(attrName?: string): void
550
550
  forceRender(bounds?: IBoundsData, sync?: boolean): void
551
551
 
552
+ __extraUpdate(): void // 额外更新
553
+
552
554
  // ILeafMatrix ->
553
555
  __updateWorldMatrix(): void
554
556
  __updateLocalMatrix(): void
@@ -3,12 +3,14 @@ import { ICanvasContext2DSettings } from '../canvas/ICanvas'
3
3
  import { ILeaf } from '../display/ILeaf'
4
4
  import { ILocationType } from '../layout/ILeafLayout'
5
5
  import { IBoundsData, IPointData, ISizeData } from '../math/IMath'
6
+ import { IFourNumber } from '../data/IData'
6
7
 
7
8
  export interface IExportOptions {
8
9
  quality?: number
9
10
  blob?: boolean
10
11
  scale?: number | IPointData
11
12
  size?: number | ISizeData
13
+ padding?: IFourNumber
12
14
  smooth?: boolean
13
15
  pixelRatio?: number
14
16
  slice?: boolean
@@ -1,2 +1,2 @@
1
- export type IExportImageType = 'jpg' | 'png' | 'webp'
1
+ export type IExportImageType = 'jpg' | 'png' | 'webp' | 'bmp'
2
2
  export type IExportFileType = IExportImageType | 'svg' | 'pdf' | 'json'
@@ -39,6 +39,9 @@ export interface IPlatform {
39
39
  download(url: string, filename: string): Promise<void>
40
40
  loadImage(url: string): Promise<any>
41
41
  noRepeat?: string // fix: 微信小程序 createPattern 直接使用 no-repeat 有bug,导致无法显示
42
+ Image?: any
43
+ PointerEvent?: any
44
+ DragEvent?: any
42
45
  },
43
46
 
44
47
  roundRectPatch?: boolean // fix: skia-canvas roundRect
package/types/index.d.ts CHANGED
@@ -843,7 +843,7 @@ interface ICanvasManager {
843
843
  destroy(): void;
844
844
  }
845
845
 
846
- type IExportImageType = 'jpg' | 'png' | 'webp';
846
+ type IExportImageType = 'jpg' | 'png' | 'webp' | 'bmp';
847
847
  type IExportFileType = IExportImageType | 'svg' | 'pdf' | 'json';
848
848
 
849
849
  type ILocationType = 'world' | 'page' | 'local' | 'inner';
@@ -923,6 +923,7 @@ interface IExportOptions {
923
923
  blob?: boolean;
924
924
  scale?: number | IPointData;
925
925
  size?: number | ISizeData;
926
+ padding?: IFourNumber;
926
927
  smooth?: boolean;
927
928
  pixelRatio?: number;
928
929
  slice?: boolean;
@@ -1592,6 +1593,7 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
1592
1593
  updateLayout(): void;
1593
1594
  forceUpdate(attrName?: string): void;
1594
1595
  forceRender(bounds?: IBoundsData, sync?: boolean): void;
1596
+ __extraUpdate(): void;
1595
1597
  __updateWorldMatrix(): void;
1596
1598
  __updateLocalMatrix(): void;
1597
1599
  __updateWorldBounds(): void;
@@ -1941,6 +1943,9 @@ interface ILeaferConfig extends IRendererConfig, ILeaferCanvasConfig, IInteracti
1941
1943
  type?: ILeaferType;
1942
1944
  mobile?: boolean;
1943
1945
  realCanvas?: boolean;
1946
+ grow?: boolean | 'box' | 'render';
1947
+ growWidth?: boolean;
1948
+ growHeight?: boolean;
1944
1949
  lazySpeard?: IFourNumber;
1945
1950
  }
1946
1951
  interface ILeaferAttrData {
@@ -2148,6 +2153,9 @@ interface IPlatform {
2148
2153
  download(url: string, filename: string): Promise<void>;
2149
2154
  loadImage(url: string): Promise<any>;
2150
2155
  noRepeat?: string;
2156
+ Image?: any;
2157
+ PointerEvent?: any;
2158
+ DragEvent?: any;
2151
2159
  };
2152
2160
  roundRectPatch?: boolean;
2153
2161
  ellipseToCurve?: boolean;