/** * Global plugin registry for bQuery. * * 1.14+ adds plugin metadata, dependencies, async install, full lifecycle * tracking (so `unuse()` can deterministically tear down a plugin's * directives, components stub, filters, actions, DI bindings, and any * user-supplied `onCleanup` callbacks), and the richer * {@link PluginInstallContext}. * * @module bquery/plugin */ import { addFilter as freeAddFilter, applyFilters as freeApplyFilters, addAction as freeAddAction, doAction as freeDoAction } from './hooks'; import { hasProvided } from './di'; import type { BQueryPlugin, CustomDirective, CustomDirectiveHandler, PluginInfo } from './types'; /** * Register a bQuery plugin. * * 1.14+: returns `void` when the plugin's `install()` is synchronous and a * `Promise` when it is asynchronous, preserving the original synchronous * contract while supporting awaitable installs. * * Concurrent calls with the same plugin name during an async install share * the in-flight promise so dependent code can safely `await use(plugin)`. */ export declare const use: (plugin: BQueryPlugin, options?: TOptions) => void | Promise; /** * Uninstall a previously installed plugin (1.14+). * * Removes all directives, filters, actions, DI bindings, and runs any * `ctx.onCleanup()` callbacks the plugin registered. Components defined via * `customElements.define()` cannot be removed by the browser and remain * registered, but are no longer tracked. * * @returns `true` when the plugin was installed and has now been removed, * `false` when no plugin with the given name was registered. */ export declare const unuse: (name: string) => boolean; /** Alias for {@link unuse}. */ export declare const uninstall: (name: string) => boolean; export declare const isInstalled: (name: string) => boolean; /** * Return a read-only snapshot of installed plugin names. * * Overload (1.14+): `getInstalledPlugins({ withMetadata: true })` returns * structured {@link PluginInfo} entries. */ export declare function getInstalledPlugins(): readonly string[]; export declare function getInstalledPlugins(options: { withMetadata: true; }): readonly PluginInfo[]; /** Return metadata for a single installed plugin, or `undefined`. */ export declare const getPluginInfo: (name: string) => PluginInfo | undefined; export declare const getCustomDirective: (name: string) => CustomDirectiveHandler | undefined; export declare const getCustomDirectives: () => readonly CustomDirective[]; /** * Reset all plugin registrations. * * Calls `unuse()` on every installed plugin so plugin-supplied cleanups run. * Also clears the directive registry and re-attaches the resolver. */ export declare const resetPlugins: () => void; export { freeAddFilter as addFilter, freeApplyFilters as applyFilters }; export { freeAddAction as addAction, freeDoAction as doAction }; export { hasProvided }; //# sourceMappingURL=registry.d.ts.map