import 'reflect-metadata'; import { type Express } from 'express'; import { Container, type Factory } from './Container.js'; import type { ServiceProvider } from './ServiceProvider.js'; export type ListenCallback = () => void; /** * HTTP application foundation for Atlex. */ export declare class Application { private readonly expressApp; private readonly providers; private readonly loadedDeferredProviders; /** * The application service container. */ readonly container: Container; constructor(); /** * Get the underlying Express app instance. */ get express(): Express; /** * Register a service provider (register phase only). */ register(provider: ServiceProvider): this; /** * Resolve a controller for HTTP dispatch: container `make()` when `@Injectable()`, otherwise `new`. * * @typeParam T - Controller instance type. * @param ControllerClass - Controller constructor. * @returns Controller instance. */ resolveController(ControllerClass: new (...args: never[]) => T): T; /** * Boot the application (boot all providers, register HTTP context middleware, then bind routes). * * Registers middleware so {@link response}() and {@link request}() work without passing `res`/`req`. * Register body parsers and other global `express.use` **before** `boot()` so they run first. */ boot(): this; /** * Register a transient binding on the container. * * @typeParam TValue - Service type. * @param abstractKey - Abstract name. * @param factory - Factory for new instances. * @returns This application (fluent). */ bind(abstractKey: string, factory: Factory): this; /** * Register a singleton binding on the container. * * @typeParam TValue - Service type. * @param abstractKey - Abstract name. * @param factory - Factory invoked once. * @returns This application (fluent). */ singleton(abstractKey: string, factory: Factory): this; /** * Resolve a string binding from the container. * * @typeParam TValue - Resolved service type. * @param abstractKey - Registered abstract name. * @returns The resolved value. */ make(abstractKey: string): TValue; /** * Resolve an `@Injectable()` class with constructor auto-wiring. * * @typeParam TInstance - Resolved instance type. * @param concrete - Injectable class constructor. * @returns The resolved instance. */ make(concrete: new (...args: never[]) => TInstance): TInstance; /** * Load and register the first deferred provider that advertises the given abstract (idempotent per provider). * * @param abstractKey - Resolved abstract key (after container aliases). */ private loadDeferredProvidersFor; /** * Start listening for HTTP requests. * Set `HOST=0.0.0.0` in Docker (or compose) so published ports accept traffic. */ listen(port: number, callback?: ListenCallback): void; } /** * Global application singleton. */ export declare const app: Application; //# sourceMappingURL=Application.d.ts.map