@mastergo/plugin-typings 2.16.0 → 2.16.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +18 -1
  2. package/package.json +17 -17
package/dist/index.d.ts CHANGED
@@ -1271,6 +1271,16 @@ declare global {
1271
1271
  loadFontAsync(fontName: FontName): Promise<boolean>
1272
1272
  createImage(imageData: Uint8Array, isSync?: boolean): Promise<Image>
1273
1273
  getImageByHref(href: string): Image
1274
+
1275
+ /**
1276
+ * 导出多个图层组成的png图片, 可过滤图层id,设置导出图片的缩放倍率
1277
+ */
1278
+ exportPng(params: GlobalExportPngSetting): string;
1279
+ /**
1280
+ * 导出多个图层组成的svg图片
1281
+ * @param layerIds 图层id数组
1282
+ */
1283
+ exportSvgByLayerIds(layerIds: string[]): string
1274
1284
 
1275
1285
  getTeamLibraryAsync(): Promise<TeamLibrary>
1276
1286
  importComponentByKeyAsync(ukey: string): Promise<ComponentNode>
@@ -1297,6 +1307,12 @@ declare global {
1297
1307
  ) => void
1298
1308
  }
1299
1309
 
1310
+ interface GlobalExportPngSetting {
1311
+ ids?: string[];
1312
+ filterIds?: string[];
1313
+ scale?: number;
1314
+ }
1315
+
1300
1316
  interface User {
1301
1317
  id: string | null
1302
1318
  name: string | 'Anonymous'
@@ -1386,6 +1402,7 @@ declare global {
1386
1402
  exportSettings: ReadonlyArray<ExportSettings>
1387
1403
  export(settings?: ExportSettings): Uint8Array | string // Defaults to PNG format
1388
1404
  exportAsync(settings?: ExportSettings): Promise<Uint8Array | string>
1405
+ exportPng(settings?: Omit<GlobalExportPngSetting, 'ids'>): string
1389
1406
  }
1390
1407
 
1391
1408
  interface NotifyOptions {
@@ -2351,7 +2368,7 @@ declare global {
2351
2368
  readonly hyperlinks: Array<HyperlinkWithRange>
2352
2369
  textAlignHorizontal: 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFIED'
2353
2370
  textAlignVertical: 'TOP' | 'CENTER' | 'BOTTOM'
2354
- textAutoResize: 'NONE' | 'WIDTH_AND_HEIGHT' | 'HEIGHT' | 'TRUNCATE'
2371
+ textAutoResize: 'NONE' | 'WIDTH_AND_HEIGHT' | 'HEIGHT' | 'TRUNCATE' | 'TRUNCATE_AND_AUTO_WIDTH' | 'TRUNCATE_AND_AUTO_HEIGHT'
2355
2372
  paragraphSpacing: number
2356
2373
  readonly textStyles: ReadonlyArray<TextSegStyle>
2357
2374
  readonly listStyles: ReadonlyArray<ListStyle>
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@mastergo/plugin-typings",
3
- "version": "2.16.0",
3
+ "version": "2.16.1",
4
4
  "description": "MasterGo插件API声明文件",
5
+ "type": "module",
5
6
  "main": "",
6
7
  "types": "dist/index.d.ts",
7
8
  "scripts": {
8
9
  "prepare": "husky install",
9
10
  "dev": "rollup -c --environment NODE_ENV=development",
10
11
  "build": "rollup -c --environment NODE_ENV=production",
11
- "release": "node scripts/release.js",
12
+ "release": "node scripts/release.cjs",
12
13
  "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
13
14
  "commit": "git-cz"
14
15
  },
@@ -26,35 +27,34 @@
26
27
  "license": "MIT",
27
28
  "repository": {
28
29
  "type": "git",
29
- "url": "https://github.com/mastergo-design/plugin-typings"
30
+ "url": "git+https://github.com/mastergo-design/plugin-typings.git"
30
31
  },
31
32
  "directories": {
32
33
  "lib": "lib"
33
34
  },
34
35
  "devDependencies": {
35
- "@rollup/plugin-commonjs": "^20.0.0",
36
- "@rollup/plugin-json": "^4.1.0",
37
- "@rollup/plugin-node-resolve": "^13.0.4",
36
+ "@commitlint/cli": "^17.0.0",
37
+ "@commitlint/config-conventional": "^17.0.0",
38
+ "@rollup/plugin-commonjs": "^29.0.2",
39
+ "@rollup/plugin-json": "^6.1.0",
40
+ "@rollup/plugin-node-resolve": "^15.2.0",
38
41
  "chalk": "^4.1.2",
39
- "conventional-changelog-cli": "^2.1.1",
42
+ "commitizen": "^4.2.4",
43
+ "conventional-changelog-cli": "^3.0.0",
44
+ "csstype": "^3.1.3",
45
+ "cz-conventional-changelog": "^3.3.0",
40
46
  "execa": "^5.1.1",
41
47
  "husky": "^7.0.2",
42
48
  "inquirer": "^8.0.0",
43
49
  "inquirer-autocomplete-prompt": "^2.0.0",
44
50
  "lint-staged": "^11.1.2",
45
51
  "prettier": "^2.4.1",
46
- "rollup": "^2.56.3",
47
- "rollup-plugin-dts": "^4.0.0",
48
- "rollup-plugin-polyfill-node": "^0.7.0",
49
- "rollup-plugin-typescript2": "^0.30.0",
52
+ "rollup": "^4.59.0",
53
+ "rollup-plugin-dts": "^6.4.0",
54
+ "rollup-plugin-typescript2": "^0.36.0",
50
55
  "semver": "^7.3.5",
51
56
  "shelljs": "^0.8.5",
52
- "typescript": "^4.4.3",
53
- "@commitlint/cli": "^17.0.0",
54
- "@commitlint/config-conventional": "^17.0.0",
55
- "commitizen": "^4.2.4",
56
- "cz-conventional-changelog": "^3.3.0",
57
- "csstype": "^3.1.3"
57
+ "typescript": "^5.9.3"
58
58
  },
59
59
  "lint-staged": {
60
60
  "*.js": [