@mastergo/plugin-typings 1.4.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
@@ -55,7 +55,7 @@ declare global {
55
55
  hyperlink: Hyperlink
56
56
  }
57
57
 
58
- type PluginEventType = 'selectionchange' | 'currentpagechange' | 'close' | 'themechange' | 'drop'
58
+ type PluginEventType = 'selectionchange' | 'currentpagechange' | 'close' | 'themechange' | 'drop' | 'run'
59
59
  type ThemeColor = 'dark' | 'light'
60
60
 
61
61
  interface PluginAPI {
@@ -69,6 +69,8 @@ declare global {
69
69
 
70
70
  readonly documentId: number
71
71
 
72
+ readonly command: string
73
+
72
74
  readonly clientStorage: ClientStorageAPI
73
75
 
74
76
  readonly viewport: ViewportAPI
@@ -146,6 +148,8 @@ declare global {
146
148
  center: Vector
147
149
  zoom: number
148
150
  readonly bound: Rect
151
+ rulerVisible: boolean
152
+ layoutGridVisible: boolean
149
153
  scrollAndZoomIntoView(nodes: ReadonlyArray<BaseNode>): void
150
154
  }
151
155
 
@@ -238,6 +242,13 @@ declare global {
238
242
  fills: Paint[]
239
243
  }
240
244
 
245
+ interface ListStyle {
246
+ start: number
247
+ end: number
248
+ level: number
249
+ type: 'ORDERED' | 'BULLETED' | 'NONE'
250
+ }
251
+
241
252
  interface EffectStyle extends BaseStyle {
242
253
  type: 'EFFECT'
243
254
  effects: ReadonlyArray<Effect>
@@ -713,6 +724,7 @@ declare global {
713
724
  interface FrameNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
714
725
  readonly type: 'FRAME'
715
726
  clone(): FrameNode
727
+ resizeToFit(): void
716
728
  }
717
729
 
718
730
  interface GroupNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin {
@@ -819,6 +831,7 @@ declare global {
819
831
  textAutoResize: 'NONE' | 'WIDTH_AND_HEIGHT' | 'HEIGHT'
820
832
  paragraphSpacing: number
821
833
  readonly textStyles: ReadonlyArray<TextSegStyle>
834
+ readonly listStyles: ReadonlyArray<ListStyle>
822
835
  clone(): TextNode
823
836
 
824
837
  insertCharacters(start: number, characters: string): void
@@ -845,6 +858,7 @@ declare global {
845
858
  setRangeSuperLink(start: number, end: number, link: string | null): void
846
859
  setRangeHyperLink(start: number, end: number, hyperlink: Hyperlink | null): void
847
860
  setRangeTextCase(start: number, end: number, textCase: TextCase): void
861
+ setRangeListStyle(start: number, end: number, type: 'ORDERED' | 'BULLETED' | 'NONE'): void
848
862
  }
849
863
 
850
864
  interface ComponentNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
@@ -854,6 +868,7 @@ declare global {
854
868
  setVariantPropertyValues(property: Record<string, string>): void
855
869
  clone(): ComponentNode
856
870
  createInstance(): InstanceNode
871
+ resizeToFit(): void
857
872
  }
858
873
 
859
874
  interface ComponentSetNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
@@ -865,6 +880,7 @@ declare global {
865
880
  editVariantProperties(properties: Record<string, string>): void
866
881
  editVariantPropertyValues(properties: Record<string, { oldValue: string, newValue: string }>): void
867
882
  deleteVariantProperty(property: string): void
883
+ resizeToFit(): void
868
884
  }
869
885
 
870
886
  interface InstanceNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
@@ -1122,7 +1138,7 @@ declare global {
1122
1138
  hyperlink: Hyperlink
1123
1139
  }
1124
1140
 
1125
- type PluginEventType = 'selectionchange' | 'currentpagechange' | 'close' | 'themechange' | 'drop'
1141
+ type PluginEventType = 'selectionchange' | 'currentpagechange' | 'close' | 'themechange' | 'drop' | 'run'
1126
1142
  type ThemeColor = 'dark' | 'light'
1127
1143
 
1128
1144
  interface PluginAPI {
@@ -1136,6 +1152,8 @@ declare global {
1136
1152
 
1137
1153
  readonly documentId: number
1138
1154
 
1155
+ readonly command: string
1156
+
1139
1157
  readonly clientStorage: ClientStorageAPI
1140
1158
 
1141
1159
  readonly viewport: ViewportAPI
@@ -1213,6 +1231,8 @@ declare global {
1213
1231
  center: Vector
1214
1232
  zoom: number
1215
1233
  readonly bound: Rect
1234
+ rulerVisible: boolean
1235
+ layoutGridVisible: boolean
1216
1236
  scrollAndZoomIntoView(nodes: ReadonlyArray<BaseNode>): void
1217
1237
  }
1218
1238
 
@@ -1305,6 +1325,13 @@ declare global {
1305
1325
  fills: Paint[]
1306
1326
  }
1307
1327
 
1328
+ interface ListStyle {
1329
+ start: number
1330
+ end: number
1331
+ level: number
1332
+ type: 'ORDERED' | 'BULLETED' | 'NONE'
1333
+ }
1334
+
1308
1335
  interface EffectStyle extends BaseStyle {
1309
1336
  type: 'EFFECT'
1310
1337
  effects: ReadonlyArray<Effect>
@@ -1780,6 +1807,7 @@ declare global {
1780
1807
  interface FrameNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
1781
1808
  readonly type: 'FRAME'
1782
1809
  clone(): FrameNode
1810
+ resizeToFit(): void
1783
1811
  }
1784
1812
 
1785
1813
  interface GroupNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin {
@@ -1886,6 +1914,7 @@ declare global {
1886
1914
  textAutoResize: 'NONE' | 'WIDTH_AND_HEIGHT' | 'HEIGHT'
1887
1915
  paragraphSpacing: number
1888
1916
  readonly textStyles: ReadonlyArray<TextSegStyle>
1917
+ readonly listStyles: ReadonlyArray<ListStyle>
1889
1918
  clone(): TextNode
1890
1919
 
1891
1920
  insertCharacters(start: number, characters: string): void
@@ -1912,6 +1941,7 @@ declare global {
1912
1941
  setRangeSuperLink(start: number, end: number, link: string | null): void
1913
1942
  setRangeHyperLink(start: number, end: number, hyperlink: Hyperlink | null): void
1914
1943
  setRangeTextCase(start: number, end: number, textCase: TextCase): void
1944
+ setRangeListStyle(start: number, end: number, type: 'ORDERED' | 'BULLETED' | 'NONE'): void
1915
1945
  }
1916
1946
 
1917
1947
  interface ComponentNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
@@ -1921,6 +1951,7 @@ declare global {
1921
1951
  setVariantPropertyValues(property: Record<string, string>): void
1922
1952
  clone(): ComponentNode
1923
1953
  createInstance(): InstanceNode
1954
+ resizeToFit(): void
1924
1955
  }
1925
1956
 
1926
1957
  interface ComponentSetNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin, RectangleStrokeWeightMixin {
@@ -1932,6 +1963,7 @@ declare global {
1932
1963
  editVariantProperties(properties: Record<string, string>): void
1933
1964
  editVariantPropertyValues(properties: Record<string, { oldValue: string, newValue: string }>): void
1934
1965
  deleteVariantProperty(property: string): void
1966
+ resizeToFit(): void
1935
1967
  }
1936
1968
 
1937
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.4.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
  },