@mastergo/plugin-typings 1.10.2 → 1.12.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/CHANGELOG.md +26 -0
- package/dist/index.d.ts +11 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
# [1.12.0](https://github.com/mastergo-design/plugin-typings/compare/v1.11.0...v1.12.0) (2022-12-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* 类型优化,添加ui.viewport和ui.moveTo ([8fc66ea](https://github.com/mastergo-design/plugin-typings/commit/8fc66eaa0da1992256b90cc8ce9ad93f5fe53766))
|
|
7
|
+
* 修改ui可视属性字段名 ([6cd233d](https://github.com/mastergo-design/plugin-typings/commit/6cd233dc6fb3e8b310bfd4cfb3bdfee5a0c1142c))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# [1.11.0](https://github.com/mastergo-design/plugin-typings/compare/v1.10.2...v1.11.0) (2022-12-15)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* 修复错误的parent类型 ([b92257d](https://github.com/mastergo-design/plugin-typings/commit/b92257db0b34b8689328a82f523183161cef71c2))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* 添加getNodeByPosition接口 ([9cda766](https://github.com/mastergo-design/plugin-typings/commit/9cda7668c19e07f2f4755c81464efa11a25a5ab9))
|
|
22
|
+
* 文字分段样式增加lineHeightByPx描述实际px行高字段 ([0cd8111](https://github.com/mastergo-design/plugin-typings/commit/0cd81114b45304f0363f6f05a4a0a84ea8a9208f))
|
|
23
|
+
* 修改返回值类型 ([eb71a36](https://github.com/mastergo-design/plugin-typings/commit/eb71a36444ff1c2f714d686ac7476579a4fe0a23))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
1
27
|
## [1.10.2](https://github.com/mastergo-design/plugin-typings/compare/v1.10.0...v1.10.2) (2022-12-13)
|
|
2
28
|
|
|
3
29
|
|
package/dist/index.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ declare global {
|
|
|
59
59
|
showUI(html: string, options?: ShowUIOptions): void
|
|
60
60
|
|
|
61
61
|
getNodeById(id: string): SceneNode | null
|
|
62
|
+
getNodeByPosition(position: {x: number, y: number}): SceneNode | null
|
|
62
63
|
createRectangle(): RectangleNode
|
|
63
64
|
createLine(): LineNode
|
|
64
65
|
createEllipse(): EllipseNode
|
|
@@ -126,12 +127,7 @@ declare global {
|
|
|
126
127
|
RGBAToHex(rgba: RGBA): string
|
|
127
128
|
}
|
|
128
129
|
|
|
129
|
-
interface Rect {
|
|
130
|
-
readonly x: number
|
|
131
|
-
readonly y: number
|
|
132
|
-
readonly width: number
|
|
133
|
-
readonly height: number
|
|
134
|
-
}
|
|
130
|
+
interface Rect extends Readonly<Bound> {}
|
|
135
131
|
|
|
136
132
|
interface ViewportAPI {
|
|
137
133
|
center: Vector
|
|
@@ -180,12 +176,18 @@ declare global {
|
|
|
180
176
|
type?: 'normal' | 'highlight' | 'error' | 'warning' | 'success'
|
|
181
177
|
}
|
|
182
178
|
|
|
179
|
+
interface UIViewport extends Bound {
|
|
180
|
+
headerHeight: number
|
|
181
|
+
visible: boolean
|
|
182
|
+
}
|
|
183
|
+
|
|
183
184
|
interface UIAPI {
|
|
184
185
|
show(): void
|
|
185
186
|
hide(): void
|
|
186
187
|
close(): void
|
|
187
188
|
resize(width: number, height: number): void
|
|
188
|
-
|
|
189
|
+
moveTo(x: number, y: number): void
|
|
190
|
+
viewport: UIViewport
|
|
189
191
|
postMessage(pluginMessage: any, origin?: string): void
|
|
190
192
|
onmessage: ((pluginMessage: any, origin: string) => void) | undefined
|
|
191
193
|
}
|
|
@@ -231,6 +233,7 @@ declare global {
|
|
|
231
233
|
fontSize: number
|
|
232
234
|
letterSpacing: LetterSpacing
|
|
233
235
|
lineHeight: LineHeight
|
|
236
|
+
lineHeightByPx: number
|
|
234
237
|
textDecoration: TextDecoration
|
|
235
238
|
textCase: TextCase
|
|
236
239
|
fontWeight: number
|
|
@@ -445,7 +448,7 @@ declare global {
|
|
|
445
448
|
|
|
446
449
|
interface BaseNodeMixin {
|
|
447
450
|
readonly id: string
|
|
448
|
-
readonly parent: (BaseNode & ChildrenMixin) |
|
|
451
|
+
readonly parent: (BaseNode & ChildrenMixin) | null
|
|
449
452
|
name: string
|
|
450
453
|
removed: boolean
|
|
451
454
|
remove(): void
|