@mastergo/plugin-typings
Advanced tools
+218
-6
@@ -75,2 +75,3 @@ declare global { | ||
| createSlice(): SliceNode | ||
| createConnector(): ConnectorNode | ||
| createNodeFromSvgAsync(svg: string): Promise<FrameNode> | ||
@@ -212,2 +213,3 @@ | ||
| textDecoration: TextDecoration | ||
| textCase: TextCase | ||
| } | ||
@@ -230,2 +232,3 @@ fills: Paint[] | ||
| letterSpacingUnit: NumValue['unit'] | ||
| textCase: TextCase | ||
| } | ||
@@ -273,2 +276,4 @@ | ||
| type TextCase = 'ORIGINAL' | 'UPPER' | 'LOWER' | 'TITLE'; | ||
| type TextDecoration = 'NONE' | 'UNDERLINE' | 'STRIKETHROUGH' | ||
@@ -413,3 +418,2 @@ | ||
| removed: boolean | ||
| reactions: Reaction[] | ||
| remove(): void | ||
@@ -479,3 +483,3 @@ getPluginData(key: string): string | ||
| type StrokeCap = 'NONE' | 'ROUND' | 'SQUARE' | 'LINE_ARROW' | 'TRIANGLE_ARROW' | ||
| type StrokeCap = 'NONE' | 'ROUND' | 'SQUARE' | 'LINE_ARROW' | 'TRIANGLE_ARROW' | 'ROUND_ARROW' | 'RING' | 'DIAMOND' | 'LINE' | ||
| type StrokeJoin = 'MITER' | 'BEVEL' | 'ROUND' | ||
@@ -485,3 +489,19 @@ type StrokeAlign = 'CENTER' | 'INSIDE' | 'OUTSIDE' | ||
| type StrokeStyle = 'SOLID' | 'DASH' | 'CUSTOM' | ||
| type ConnectorStrokeCap = StrokeCap | ||
| interface ConnectorEndpointPosition { | ||
| readonly position: { x: number; y: number } | ||
| } | ||
| interface ConnectorEndpointConnected { | ||
| readonly position: { x: number; y: number } | ||
| readonly endpointNodeId: string | ||
| readonly magnet: 'TOP' | 'LEFT' | 'BOTTOM' | 'RIGHT' | ||
| } | ||
| type ConnectorEndpoint = | ||
| | ConnectorEndpointPosition | ||
| | ConnectorEndpointConnected | ||
| interface GeometryMixin { | ||
@@ -496,3 +516,3 @@ fills: ReadonlyArray<Paint> | ||
| dashCap: DashCap | ||
| strokeDashes: ReadonlyArray<[number, number]> | ||
| strokeDashes: ReadonlyArray<number> | ||
| fillStyleId: string | ||
@@ -526,2 +546,3 @@ strokeStyleId: string | ||
| LayoutMixin, | ||
| ReactionMixin, | ||
| ExportMixin { } | ||
@@ -531,2 +552,3 @@ | ||
| extends BaseNodeMixin, | ||
| ReactionMixin, | ||
| SceneNodeMixin, | ||
@@ -600,2 +622,37 @@ ChildrenMixin, | ||
| interface ReactionMixin { | ||
| reactions: ReadonlyArray<Reaction> | ||
| } | ||
| interface OpaqueNodeMixin extends BaseNodeMixin, SceneNodeMixin, ExportMixin { | ||
| readonly absoluteTransform: Transform | ||
| relativeTransform: Transform | ||
| x: number | ||
| y: number | ||
| readonly width: number | ||
| readonly height: number | ||
| } | ||
| interface MinimalBlendMixin { | ||
| opacity: number | ||
| blendMode: BlendMode | ||
| } | ||
| interface MinimalStrokesMixin { | ||
| strokes: ReadonlyArray<Paint> | ||
| strokeStyleId: string | ||
| strokeWeight: number | ||
| strokeJoin: StrokeJoin | ||
| strokeAlign: StrokeAlign | ||
| strokeStyle: StrokeStyle | ||
| strokeCap: StrokeCap | ||
| strokeDashes: ReadonlyArray<number> | ||
| dashCap: DashCap | ||
| } | ||
| interface MinimalFillsMixin { | ||
| fills: ReadonlyArray<Paint> | ||
| fillStyleId: string | ||
| } | ||
| /// ///////////////////////////////////////////////////////////////////////////// | ||
@@ -770,2 +827,3 @@ // Nodes | ||
| setRangeSuperLink(start: number, end: number, link: string | null): void | ||
| setRangeTextCase(start: number, end: number, textCase: TextCase): void | ||
| } | ||
@@ -801,2 +859,47 @@ | ||
| interface ConnectorNode extends OpaqueNodeMixin, Pick<MinimalBlendMixin, 'opacity'>, Omit<MinimalStrokesMixin, 'strokeAlign'> { | ||
| readonly type: 'CONNECTOR' | ||
| createText(): TextSublayerNode | ||
| readonly text: TextSublayerNode | null | ||
| cornerRadius?: number | ||
| connectorStart: ConnectorEndpoint | ||
| connectorEnd: ConnectorEndpoint | ||
| connectorStartStrokeCap: ConnectorStrokeCap | ||
| connectorEndStrokeCap: ConnectorStrokeCap | ||
| readonly strokeAlign: 'CENTER' | ||
| clone(): ConnectorNode | ||
| } | ||
| interface TextSublayerNode extends MinimalFillsMixin { | ||
| readonly id: string | ||
| readonly hasMissingFont: boolean | ||
| readonly textAlignHorizontal: 'CENTER' | ||
| readonly textAlignVertical: 'CENTER' | ||
| readonly textAutoResize: 'WIDTH_AND_HEIGHT' | ||
| readonly textStyles: ReadonlyArray<TextSegStyle> | ||
| paragraphSpacing: number | ||
| characters: string | ||
| insertCharacters(start: number, characters: string): void | ||
| deleteCharacters(start: number, end: number): void | ||
| setRangeFontSize(start: number, end: number, fontSize: number): void | ||
| setRangeTextDecoration( | ||
| start: number, | ||
| end: number, | ||
| decoration: TextDecoration | ||
| ): void | ||
| setRangeFontName(start: number, end: number, fontName: FontName): void | ||
| setRangeLetterSpacing( | ||
| start: number, | ||
| end: number, | ||
| value: LetterSpacing | ||
| ): void | ||
| setRangeLineHeight(start: number, end: number, value: LineHeight): void | ||
| setRangeFills(start: number, end: number, paints: Paint[]): void | ||
| setRangeTextCase(start: number, end: number, textCase: TextCase): void | ||
| } | ||
| type BaseNode = DocumentNode | PageNode | SceneNode | ||
@@ -818,5 +921,7 @@ | ||
| | ComponentNode | ||
| | ComponentSetNode | ||
| | InstanceNode | ||
| | BooleanOperationNode | ||
| | SliceNode | ||
| | ConnectorNode | ||
@@ -840,2 +945,3 @@ type NodeType = | ||
| | 'SLICE' | ||
| | 'CONNECTOR' | ||
| } | ||
@@ -994,2 +1100,3 @@ | ||
| createSlice(): SliceNode | ||
| createConnector(): ConnectorNode | ||
| createNodeFromSvgAsync(svg: string): Promise<FrameNode> | ||
@@ -1131,2 +1238,3 @@ | ||
| textDecoration: TextDecoration | ||
| textCase: TextCase | ||
| } | ||
@@ -1149,2 +1257,3 @@ fills: Paint[] | ||
| letterSpacingUnit: NumValue['unit'] | ||
| textCase: TextCase | ||
| } | ||
@@ -1192,2 +1301,4 @@ | ||
| type TextCase = 'ORIGINAL' | 'UPPER' | 'LOWER' | 'TITLE'; | ||
| type TextDecoration = 'NONE' | 'UNDERLINE' | 'STRIKETHROUGH' | ||
@@ -1332,3 +1443,2 @@ | ||
| removed: boolean | ||
| reactions: Reaction[] | ||
| remove(): void | ||
@@ -1398,3 +1508,3 @@ getPluginData(key: string): string | ||
| type StrokeCap = 'NONE' | 'ROUND' | 'SQUARE' | 'LINE_ARROW' | 'TRIANGLE_ARROW' | ||
| type StrokeCap = 'NONE' | 'ROUND' | 'SQUARE' | 'LINE_ARROW' | 'TRIANGLE_ARROW' | 'ROUND_ARROW' | 'RING' | 'DIAMOND' | 'LINE' | ||
| type StrokeJoin = 'MITER' | 'BEVEL' | 'ROUND' | ||
@@ -1404,3 +1514,19 @@ type StrokeAlign = 'CENTER' | 'INSIDE' | 'OUTSIDE' | ||
| type StrokeStyle = 'SOLID' | 'DASH' | 'CUSTOM' | ||
| type ConnectorStrokeCap = StrokeCap | ||
| interface ConnectorEndpointPosition { | ||
| readonly position: { x: number; y: number } | ||
| } | ||
| interface ConnectorEndpointConnected { | ||
| readonly position: { x: number; y: number } | ||
| readonly endpointNodeId: string | ||
| readonly magnet: 'TOP' | 'LEFT' | 'BOTTOM' | 'RIGHT' | ||
| } | ||
| type ConnectorEndpoint = | ||
| | ConnectorEndpointPosition | ||
| | ConnectorEndpointConnected | ||
| interface GeometryMixin { | ||
@@ -1415,3 +1541,3 @@ fills: ReadonlyArray<Paint> | ||
| dashCap: DashCap | ||
| strokeDashes: ReadonlyArray<[number, number]> | ||
| strokeDashes: ReadonlyArray<number> | ||
| fillStyleId: string | ||
@@ -1445,2 +1571,3 @@ strokeStyleId: string | ||
| LayoutMixin, | ||
| ReactionMixin, | ||
| ExportMixin { } | ||
@@ -1450,2 +1577,3 @@ | ||
| extends BaseNodeMixin, | ||
| ReactionMixin, | ||
| SceneNodeMixin, | ||
@@ -1519,2 +1647,37 @@ ChildrenMixin, | ||
| interface ReactionMixin { | ||
| reactions: ReadonlyArray<Reaction> | ||
| } | ||
| interface OpaqueNodeMixin extends BaseNodeMixin, SceneNodeMixin, ExportMixin { | ||
| readonly absoluteTransform: Transform | ||
| relativeTransform: Transform | ||
| x: number | ||
| y: number | ||
| readonly width: number | ||
| readonly height: number | ||
| } | ||
| interface MinimalBlendMixin { | ||
| opacity: number | ||
| blendMode: BlendMode | ||
| } | ||
| interface MinimalStrokesMixin { | ||
| strokes: ReadonlyArray<Paint> | ||
| strokeStyleId: string | ||
| strokeWeight: number | ||
| strokeJoin: StrokeJoin | ||
| strokeAlign: StrokeAlign | ||
| strokeStyle: StrokeStyle | ||
| strokeCap: StrokeCap | ||
| strokeDashes: ReadonlyArray<number> | ||
| dashCap: DashCap | ||
| } | ||
| interface MinimalFillsMixin { | ||
| fills: ReadonlyArray<Paint> | ||
| fillStyleId: string | ||
| } | ||
| /// ///////////////////////////////////////////////////////////////////////////// | ||
@@ -1689,2 +1852,3 @@ // Nodes | ||
| setRangeSuperLink(start: number, end: number, link: string | null): void | ||
| setRangeTextCase(start: number, end: number, textCase: TextCase): void | ||
| } | ||
@@ -1720,2 +1884,47 @@ | ||
| interface ConnectorNode extends OpaqueNodeMixin, Pick<MinimalBlendMixin, 'opacity'>, Omit<MinimalStrokesMixin, 'strokeAlign'> { | ||
| readonly type: 'CONNECTOR' | ||
| createText(): TextSublayerNode | ||
| readonly text: TextSublayerNode | null | ||
| cornerRadius?: number | ||
| connectorStart: ConnectorEndpoint | ||
| connectorEnd: ConnectorEndpoint | ||
| connectorStartStrokeCap: ConnectorStrokeCap | ||
| connectorEndStrokeCap: ConnectorStrokeCap | ||
| readonly strokeAlign: 'CENTER' | ||
| clone(): ConnectorNode | ||
| } | ||
| interface TextSublayerNode extends MinimalFillsMixin { | ||
| readonly id: string | ||
| readonly hasMissingFont: boolean | ||
| readonly textAlignHorizontal: 'CENTER' | ||
| readonly textAlignVertical: 'CENTER' | ||
| readonly textAutoResize: 'WIDTH_AND_HEIGHT' | ||
| readonly textStyles: ReadonlyArray<TextSegStyle> | ||
| paragraphSpacing: number | ||
| characters: string | ||
| insertCharacters(start: number, characters: string): void | ||
| deleteCharacters(start: number, end: number): void | ||
| setRangeFontSize(start: number, end: number, fontSize: number): void | ||
| setRangeTextDecoration( | ||
| start: number, | ||
| end: number, | ||
| decoration: TextDecoration | ||
| ): void | ||
| setRangeFontName(start: number, end: number, fontName: FontName): void | ||
| setRangeLetterSpacing( | ||
| start: number, | ||
| end: number, | ||
| value: LetterSpacing | ||
| ): void | ||
| setRangeLineHeight(start: number, end: number, value: LineHeight): void | ||
| setRangeFills(start: number, end: number, paints: Paint[]): void | ||
| setRangeTextCase(start: number, end: number, textCase: TextCase): void | ||
| } | ||
| type BaseNode = DocumentNode | PageNode | SceneNode | ||
@@ -1737,5 +1946,7 @@ | ||
| | ComponentNode | ||
| | ComponentSetNode | ||
| | InstanceNode | ||
| | BooleanOperationNode | ||
| | SliceNode | ||
| | ConnectorNode | ||
@@ -1759,2 +1970,3 @@ type NodeType = | ||
| | 'SLICE' | ||
| | 'CONNECTOR' | ||
| } | ||
@@ -1761,0 +1973,0 @@ |
+1
-1
| { | ||
| "name": "@mastergo/plugin-typings", | ||
| "version": "1.0.0", | ||
| "version": "1.1.0", | ||
| "description": "MasterGo插件API声明文件", | ||
@@ -5,0 +5,0 @@ "main": "", |
54734
12.8%1708
11.78%