webloom-framework 0.3.0 → 0.4.1
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/README.md +70 -42
- package/dist/advanced.d.ts +168 -0
- package/dist/advanced.js +441 -0
- package/dist/advanced.js.map +1 -0
- package/dist/chunk-4DSINPZD.js +158 -0
- package/dist/chunk-4DSINPZD.js.map +1 -0
- package/dist/chunk-ANA6GBEI.js +1737 -0
- package/dist/chunk-ANA6GBEI.js.map +1 -0
- package/dist/chunk-HJKPKWI7.js +4024 -0
- package/dist/chunk-HJKPKWI7.js.map +1 -0
- package/dist/chunk-SX46RHDI.js +433 -0
- package/dist/chunk-SX46RHDI.js.map +1 -0
- package/dist/index.d.ts +39 -259
- package/dist/index.js +38 -1359
- package/dist/index.js.map +1 -1
- package/dist/messageBus-CtrwkjrO.d.ts +5 -0
- package/dist/messagePortServiceTransport-BYprNvQY.d.ts +264 -0
- package/dist/react.d.ts +41 -28
- package/dist/react.js +79 -88
- package/dist/react.js.map +1 -1
- package/dist/runtimeTypes-DquUCHz-.d.ts +1640 -0
- package/dist/sharedWorkerHost-KI7TIGdX.d.ts +192 -0
- package/dist/testing.d.ts +18 -17
- package/dist/testing.js +23 -15
- package/dist/testing.js.map +1 -1
- package/dist/windowRuntime-BKkLPsAS.d.ts +23 -0
- package/docs/api.md +148 -111
- package/docs/proposals/webloom-v4/implementation-plan.md +443 -0
- package/docs/proposals/webloom-v4/requirements.md +555 -0
- package/docs/proposals/webloom-v4/verification.md +115 -0
- package/package.json +11 -2
- package/dist/chunk-76BGPI6M.js +0 -4261
- package/dist/chunk-76BGPI6M.js.map +0 -1
- package/dist/createPluginHost-BVsUCDKN.d.ts +0 -1318
- package/dist/resourceRegistry-BFnjmeGE.d.ts +0 -267
package/dist/index.d.ts
CHANGED
|
@@ -1,264 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export { C as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/** 当前 Host 的真实 Runtime;未选中的 Window/Worker 单元不会进入图。 */
|
|
10
|
-
runtime?: RuntimeKind;
|
|
11
|
-
}
|
|
12
|
-
interface ValidatePluginGraphOptions extends BuildPluginGraphOptions {
|
|
13
|
-
/** 平台内建 capability,不需要由某个 manifest 提供。 */
|
|
14
|
-
builtinCapabilities?: ReadonlySet<string>;
|
|
15
|
-
/** 允许多 Provider 的 capability;调用方必须有专门 Registry 选择语义。 */
|
|
16
|
-
multiProviderCapabilities?: ReadonlySet<string>;
|
|
17
|
-
/** Host 分批注册时允许 provider 尚未注册;真正装配前仍会进入 blocked。 */
|
|
18
|
-
allowMissingDependencies?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* 允许依赖当前图之外的另一个真实 Runtime;实际是否 ready 由运行时
|
|
21
|
-
* snapshot 和 RemoteServiceBridge 在 Host reconcile 时决定。
|
|
22
|
-
*/
|
|
23
|
-
externalRuntimeDependencies?: boolean;
|
|
24
|
-
}
|
|
25
|
-
interface PluginGraphDiagnostic {
|
|
26
|
-
/** 稳定诊断码。 */
|
|
27
|
-
code: "plugin.duplicate_id" | "capability.duplicate_provider" | "plugin.missing_dependency" | "plugin.dependency_cycle" | "plugin.dependency_contract_invalid" | "plugin.dependency_contract_unavailable" | "plugin.runtime_invalid" | "plugin.runtime_declaration_at_product_level";
|
|
28
|
-
/** 相关插件或 capability。 */
|
|
29
|
-
ids: string[];
|
|
30
|
-
/** 中文诊断原因,供设置页直接显示或再做 i18n 映射。 */
|
|
31
|
-
message: string;
|
|
32
|
-
}
|
|
33
|
-
/** 依赖图不满足装配条件。 */
|
|
34
|
-
declare class PluginGraphValidationError extends Error {
|
|
35
|
-
readonly code: "plugin.graph_invalid";
|
|
36
|
-
readonly diagnostics: readonly PluginGraphDiagnostic[];
|
|
37
|
-
constructor(diagnostics: readonly PluginGraphDiagnostic[]);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* 校验所有显式运行单元的跨环境依赖契约。
|
|
41
|
-
*
|
|
42
|
-
* 多运行单元产品的运行期声明必须全部位于对应 unit;产品级字段只给没有
|
|
43
|
-
* `units` 的简单插件保留兼容性。此函数同时服务 TypeScript 以外导入的
|
|
44
|
-
* manifest,避免运行时只依赖静态类型。
|
|
45
|
-
*/
|
|
46
|
-
declare function validateRuntimeUnitDependencyContracts(manifests: readonly PluginManifest[]): PluginGraphDiagnostic[];
|
|
47
|
-
/**
|
|
48
|
-
* 返回当前执行环境的依赖;显式运行单元不会继承产品级依赖。
|
|
49
|
-
* 只有没有 units 的简单插件才读取历史 product-level dependencies。
|
|
50
|
-
*/
|
|
51
|
-
declare function dependenciesOfManifest(manifest: PluginManifest, runtime?: RuntimeKind): PluginDependency[];
|
|
52
|
-
/** 返回当前执行环境提供的 capability;显式单元不会继承产品级摘要。 */
|
|
53
|
-
declare function providesOfManifest(manifest: PluginManifest, runtime?: RuntimeKind): string[];
|
|
54
|
-
/** 从 manifest 列表构造依赖、提供者和反向依赖。 */
|
|
55
|
-
declare function buildPluginGraph(manifests: PluginManifest[], options?: BuildPluginGraphOptions): PluginGraph;
|
|
56
|
-
/** 在任何 setup 前校验重复提供、缺失硬依赖和硬依赖环。 */
|
|
57
|
-
declare function validatePluginGraph(manifests: readonly PluginManifest[], options?: ValidatePluginGraphOptions): PluginGraph;
|
|
58
|
-
/** 查询当前启用的逆依赖者;禁用提供者时应按此集合先停止消费者。 */
|
|
59
|
-
declare function reverseDependentsOf(graph: PluginGraph, pluginId: string, enabledSet: ReadonlySet<string>): PluginReverseDep[];
|
|
60
|
-
|
|
61
|
-
interface DefinePluginOptions<TContribution = PluginContribution, TConfig extends PluginConfig = PluginConfig, TExtension extends PluginContextExtension = PluginContextExtension> {
|
|
1
|
+
import { K as Capability, M as CapabilityDependency, N as PluginContribution, O as PluginConfig, Q as PluginContextExtension, R as RuntimeKind, e as PluginPermission, T as PluginSetup, V as PluginDefinition } from './runtimeTypes-DquUCHz-.js';
|
|
2
|
+
export { X as AppLike, Y as CapabilityBridge, Z as CapabilityClient, C as CapabilityDescriptor, _ as CapabilityKind, j as CapabilityPeer, h as CreateUpgradeGateOptions, $ as DefineLocalCapabilityOptions, a0 as DefineRpcCapabilityOptions, a1 as DefineStreamCapabilityOptions, a2 as DispatchOptions, a3 as EventHandler, a4 as FrameworkErrorCode, a5 as FrameworkErrorContext, a6 as FrameworkErrorPhase, a7 as HandlerCallContext, a8 as HandlerOptions, a9 as HandlerOrigin, aa as HostListener, ab as ItemOf, ac as LIFECYCLE_ERROR_TEXT, ad as LifecycleCleanup, ae as LifecycleCleanupIssue, af as LifecycleCleanupPhase, ag as LifecycleDisposeOptions, ah as LifecycleDisposeResult, ai as LifecycleResourceHandle, aj as LifecycleResourceSnapshot, f as LifecycleScope, L as LifecycleScopeIdentity, ak as LifecycleScopeKind, al as LifecycleScopeRevokedError, am as LifecycleScopeState, an as LocalCapability, ao as LocalServiceOf, ap as Message, aq as MessageBus, ar as MessageBusSnapshot, as as MessageHandler, at as MessageMode, au as OwnedResourceDefinition, av as PeerCapabilityDependency, aw as PeerScopeView, ax as PermissionDeniedError, g as PermissionLease, ay as PermissionLeaseBinding, az as PermissionLeaseBindingExpectation, aA as PermissionLeaseRevokedError, aB as PluginAttributes, aC as PluginContext, a as PluginGraph, aD as PluginIntentCommand, aE as PluginIntentCommandResult, aF as PluginIntentController, aG as PluginIntentCoordinator, aH as PluginIntentSnapshot, aI as PluginIntentSubmissionResult, aJ as PluginLifecycleState, P as PluginManifest, aK as PluginManifestInput, c as PluginReverseDep, aL as PluginStartupMode, aM as PluginState, aN as PluginStateKind, aO as PluginTeardown, aP as PluginUnitGraph, aQ as PluginUnitState, aR as PublishOptions, aS as RESOURCE_OWNER, aT as RESOURCE_REGISTRY, aU as RUNTIME_MESSAGE_BUS, aV as RemoteCapability, aW as RequestOf, aX as RequestOptions, aY as ResourceContext, aZ as ResourceDefinition, a_ as ResourceKey, a$ as ResourceRegistry, b0 as ResourceSnapshot, b1 as ResourceStatus, b2 as ResponseOf, b3 as RpcCallOptions, b4 as RpcCapability, b5 as RpcCapabilityBase, b6 as RpcClient, b7 as RpcHandler, b8 as RpcTransferDescriptor, b9 as RuntimeCapabilityDependency, l as RuntimeHandle, ba as RuntimeInitializationError, bb as RuntimeLimits, bc as RuntimeServiceSnapshot, bd as RuntimeSnapshot, be as RuntimeStatusListener, bf as RuntimeStatusSnapshot, bg as RuntimeUnavailableError, b as RuntimeUnitDependency, bh as RuntimeUnitDependencyInput, d as RuntimeUnitDescriptor, bi as RuntimeUnitDescriptorInput, bj as RuntimeUnitImplementationRegistry, bk as SCOPED_TASK_SCHEDULER_CAPABILITY, bl as ScopedTaskDefinition, S as ScopedTaskScheduler, bm as ScopedTaskSnapshot, i as ServiceReference, bn as SnapshotApplyResult, bo as StartupCapabilityErrorDetails, bp as StartupPluginErrorDetails, bq as StreamCapability, br as StreamCapabilityBase, bs as StreamClient, bt as StreamHandler, bu as StreamSubscribeOptions, bv as StreamSubscription, bw as StreamTransferDescriptor, bx as TransferExtractor, by as UpgradeDrainResult, U as UpgradeGate, bz as UpgradeGateRejectedError, bA as UpgradeGateState, bB as UpgradeHandshake, bC as UpgradeHandshakeResult, bD as UpgradeIoLease, bE as UpgradeMode, bF as UpgradeSession, bG as ValueParser, bH as WebLoomError, W as WindowApp, bI as assertCapability, bJ as capabilityDescriptor, bK as capabilityKey, bL as defineCapability, bM as isCapability, bN as isCapabilityDescriptor, bO as lifecycleErrorText } from './runtimeTypes-DquUCHz-.js';
|
|
3
|
+
export { k as ConnectSharedWorkerOptions, P as PeerController, d as PeerExposureOptions, c as RuntimePluginDefinition, S as SharedWorkerApp, l as SharedWorkerLike, g as StartSharedWorkerAppOptions, m as connectSharedWorker, i as createLifecycleScope, j as createResourceScope, s as startSharedWorkerApp } from './sharedWorkerHost-KI7TIGdX.js';
|
|
4
|
+
export { C as CreateWindowAppOptions, a as createWindowApp } from './windowRuntime-BKkLPsAS.js';
|
|
5
|
+
export { c as createMessageBus } from './messageBus-CtrwkjrO.js';
|
|
6
|
+
|
|
7
|
+
/** 普通插件定义选项;插件声明只使用 typed capability 与单一启动策略。 */
|
|
8
|
+
interface DefinePluginOptions<TProvides extends readonly Capability[] = readonly Capability[], TDependencies extends readonly CapabilityDependency[] = readonly CapabilityDependency[], TContribution = PluginContribution, TConfig extends PluginConfig = PluginConfig, TExtension extends PluginContextExtension = PluginContextExtension> {
|
|
62
9
|
/** 全局稳定插件标识。 */
|
|
63
|
-
id: string;
|
|
64
|
-
/**
|
|
65
|
-
name?: string;
|
|
66
|
-
/**
|
|
67
|
-
description?: string;
|
|
68
|
-
/**
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
|
|
90
|
-
/** required 插件在 App 初始启动时必须成功。 */
|
|
91
|
-
required?: boolean;
|
|
92
|
-
/** 显式启动模式;required=true 时不能覆盖为 optional。 */
|
|
93
|
-
startup?: "required" | "optional";
|
|
94
|
-
/** 仅用于兼容低层消费方的静态 meta 扩展;WebLoom 不解释分类字段。 */
|
|
95
|
-
meta?: Partial<PluginMeta>;
|
|
96
|
-
}
|
|
97
|
-
/** 静态 descriptor 与当前 realm 的实现函数分离。 */
|
|
98
|
-
interface PluginDefinition<TContribution = PluginContribution, TConfig extends PluginConfig = PluginConfig, TExtension extends PluginContextExtension = PluginContextExtension> {
|
|
99
|
-
readonly manifest: PluginManifestInput<TContribution, TConfig, TExtension>;
|
|
100
|
-
readonly descriptor: RuntimeUnitDescriptorInput<TContribution, TConfig>;
|
|
101
|
-
readonly setup: PluginSetup<TConfig, TExtension>;
|
|
10
|
+
readonly id: string;
|
|
11
|
+
/** 展示名称。 */
|
|
12
|
+
readonly name?: string;
|
|
13
|
+
/** 诊断描述。 */
|
|
14
|
+
readonly description?: string;
|
|
15
|
+
/** 本插件声明提供的能力。 */
|
|
16
|
+
readonly provides?: TProvides;
|
|
17
|
+
/** 本插件声明消费的能力。 */
|
|
18
|
+
readonly dependencies?: TDependencies;
|
|
19
|
+
/** 默认执行 Runtime。 */
|
|
20
|
+
readonly runtime?: RuntimeKind;
|
|
21
|
+
/** 多 unit 装配时的稳定 unit id。 */
|
|
22
|
+
readonly unitId?: string;
|
|
23
|
+
/** 申请权限。 */
|
|
24
|
+
readonly permissions?: readonly PluginPermission[];
|
|
25
|
+
/** 只读插件配置。 */
|
|
26
|
+
readonly config?: TConfig;
|
|
27
|
+
/** 领域贡献。 */
|
|
28
|
+
readonly contribution?: TContribution;
|
|
29
|
+
/** 唯一启动策略;默认为 optional。 */
|
|
30
|
+
readonly startup?: "required" | "optional";
|
|
31
|
+
/** 默认启用意图;required 时必须为 true。 */
|
|
32
|
+
readonly defaultEnabled?: boolean;
|
|
33
|
+
/** optional 插件默认为可停用;required 必须为 false。 */
|
|
34
|
+
readonly canDisable?: boolean;
|
|
35
|
+
/** 当前 realm 的插件实现。 */
|
|
36
|
+
readonly setup: PluginSetup<TProvides, TDependencies, TConfig, TExtension>;
|
|
102
37
|
}
|
|
103
38
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* 该函数不创建 Host,也不启动 setup;真正的启动边界由
|
|
107
|
-
* createWindowApp()/startSharedWorkerApp() 拥有。
|
|
39
|
+
* 声明一个插件。它不会创建 Host,也不会运行 setup;Runtime 装配边界
|
|
40
|
+
* createWindowApp()/startSharedWorkerApp() 才会执行实现。
|
|
108
41
|
*/
|
|
109
|
-
declare function definePlugin<TContribution = PluginContribution, TConfig extends PluginConfig = PluginConfig, TExtension extends PluginContextExtension = PluginContextExtension>(options: DefinePluginOptions<TContribution, TConfig, TExtension>): PluginDefinition<TContribution, TConfig, TExtension>;
|
|
110
|
-
|
|
111
|
-
type RuntimePluginDefinition = PluginDefinition<any, any, any> | {
|
|
112
|
-
readonly manifest: PluginManifest | PluginManifestInput;
|
|
113
|
-
readonly setup: PluginSetup<any, any>;
|
|
114
|
-
/** 多 unit manifest 中 setup 所实现的目标 unit;单一匹配 unit 可省略。 */
|
|
115
|
-
readonly unitId?: string;
|
|
116
|
-
};
|
|
117
|
-
interface MaterializedPluginDefinition {
|
|
118
|
-
readonly manifest: PluginManifest;
|
|
119
|
-
/** 当前 Runtime 中由 setup 实现的 unit。 */
|
|
120
|
-
readonly unitId: string;
|
|
121
|
-
readonly setup: PluginSetup;
|
|
122
|
-
}
|
|
123
|
-
/** 将作者定义绑定到真实 Runtime;不把 setup 复制进 manifest。 */
|
|
124
|
-
declare function materializePluginDefinition(input: RuntimePluginDefinition, runtime: RuntimeKind): MaterializedPluginDefinition;
|
|
125
|
-
declare function materializePluginDefinitions(inputs: readonly RuntimePluginDefinition[], runtime: RuntimeKind): MaterializedPluginDefinition[];
|
|
126
|
-
|
|
127
|
-
interface CreateWindowAppOptions extends Omit<CreatePluginHostOptions, "runtime" | "runtimeUnitImplementationRegistry"> {
|
|
128
|
-
/** 逻辑 Runtime 标识;同一页面通常只创建一个 App。 */
|
|
129
|
-
id?: string;
|
|
130
|
-
/** 当前 Window 的插件定义;setup 只在当前 Window realm 执行。 */
|
|
131
|
-
plugins: readonly RuntimePluginDefinition[];
|
|
132
|
-
/**
|
|
133
|
-
* 供领域适配层接管分阶段注册时复用已经创建的 Window Host。
|
|
134
|
-
* 普通插件应省略该字段;传入后由调用方负责后续 register,App 仍负责
|
|
135
|
-
* Window Runtime 快照、远端投影和最终 dispose。
|
|
136
|
-
*/
|
|
137
|
-
host?: PluginHost;
|
|
138
|
-
/** 可选的 SharedWorker Runtime;Window 单元只投影其状态,不创建 Worker 假实例。 */
|
|
139
|
-
remoteRuntime?: RuntimeHandle;
|
|
140
|
-
}
|
|
141
|
-
/** 创建当前 Window 的唯一 window-main Runtime。 */
|
|
142
|
-
declare function createWindowApp(options: CreateWindowAppOptions): Promise<WindowApp>;
|
|
143
|
-
|
|
144
|
-
interface SharedWorkerScopeLike {
|
|
145
|
-
onconnect: ((event: {
|
|
146
|
-
ports: MessagePort[];
|
|
147
|
-
}) => void) | null;
|
|
148
|
-
}
|
|
149
|
-
interface StartSharedWorkerAppOptions extends Omit<CreatePluginHostOptions, "runtime" | "runtimeUnitImplementationRegistry"> {
|
|
150
|
-
id: string;
|
|
151
|
-
plugins: readonly RuntimePluginDefinition[];
|
|
152
|
-
globalScope?: SharedWorkerScopeLike;
|
|
153
|
-
/** SWCF-009 完成前的临时领域端口装配接缝。 */
|
|
154
|
-
onPortConnect?: (event: {
|
|
155
|
-
ports: MessagePort[];
|
|
156
|
-
}) => void;
|
|
157
|
-
}
|
|
158
|
-
interface SharedWorkerApp {
|
|
159
|
-
readonly runtimeKind: "shared-worker";
|
|
160
|
-
readonly runtimeId: string;
|
|
161
|
-
readonly runtimeInstanceId: string;
|
|
162
|
-
ready(): Promise<void>;
|
|
163
|
-
reconcile(): Promise<void>;
|
|
164
|
-
state(): RuntimeStatusSnapshot;
|
|
165
|
-
subscribe(listener: RuntimeStatusListener): () => void;
|
|
166
|
-
dispose(reason?: string): Promise<LifecycleDisposeResult>;
|
|
167
|
-
}
|
|
168
|
-
/** 在当前 SharedWorkerGlobalScope 中安装唯一的 Worker Runtime。 */
|
|
169
|
-
declare function startSharedWorkerApp(options: StartSharedWorkerAppOptions): SharedWorkerApp;
|
|
170
|
-
|
|
171
|
-
/** 创建绑定到指定插件实例的 MessageBus 视图。 */
|
|
172
|
-
declare function createScopedMessageBus(base: MessageBus, scope: LifecycleScope): MessageBus;
|
|
173
|
-
|
|
174
|
-
interface CreatePermissionLeaseOptions {
|
|
175
|
-
/** 已由 Host 绑定的作用域身份;调用方不能从请求体自报。 */
|
|
176
|
-
identity: LifecycleScopeIdentity;
|
|
177
|
-
/** 插件 manifest 申请的权限。 */
|
|
178
|
-
requested?: readonly PluginPermission[];
|
|
179
|
-
/** 可信策略批准的权限。 */
|
|
180
|
-
approved?: readonly PluginPermission[];
|
|
181
|
-
/** 当前会话约束;存在时再与申请、批准求交集。 */
|
|
182
|
-
sessionConstraints?: readonly PluginPermission[];
|
|
183
|
-
/** 内置可信策略修订;策略变化后不能复用旧租约。 */
|
|
184
|
-
policyRevision?: number;
|
|
185
|
-
/** Connect 用户授权修订;内置插件可以省略。 */
|
|
186
|
-
grantRevision?: number;
|
|
187
|
-
/** Connect/外部授权的不可猜测授权标识;最终边界仍需查权威状态。 */
|
|
188
|
-
grantId?: string;
|
|
189
|
-
/** 可选作用域;撤权时自动撤销租约。 */
|
|
190
|
-
scope?: LifecycleScope;
|
|
191
|
-
}
|
|
192
|
-
/** 创建一个不可换绑的权限租约。 */
|
|
193
|
-
declare function createPermissionLease(options: CreatePermissionLeaseOptions): PermissionLease;
|
|
194
|
-
|
|
195
|
-
interface VerifyPermissionLeaseOptions {
|
|
196
|
-
/** 已由受信装配层创建的租约。 */
|
|
197
|
-
lease: PermissionLease;
|
|
198
|
-
/** 本次实际操作所需的最小权限。 */
|
|
199
|
-
permission: PluginPermission;
|
|
200
|
-
/** 从端口 / 当前会话权威取得的绑定值。 */
|
|
201
|
-
binding?: Parameters<PermissionLease["assertBinding"]>[0];
|
|
202
|
-
}
|
|
203
|
-
/** 在最终 RPC / I/O 边界执行一次 fail-closed 校验。 */
|
|
204
|
-
declare function verifyPermissionLease(options: VerifyPermissionLeaseOptions): void;
|
|
205
|
-
|
|
206
|
-
interface CreateScopedTaskSchedulerOptions {
|
|
207
|
-
/** 注册后是否先恢复运行一次;缺省为 false,由业务显式触发。 */
|
|
208
|
-
runOnRegister?: boolean;
|
|
209
|
-
}
|
|
210
|
-
/** 创建绑定到一个 lifecycle scope 的任务调度器。 */
|
|
211
|
-
declare function createScopedTaskScheduler(scope: LifecycleScope, options?: CreateScopedTaskSchedulerOptions): ScopedTaskScheduler & {
|
|
212
|
-
dispose(): Promise<void>;
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
interface ScopedRegistryRegistration {
|
|
216
|
-
/** 注册方法名,例如 register / registerFeature。 */
|
|
217
|
-
method: string;
|
|
218
|
-
/** 从参数哪个位置读取带 id 的定义。 */
|
|
219
|
-
idArgument?: number;
|
|
220
|
-
/** 没有返回取消函数时使用的注销方法。 */
|
|
221
|
-
unregisterMethod?: string;
|
|
222
|
-
/** 注销方法的参数位置;默认使用 idArgument。 */
|
|
223
|
-
unregisterArgument?: number;
|
|
224
|
-
/** 含 ownerPluginId 参数的注册方法;由 Host 绑定当前插件身份。 */
|
|
225
|
-
bindPluginIdArgument?: number;
|
|
226
|
-
/** 定义对象中的 ownerPluginId 字段;存在时必须与当前插件一致。 */
|
|
227
|
-
ownerPluginIdProperty?: string;
|
|
228
|
-
}
|
|
229
|
-
interface CreateScopedRegistryFacadeOptions {
|
|
230
|
-
/** 日志和作用域资源中显示的注册表名。 */
|
|
231
|
-
name: string;
|
|
232
|
-
/** 注册方法规则;缺省只包装 register(item)。 */
|
|
233
|
-
registrations?: readonly ScopedRegistryRegistration[];
|
|
234
|
-
}
|
|
235
|
-
/** 创建一个只对当前插件实例开放的 Registry 视图。 */
|
|
236
|
-
declare function createScopedRegistryFacade<T extends object>(target: T, scope: LifecycleScope, options: CreateScopedRegistryFacadeOptions): T;
|
|
237
|
-
|
|
238
|
-
/** 创建一个绑定当前构建和接管世代的升级门禁。 */
|
|
239
|
-
declare function createUpgradeGate(options: CreateUpgradeGateOptions): UpgradeGate;
|
|
240
|
-
|
|
241
|
-
interface CreateMessagePortServiceProviderOptions {
|
|
242
|
-
/** 与页面服务桥配对的专用双工端口。 */
|
|
243
|
-
port: MessagePort;
|
|
244
|
-
/** Provider 的本地权威目录;不会采信客户端回传的完整 reference。 */
|
|
245
|
-
services?: () => readonly RemoteServiceReference[];
|
|
246
|
-
/** 具体服务分派;这里不自动重放调用。 */
|
|
247
|
-
handleCall(input: MessagePortServiceCallInput): Promise<unknown>;
|
|
248
|
-
/** dispose 时是否关闭本端端口;默认关闭。 */
|
|
249
|
-
closeOnDispose?: boolean;
|
|
250
|
-
/** wire 消息 codec;默认 webloom.remote-service.v2。 */
|
|
251
|
-
codec?: RemoteServiceMessageCodec;
|
|
252
|
-
}
|
|
253
|
-
interface MessagePortServiceProvider {
|
|
254
|
-
/** 替换 Provider 本地权威目录;不产生 wire 控制消息。 */
|
|
255
|
-
setServices(services: readonly RemoteServiceReference[]): void;
|
|
256
|
-
/** 同步停止新调用并 abort 当前 handler。 */
|
|
257
|
-
revoke(reason?: string): void;
|
|
258
|
-
/** 移除监听器并释放端口;不发送断开控制包。 */
|
|
259
|
-
dispose(): void;
|
|
260
|
-
}
|
|
261
|
-
/** 创建一条只服务于当前 MessagePort 的 Provider 端点。 */
|
|
262
|
-
declare function createMessagePortServiceProvider(options: CreateMessagePortServiceProviderOptions): MessagePortServiceProvider;
|
|
42
|
+
declare function definePlugin<TProvides extends readonly Capability[] = readonly Capability[], TDependencies extends readonly CapabilityDependency[] = readonly CapabilityDependency[], TContribution = PluginContribution, TConfig extends PluginConfig = PluginConfig, TExtension extends PluginContextExtension = PluginContextExtension>(options: DefinePluginOptions<TProvides, TDependencies, TContribution, TConfig, TExtension>): PluginDefinition<TProvides, TDependencies, TContribution, TConfig, TExtension>;
|
|
263
43
|
|
|
264
|
-
export {
|
|
44
|
+
export { Capability, CapabilityDependency, type DefinePluginOptions, PluginConfig, PluginContextExtension, PluginContribution, PluginDefinition, PluginPermission, PluginSetup, RuntimeKind, definePlugin };
|