@mastergo/plugin-typings 2.8.0-beta.2 → 2.8.0-beta.4

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 +27 -33
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1184,15 +1184,7 @@ declare global {
1184
1184
  * @param styleName
1185
1185
  * @param description
1186
1186
  */
1187
- createStyleCopy<T extends StyleType = StyleType>(sourceStyleId: string, type: T, styleName?: string, description?: string): StyleReturnType<T>
1188
- /**
1189
- * 创建某一个样式引用
1190
- * @param sourceStyleId 引用源样式id
1191
- * @param type
1192
- * @param styleName
1193
- * @param description
1194
- */
1195
- createStyleRef<T extends StyleType = StyleType>(sourceStyleId: string, type: T, styleName?: string, description?: string): StyleReturnType<T>
1187
+ createStyleCopy<T extends StyleType = "PAINT">(sourceStyleId: string, styleName?: string, description?: string): StyleReturnType<T>
1196
1188
 
1197
1189
  getLocalPaintStyles(): PaintStyle[]
1198
1190
  getLocalEffectStyles(): EffectStyle[]
@@ -1362,7 +1354,7 @@ declare global {
1362
1354
  type StyleType = 'PAINT' | 'TEXT' | 'EFFECT' | 'GRID' | 'STROKE_WIDTH' | 'CORNER_RADIUS' | 'PADDING' | 'SPACING'
1363
1355
  type NodeStyleType = 'fill' | 'strokeFill' | 'strokeWidth' | 'cornerRadius' | 'padding' | 'spacing'
1364
1356
 
1365
- interface BaseStyle extends Omit<PublishableMixin, 'documentationLinks' | 'alias'> {
1357
+ interface BaseStyle extends Omit<PublishableMixin, 'documentationLinks'> {
1366
1358
  readonly id: string
1367
1359
  readonly type: StyleType
1368
1360
  name: string
@@ -1452,7 +1444,9 @@ declare global {
1452
1444
  layoutGrids: ReadonlyArray<LayoutGrid>
1453
1445
  }
1454
1446
 
1455
- type Style = PaintStyle | EffectStyle | TextStyle | GridStyle
1447
+ type Style = PaintStyle | EffectStyle | TextStyle |
1448
+ GridStyle | StrokeWidthStyle | CornerRadiusStyle |
1449
+ PaddingStyle | SpacingStyle
1456
1450
 
1457
1451
  /// /////////////////////////////////////////////////////////////////////////////
1458
1452
  // Datatypes
@@ -1651,7 +1645,7 @@ declare global {
1651
1645
  | 'PLUS_LIGHTER'
1652
1646
  | 'PASS_THROUGH'
1653
1647
 
1654
- type FontReferrer = 'team' | 'org' | 'local' | 'official'
1648
+ type FontReferrer = 'team' | 'org' | 'local' | 'official'
1655
1649
 
1656
1650
  interface Font {
1657
1651
  fontName: FontName
@@ -1796,7 +1790,6 @@ declare global {
1796
1790
  strokeStyleId: string
1797
1791
  strokeFillStyleId: string
1798
1792
  strokeWidthStyleId: string
1799
- borderStyleId: string
1800
1793
  paddingStyleId: string
1801
1794
  spacingStyleId: string
1802
1795
  cornerRadiusStyleId: string
@@ -2198,6 +2191,7 @@ declare global {
2198
2191
  name?: string
2199
2192
  defaultValue?: string | boolean
2200
2193
  preferredValues?: InstanceSwapPreferredValue[]
2194
+ alias?: string
2201
2195
  },
2202
2196
  ): string
2203
2197
  deleteComponentProperty(propertyId: string): void
@@ -2501,9 +2495,9 @@ declare global {
2501
2495
  | 'SLICE'
2502
2496
  | 'CONNECTOR'
2503
2497
  | 'SECTION'
2504
-
2505
-
2506
-
2498
+
2499
+
2500
+
2507
2501
  // d2c
2508
2502
  type CodeFile = {
2509
2503
  /**
@@ -2532,15 +2526,15 @@ declare global {
2532
2526
  /**
2533
2527
  * @param event a callback function that is triggered when the plugin generates the DSL, and the parameter of the callback function is the modified DSL data
2534
2528
  */
2535
- on(type: 'generateDSL', event: (generateData: {data: MGDSL.MGDSLData, callback: (modifiedData: MGDSL.MGDSLData) => void}) => void) : void
2529
+ on(type: 'generateDSL', event: (generateData: { data: MGDSL.MGDSLData, callback: (modifiedData: MGDSL.MGDSLData) => void }) => void): void
2536
2530
  /**
2537
2531
  * @param event a callback function that is triggered when the plugin generates the DSL, and the parameter of the callback function is the custom code, and when the callback returns the custom code, the custom code will be used as the standard, and the code will not be generated according to the DSL
2538
2532
  */
2539
- on(type: 'generate', event: (generateData: {data: MGDSL.MGDSLData, callback: (modifiedData: MGDSL.CustomCode) => void}) => void) : void
2533
+ on(type: 'generate', event: (generateData: { data: MGDSL.MGDSLData, callback: (modifiedData: MGDSL.CustomCode) => void }) => void): void
2540
2534
  /**
2541
2535
  * @param event a callback function that is triggered when the plugin generates the code, and the parameter of the callback function is the generated code
2542
2536
  */
2543
- on(type: 'codeChange', event: (data: MGDSL.CustomCode['data']) => void) : void
2537
+ on(type: 'codeChange', event: (data: MGDSL.CustomCode['data']) => void): void
2544
2538
  /**
2545
2539
  * Set the component template
2546
2540
  * @description used to set the component mapping relationship
@@ -2570,21 +2564,21 @@ declare global {
2570
2564
  getCodeByDSL(data: MGDSL.MGDSLData, type: MGDSL.Framework): Promise<CodeFile | null>;
2571
2565
  }
2572
2566
 
2573
- type StyleReturnType<T extends StyleType> =
2574
- T extends 'PAINT' ? PaintStyle :
2575
- T extends 'TEXT' ? TextStyle :
2576
- T extends 'EFFECT' ? EffectStyle :
2577
- T extends 'GRID' ? GridStyle :
2578
- T extends 'STROKE_WIDTH' ? StrokeWidthStyle :
2579
- T extends 'CORNER_RADIUS' ? CornerRadiusStyle :
2580
- T extends 'PADDING' ? PaddingStyle :
2567
+ type StyleReturnType<T extends StyleType> =
2568
+ T extends 'PAINT' ? PaintStyle :
2569
+ T extends 'TEXT' ? TextStyle :
2570
+ T extends 'EFFECT' ? EffectStyle :
2571
+ T extends 'GRID' ? GridStyle :
2572
+ T extends 'STROKE_WIDTH' ? StrokeWidthStyle :
2573
+ T extends 'CORNER_RADIUS' ? CornerRadiusStyle :
2574
+ T extends 'PADDING' ? PaddingStyle :
2581
2575
  T extends 'SPACING' ? SpacingStyle : never
2582
2576
 
2583
- type NodeStyleReturnType<T extends NodeStyleType> =
2584
- T extends 'fill' ? PaintStyle :
2585
- T extends 'strokeFill' ? PaintStyle :
2586
- T extends 'strokeWidth' ? StrokeWidthStyle :
2587
- T extends 'cornerRadius' ? CornerRadiusStyle :
2588
- T extends 'padding' ? PaddingStyle :
2577
+ type NodeStyleReturnType<T extends NodeStyleType> =
2578
+ T extends 'fill' ? PaintStyle :
2579
+ T extends 'strokeFill' ? PaintStyle :
2580
+ T extends 'strokeWidth' ? StrokeWidthStyle :
2581
+ T extends 'cornerRadius' ? CornerRadiusStyle :
2582
+ T extends 'padding' ? PaddingStyle :
2589
2583
  T extends 'spacing' ? SpacingStyle : never
2590
2584
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastergo/plugin-typings",
3
- "version": "2.8.0-beta.2",
3
+ "version": "2.8.0-beta.4",
4
4
  "description": "MasterGo插件API声明文件",
5
5
  "main": "",
6
6
  "types": "dist/index.d.ts",