import type { Container } from './di-container.js'; import type { Constructor } from './types.js'; /** * Public DI lookup API. Wraps `Container` with a narrowed surface: only the * read operations user code legitimately needs (`has`, `resolve`, * `resolveOptional`). Mutations (`register`, `destroyAll`) stay internal - * `Container` itself is not registered as a public DI token. * * **Prefer `inject(Token)` over `resolver.resolve(Token)` when possible.** * Field-init `inject()` is the idiomatic MiiaJS pattern - it composes with * lifecycle hooks and keeps deps explicit at the class level. Reach for * `Resolver` only for runtime inspection: plugin systems, conditional * resolution, or when the token is not known until runtime. * * @example * ```ts * @Injectable() * class PluginRegistry { * private resolver = inject(Resolver) * * load(name: string) { * const token = `plugin:${name}` * if (!this.resolver.has(token)) throw new Error(`unknown plugin: ${name}`) * return this.resolver.resolve(token) * } * } * ``` */ export declare class Resolver { private container; constructor(container: Container); has(token: Constructor | string): boolean; resolve(token: Constructor | string): T; resolveOptional(token: Constructor | string): T | null; } //# sourceMappingURL=resolver.d.ts.map