/** * `@nwire/container/awilix` — Awilix-backed implementation of the * `Container` contract from the top-level `@nwire/container` * entry. Scope hierarchy, lazy proxy cradle, lifetimes * (singleton/transient/scoped), classes via asClass, disposers, * factory-with-deps. Source-location capture wraps `register()` so * Studio's `.nwire/di.json` surfaces "where was this binding made?". * * Import this entry only when you need a real container; consumers * that only need the type contract stay on `@nwire/container`. */ import { type AwilixContainer } from "awilix"; import type { BindingEntry, Container, HealthResult, RegisterOptions } from "./index.js"; export type { BindingEntry, Container, HealthResult, RegisterOptions }; /** * `AwilixBackedContainer` — narrowed `Container` that * pins `raw` to the awilix container type so test code reaching through * the escape hatch keeps its types. */ export interface AwilixBackedContainer extends Container { readonly raw: AwilixContainer; } /** * Build a container — generic over `TCradle`. The returned value * satisfies the `Container` interface and is backed by Awilix * (PROXY-mode cradle, scope hierarchy, lifetimes, classes, disposers). * * type AppCradle = { logger: Logger; pg: PgClient }; * const root = createContainer(); * root.register("logger", () => makeLogger(), { dispose: l => l.flush() }); * root.cradle.logger.log("…"); */ export declare function createContainer(): AwilixBackedContainer;