/** * Plugin 点注册表。 * * 关键点(中文) * - 统一管理 pipeline / guard / effect / resolve 四类 plugin 点。 * - service 只依赖固定执行语义,不再自己拼装扩展调度逻辑。 */ import type { JsonValue } from "../../types/common/Json.js"; import type { PluginEffectHook, PluginGuardHook, PluginPipelineHook, PluginResolveHook } from "../../types/plugin/PluginRuntime.js"; import type { PluginContext } from "../../types/plugin/PluginContext.js"; /** * HookRegistry:plugin 点注册与执行实现。 */ export declare class HookRegistry { private readonly get_context; private readonly is_plugin_ready; private readonly pipelineHooks; private readonly guardHooks; private readonly effectHooks; private readonly resolveHooks; constructor(params: { get_context: () => PluginContext; is_plugin_ready: (plugin_name: string) => boolean; }); /** * 注册 pipeline 扩展点。 */ pipeline(point_name: string, plugin_name: string, handler: PluginPipelineHook): void; /** * 注册 guard 扩展点。 */ guard(point_name: string, plugin_name: string, handler: PluginGuardHook): void; /** * 注册 effect 扩展点。 */ effect(point_name: string, plugin_name: string, handler: PluginEffectHook): void; /** * 注册 resolve 扩展点。 * * 关键点(中文) * - resolve 语义要求单点单处理器,避免 service 侧再做二次仲裁。 */ resolve(point_name: string, plugin_name: string, handler: PluginResolveHook): void; /** * 移除指定 plugin 注册的全部扩展点。 */ unregister_plugin(plugin_name: string): void; /** * 列出所有已注册扩展点。 */ list(): string[]; /** * 运行 pipeline 扩展点。 */ pipelineValue(point_name: string, value: T): Promise; /** * 运行 guard 扩展点。 */ guardValue(point_name: string, value: T): Promise; /** * 运行 effect 扩展点。 */ effectValue(point_name: string, value: T): Promise; /** * 运行 resolve 点。 */ resolveValue(point_name: string, value: TInput): Promise; } //# sourceMappingURL=HookRegistry.d.ts.map