import { type ResolvedDependencies, type ResolvedValues, type Resolvers } from './types.js'; export declare const INTERNAL_STATE: unique symbol; /** * What `merge` and `compose` may read from *another* container's state — and nothing else. * * `INTERNAL_STATE` is a `Symbol.for` key so that two installed copies of rsdi can compose each * other's containers, and those two copies can be different versions. That makes the shape of the * state object a cross-version contract: the incoming side may have fields this version has never * heard of, and may lack any field this version added after the two maps. `mergeInto` therefore * types the foreign state as this `Pick`, so reading a third field from it is a compile error rather * than a runtime failure in someone's dependency tree — and `isContainer` checks exactly these two. * Adding fields to `InternalState` is safe; renaming or removing `resolvers` or * `resolvedDependencies` is a break with every other version. */ export type ForeignContainerState = Pick, 'resolvedDependencies' | 'resolvers'>; /** * Everything a container owns, kept in one object behind `INTERNAL_STATE` on the class. * `context` is the proxy factories receive; the two maps are null-prototype; `resolving` is the * set of names whose factory is running. Exported because a `protected` member's type has to be * nameable for declaration emit, not because consumers should use it. */ export type InternalState = { readonly context: ContainerResolvers; /** * Bumped on every resolver write — `add`, `update`, `merge`, seeding a clone. `get` reads it * before running a factory and caches the result only if it is unchanged after, so a resolver * replaced mid-flight never has the old factory's value cached under it. A counter rather than * comparing function identity: `update(name, sameFactory)` and a `merge` carrying the same * function object are replacements too, and identity cannot see them. */ registrations: number; readonly resolvedDependencies: ResolvedValues; readonly resolvers: Resolvers; readonly resolving: Set; };