@mastergo/plugin-typings 2.18.1 → 2.18.3-beta.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +44 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1339,6 +1339,8 @@ declare global {
1339
1339
 
1340
1340
  readonly clientStorage: ClientStorageAPI
1341
1341
 
1342
+ readonly WebSocket: WebSocketAPI
1343
+
1342
1344
  readonly currentUser: User | null
1343
1345
 
1344
1346
  readonly viewport: ViewportAPI
@@ -1592,6 +1594,29 @@ declare global {
1592
1594
  keysAsync(): Promise<string[]>
1593
1595
  }
1594
1596
 
1597
+ interface WebSocketHandle {
1598
+ readonly readyState: number
1599
+ readonly url: string
1600
+ readonly protocol: string
1601
+
1602
+ onopen: ((self: WebSocketHandle, event: { type: string }) => void) | undefined
1603
+ onmessage: ((self: WebSocketHandle, data: any) => void) | undefined
1604
+ onclose: ((self: WebSocketHandle, event: { code: number; reason: string; wasClean: boolean }) => void) | undefined
1605
+ onerror: ((self: WebSocketHandle, event: { type: string }) => void) | undefined
1606
+
1607
+ send(data: any): void
1608
+ close(code?: number, reason?: string): void
1609
+ }
1610
+
1611
+ interface WebSocketAPI {
1612
+ CONNECTING: 0
1613
+ OPEN: 1
1614
+ CLOSING: 2
1615
+ CLOSED: 3
1616
+
1617
+ connect(url: string, protocols?: string | string[]): WebSocketHandle
1618
+ }
1619
+
1595
1620
  type ShowUIOptions = {
1596
1621
  width?: number
1597
1622
  height?: number
@@ -2795,6 +2820,7 @@ declare global {
2795
2820
  }
2796
2821
  ): string
2797
2822
  deleteComponentProperty(propertyId: string): void
2823
+ getComponentListVal(): ComponentItemVal[]
2798
2824
  }
2799
2825
 
2800
2826
  type ComponentPropertyValues = Array<ComponentPropertyValue>
@@ -2818,6 +2844,24 @@ declare global {
2818
2844
  type ComponentPropertyOptions = {
2819
2845
  preferredValues?: InstanceSwapPreferredValue[]
2820
2846
  }
2847
+ type ComponentItemVal = {
2848
+ id: string
2849
+ name: string
2850
+ componentSignature: string
2851
+ cover: string
2852
+ description: string
2853
+ documentationLinks: Array<{ url: string }>
2854
+ height: number
2855
+ width: number
2856
+ isExternal: boolean
2857
+ isHidden: boolean
2858
+ pageId: string
2859
+ pageName: string
2860
+ ukey: string
2861
+ version: number
2862
+ componentNameAlias: string
2863
+ parentId?: string
2864
+ }
2821
2865
  type ComponentProperties = {
2822
2866
  name: string
2823
2867
  id?: string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastergo/plugin-typings",
3
- "version": "2.18.1",
3
+ "version": "2.18.3-beta.0",
4
4
  "description": "MasterGo插件API声明文件",
5
5
  "type": "module",
6
6
  "main": "",