import type { FactoryProvider } from './types/factory-provider.js'; import type { Token } from './types/tokens.js'; import type { ScopedClassData } from './container.js'; /** * A ScopedContainer represents a context for scoped instances. * Scoped instances are created on-demand and cached within this container. * When the scoped container is destroyed, all scoped instances are cleaned up. */ export declare class ScopedContainer { private readonly parentInstances; private readonly scopedClassProviders; private readonly scopedFactoryProviders; private readonly scopedValueTokens; private readonly instances; private readonly pendingPromises; private readonly creationOrder; private _isDestroyed; constructor(parentInstances: Map, unknown>, scopedClassProviders: Map, ScopedClassData>, scopedFactoryProviders: Map, FactoryProvider>, scopeValues?: Map, unknown>, scopedValueTokens?: Set>); get isDestroyed(): boolean; /** * Get a singleton instance from the parent container. * Throws if the token is a scoped provider - use getScoped() for those. */ get(token: Token): T; /** * Get a scoped instance by its token. * Creates and caches the instance within this scope on first access. * Throws if the token is not a scoped provider. */ getScoped(token: Token): Promise; /** * Calls onDestroy on all created instances in reverse creation order. */ destroy(): Promise; private createScopedClassInstance; private createScopedFactoryInstance; /** * Internal resolution logic for dependency resolution. * Does not check if scope is destroyed - caller must handle that. */ private resolve; /** * Resolves a scoped instance, returning undefined if the token is not a scoped provider. * Handles caching of both instances and in-flight promises to prevent race conditions. */ private resolveScoped; } //# sourceMappingURL=scoped-container.d.ts.map