@mastergo/plugin-typings 1.0.0 → 1.1.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/dist/index.d.ts +218 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -72,6 +72,7 @@ declare global {
|
|
|
72
72
|
createComponent(): ComponentNode
|
|
73
73
|
createPage(): PageNode
|
|
74
74
|
createSlice(): SliceNode
|
|
75
|
+
createConnector(): ConnectorNode
|
|
75
76
|
createNodeFromSvgAsync(svg: string): Promise<FrameNode>
|
|
76
77
|
|
|
77
78
|
getHoverLayer(): PageNode | SceneNode
|
|
@@ -208,6 +209,7 @@ declare global {
|
|
|
208
209
|
letterSpacing: LetterSpacing
|
|
209
210
|
lineHeight: LineHeight
|
|
210
211
|
textDecoration: TextDecoration
|
|
212
|
+
textCase: TextCase
|
|
211
213
|
}
|
|
212
214
|
fills: Paint[]
|
|
213
215
|
}
|
|
@@ -225,6 +227,7 @@ declare global {
|
|
|
225
227
|
isExternal: boolean
|
|
226
228
|
letterSpacing: number
|
|
227
229
|
letterSpacingUnit: NumValue['unit']
|
|
230
|
+
textCase: TextCase
|
|
228
231
|
}
|
|
229
232
|
|
|
230
233
|
interface FontAlias {
|
|
@@ -267,6 +270,8 @@ declare global {
|
|
|
267
270
|
readonly style: string
|
|
268
271
|
}
|
|
269
272
|
|
|
273
|
+
type TextCase = 'ORIGINAL' | 'UPPER' | 'LOWER' | 'TITLE';
|
|
274
|
+
|
|
270
275
|
type TextDecoration = 'NONE' | 'UNDERLINE' | 'STRIKETHROUGH'
|
|
271
276
|
|
|
272
277
|
interface ShadowEffect {
|
|
@@ -406,7 +411,6 @@ declare global {
|
|
|
406
411
|
readonly parent: (BaseNode & ChildrenMixin) | void
|
|
407
412
|
name: string // Note: setting this also sets \`autoRename\` to false on TextNodes
|
|
408
413
|
removed: boolean
|
|
409
|
-
reactions: Reaction[]
|
|
410
414
|
remove(): void
|
|
411
415
|
getPluginData(key: string): string
|
|
412
416
|
setPluginData(key: string, value: string): void
|
|
@@ -471,11 +475,27 @@ declare global {
|
|
|
471
475
|
effectStyleId: string
|
|
472
476
|
}
|
|
473
477
|
|
|
474
|
-
type StrokeCap = 'NONE' | 'ROUND' | 'SQUARE' | 'LINE_ARROW' | 'TRIANGLE_ARROW'
|
|
478
|
+
type StrokeCap = 'NONE' | 'ROUND' | 'SQUARE' | 'LINE_ARROW' | 'TRIANGLE_ARROW' | 'ROUND_ARROW' | 'RING' | 'DIAMOND' | 'LINE'
|
|
475
479
|
type StrokeJoin = 'MITER' | 'BEVEL' | 'ROUND'
|
|
476
480
|
type StrokeAlign = 'CENTER' | 'INSIDE' | 'OUTSIDE'
|
|
477
481
|
type DashCap = 'NONE' | 'ROUND' | 'SQUARE'
|
|
478
482
|
type StrokeStyle = 'SOLID' | 'DASH' | 'CUSTOM'
|
|
483
|
+
type ConnectorStrokeCap = StrokeCap
|
|
484
|
+
|
|
485
|
+
interface ConnectorEndpointPosition {
|
|
486
|
+
readonly position: { x: number; y: number }
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
interface ConnectorEndpointConnected {
|
|
490
|
+
readonly position: { x: number; y: number }
|
|
491
|
+
readonly endpointNodeId: string
|
|
492
|
+
readonly magnet: 'TOP' | 'LEFT' | 'BOTTOM' | 'RIGHT'
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
type ConnectorEndpoint =
|
|
497
|
+
| ConnectorEndpointPosition
|
|
498
|
+
| ConnectorEndpointConnected
|
|
479
499
|
|
|
480
500
|
interface GeometryMixin {
|
|
481
501
|
fills: ReadonlyArray<Paint>
|
|
@@ -486,7 +506,7 @@ declare global {
|
|
|
486
506
|
strokeJoin: StrokeJoin
|
|
487
507
|
strokeStyle: StrokeStyle
|
|
488
508
|
dashCap: DashCap
|
|
489
|
-
strokeDashes: ReadonlyArray<
|
|
509
|
+
strokeDashes: ReadonlyArray<number>
|
|
490
510
|
fillStyleId: string
|
|
491
511
|
strokeStyleId: string
|
|
492
512
|
/**
|
|
@@ -515,10 +535,12 @@ declare global {
|
|
|
515
535
|
BlendMixin,
|
|
516
536
|
GeometryMixin,
|
|
517
537
|
LayoutMixin,
|
|
538
|
+
ReactionMixin,
|
|
518
539
|
ExportMixin { }
|
|
519
540
|
|
|
520
541
|
interface DefaultContainerMixin
|
|
521
542
|
extends BaseNodeMixin,
|
|
543
|
+
ReactionMixin,
|
|
522
544
|
SceneNodeMixin,
|
|
523
545
|
ChildrenMixin,
|
|
524
546
|
RectangleStrokeWeightMixin,
|
|
@@ -587,6 +609,41 @@ declare global {
|
|
|
587
609
|
bottomRightRadius: number
|
|
588
610
|
}
|
|
589
611
|
|
|
612
|
+
interface ReactionMixin {
|
|
613
|
+
reactions: ReadonlyArray<Reaction>
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
interface OpaqueNodeMixin extends BaseNodeMixin, SceneNodeMixin, ExportMixin {
|
|
617
|
+
readonly absoluteTransform: Transform
|
|
618
|
+
relativeTransform: Transform
|
|
619
|
+
x: number
|
|
620
|
+
y: number
|
|
621
|
+
readonly width: number
|
|
622
|
+
readonly height: number
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
interface MinimalBlendMixin {
|
|
626
|
+
opacity: number
|
|
627
|
+
blendMode: BlendMode
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
interface MinimalStrokesMixin {
|
|
631
|
+
strokes: ReadonlyArray<Paint>
|
|
632
|
+
strokeStyleId: string
|
|
633
|
+
strokeWeight: number
|
|
634
|
+
strokeJoin: StrokeJoin
|
|
635
|
+
strokeAlign: StrokeAlign
|
|
636
|
+
strokeStyle: StrokeStyle
|
|
637
|
+
strokeCap: StrokeCap
|
|
638
|
+
strokeDashes: ReadonlyArray<number>
|
|
639
|
+
dashCap: DashCap
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
interface MinimalFillsMixin {
|
|
643
|
+
fills: ReadonlyArray<Paint>
|
|
644
|
+
fillStyleId: string
|
|
645
|
+
}
|
|
646
|
+
|
|
590
647
|
/// /////////////////////////////////////////////////////////////////////////////
|
|
591
648
|
// Nodes
|
|
592
649
|
|
|
@@ -756,6 +813,7 @@ declare global {
|
|
|
756
813
|
setRangeLineHeight(start: number, end: number, value: LineHeight): void
|
|
757
814
|
setRangeFills(start: number, end: number, paints: Paint[]): void
|
|
758
815
|
setRangeSuperLink(start: number, end: number, link: string | null): void
|
|
816
|
+
setRangeTextCase(start: number, end: number, textCase: TextCase): void
|
|
759
817
|
}
|
|
760
818
|
|
|
761
819
|
interface ComponentNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin {
|
|
@@ -786,6 +844,51 @@ declare global {
|
|
|
786
844
|
isPreserveRatio: boolean
|
|
787
845
|
}
|
|
788
846
|
|
|
847
|
+
interface ConnectorNode extends OpaqueNodeMixin, Pick<MinimalBlendMixin, 'opacity'>, Omit<MinimalStrokesMixin, 'strokeAlign'> {
|
|
848
|
+
readonly type: 'CONNECTOR'
|
|
849
|
+
createText(): TextSublayerNode
|
|
850
|
+
readonly text: TextSublayerNode | null
|
|
851
|
+
cornerRadius?: number
|
|
852
|
+
connectorStart: ConnectorEndpoint
|
|
853
|
+
connectorEnd: ConnectorEndpoint
|
|
854
|
+
connectorStartStrokeCap: ConnectorStrokeCap
|
|
855
|
+
connectorEndStrokeCap: ConnectorStrokeCap
|
|
856
|
+
readonly strokeAlign: 'CENTER'
|
|
857
|
+
clone(): ConnectorNode
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
interface TextSublayerNode extends MinimalFillsMixin {
|
|
861
|
+
readonly id: string
|
|
862
|
+
readonly hasMissingFont: boolean
|
|
863
|
+
readonly textAlignHorizontal: 'CENTER'
|
|
864
|
+
readonly textAlignVertical: 'CENTER'
|
|
865
|
+
readonly textAutoResize: 'WIDTH_AND_HEIGHT'
|
|
866
|
+
|
|
867
|
+
readonly textStyles: ReadonlyArray<TextSegStyle>
|
|
868
|
+
|
|
869
|
+
paragraphSpacing: number
|
|
870
|
+
|
|
871
|
+
characters: string
|
|
872
|
+
insertCharacters(start: number, characters: string): void
|
|
873
|
+
deleteCharacters(start: number, end: number): void
|
|
874
|
+
|
|
875
|
+
setRangeFontSize(start: number, end: number, fontSize: number): void
|
|
876
|
+
setRangeTextDecoration(
|
|
877
|
+
start: number,
|
|
878
|
+
end: number,
|
|
879
|
+
decoration: TextDecoration
|
|
880
|
+
): void
|
|
881
|
+
setRangeFontName(start: number, end: number, fontName: FontName): void
|
|
882
|
+
setRangeLetterSpacing(
|
|
883
|
+
start: number,
|
|
884
|
+
end: number,
|
|
885
|
+
value: LetterSpacing
|
|
886
|
+
): void
|
|
887
|
+
setRangeLineHeight(start: number, end: number, value: LineHeight): void
|
|
888
|
+
setRangeFills(start: number, end: number, paints: Paint[]): void
|
|
889
|
+
setRangeTextCase(start: number, end: number, textCase: TextCase): void
|
|
890
|
+
}
|
|
891
|
+
|
|
789
892
|
type BaseNode = DocumentNode | PageNode | SceneNode
|
|
790
893
|
|
|
791
894
|
/**
|
|
@@ -802,9 +905,11 @@ declare global {
|
|
|
802
905
|
| RectangleNode
|
|
803
906
|
| TextNode
|
|
804
907
|
| ComponentNode
|
|
908
|
+
| ComponentSetNode
|
|
805
909
|
| InstanceNode
|
|
806
910
|
| BooleanOperationNode
|
|
807
911
|
| SliceNode
|
|
912
|
+
| ConnectorNode
|
|
808
913
|
|
|
809
914
|
type NodeType =
|
|
810
915
|
| 'DOCUMENT'
|
|
@@ -823,6 +928,7 @@ declare global {
|
|
|
823
928
|
| 'INSTANCE'
|
|
824
929
|
| 'BOOLEAN_OPERATION'
|
|
825
930
|
| 'SLICE'
|
|
931
|
+
| 'CONNECTOR'
|
|
826
932
|
}
|
|
827
933
|
|
|
828
934
|
interface CreateStyleConfig {
|
|
@@ -976,6 +1082,7 @@ declare global {
|
|
|
976
1082
|
createComponent(): ComponentNode
|
|
977
1083
|
createPage(): PageNode
|
|
978
1084
|
createSlice(): SliceNode
|
|
1085
|
+
createConnector(): ConnectorNode
|
|
979
1086
|
createNodeFromSvgAsync(svg: string): Promise<FrameNode>
|
|
980
1087
|
|
|
981
1088
|
getHoverLayer(): PageNode | SceneNode
|
|
@@ -1112,6 +1219,7 @@ declare global {
|
|
|
1112
1219
|
letterSpacing: LetterSpacing
|
|
1113
1220
|
lineHeight: LineHeight
|
|
1114
1221
|
textDecoration: TextDecoration
|
|
1222
|
+
textCase: TextCase
|
|
1115
1223
|
}
|
|
1116
1224
|
fills: Paint[]
|
|
1117
1225
|
}
|
|
@@ -1129,6 +1237,7 @@ declare global {
|
|
|
1129
1237
|
isExternal: boolean
|
|
1130
1238
|
letterSpacing: number
|
|
1131
1239
|
letterSpacingUnit: NumValue['unit']
|
|
1240
|
+
textCase: TextCase
|
|
1132
1241
|
}
|
|
1133
1242
|
|
|
1134
1243
|
interface FontAlias {
|
|
@@ -1171,6 +1280,8 @@ declare global {
|
|
|
1171
1280
|
readonly style: string
|
|
1172
1281
|
}
|
|
1173
1282
|
|
|
1283
|
+
type TextCase = 'ORIGINAL' | 'UPPER' | 'LOWER' | 'TITLE';
|
|
1284
|
+
|
|
1174
1285
|
type TextDecoration = 'NONE' | 'UNDERLINE' | 'STRIKETHROUGH'
|
|
1175
1286
|
|
|
1176
1287
|
interface ShadowEffect {
|
|
@@ -1310,7 +1421,6 @@ declare global {
|
|
|
1310
1421
|
readonly parent: (BaseNode & ChildrenMixin) | void
|
|
1311
1422
|
name: string // Note: setting this also sets \`autoRename\` to false on TextNodes
|
|
1312
1423
|
removed: boolean
|
|
1313
|
-
reactions: Reaction[]
|
|
1314
1424
|
remove(): void
|
|
1315
1425
|
getPluginData(key: string): string
|
|
1316
1426
|
setPluginData(key: string, value: string): void
|
|
@@ -1375,11 +1485,27 @@ declare global {
|
|
|
1375
1485
|
effectStyleId: string
|
|
1376
1486
|
}
|
|
1377
1487
|
|
|
1378
|
-
type StrokeCap = 'NONE' | 'ROUND' | 'SQUARE' | 'LINE_ARROW' | 'TRIANGLE_ARROW'
|
|
1488
|
+
type StrokeCap = 'NONE' | 'ROUND' | 'SQUARE' | 'LINE_ARROW' | 'TRIANGLE_ARROW' | 'ROUND_ARROW' | 'RING' | 'DIAMOND' | 'LINE'
|
|
1379
1489
|
type StrokeJoin = 'MITER' | 'BEVEL' | 'ROUND'
|
|
1380
1490
|
type StrokeAlign = 'CENTER' | 'INSIDE' | 'OUTSIDE'
|
|
1381
1491
|
type DashCap = 'NONE' | 'ROUND' | 'SQUARE'
|
|
1382
1492
|
type StrokeStyle = 'SOLID' | 'DASH' | 'CUSTOM'
|
|
1493
|
+
type ConnectorStrokeCap = StrokeCap
|
|
1494
|
+
|
|
1495
|
+
interface ConnectorEndpointPosition {
|
|
1496
|
+
readonly position: { x: number; y: number }
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
interface ConnectorEndpointConnected {
|
|
1500
|
+
readonly position: { x: number; y: number }
|
|
1501
|
+
readonly endpointNodeId: string
|
|
1502
|
+
readonly magnet: 'TOP' | 'LEFT' | 'BOTTOM' | 'RIGHT'
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
|
|
1506
|
+
type ConnectorEndpoint =
|
|
1507
|
+
| ConnectorEndpointPosition
|
|
1508
|
+
| ConnectorEndpointConnected
|
|
1383
1509
|
|
|
1384
1510
|
interface GeometryMixin {
|
|
1385
1511
|
fills: ReadonlyArray<Paint>
|
|
@@ -1390,7 +1516,7 @@ declare global {
|
|
|
1390
1516
|
strokeJoin: StrokeJoin
|
|
1391
1517
|
strokeStyle: StrokeStyle
|
|
1392
1518
|
dashCap: DashCap
|
|
1393
|
-
strokeDashes: ReadonlyArray<
|
|
1519
|
+
strokeDashes: ReadonlyArray<number>
|
|
1394
1520
|
fillStyleId: string
|
|
1395
1521
|
strokeStyleId: string
|
|
1396
1522
|
/**
|
|
@@ -1419,10 +1545,12 @@ declare global {
|
|
|
1419
1545
|
BlendMixin,
|
|
1420
1546
|
GeometryMixin,
|
|
1421
1547
|
LayoutMixin,
|
|
1548
|
+
ReactionMixin,
|
|
1422
1549
|
ExportMixin { }
|
|
1423
1550
|
|
|
1424
1551
|
interface DefaultContainerMixin
|
|
1425
1552
|
extends BaseNodeMixin,
|
|
1553
|
+
ReactionMixin,
|
|
1426
1554
|
SceneNodeMixin,
|
|
1427
1555
|
ChildrenMixin,
|
|
1428
1556
|
RectangleStrokeWeightMixin,
|
|
@@ -1491,6 +1619,41 @@ declare global {
|
|
|
1491
1619
|
bottomRightRadius: number
|
|
1492
1620
|
}
|
|
1493
1621
|
|
|
1622
|
+
interface ReactionMixin {
|
|
1623
|
+
reactions: ReadonlyArray<Reaction>
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
interface OpaqueNodeMixin extends BaseNodeMixin, SceneNodeMixin, ExportMixin {
|
|
1627
|
+
readonly absoluteTransform: Transform
|
|
1628
|
+
relativeTransform: Transform
|
|
1629
|
+
x: number
|
|
1630
|
+
y: number
|
|
1631
|
+
readonly width: number
|
|
1632
|
+
readonly height: number
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
interface MinimalBlendMixin {
|
|
1636
|
+
opacity: number
|
|
1637
|
+
blendMode: BlendMode
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
interface MinimalStrokesMixin {
|
|
1641
|
+
strokes: ReadonlyArray<Paint>
|
|
1642
|
+
strokeStyleId: string
|
|
1643
|
+
strokeWeight: number
|
|
1644
|
+
strokeJoin: StrokeJoin
|
|
1645
|
+
strokeAlign: StrokeAlign
|
|
1646
|
+
strokeStyle: StrokeStyle
|
|
1647
|
+
strokeCap: StrokeCap
|
|
1648
|
+
strokeDashes: ReadonlyArray<number>
|
|
1649
|
+
dashCap: DashCap
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
interface MinimalFillsMixin {
|
|
1653
|
+
fills: ReadonlyArray<Paint>
|
|
1654
|
+
fillStyleId: string
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1494
1657
|
/// /////////////////////////////////////////////////////////////////////////////
|
|
1495
1658
|
// Nodes
|
|
1496
1659
|
|
|
@@ -1660,6 +1823,7 @@ declare global {
|
|
|
1660
1823
|
setRangeLineHeight(start: number, end: number, value: LineHeight): void
|
|
1661
1824
|
setRangeFills(start: number, end: number, paints: Paint[]): void
|
|
1662
1825
|
setRangeSuperLink(start: number, end: number, link: string | null): void
|
|
1826
|
+
setRangeTextCase(start: number, end: number, textCase: TextCase): void
|
|
1663
1827
|
}
|
|
1664
1828
|
|
|
1665
1829
|
interface ComponentNode extends DefaultContainerMixin, GeometryMixin, FrameContainerMixin {
|
|
@@ -1690,6 +1854,51 @@ declare global {
|
|
|
1690
1854
|
isPreserveRatio: boolean
|
|
1691
1855
|
}
|
|
1692
1856
|
|
|
1857
|
+
interface ConnectorNode extends OpaqueNodeMixin, Pick<MinimalBlendMixin, 'opacity'>, Omit<MinimalStrokesMixin, 'strokeAlign'> {
|
|
1858
|
+
readonly type: 'CONNECTOR'
|
|
1859
|
+
createText(): TextSublayerNode
|
|
1860
|
+
readonly text: TextSublayerNode | null
|
|
1861
|
+
cornerRadius?: number
|
|
1862
|
+
connectorStart: ConnectorEndpoint
|
|
1863
|
+
connectorEnd: ConnectorEndpoint
|
|
1864
|
+
connectorStartStrokeCap: ConnectorStrokeCap
|
|
1865
|
+
connectorEndStrokeCap: ConnectorStrokeCap
|
|
1866
|
+
readonly strokeAlign: 'CENTER'
|
|
1867
|
+
clone(): ConnectorNode
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
interface TextSublayerNode extends MinimalFillsMixin {
|
|
1871
|
+
readonly id: string
|
|
1872
|
+
readonly hasMissingFont: boolean
|
|
1873
|
+
readonly textAlignHorizontal: 'CENTER'
|
|
1874
|
+
readonly textAlignVertical: 'CENTER'
|
|
1875
|
+
readonly textAutoResize: 'WIDTH_AND_HEIGHT'
|
|
1876
|
+
|
|
1877
|
+
readonly textStyles: ReadonlyArray<TextSegStyle>
|
|
1878
|
+
|
|
1879
|
+
paragraphSpacing: number
|
|
1880
|
+
|
|
1881
|
+
characters: string
|
|
1882
|
+
insertCharacters(start: number, characters: string): void
|
|
1883
|
+
deleteCharacters(start: number, end: number): void
|
|
1884
|
+
|
|
1885
|
+
setRangeFontSize(start: number, end: number, fontSize: number): void
|
|
1886
|
+
setRangeTextDecoration(
|
|
1887
|
+
start: number,
|
|
1888
|
+
end: number,
|
|
1889
|
+
decoration: TextDecoration
|
|
1890
|
+
): void
|
|
1891
|
+
setRangeFontName(start: number, end: number, fontName: FontName): void
|
|
1892
|
+
setRangeLetterSpacing(
|
|
1893
|
+
start: number,
|
|
1894
|
+
end: number,
|
|
1895
|
+
value: LetterSpacing
|
|
1896
|
+
): void
|
|
1897
|
+
setRangeLineHeight(start: number, end: number, value: LineHeight): void
|
|
1898
|
+
setRangeFills(start: number, end: number, paints: Paint[]): void
|
|
1899
|
+
setRangeTextCase(start: number, end: number, textCase: TextCase): void
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1693
1902
|
type BaseNode = DocumentNode | PageNode | SceneNode
|
|
1694
1903
|
|
|
1695
1904
|
/**
|
|
@@ -1706,9 +1915,11 @@ declare global {
|
|
|
1706
1915
|
| RectangleNode
|
|
1707
1916
|
| TextNode
|
|
1708
1917
|
| ComponentNode
|
|
1918
|
+
| ComponentSetNode
|
|
1709
1919
|
| InstanceNode
|
|
1710
1920
|
| BooleanOperationNode
|
|
1711
1921
|
| SliceNode
|
|
1922
|
+
| ConnectorNode
|
|
1712
1923
|
|
|
1713
1924
|
type NodeType =
|
|
1714
1925
|
| 'DOCUMENT'
|
|
@@ -1727,6 +1938,7 @@ declare global {
|
|
|
1727
1938
|
| 'INSTANCE'
|
|
1728
1939
|
| 'BOOLEAN_OPERATION'
|
|
1729
1940
|
| 'SLICE'
|
|
1941
|
+
| 'CONNECTOR'
|
|
1730
1942
|
}
|
|
1731
1943
|
|
|
1732
1944
|
export interface CreateStyleConfig {
|