@mastergo/plugin-typings 1.5.0 → 1.6.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 MasterGo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ **中文** | [English](./README-en.md)
2
+
1
3
  # MasterGo插件API声明文件
2
4
  本项目为MasterGo插件API的ts声明文件。
3
5
 
@@ -10,7 +12,7 @@
10
12
  yarn add -D @mastergo/plugin-typings
11
13
  ```
12
14
 
13
- 2. 配置 _tsconfig.json_
15
+ 2. 配置 `tsconfig.json`
14
16
  ```js
15
17
  {
16
18
  "compilerOptions": {
package/dist/index.d.ts CHANGED
@@ -148,6 +148,8 @@ declare global {
148
148
  center: Vector
149
149
  zoom: number
150
150
  readonly bound: Rect
151
+ rulerVisible: boolean
152
+ layoutGridVisible: boolean
151
153
  scrollAndZoomIntoView(nodes: ReadonlyArray<BaseNode>): void
152
154
  }
153
155
 
@@ -240,6 +242,13 @@ declare global {
240
242
  fills: Paint[]
241
243
  }
242
244
 
245
+ interface ListStyle {
246
+ start: number
247
+ end: number
248
+ level: number
249
+ type: 'ORDERED' | 'BULLETED' | 'NONE'
250
+ }
251
+
243
252
  interface EffectStyle extends BaseStyle {
244
253
  type: 'EFFECT'
245
254
  effects: ReadonlyArray<Effect>
@@ -715,6 +724,7 @@ declare global {
715
724
  interface FrameNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
716
725
  readonly type: 'FRAME'
717
726
  clone(): FrameNode
727
+ resizeToFit(): void
718
728
  }
719
729
 
720
730
  interface GroupNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin {
@@ -821,6 +831,7 @@ declare global {
821
831
  textAutoResize: 'NONE' | 'WIDTH_AND_HEIGHT' | 'HEIGHT'
822
832
  paragraphSpacing: number
823
833
  readonly textStyles: ReadonlyArray<TextSegStyle>
834
+ readonly listStyles: ReadonlyArray<ListStyle>
824
835
  clone(): TextNode
825
836
 
826
837
  insertCharacters(start: number, characters: string): void
@@ -847,6 +858,7 @@ declare global {
847
858
  setRangeSuperLink(start: number, end: number, link: string | null): void
848
859
  setRangeHyperLink(start: number, end: number, hyperlink: Hyperlink | null): void
849
860
  setRangeTextCase(start: number, end: number, textCase: TextCase): void
861
+ setRangeListStyle(start: number, end: number, type: 'ORDERED' | 'BULLETED' | 'NONE'): void
850
862
  }
851
863
 
852
864
  interface ComponentNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
@@ -856,6 +868,7 @@ declare global {
856
868
  setVariantPropertyValues(property: Record<string, string>): void
857
869
  clone(): ComponentNode
858
870
  createInstance(): InstanceNode
871
+ resizeToFit(): void
859
872
  }
860
873
 
861
874
  interface ComponentSetNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
@@ -867,6 +880,7 @@ declare global {
867
880
  editVariantProperties(properties: Record<string, string>): void
868
881
  editVariantPropertyValues(properties: Record<string, { oldValue: string, newValue: string }>): void
869
882
  deleteVariantProperty(property: string): void
883
+ resizeToFit(): void
870
884
  }
871
885
 
872
886
  interface InstanceNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
@@ -1217,6 +1231,8 @@ declare global {
1217
1231
  center: Vector
1218
1232
  zoom: number
1219
1233
  readonly bound: Rect
1234
+ rulerVisible: boolean
1235
+ layoutGridVisible: boolean
1220
1236
  scrollAndZoomIntoView(nodes: ReadonlyArray<BaseNode>): void
1221
1237
  }
1222
1238
 
@@ -1309,6 +1325,13 @@ declare global {
1309
1325
  fills: Paint[]
1310
1326
  }
1311
1327
 
1328
+ interface ListStyle {
1329
+ start: number
1330
+ end: number
1331
+ level: number
1332
+ type: 'ORDERED' | 'BULLETED' | 'NONE'
1333
+ }
1334
+
1312
1335
  interface EffectStyle extends BaseStyle {
1313
1336
  type: 'EFFECT'
1314
1337
  effects: ReadonlyArray<Effect>
@@ -1784,6 +1807,7 @@ declare global {
1784
1807
  interface FrameNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
1785
1808
  readonly type: 'FRAME'
1786
1809
  clone(): FrameNode
1810
+ resizeToFit(): void
1787
1811
  }
1788
1812
 
1789
1813
  interface GroupNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin {
@@ -1890,6 +1914,7 @@ declare global {
1890
1914
  textAutoResize: 'NONE' | 'WIDTH_AND_HEIGHT' | 'HEIGHT'
1891
1915
  paragraphSpacing: number
1892
1916
  readonly textStyles: ReadonlyArray<TextSegStyle>
1917
+ readonly listStyles: ReadonlyArray<ListStyle>
1893
1918
  clone(): TextNode
1894
1919
 
1895
1920
  insertCharacters(start: number, characters: string): void
@@ -1916,6 +1941,7 @@ declare global {
1916
1941
  setRangeSuperLink(start: number, end: number, link: string | null): void
1917
1942
  setRangeHyperLink(start: number, end: number, hyperlink: Hyperlink | null): void
1918
1943
  setRangeTextCase(start: number, end: number, textCase: TextCase): void
1944
+ setRangeListStyle(start: number, end: number, type: 'ORDERED' | 'BULLETED' | 'NONE'): void
1919
1945
  }
1920
1946
 
1921
1947
  interface ComponentNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
@@ -1925,6 +1951,7 @@ declare global {
1925
1951
  setVariantPropertyValues(property: Record<string, string>): void
1926
1952
  clone(): ComponentNode
1927
1953
  createInstance(): InstanceNode
1954
+ resizeToFit(): void
1928
1955
  }
1929
1956
 
1930
1957
  interface ComponentSetNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
@@ -1936,6 +1963,7 @@ declare global {
1936
1963
  editVariantProperties(properties: Record<string, string>): void
1937
1964
  editVariantPropertyValues(properties: Record<string, { oldValue: string, newValue: string }>): void
1938
1965
  deleteVariantProperty(property: string): void
1966
+ resizeToFit(): void
1939
1967
  }
1940
1968
 
1941
1969
  interface InstanceNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastergo/plugin-typings",
3
- "version": "1.5.0",
3
+ "version": "1.6.1",
4
4
  "description": "MasterGo插件API声明文件",
5
5
  "main": "",
6
6
  "types": "dist/index.d.ts",
@@ -24,6 +24,10 @@
24
24
  ],
25
25
  "author": "MasterGo",
26
26
  "license": "MIT",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/mastergo-design/plugin-typings"
30
+ },
27
31
  "directories": {
28
32
  "lib": "lib"
29
33
  },