import { InstanceHolder } from "../holder/instance-holder.mjs"; //#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 export { ResolutionContextData, getCurrentResolutionContext, withResolutionContext, withoutResolutionContext }; //# sourceMappingURL=resolution-context.d.mts.map