import type { HttpsConfig } from '@ms-cloudpack/common-types'; import { type Express } from 'express'; import type { Server } from 'http'; export interface CreateExpressAppOptions { /** Port(s) to try */ portRange?: number | number[]; /** Throw an error if none of the ports specified in `portRange` are available. */ requireSpecifiedPort?: boolean; /** * Hostname to use for the server. Supports replacement `{ip}` for the current IP address. * @default 'localhost' */ hostname?: string; /** Include these headers with all responses */ requestHeaders?: Record; /** cwd for resolving any relative paths in `sslOptions` */ cwd?: string; /** Options for an HTTPS server. Certificate paths support tokens `{homedir}` and `{tmpdir}`. */ sslOptions?: HttpsConfig | true; /** @deprecated use returned `app` */ setupCallback?: (app: Express, baseUrl: string) => void | Promise; /** Path of any static assets */ publicDir?: string; /** @deprecated Inferred based on presence of `server` */ middlewareMode?: boolean; /** If provided, act as a middleware on this server, rather than starting a new server */ server?: Server; } export interface CreateExpressAppResult { app: Express; /** http or https server */ server: Server; /** Close the server */ close: () => Promise; /** Base URL of the app */ url: string; /** @deprecated use `url` */ baseUrl: string; protocol: 'http' | 'https'; /** Domain (no protocol or port) the app is running on */ domain: string; /** Port the app is running on */ port: number; } /** * Create an Express app with the given options. * * Note: If you update the errors thrown by this function, also update the ones in `handleKnownServerErrors.ts`. */ export declare function createExpressApp(options: CreateExpressAppOptions): Promise; export type { Express }; //# sourceMappingURL=createExpressApp.d.ts.map