web-extend-plugin-vue2 0.3.3 → 0.3.4
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/dist/index.cjs +209 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +202 -10
- package/dist/index.mjs.map +1 -1
- package/index.d.ts +74 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -36,7 +36,49 @@ export type AdaptRouteDeclarationsFn = (ctx: {
|
|
|
36
36
|
declarations: ReadonlyArray<RouteDeclaration>
|
|
37
37
|
}) => VueRouteConfig[]
|
|
38
38
|
|
|
39
|
-
export type
|
|
39
|
+
export type HostExposeMeta = {
|
|
40
|
+
title?: string
|
|
41
|
+
description?: string
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type HostComponentMeta = HostExposeMeta
|
|
45
|
+
|
|
46
|
+
export type HostComponentEntry = HostComponentMeta & {
|
|
47
|
+
component: unknown
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type HostComponentRegistry =
|
|
51
|
+
| Record<string, unknown | HostComponentEntry>
|
|
52
|
+
| Array<(HostComponentEntry & { name: string })>
|
|
53
|
+
|
|
54
|
+
export type HostModuleMeta = HostExposeMeta
|
|
55
|
+
|
|
56
|
+
export type HostModuleEntry = HostModuleMeta & {
|
|
57
|
+
module: unknown
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type HostModuleRegistry =
|
|
61
|
+
| Record<string, unknown | HostModuleEntry>
|
|
62
|
+
| Array<(HostModuleEntry & { name: string })>
|
|
63
|
+
|
|
64
|
+
export type HostUiCapability = {
|
|
65
|
+
framework?: string
|
|
66
|
+
componentLibrary?: string
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type HostCapabilities = Readonly<
|
|
70
|
+
Record<string, unknown> & {
|
|
71
|
+
ui?: HostUiCapability
|
|
72
|
+
modules?: Readonly<Record<string, HostModuleMeta>>
|
|
73
|
+
components?: Readonly<Record<string, HostComponentMeta>>
|
|
74
|
+
}
|
|
75
|
+
>
|
|
76
|
+
|
|
77
|
+
export type HostContext = Readonly<
|
|
78
|
+
Record<string, unknown> & {
|
|
79
|
+
capabilities?: HostCapabilities
|
|
80
|
+
}
|
|
81
|
+
>
|
|
40
82
|
|
|
41
83
|
export type OnBeforePluginActivateFn = (ctx: {
|
|
42
84
|
pluginId: string
|
|
@@ -75,6 +117,24 @@ export type HostKitOptions = {
|
|
|
75
117
|
hostContext?: HostContext
|
|
76
118
|
}
|
|
77
119
|
|
|
120
|
+
export type PluginManifestHostCapabilities = Readonly<
|
|
121
|
+
Record<string, unknown> & {
|
|
122
|
+
modules?: string[]
|
|
123
|
+
components?: string[]
|
|
124
|
+
ui?: Record<string, unknown>
|
|
125
|
+
}
|
|
126
|
+
>
|
|
127
|
+
|
|
128
|
+
export type WebExtendPluginManifestRecord = Readonly<
|
|
129
|
+
Record<string, unknown> & {
|
|
130
|
+
id: string
|
|
131
|
+
priority?: unknown
|
|
132
|
+
entryUrl?: string
|
|
133
|
+
engines?: { host?: string }
|
|
134
|
+
hostCapabilities?: PluginManifestHostCapabilities
|
|
135
|
+
}
|
|
136
|
+
>
|
|
137
|
+
|
|
78
138
|
export type WebExtendPluginRuntimeOptions = HostKitOptions &
|
|
79
139
|
Record<string, unknown> & {
|
|
80
140
|
manifestBase?: string
|
|
@@ -101,6 +161,7 @@ export type WebExtendPluginRuntimeOptions = HostKitOptions &
|
|
|
101
161
|
bootstrapSummary?: boolean
|
|
102
162
|
fetchManifest?: ManifestFetchFn
|
|
103
163
|
hostContext?: Record<string, unknown>
|
|
164
|
+
hostCapabilities?: HostCapabilities
|
|
104
165
|
onBeforePluginActivate?: OnBeforePluginActivateFn
|
|
105
166
|
onAfterPluginActivate?: OnAfterPluginActivateFn
|
|
106
167
|
onPluginActivateError?: OnPluginActivateErrorFn
|
|
@@ -118,6 +179,10 @@ export interface HostApi {
|
|
|
118
179
|
registerScriptUrls(urls?: string[]): void
|
|
119
180
|
registerSanitizedHtmlSnippet(): void
|
|
120
181
|
getContributedRoutes(): PluginRouteSnapshot[]
|
|
182
|
+
getHostModule(name: string): unknown
|
|
183
|
+
getHostModuleMeta(name: string): HostModuleMeta | undefined
|
|
184
|
+
getHostComponent(name: string): unknown
|
|
185
|
+
getHostComponentMeta(name: string): HostComponentMeta | undefined
|
|
121
186
|
getBridge(): {
|
|
122
187
|
request(path: string, init?: RequestInit): Promise<Response>
|
|
123
188
|
}
|
|
@@ -175,6 +240,14 @@ export function createHostApi(pluginId: string, router: unknown, hostKit?: HostK
|
|
|
175
240
|
|
|
176
241
|
export function disposeWebPlugin(pluginId: string): void
|
|
177
242
|
export const registries: unknown
|
|
243
|
+
export function registerHostModules(input: HostModuleRegistry): Readonly<Record<string, HostModuleMeta>>
|
|
244
|
+
export function registerHostComponents(input: HostComponentRegistry): Readonly<Record<string, HostComponentMeta>>
|
|
245
|
+
export function getHostModule(name: string): unknown
|
|
246
|
+
export function getHostModuleMeta(name: string): HostModuleMeta | undefined
|
|
247
|
+
export function getAllHostModuleMeta(): Readonly<Record<string, HostModuleMeta>>
|
|
248
|
+
export function getHostComponent(name: string): unknown
|
|
249
|
+
export function getHostComponentMeta(name: string): HostComponentMeta | undefined
|
|
250
|
+
export function getAllHostComponentMeta(): Readonly<Record<string, HostComponentMeta>>
|
|
178
251
|
|
|
179
252
|
export function createRequestBridge(config?: {
|
|
180
253
|
allowedPathPrefixes?: string[]
|