import { A as ClassTypeWithoutArguments, C as BoundInjectionToken, D as ClassTypeWithInstanceAndArgument, E as ClassTypeWithInstance, F as OptionalInjectionTokenSchemaType, M as InjectionToken, N as InjectionTokenSchemaType, O as ClassTypeWithInstanceAndOptionalArgument, P as InjectionTokenType, S as BaseInjectionTokenSchemaType, T as ClassTypeWithArgument, _ as PopUnion, a as FactorableWithArgs, b as UnionToOvlds, c as getInjectors, d as InjectableScope, f as IContainer, g as Join, h as IsUnion, i as Factorable, j as FactoryInjectionToken, k as ClassTypeWithOptionalArgument, l as ServiceInitializationContext, m as InjectState, n as Registry, o as FactoryContext, p as InjectRequest, r as globalRegistry, s as Injectors, t as FactoryRecord, u as InjectableType, v as UnionToArray, w as ClassType, x as AnyInjectableType, y as UnionToIntersection } from "./registry-DKbKWFvJ.cjs"; import { C as NameResolver, S as DIErrorCode, _ as InstanceHolderCreating, a as ScopedContainer, b as InstanceStatus, c as ClearAllOptions, d as LifecycleEventBus, f as HolderGetResult, g as InstanceHolderCreated, h as InstanceHolder, i as ScopeTracker, l as InvalidationOptions, m as InstanceDestroyListener, n as InstanceResolver, o as UnifiedStorage, p as IHolderStorage, r as ServiceInitializer, s as TokenResolver, t as Container, u as ServiceInvalidator, v as InstanceHolderDestroying, x as DIError, y as InstanceHolderError } from "./container-r1KP4F-n.cjs"; import { i as FactoryOptions, n as InjectableOptions, r as Factory, t as Injectable } from "./injectable.decorator-BNfWpjr_.cjs"; //#region src/utils/default-injectors.d.mts declare const defaultInjectors: Injectors; declare const inject: Injectors['inject']; declare const optional: Injectors['optional']; declare const asyncInject: Injectors['asyncInject']; declare const wrapSyncInit: Injectors['wrapSyncInit']; declare const provideFactoryContext: Injectors['provideFactoryContext']; //#endregion //#region src/utils/get-injectable-token.d.mts declare function getInjectableToken(target: ClassType): R extends { create(...args: any[]): infer V; } ? InjectionToken : InjectionToken; //#endregion //#region src/interfaces/on-service-destroy.interface.d.mts interface OnServiceDestroy { onServiceDestroy(): Promise | void; } //#endregion //#region src/interfaces/on-service-init.interface.d.mts interface OnServiceInit { onServiceInit(): Promise | void; } //#endregion //#region src/internal/context/async-local-storage.types.d.mts /** * Interface matching the subset of AsyncLocalStorage API we use. */ interface IAsyncLocalStorage { run(store: T, fn: () => R): R; getStore(): T | undefined; } //#endregion //#region src/internal/context/async-local-storage.d.mts declare function createAsyncLocalStorage(): IAsyncLocalStorage; declare function isUsingNativeAsyncLocalStorage(): boolean; //#endregion //#region src/internal/context/resolution-context.d.mts /** * Data stored in the resolution context during service instantiation. */ interface ResolutionContextData { /** The holder that is currently being instantiated */ waiterHolder: InstanceHolder; /** Function to get a holder by name (for cycle detection) */ getHolder: (name: string) => InstanceHolder | undefined; } /** * Runs a function within a resolution context. * * The context tracks which holder is currently being instantiated, * allowing circular dependency detection to work correctly. * * @param waiterHolder The holder being instantiated * @param getHolder Function to retrieve holders by name * @param fn The function to run within the context */ declare function withResolutionContext(waiterHolder: InstanceHolder, getHolder: (name: string) => InstanceHolder | undefined, fn: () => T): T; /** * Gets the current resolution context, if any. * * Returns undefined if we're not inside a resolution context * (e.g., when resolving a top-level service that has no parent). */ declare function getCurrentResolutionContext(): ResolutionContextData | undefined; /** * Runs a function outside any resolution context. * * This is useful for async injections that should not participate * in circular dependency detection since they don't block. * * @param fn The function to run without resolution context */ declare function withoutResolutionContext(fn: () => T): T; //#endregion //#region src/internal/lifecycle/circular-detector.d.mts /** * Detects circular dependencies by analyzing the waitingFor relationships * between service holders. * * Uses BFS to traverse the waitingFor graph starting from a target holder * and checks if following the chain leads back to the waiter, indicating a circular dependency. * * Note: In production (NODE_ENV === 'production'), detection is skipped for performance. */ declare class CircularDetector { /** * Detects if waiting for `targetName` from `waiterName` would create a cycle. * * This works by checking if `targetName` (or any holder in its waitingFor chain) * is currently waiting for `waiterName`. If so, waiting would create a deadlock. * * In production mode, this always returns null to skip the BFS traversal overhead. * * @param waiterName The name of the holder that wants to wait * @param targetName The name of the holder being waited on * @param getHolder Function to retrieve a holder by name * @returns The cycle path if a cycle is detected, null otherwise */ static detectCycle(waiterName: string, targetName: string, getHolder: (name: string) => InstanceHolder | undefined): string[] | null; /** * Formats a cycle path into a human-readable string. * * @param cycle The cycle path (array of service names) * @returns Formatted string like "ServiceA -> ServiceB -> ServiceA" */ static formatCycle(cycle: string[]): string; } //#endregion //#region src/internal/stub-factory-class.d.mts /** * Stub factory class used when registering InjectionTokens without a real class implementation. * This is used in ScopedContainer.addInstance() to allow registering tokens that don't have * a corresponding class, while preventing accidental instantiation. * * @internal */ declare class StubFactoryClass { constructor(); } //#endregion //#region src/symbols/injectable-token.d.mts declare const InjectableTokenMeta: unique symbol; //#endregion //#region src/event-emitter.d.mts type EventsConfig = { [event: string]: any[]; }; type EventsNames = Exclude; type EventsArgs> = Events[Name] extends any[] ? Events[Name] : []; declare class EventEmitter { private listeners; on, Args extends EventsArgs>(event: E, listener: (...args: Args) => void | Promise): () => void; off, Args extends EventsArgs>(event: E, listener: (...args: Args) => void | Promise): void; once, Args extends EventsArgs>(event: E, listener: (...args: Args) => void | Promise): () => void; emit, Args extends EventsArgs>(event: E, ...args: Args): Promise; } //#endregion export { AnyInjectableType, BaseInjectionTokenSchemaType, BoundInjectionToken, CircularDetector, ClassType, ClassTypeWithArgument, ClassTypeWithInstance, ClassTypeWithInstanceAndArgument, ClassTypeWithInstanceAndOptionalArgument, ClassTypeWithOptionalArgument, ClassTypeWithoutArguments, ClearAllOptions, Container, DIError, DIErrorCode, EventEmitter, EventsArgs, EventsConfig, EventsNames, Factorable, FactorableWithArgs, Factory, FactoryContext, FactoryInjectionToken, FactoryOptions, FactoryRecord, HolderGetResult, type IAsyncLocalStorage, IContainer, IHolderStorage, InjectRequest, InjectState, Injectable, InjectableOptions, InjectableScope, InjectableTokenMeta, InjectableType, InjectionToken, InjectionTokenSchemaType, InjectionTokenType, Injectors, InstanceDestroyListener, InstanceHolder, InstanceHolderCreated, InstanceHolderCreating, InstanceHolderDestroying, InstanceHolderError, InstanceResolver, InstanceStatus, InvalidationOptions, IsUnion, Join, LifecycleEventBus, NameResolver, OnServiceDestroy, OnServiceInit, OptionalInjectionTokenSchemaType, PopUnion, Registry, ResolutionContextData, ScopeTracker, ScopedContainer, ServiceInitializationContext, ServiceInitializer, ServiceInvalidator, StubFactoryClass, TokenResolver, UnifiedStorage, UnionToArray, UnionToIntersection, UnionToOvlds, asyncInject, createAsyncLocalStorage, defaultInjectors, getCurrentResolutionContext, getInjectableToken, getInjectors, globalRegistry, inject, isUsingNativeAsyncLocalStorage, optional, provideFactoryContext, withResolutionContext, withoutResolutionContext, wrapSyncInit }; //# sourceMappingURL=index.d.cts.map