From 9f7ee7543ef4959620cb2f36f39f6ab0df59b8fe Mon Sep 17 00:00:00 2001 From: liyanfeng Date: Wed, 10 Jun 2026 18:25:34 +0800 Subject: [PATCH 1/7] 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/7] 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/7] =?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 23b2ad9e453b093a691f6ccd0b7bc504772abdd0 Mon Sep 17 00:00:00 2001 From: liyanfeng Date: Fri, 12 Jun 2026 18:45:14 +0800 Subject: [PATCH 4/7] refactor(plugin.d.ts): move getComponentListVal to global scope move the getComponentListVal method declaration out of the nested interface scope to the global global declaration block --- plugin.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.d.ts b/plugin.d.ts index 3fc3027..dd5cfe9 100644 --- a/plugin.d.ts +++ b/plugin.d.ts @@ -498,6 +498,7 @@ declare global { importComponentByKeyAsync(ukey: string): Promise importComponentSetByKeyAsync(ukey: string): Promise importStyleByKeyAsync(ukey: string): Promise