/** * Global dependency-injection container for plugins (1.14+). * * Mirrors the component-level `provide()`/`inject()` pair but operates at * application scope so plugins can publish typed singletons consumed by other * plugins, stores, or application code. * * @module bquery/plugin */ /** * Typed key used to store and retrieve values in the global DI container. * * The key carries a phantom `T` so that `inject(key)` resolves to the same * type that was provided. */ export interface InjectionKey { readonly description?: string; /** Phantom for the value type. */ readonly __type?: T; } /** * Create a typed injection key. * * @example * ```ts * import { createInjectionKey, provide, inject } from '@bquery/bquery/plugin'; * const LoggerKey = createInjectionKey('logger'); * provide(LoggerKey, console); * const logger = inject(LoggerKey); // typed as Logger | undefined * ``` */ export declare const createInjectionKey: (description?: string) => InjectionKey; /** * Register a value in the global DI container. * * @param key - The injection key, string, or symbol. * @param value - The value to expose to consumers. */ export declare const provide: (key: InjectionKey | string | symbol, value: T) => void; /** @internal */ export declare const registerProvide: (key: InjectionKey | string | symbol, value: unknown, owner?: string) => void; /** * Retrieve a value previously registered via {@link provide}. * * @returns The value or `undefined` when no value was provided. */ export declare const inject: (key: InjectionKey | string | symbol) => T | undefined; /** * Returns `true` when a value has been provided for the given key. */ export declare const hasProvided: (key: InjectionKey | string | symbol) => boolean; /** Remove every DI binding owned by the given plugin. @internal */ export declare const removeProvidedByOwner: (owner: string) => void; /** Reset the entire DI container. Test-only. @internal */ export declare const resetDi: () => void; //# sourceMappingURL=di.d.ts.map