import { InstanceHolder } from "../holder/instance-holder.mjs"; //#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 export { CircularDetector }; //# sourceMappingURL=circular-detector.d.mts.map