import { type Provider } from "./providers.ts"; import { type Token } from "./tokens.ts"; import { Container } from "./container.ts"; /** * The providers that are currently being constructed, ordered from the root of a * resolution down to the provider that is being constructed right now. * * A chain belongs to a single resolution and is treated as immutable: every nested * injection receives its own extended copy. This is what keeps concurrent resolutions * isolated. A single mutable stack shared by the whole container would interleave * them, and any provider two overlapping resolutions have in common would be reported * as a circular dependency. * * @internal */ export type ResolutionChain = readonly Provider[]; /** * Asserts that constructing `provider` as the next step of `chain` does not close a * cycle, i.e., that the provider does not (transitively) depend on itself. * * @internal */ export declare function assertNoCycle(chain: ResolutionChain, provider: Provider): void; /** * @internal */ export declare class Factory { private readonly container; constructor(container: Container); construct(provider: Provider, token: Token, chain: ResolutionChain): T[]; constructAsync(provider: Provider, chain: ResolutionChain): Promise; private doConstruct; private enter; }