import 'reflect-metadata'; import type { ClassType, ApplicationOptions, Token, ApplicationContext } from '@nl-framework/core'; import type { MiddlewareHandler, HttpMethod, RequestContext } from './interfaces/http'; import type { HttpVersioningOptions } from './versioning/options'; import { type CorsOptions } from './middleware/cors'; import { type SecurityOptions } from './middleware/security'; import { type ServeStaticOptions } from './static/serve-static'; export interface HttpServerOptions { host?: string; port?: number; middleware?: MiddlewareHandler[]; versioning?: HttpVersioningOptions; /** Enable CORS (`true` = allow any origin) or configure it. */ cors?: boolean | CorsOptions; /** Enable security response headers (`true` = helmet-core defaults) or configure them. */ security?: boolean | SecurityOptions; /** Serve static files from one or more mounts before routing. */ serveStatic?: ServeStaticOptions | ServeStaticOptions[]; } export interface HttpApplicationOptions extends ApplicationOptions, HttpServerOptions { } export declare class HttpApplication { private readonly context; private readonly options; private readonly ownsContext; private readonly router; private server?; private logger; private customRouteCounter; private readonly routeRegistrarPromise; private readonly unsubscribeModuleListener; private readonly corsOptions?; private readonly securityOptions?; private readonly staticServers; constructor(context: ApplicationContext, options: HttpServerOptions, ownsContext: boolean); private registerControllers; private registerControllerInstances; private registerControllerInstance; use(middleware: MiddlewareHandler): void; registerRouteHandler(method: HttpMethod, path: string, handler: (context: RequestContext) => unknown | Promise, options?: { public?: boolean; }): void; /** * Dispatch a single `Request` through the full routing pipeline and return the * resulting `Response`, without binding a port. This is what `Bun.serve`'s * `fetch` handler calls, and it lets tests (and serverless adapters) drive the * application directly. Route registrars are awaited on first use. */ handle(request: Request): Promise; /** Apply CORS + security response headers to an outgoing response. */ private finalizeResponse; listen(port?: number): Promise>; get(token: Token): Promise; getConfig>(): import("@nl-framework/core").ConfigService; close(): Promise; private initializeRouteRegistrars; } export declare const createHttpApplication: (rootModule: ClassType, options?: HttpApplicationOptions) => Promise; export declare const createHttpApplicationFromContext: (context: ApplicationContext, options?: HttpServerOptions) => HttpApplication; //# sourceMappingURL=http-application.d.ts.map