@mastergo/plugin-typings 1.16.2 → 1.17.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,11 +1,32 @@
1
- ## [1.16.2](https://github.com/mastergo-design/plugin-typings/compare/v1.16.1...v1.16.2) (2023-03-23)
1
+ ## [1.17.1](https://github.com/mastergo-design/plugin-typings/compare/v1.17.0...v1.17.1) (2023-03-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * getSharedPluginDataKeys返回错误 ([cb9c3cd](https://github.com/mastergo-design/plugin-typings/commit/cb9c3cd15fede7584fe1b253b91fbc67bd1ed993))
7
+
8
+
9
+
10
+ # [1.17.0](https://github.com/mastergo-design/plugin-typings/compare/v1.16.1...v1.17.0) (2023-03-30)
2
11
 
3
12
 
4
13
  ### Bug Fixes
5
14
 
15
+ * 完善flatten返回值类型 ([687ff5d](https://github.com/mastergo-design/plugin-typings/commit/687ff5de547be6f6ccc6d2f9b5c50dcbb1c014c0))
16
+ * 修复布尔组的childrenMixin的错误 ([25c6588](https://github.com/mastergo-design/plugin-typings/commit/25c6588c0a774733770a4eced4887a6f55024832))
6
17
  * 修复instance的swapComponent和detachInstance类型错误 ([c8aa208](https://github.com/mastergo-design/plugin-typings/commit/c8aa208700fc4f5323bffc41737199360ee13f6b))
18
+ * userenderBounds注释错误 ([caae3fb](https://github.com/mastergo-design/plugin-typings/commit/caae3fbd654bfc970cedabc62bc1b548a78419f5))
7
19
 
8
20
 
21
+ ### Features
22
+
23
+ * 实例切换首选项和公开嵌套实例 ([a821c55](https://github.com/mastergo-design/plugin-typings/commit/a821c55e7388286f9673da006659e51ea052883d))
24
+ * 移除group和布尔组的约束属性 ([a636dd4](https://github.com/mastergo-design/plugin-typings/commit/a636dd4d7fc2bb9ba1dff8550e5acef9401c4605))
25
+
26
+ ## [1.16.2](https://github.com/mastergo-design/plugin-typings/compare/v1.16.1...v1.16.2) (2023-03-23)
27
+ ### Bug Fixes
28
+
29
+ * 修复instance的swapComponent和detachInstance类型错误 ([c8aa208](https://github.com/mastergo-design/plugin-typings/commit/c8aa208700fc4f5323bffc41737199360ee13f6b))
9
30
 
10
31
  ## [1.16.1](https://github.com/mastergo-design/plugin-typings/compare/v1.16.0...v1.16.1) (2023-03-22)
11
32
 
package/dist/index.d.ts CHANGED
@@ -89,7 +89,7 @@ declare global {
89
89
  subtract(children: SceneNode[]): BooleanOperationNode
90
90
  intersect(children: SceneNode[]): BooleanOperationNode
91
91
  exclude(children: SceneNode[]): BooleanOperationNode
92
- flatten(nodes: SceneNode[]): PenNode
92
+ flatten(nodes: SceneNode[]): PenNode | null
93
93
 
94
94
  saveVersionHistoryAsync(desc: string): Promise<void>
95
95
 
@@ -167,7 +167,7 @@ declare global {
167
167
  readonly isSuffix?: boolean
168
168
  readonly fileName?: string
169
169
  readonly constraint?: ExportSettingsConstraints
170
- readonly useAbsoluteBounds?: boolean // defaults to false
170
+ readonly useAbsoluteBounds?: boolean // defaults to true
171
171
  readonly useRenderBounds?: boolean // default to true
172
172
  }
173
173
  interface ExportSettingsSVG {
@@ -180,7 +180,7 @@ declare global {
180
180
  readonly format: 'PDF'
181
181
  readonly isSuffix?: string
182
182
  readonly fileName?: string
183
- readonly useAbsoluteBounds?: boolean // defaults to false
183
+ readonly useAbsoluteBounds?: boolean // defaults to true
184
184
  readonly useRenderBounds?: boolean // default to true
185
185
  }
186
186
 
@@ -480,7 +480,7 @@ declare global {
480
480
  clearPluginData(): void
481
481
  getSharedPluginData(namespace: string, key: string): string
482
482
  setSharedPluginData(namespace: string, key: string, value: string): void
483
- getSharedPluginDataKeys(namespace: string): void
483
+ getSharedPluginDataKeys(namespace: string): string[]
484
484
  removeSharedPluginData(namespace: string, key: string): void
485
485
  clearSharedPluginData(namespace: string): void
486
486
  }
@@ -781,11 +781,6 @@ declare global {
781
781
  resizeToFit(): void
782
782
  }
783
783
 
784
- interface GroupNode extends DefaultContainerMixin, GeometryMixin {
785
- readonly type: 'GROUP'
786
- clone(): GroupNode
787
- }
788
-
789
784
  interface RectangleNode
790
785
  extends DefaultShapeMixin,
791
786
  ConstraintMixin,
@@ -849,13 +844,22 @@ declare global {
849
844
 
850
845
  interface BooleanOperationNode
851
846
  extends DefaultShapeMixin,
852
- Omit<ChildrenMixin, 'appendChild' | 'insertChild'>,
847
+ ChildrenMixin,
853
848
  CornerMixin {
854
849
  readonly type: 'BOOLEAN_OPERATION'
855
850
  booleanOperation: 'UNION' | 'INTERSECT' | 'SUBTRACT' | 'EXCLUDE'
856
851
  clone(): BooleanOperationNode
857
852
  }
858
853
 
854
+
855
+ interface GroupNode
856
+ extends DefaultShapeMixin,
857
+ ChildrenMixin,
858
+ CornerMixin {
859
+ readonly type: 'GROUP'
860
+ clone(): GroupNode
861
+ }
862
+
859
863
  interface TextRangeStyle {
860
864
  fontName: FontName
861
865
  fontSize: number
@@ -965,12 +969,14 @@ declare global {
965
969
  propertyName: string,
966
970
  type: Exclude<ComponentPropertyType, 'VARIANT'>,
967
971
  defaultValue: string | boolean,
972
+ options?: ComponentPropertyOptions,
968
973
  ): string
969
974
  editComponentProperty(
970
975
  propertyId: string,
971
976
  newValue: {
972
977
  name?: string
973
978
  defaultValue?: string | boolean
979
+ preferredValues?: InstanceSwapPreferredValue[]
974
980
  },
975
981
  ): string
976
982
  deleteComponentProperty(propertyId: string): void
@@ -984,15 +990,23 @@ declare global {
984
990
  defaultValue: string | boolean
985
991
  id?: string
986
992
  variantOptions?: string[]
993
+ preferredValues?: InstanceSwapPreferredValue[]
987
994
  }
988
995
 
989
996
  type ComponentPropertyType = 'BOOLEAN' | 'TEXT' | 'INSTANCE_SWAP' | 'VARIANT'
990
-
997
+ type InstanceSwapPreferredValue = {
998
+ type: 'COMPONENT' | 'COMPONENT_SET'
999
+ key: string
1000
+ }
1001
+ type ComponentPropertyOptions = {
1002
+ preferredValues?: InstanceSwapPreferredValue[]
1003
+ }
991
1004
  type ComponentProperties = {
992
1005
  name: string
993
1006
  id?: string
994
1007
  type: ComponentPropertyType
995
1008
  value: boolean | string
1009
+ preferredValues?: InstanceSwapPreferredValue[]
996
1010
  }
997
1011
 
998
1012
  interface ComponentNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin, PublishableMixin, ComponentPropertiesMixin {
@@ -1022,11 +1036,14 @@ declare global {
1022
1036
  interface InstanceNode extends Omit<DefaultContainerMixin, 'appendChild' | 'insertChild'>, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
1023
1037
  readonly type: 'INSTANCE'
1024
1038
  readonly variantProperties: Array<VariantProperty> | undefined
1039
+
1025
1040
  setVariantPropertyValues(property: Record<string, string>): void
1026
1041
 
1027
1042
  readonly componentProperties: Array<ComponentProperties>
1028
1043
  setProperties(properties: { [propertyId: string]: string | boolean }): void
1029
-
1044
+ readonly exposedInstances: InstanceNode[]
1045
+ isExposedInstance: boolean
1046
+
1030
1047
  clone(): InstanceNode
1031
1048
  /**
1032
1049
  * this is an async func
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastergo/plugin-typings",
3
- "version": "1.16.2",
3
+ "version": "1.17.1",
4
4
  "description": "MasterGo插件API声明文件",
5
5
  "main": "",
6
6
  "types": "dist/index.d.ts",