From 9f7ee7543ef4959620cb2f36f39f6ab0df59b8fe Mon Sep 17 00:00:00 2001 From: liyanfeng Date: Wed, 10 Jun 2026 18:25:34 +0800 Subject: [PATCH 1/4] feat(types): add WebSocket API type definitions add global WebSocketAPI and WebSocketHandle interfaces to the plugin type definitions, exposing the typed WebSocket client API for the application --- plugin.d.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/plugin.d.ts b/plugin.d.ts index a3aa6e6..356d569 100644 --- a/plugin.d.ts +++ b/plugin.d.ts @@ -315,6 +315,8 @@ declare global { readonly clientStorage: ClientStorageAPI + readonly WebSocket: WebSocketAPI + readonly currentUser: User | null readonly viewport: ViewportAPI @@ -568,6 +570,29 @@ declare global { keysAsync(): Promise } + interface WebSocketHandle { + readonly readyState: number + readonly url: string + readonly protocol: string + + onopen: ((self: WebSocketHandle, event: { type: string }) => void) | undefined + onmessage: ((self: WebSocketHandle, data: any) => void) | undefined + onclose: ((self: WebSocketHandle, event: { code: number; reason: string; wasClean: boolean }) => void) | undefined + onerror: ((self: WebSocketHandle, event: { type: string }) => void) | undefined + + send(data: any): void + close(code?: number, reason?: string): void + } + + interface WebSocketAPI { + CONNECTING: 0 + OPEN: 1 + CLOSING: 2 + CLOSED: 3 + + connect(url: string, protocols?: string | string[]): WebSocketHandle + } + type ShowUIOptions = { width?: number height?: number From a3f3bf4351fbdd9c50f198753c27ea161996e1b6 Mon Sep 17 00:00:00 2001 From: liyanfeng Date: Fri, 12 Jun 2026 17:29:21 +0800 Subject: [PATCH 2/4] feat: add getComponentListVal method and ComponentItemVal type add the getComponentListVal method to the global plugin namespace and define the matching ComponentItemVal type structure --- plugin.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/plugin.d.ts b/plugin.d.ts index 356d569..3fc3027 100644 --- a/plugin.d.ts +++ b/plugin.d.ts @@ -1796,6 +1796,7 @@ declare global { } ): string deleteComponentProperty(propertyId: string): void + getComponentListVal(): ComponentItemVal[] } type ComponentPropertyValues = Array @@ -1819,6 +1820,24 @@ declare global { type ComponentPropertyOptions = { preferredValues?: InstanceSwapPreferredValue[] } + type ComponentItemVal = { + id: string + name: string + componentSignature: string + cover: string + description: string + documentationLinks: Array<{ url: string }> + height: number + width: number + isExternal: boolean + isHidden: boolean + pageId: string + pageName: string + ukey: string + version: number + componentNameAlias: string + parentId?: string + } type ComponentProperties = { name: string id?: string From d10347e4acaf7645ddf588d915f293440278fac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BE=B7=E5=8D=87?= Date: Fri, 12 Jun 2026 17:35:11 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b1017e2..157c97e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mastergo/plugin-typings", - "version": "2.18.1", + "version": "2.18.2-beta.0", "description": "MasterGo插件API声明文件", "type": "module", "main": "", From ff83fb1a218af0286a8e830b115abab716c409b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BE=B7=E5=8D=87?= Date: Fri, 12 Jun 2026 17:35:23 +0800 Subject: [PATCH 4/4] chore: release v2.18.3-beta.0 --- CHANGELOG.md | 11 +++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abafd63..397343c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## [2.18.3-beta.0](https://github.com/mastergo-design/plugin-typings/compare/v2.18.1...v2.18.3-beta.0) (2026-06-12) + + +### Features + +* 修改版本号 ([d10347e](https://github.com/mastergo-design/plugin-typings/commit/d10347e4acaf7645ddf588d915f293440278fac6)) +* add getComponentListVal method and ComponentItemVal type ([a3f3bf4](https://github.com/mastergo-design/plugin-typings/commit/a3f3bf4351fbdd9c50f198753c27ea161996e1b6)) +* **types:** add WebSocket API type definitions ([9f7ee75](https://github.com/mastergo-design/plugin-typings/commit/9f7ee7543ef4959620cb2f36f39f6ab0df59b8fe)) + + + ## [2.18.1](https://github.com/mastergo-design/plugin-typings/compare/v2.18.0...v2.18.1) (2026-06-05) diff --git a/package-lock.json b/package-lock.json index 5340b4b..33651cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mastergo/plugin-typings", - "version": "2.18.1", + "version": "2.18.3-beta.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mastergo/plugin-typings", - "version": "2.18.1", + "version": "2.18.3-beta.0", "license": "MIT", "devDependencies": { "@commitlint/cli": "^17.0.0", diff --git a/package.json b/package.json index 157c97e..a7323eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mastergo/plugin-typings", - "version": "2.18.2-beta.0", + "version": "2.18.3-beta.0", "description": "MasterGo插件API声明文件", "type": "module", "main": "",