import type { Server as NodeServer } from 'node:http'; import type { SecureContextOptions } from 'node:tls'; import type { Express, Request, Response, RequestHandler, Application, Router } from 'express'; import type { Trace } from './trace/trace.node.js'; import express from 'express'; export type { Express, Request, Response, RequestHandler, Application, Router }; /** * Represents an internal error with additional properties. */ export type InternalError = Error & { [key: string]: any; }; /** * Represents options for server initialization. */ export type Options = { name: string; version: string; port: number; certificat?: SecureContextOptions; serviceDependencies?: string[]; devMode?: boolean; logger?: Trace; }; /** * Creates an Express application instance. */ export declare const createApp: typeof express; /** * Represents a server. */ export declare class Server { options: Options; server: NodeServer; app: Express; /** * A collection of request body parsers. */ static readonly parser: { /** * Parse incoming requests with JSON payloads and is based on body-parser */ json: (options?: import("body-parser").OptionsJson) => import("connect").NextHandleFunction; /** * Parse incoming requests with Buffer payloads and is based on body-parser */ raw: (options?: import("body-parser").Options) => import("connect").NextHandleFunction; /** * Parse incoming requests with text payloads and is based on body-parser */ text: (options?: import("body-parser").OptionsText) => import("connect").NextHandleFunction; /** * Parse incoming requests with urlencoded payloads and is based on body-parser */ urlencoded: (options?: import("body-parser").OptionsUrlencoded) => import("connect").NextHandleFunction; }; /** * Creates an Express router instance. * @returns {Router} The Express router. */ static createRouter(): Router; /** * Handles errors and sends appropriate responses. * @param {InternalError} err - The error to handle. * @param {Response} res - The Express response object. * @param {Trace} [logger] - Optional logger instance. */ static handleError(err: InternalError, res: Response, logger?: Trace): void; /** * Constructs a new Server instance. * @param {Options} options - The options for server initialization. */ constructor(options: Options); protected _start(): Promise; protected _prepare(): Promise; /** * Starts the server. * @returns {Promise} A promise that resolves when the server has started. */ start(): Promise; }