@mastergo/plugin-typings 1.16.2 → 1.18.0

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,41 @@
1
- ## [1.16.2](https://github.com/mastergo-design/plugin-typings/compare/v1.16.1...v1.16.2) (2023-03-23)
1
+ # [1.18.0](https://github.com/mastergo-design/plugin-typings/compare/v1.17.1...v1.18.0) (2023-04-06)
2
+
3
+
4
+ ### Features
5
+
6
+ * 容器图层增加expanded属性, 实例增加resetoverrides方法 ([a2d1bad](https://github.com/mastergo-design/plugin-typings/commit/a2d1bad715c5e6d3096c4c406ce73a1fc4f3b391))
7
+
8
+
9
+
10
+ ## [1.17.1](https://github.com/mastergo-design/plugin-typings/compare/v1.17.0...v1.17.1) (2023-03-30)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * getSharedPluginDataKeys返回错误 ([cb9c3cd](https://github.com/mastergo-design/plugin-typings/commit/cb9c3cd15fede7584fe1b253b91fbc67bd1ed993))
16
+
17
+
18
+
19
+ # [1.17.0](https://github.com/mastergo-design/plugin-typings/compare/v1.16.1...v1.17.0) (2023-03-30)
2
20
 
3
21
 
4
22
  ### Bug Fixes
5
23
 
24
+ * 完善flatten返回值类型 ([687ff5d](https://github.com/mastergo-design/plugin-typings/commit/687ff5de547be6f6ccc6d2f9b5c50dcbb1c014c0))
25
+ * 修复布尔组的childrenMixin的错误 ([25c6588](https://github.com/mastergo-design/plugin-typings/commit/25c6588c0a774733770a4eced4887a6f55024832))
6
26
  * 修复instance的swapComponent和detachInstance类型错误 ([c8aa208](https://github.com/mastergo-design/plugin-typings/commit/c8aa208700fc4f5323bffc41737199360ee13f6b))
27
+ * userenderBounds注释错误 ([caae3fb](https://github.com/mastergo-design/plugin-typings/commit/caae3fbd654bfc970cedabc62bc1b548a78419f5))
28
+
7
29
 
30
+ ### Features
8
31
 
32
+ * 实例切换首选项和公开嵌套实例 ([a821c55](https://github.com/mastergo-design/plugin-typings/commit/a821c55e7388286f9673da006659e51ea052883d))
33
+ * 移除group和布尔组的约束属性 ([a636dd4](https://github.com/mastergo-design/plugin-typings/commit/a636dd4d7fc2bb9ba1dff8550e5acef9401c4605))
34
+
35
+ ## [1.16.2](https://github.com/mastergo-design/plugin-typings/compare/v1.16.1...v1.16.2) (2023-03-23)
36
+ ### Bug Fixes
37
+
38
+ * 修复instance的swapComponent和detachInstance类型错误 ([c8aa208](https://github.com/mastergo-design/plugin-typings/commit/c8aa208700fc4f5323bffc41737199360ee13f6b))
9
39
 
10
40
  ## [1.16.1](https://github.com/mastergo-design/plugin-typings/compare/v1.16.0...v1.16.1) (2023-03-22)
11
41
 
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
  }
@@ -620,6 +620,7 @@ declare global {
620
620
 
621
621
  interface DefaultContainerMixin
622
622
  extends BaseNodeMixin,
623
+ ContainerMixin,
623
624
  ReactionMixin,
624
625
  SceneNodeMixin,
625
626
  ChildrenMixin,
@@ -629,7 +630,9 @@ declare global {
629
630
  ConstraintMixin,
630
631
  LayoutMixin,
631
632
  ExportMixin { }
632
-
633
+ interface ContainerMixin {
634
+ expanded: boolean
635
+ }
633
636
  interface AutoLayout {
634
637
  flexMode: 'NONE' | 'HORIZONTAL' | 'VERTICAL'
635
638
  itemSpacing: number
@@ -781,11 +784,6 @@ declare global {
781
784
  resizeToFit(): void
782
785
  }
783
786
 
784
- interface GroupNode extends DefaultContainerMixin, GeometryMixin {
785
- readonly type: 'GROUP'
786
- clone(): GroupNode
787
- }
788
-
789
787
  interface RectangleNode
790
788
  extends DefaultShapeMixin,
791
789
  ConstraintMixin,
@@ -849,13 +847,24 @@ declare global {
849
847
 
850
848
  interface BooleanOperationNode
851
849
  extends DefaultShapeMixin,
852
- Omit<ChildrenMixin, 'appendChild' | 'insertChild'>,
850
+ ContainerMixin,
851
+ ChildrenMixin,
853
852
  CornerMixin {
854
853
  readonly type: 'BOOLEAN_OPERATION'
855
854
  booleanOperation: 'UNION' | 'INTERSECT' | 'SUBTRACT' | 'EXCLUDE'
856
855
  clone(): BooleanOperationNode
857
856
  }
858
857
 
858
+
859
+ interface GroupNode
860
+ extends DefaultShapeMixin,
861
+ ContainerMixin,
862
+ ChildrenMixin,
863
+ CornerMixin {
864
+ readonly type: 'GROUP'
865
+ clone(): GroupNode
866
+ }
867
+
859
868
  interface TextRangeStyle {
860
869
  fontName: FontName
861
870
  fontSize: number
@@ -965,12 +974,14 @@ declare global {
965
974
  propertyName: string,
966
975
  type: Exclude<ComponentPropertyType, 'VARIANT'>,
967
976
  defaultValue: string | boolean,
977
+ options?: ComponentPropertyOptions,
968
978
  ): string
969
979
  editComponentProperty(
970
980
  propertyId: string,
971
981
  newValue: {
972
982
  name?: string
973
983
  defaultValue?: string | boolean
984
+ preferredValues?: InstanceSwapPreferredValue[]
974
985
  },
975
986
  ): string
976
987
  deleteComponentProperty(propertyId: string): void
@@ -984,15 +995,23 @@ declare global {
984
995
  defaultValue: string | boolean
985
996
  id?: string
986
997
  variantOptions?: string[]
998
+ preferredValues?: InstanceSwapPreferredValue[]
987
999
  }
988
1000
 
989
1001
  type ComponentPropertyType = 'BOOLEAN' | 'TEXT' | 'INSTANCE_SWAP' | 'VARIANT'
990
-
1002
+ type InstanceSwapPreferredValue = {
1003
+ type: 'COMPONENT' | 'COMPONENT_SET'
1004
+ key: string
1005
+ }
1006
+ type ComponentPropertyOptions = {
1007
+ preferredValues?: InstanceSwapPreferredValue[]
1008
+ }
991
1009
  type ComponentProperties = {
992
1010
  name: string
993
1011
  id?: string
994
1012
  type: ComponentPropertyType
995
1013
  value: boolean | string
1014
+ preferredValues?: InstanceSwapPreferredValue[]
996
1015
  }
997
1016
 
998
1017
  interface ComponentNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin, PublishableMixin, ComponentPropertiesMixin {
@@ -1022,10 +1041,15 @@ declare global {
1022
1041
  interface InstanceNode extends Omit<DefaultContainerMixin, 'appendChild' | 'insertChild'>, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
1023
1042
  readonly type: 'INSTANCE'
1024
1043
  readonly variantProperties: Array<VariantProperty> | undefined
1044
+
1025
1045
  setVariantPropertyValues(property: Record<string, string>): void
1026
1046
 
1027
1047
  readonly componentProperties: Array<ComponentProperties>
1028
1048
  setProperties(properties: { [propertyId: string]: string | boolean }): void
1049
+ readonly exposedInstances: InstanceNode[]
1050
+ isExposedInstance: boolean
1051
+
1052
+ resetOverrides(): void
1029
1053
 
1030
1054
  clone(): InstanceNode
1031
1055
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastergo/plugin-typings",
3
- "version": "1.16.2",
3
+ "version": "1.18.0",
4
4
  "description": "MasterGo插件API声明文件",
5
5
  "main": "",
6
6
  "types": "dist/index.d.ts",