@mastergo/plugin-typings 1.13.0 → 1.15.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ ## [1.15.1](https://github.com/mastergo-design/plugin-typings/compare/v1.15.0...v1.15.1) (2023-03-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * 修复penNetwork错误类型 ([ea28765](https://github.com/mastergo-design/plugin-typings/commit/ea2876522eb76661e0cee898e97acee732081041))
7
+
8
+
9
+
10
+ # [1.15.0](https://github.com/mastergo-design/plugin-typings/compare/v1.14.0...v1.15.0) (2023-03-15)
11
+
12
+
13
+ ### Features
14
+
15
+ * 添加notify方法参数, 以及关闭方法 ([ae12bba](https://github.com/mastergo-design/plugin-typings/commit/ae12bbafb0a00dc042911859b18fbdb2934ddbf4))
16
+ * SceneNodeMixin增加attachedConnectors ([62af223](https://github.com/mastergo-design/plugin-typings/commit/62af223ca0d88d16976c29a7516e7cb0244015ce))
17
+
18
+
19
+
20
+ # [1.14.0](https://github.com/mastergo-design/plugin-typings/compare/v1.13.0...v1.14.0) (2023-02-07)
21
+
22
+
23
+ ### Features
24
+
25
+ * 增加异步导出接口exportAsync ([5327398](https://github.com/mastergo-design/plugin-typings/commit/532739851e5e0cc82ac0acbdc7195f7a780b354e))
26
+
27
+
28
+
1
29
  # [1.13.0](https://github.com/mastergo-design/plugin-typings/compare/v1.12.0...v1.13.0) (2023-01-12)
2
30
 
3
31
 
package/dist/index.d.ts CHANGED
@@ -91,7 +91,7 @@ declare global {
91
91
 
92
92
  saveVersionHistoryAsync(desc: string): Promise<void>
93
93
 
94
- notify(message: string, options?: NotifyOptions): void
94
+ notify(message: string, options?: NotifyOptions): NotificationHandler
95
95
 
96
96
  getStyleById(id: string): Style | null
97
97
  getTitleByFontFamilyAndStyle(fontFamily: string, fontStyle: string) : FontAlias | null
@@ -128,7 +128,9 @@ declare global {
128
128
  }
129
129
 
130
130
  interface Rect extends Readonly<Bound> {}
131
-
131
+ interface NotificationHandler {
132
+ cancel: () => void
133
+ }
132
134
  interface ViewportAPI {
133
135
  center: Vector
134
136
  zoom: number
@@ -186,16 +188,19 @@ declare global {
186
188
  interface ExportMixin {
187
189
  exportSettings: ReadonlyArray<ExportSettings>
188
190
  export(settings?: ExportSettings): Uint8Array | string // Defaults to PNG format
191
+ exportAsync(settings?: ExportSettings): Promise<Uint8Array | string>
189
192
  }
190
193
 
191
194
  interface NotifyOptions {
192
195
  position?: 'top' | 'bottom'
193
196
  type?: 'normal' | 'highlight' | 'error' | 'warning' | 'success'
197
+ timeout?: number
198
+ isLoading?: boolean
194
199
  }
195
200
 
196
201
  interface UIViewport extends Bound {
197
- headerHeight: number
198
- visible: boolean
202
+ readonly headerHeight: number
203
+ readonly visible: boolean
199
204
  }
200
205
 
201
206
  interface UIAPI {
@@ -401,20 +406,16 @@ declare global {
401
406
 
402
407
  // 待确定
403
408
  interface VectorVertex {
404
- readonly id: number
405
409
  readonly x: number
406
410
  readonly y: number
407
- readonly type: 'PATH_NODE' | 'CONTROL_NODE' // 0 路径端点 1 控制节点
408
411
  readonly strokeCap?: StrokeCap
409
- readonly strokeJoin?: StrokeJoin
410
412
  readonly cornerRadius?: number
411
413
  }
412
414
 
413
415
  // 待确定
414
416
  interface VectorRegion {
415
- readonly id: number
416
417
  readonly windingRule: WindingRule
417
- readonly pathIds?: ReadonlyArray<number>
418
+ readonly loops: ReadonlyArray<VectorPaths>
418
419
  }
419
420
 
420
421
  interface VectorCtrl {
@@ -485,6 +486,7 @@ declare global {
485
486
  interface SceneNodeMixin {
486
487
  isVisible: boolean
487
488
  isLocked: boolean
489
+ readonly attachedConnectors: ConnectorNode[]
488
490
  componentPropertyReferences: {
489
491
  isVisible?: string,
490
492
  characters?: string,
@@ -819,18 +821,13 @@ declare global {
819
821
  clone(): StarNode
820
822
  }
821
823
 
822
- // interface VectorPath {
823
- // readonly id: number
824
- // readonly nodeIds: ReadonlyArray<number>
825
- // }
826
- type VectorPath = number[]
827
-
828
- type VectorPaths = ReadonlyArray<VectorPath>
824
+ type VectorPaths = ReadonlyArray<number>
825
+ type VectorPath = [number, number, number, number]
829
826
 
830
827
  interface PenNetwork {
831
- paths: ReadonlyArray<VectorPaths>
828
+ paths: ReadonlyArray<VectorPath>
832
829
  nodes: ReadonlyArray<VectorVertex>
833
- regions: ReadonlyArray<VectorRegion> | []
830
+ regions: ReadonlyArray<VectorRegion>
834
831
  ctrlNodes: ReadonlyArray<VectorCtrl>
835
832
  }
836
833
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastergo/plugin-typings",
3
- "version": "1.13.0",
3
+ "version": "1.15.1",
4
4
  "description": "MasterGo插件API声明文件",
5
5
  "main": "",
6
6
  "types": "dist/index.d.ts",