import { type Factory, type ResolvedDependencies } from './types.js'; export declare const FOREIGN_OWN_PROPERTY = "the container already has an own property with this name that is not a dependency"; /** * A dependency is an own getter on the container, so a container that has been frozen, sealed or * passed to `Object.preventExtensions` can take no new names. V8 says `Cannot define property x, * object is not extensible`, which names neither the container nor the cause; this does. `merge` * runs it in its validation pass for every incoming name that would need a new getter, so a * non-extensible receiver is refused before any existing name is replaced — otherwise the write * pass installed the replacements and then died on the first new getter. */ export declare function assertExtensible(container: object, name: string): void; /** * The platform meaning of `freeze` is that existing values cannot be written; for a container * that is a resolver being replaced. `seal` and `preventExtensions` only forbid new names, which * `assertExtensible` covers. Resolution is never refused: it writes into the cache inside the * state object, which no lock reaches. */ export declare function assertNotFrozen(container: object, name: string): void; /** * The types already reject a non-function resolver; this is for JavaScript consumers and `any` * casts, who otherwise found out at first `get` — `TypeError: resolver is not a function`, far from * the registration and naming no dependency — or, for `null`, got a `DependencyIsMissingError` for * a name they had registered. Registration-time only, so the resolve path pays nothing. `merge` * runs it too, since a duck-typed input bypasses `add`. */ export declare function assertResolver(name: string, resolver: unknown): asserts resolver is Factory; /** What `merge` says it was handed when the argument is not a container. */ export declare function describeValue(value: unknown): string; /** * Structural, not `instanceof`: a container from another copy of rsdi is still a container, and the * registry symbol is what makes that true. It asks for exactly the two maps `ForeignContainerState` * names, and must never ask for more — a container from another version may lack whatever this one * added later. * * `boolean`, not a `value is DIContainer<…>` type guard, on purpose. The guard read better, and * cost 2,097 type instantiations in every `bench-types` scenario — narrowing the argument makes the * compiler relate the whole class type inside `merge`, and on the smallest scenario that was 11% of * the budget. `merge` already casts, so the narrowing bought nothing. */ export declare function isContainer(value: unknown): boolean; /** * Whether a consumer has frozen the container itself. Freezing is shallow: it makes the state * symbol's property non-writable and non-configurable but leaves the state object behind it * mutable, which is why resolution keeps working on a frozen container and why `update` used to. * `Object.freeze` is the only one of the three locks that turns `writable` off — `seal` and * `preventExtensions` leave it on — so one descriptor read on that single key tells them apart. * Not `Object.isFrozen`, which walks every own property and would make each `update` linear in * the number of dependencies. */ export declare function isFrozenContainer(container: object): boolean; /** A non-null object — `typeof null` is `'object'`, which is the whole reason this exists. */ export declare function isObjectLike(value: unknown): value is object; /** A property key as it should read in a message: symbols by their description. */ export declare function keyName(property: string | symbol): string; /** * A built-in `TypeError` rather than an exported class, as for writing to a frozen object: this is * a bug in a factory, not a runtime condition a consumer catches. The types do not say `Readonly`; * `Factory` in types.ts explains what that measured. * @param action what was attempted, in the imperative — `write scratch`, `change its prototype` * @param resolving the factories in flight, so the message names the one that did it */ export declare function readOnlyContext(action: string, resolving: ReadonlySet): TypeError;