import type { IncomingMessage, Server, ServerResponse } from "node:http"; import Koa from "koa"; import type { DefaultContext, DefaultState, ParameterizedContext } from "koa"; import type { Router } from "router-segments"; import type { Config } from "./config"; import type { AlpLanguageContext } from "./language"; import type { AlpParamsContext, AlpParamsRequest } from "./params/index"; import type { AlpRouteRef, RouterContext as AlpRouterContext, UrlGenerator } from "./router"; import type { TranslateBaseContext, TranslateContext } from "./translate/index"; import type { Context as AlpContext, ContextState, NodeApplication, NodeConfig } from "./types"; export interface AlpNodeAppOptions { appDirname: string; packageDirname: string; config: Config & NodeConfig; certPath?: string; publicPath?: string; } declare module "koa" { interface DefaultState extends ContextState { } interface DefaultContext extends AlpContext, AlpParamsContext, AlpRouterContext, AlpLanguageContext, TranslateContext { } interface BaseContext extends AlpContext, TranslateBaseContext { urlGenerator: UrlGenerator; redirectTo:

>(to: string, params?: P) => void; } interface BaseRequest extends AlpParamsRequest { } } export declare class AlpNodeApp extends Koa implements NodeApplication { dirname: string; certPath: string; publicPath: string; config: Config & NodeConfig; _server?: Server; router?: Router; /** * @param {Object} [options] * @param {string} [options.certPath] directory of the ssl certificates * @param {string} [options.publicPath] directory of public files */ constructor({ appDirname, packageDirname, config, certPath, publicPath, }: AlpNodeAppOptions); existsConfigSync(name: string): ReturnType; loadConfigSync(name: string): ReturnType; createContext(req: IncomingMessage, res: ServerResponse): ParameterizedContext; servePublic(): void; catchErrors(): void; listen(): never; /** * Close server and emit close event */ close(): void; start(fn: () => Promise | void): Promise; } export type { Context } from "koa"; export { type NodeApplication } from "./types"; //# sourceMappingURL=AlpNodeApp.d.ts.map