@leafer/interface 1.0.0-rc.26 → 1.0.0-rc.27

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-rc.26",
3
+ "version": "1.0.0-rc.27",
4
4
  "description": "@leafer/interface",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -5,5 +5,5 @@ import { IHitCanvas, ILeaferCanvasConfig } from './ILeaferCanvas'
5
5
  export interface IHitCanvasManager extends ICanvasManager {
6
6
  maxTotal: number // 最多缓存多少张画布
7
7
  getPathType(leaf: ILeaf): IHitCanvas
8
- getPixelType(leaf: ILeaf, config: ILeaferCanvasConfig): IHitCanvas
8
+ getPixelType(leaf: ILeaf, config?: ILeaferCanvasConfig): IHitCanvas
9
9
  }
@@ -111,6 +111,9 @@ export interface ILeafAttrData {
111
111
  focusStyle: ILeafInputData
112
112
  selectedStyle: ILeafInputData
113
113
  disabledStyle: ILeafInputData
114
+
115
+ // 预留给用户使用的数据对象
116
+ data: IObject
114
117
  }
115
118
 
116
119
 
@@ -367,6 +370,9 @@ export interface ILeafInputData {
367
370
  selectedStyle?: ILeafInputData
368
371
  disabledStyle?: ILeafInputData
369
372
 
373
+ // 预留给用户使用的数据对象
374
+ data?: IObject
375
+
370
376
  children?: ILeafInputData[]
371
377
 
372
378
  // other
@@ -455,6 +461,10 @@ export interface ILeafComputedData {
455
461
  selectedStyle?: ILeafInputData
456
462
  disabledStyle?: ILeafInputData
457
463
 
464
+
465
+ // 预留给用户使用的数据对象
466
+ data?: IObject
467
+
458
468
  // other
459
469
  __childBranchNumber?: number // 存在子分支的个数
460
470
  __complex?: boolean // 外观是否复杂
@@ -566,6 +576,10 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
566
576
 
567
577
  set(data: IObject): void
568
578
  get(name?: string | string[] | IObject): ILeafInputData | IValue
579
+ setAttr(name: string, value: any): void
580
+ getAttr(name: string): any
581
+ getComputedAttr(name: string): any
582
+
569
583
  toJSON(): IObject
570
584
  toString(): string
571
585
  toSVG(): string
package/types/index.d.ts CHANGED
@@ -1287,6 +1287,7 @@ interface ILeafAttrData {
1287
1287
  focusStyle: ILeafInputData;
1288
1288
  selectedStyle: ILeafInputData;
1289
1289
  disabledStyle: ILeafInputData;
1290
+ data: IObject;
1290
1291
  }
1291
1292
  type IAxis = 'x' | 'y';
1292
1293
  type IAxisReverse = 'x-reverse' | 'y-reverse';
@@ -1404,6 +1405,7 @@ interface ILeafInputData {
1404
1405
  focusStyle?: ILeafInputData;
1405
1406
  selectedStyle?: ILeafInputData;
1406
1407
  disabledStyle?: ILeafInputData;
1408
+ data?: IObject;
1407
1409
  children?: ILeafInputData[];
1408
1410
  noBounds?: boolean;
1409
1411
  }
@@ -1470,6 +1472,7 @@ interface ILeafComputedData {
1470
1472
  focusStyle?: ILeafInputData;
1471
1473
  selectedStyle?: ILeafInputData;
1472
1474
  disabledStyle?: ILeafInputData;
1475
+ data?: IObject;
1473
1476
  __childBranchNumber?: number;
1474
1477
  __complex?: boolean;
1475
1478
  __naturalWidth?: number;
@@ -1548,6 +1551,9 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
1548
1551
  __bindLeafer(leafer: ILeaferBase | null): void;
1549
1552
  set(data: IObject): void;
1550
1553
  get(name?: string | string[] | IObject): ILeafInputData | IValue;
1554
+ setAttr(name: string, value: any): void;
1555
+ getAttr(name: string): any;
1556
+ getComputedAttr(name: string): any;
1551
1557
  toJSON(): IObject;
1552
1558
  toString(): string;
1553
1559
  toSVG(): string;
@@ -1860,7 +1866,7 @@ interface ICursorConfig {
1860
1866
  interface IHitCanvasManager extends ICanvasManager {
1861
1867
  maxTotal: number;
1862
1868
  getPathType(leaf: ILeaf): IHitCanvas;
1863
- getPixelType(leaf: ILeaf, config: ILeaferCanvasConfig): IHitCanvas;
1869
+ getPixelType(leaf: ILeaf, config?: ILeaferCanvasConfig): IHitCanvas;
1864
1870
  }
1865
1871
 
1866
1872
  interface IZoomView extends IBranch {