/** * LombokTableSheet Plugin Framework — Registry * WS-3 */ import type { IPlugin, PluginMetadata, HookName } from './types.js'; export interface RegisterOptions { /** Skip dependency-version checking (useful for test doubles). Default: false. */ skipDependencyCheck?: boolean; } export declare class PluginRegistry { private plugins; /** * Register a plugin. Validates name/version shape, checks for duplicate * registration, and — unless skipped — verifies every declared dependency * is already registered and satisfies the requested semver range. * * Fires 'onPluginLoad' against the full registered set after adding this * plugin, so a plugin that itself declares an onPluginLoad hook WILL * observe its own registration (self-notification), not just later ones. * * Throws PluginError (not a generic Error) so callers can distinguish * plugin-system failures from other errors. */ register(plugin: IPlugin, options?: RegisterOptions): void; /** * Unregister a plugin. Refuses to remove a plugin that other registered * plugins still declare as a dependency, unless `force` is true — removing * it silently would leave those plugins referencing a missing dependency. */ unregister(name: string, force?: boolean): void; /** Names of currently-registered plugins that declare `name` as a dependency. */ findDependents(name: string): string[]; enable(name: string): void; disable(name: string): void; get(name: string): IPlugin | undefined; isEnabled(name: string): boolean; /** Enabled plugins only, in registration order. */ list(): IPlugin[]; /** All registered plugins (enabled or not) with registry metadata. */ listAll(): PluginMetadata[]; exists(name: string): boolean; count(): number; /** Remove every registered plugin (unloads in reverse-registration order, * bypassing the dependent check since everything is going away together). */ clear(): void; /** * Run all callbacks registered for `hookName`, in plugin-registration * order, skipping disabled plugins. A callback that throws is caught and * logged so one misbehaving plugin cannot break the others or the caller. * * NOTE: this does not await returned promises. If any hook for this name * may be async, use runHookAsync instead — mixing sync/async callers on * the same hook name will silently drop async results here. */ runHook(hookName: HookName, ...args: any[]): any[]; /** Async variant of runHook — awaits each callback's result in sequence. */ runHookAsync(hookName: HookName, ...args: any[]): Promise; private logHookError; } export declare const pluginRegistry: PluginRegistry;