import 'reflect-metadata'; /** * Token type for DI registration * Can be a class constructor, string, or symbol */ export type InjectionToken = (new (...args: any[]) => T) | string | symbol; /** * Provider type - a class constructor (using any[] for compatibility) */ type Provider = new (...args: any[]) => T; /** * Dependency Injection Container * * Simple DI container for managing service instances and dependencies. * Supports constructor injection and singleton pattern. */ export declare class DIContainer { private static instance; private providers; private instances; private constructor(); /** * Get the singleton container instance */ static getInstance(): DIContainer; /** * Register a provider (class) * @param token - The token to register (usually the class itself) * @param provider - Optional provider class (defaults to token if it's a class) */ register(token: InjectionToken, provider?: Provider): void; /** * Register a value directly * @param token - The token to register * @param value - The value to associate with the token */ registerValue(token: InjectionToken, value: T): void; /** * Resolve a dependency (get or create instance) * @param token - The token to resolve * @returns The resolved instance */ resolve(token: InjectionToken): T; /** * Get constructor dependencies from metadata * * Priority: * 1. Explicit deps in @Injectable({ deps: [...] }) - works in ESM * 2. @Inject() parameter decorators * 3. design:paramtypes from TypeScript (may not work in ESM) */ private getDependencies; /** * Get all currently instantiated objects in the container */ getInstances(): unknown[]; /** * Eagerly instantiate every registered provider. * * The container resolves lazily, so declared-but-uninjected providers (and * controllers) would otherwise never be constructed and would miss lifecycle * hooks. This mirrors NestJS's eager singleton instantiation. A provider that * fails to resolve is logged (if a logger is supplied) and skipped so one bad * token does not abort startup. * * @param logger - Optional logger for resolution failures */ instantiateAll(logger?: { error(msg: string, meta?: unknown): void; }): void; /** * Clear all registrations (useful for testing) */ clear(): void; /** * Check if a token is registered * @param token - The token to check */ has(token: InjectionToken): boolean; } export {}; //# sourceMappingURL=container.d.ts.map