import { IncomingMessage, ServerResponse } from "node:http"; import type { MethodServer, ServerEndpoint, ServerJson, ServerRedirect, ServerText, } from "./server-generic.js"; export function daemon(callback: () => () => void): void; export const endpoint: ServerEndpoint; export const json: ServerJson; export function listen(app: { listen: ( port: number, callback: () => void, ) => { close(): void; on(event: "error", callback: (error: unknown) => void): void; }; }): void; export function production({ html, prerender, }: { html: string; prerender({ lang, url }: { lang: string; url: string }): Promise<{ data: object; head: { elements: Set<{ props: Record; type: string; }>; lang: string; title: string; }; html: string; }>; }): ( req: IncomingMessage, res: ServerResponse, ) => Promise; export const redirect: ServerRedirect; export function route( path: string, controller: MethodServer, ): { controller: MethodServer; path: string; pattern: URLPattern; }; export function router( { pkg, }: { pkg: { name: string; version: string }; }, ...routes: { controller: MethodServer; path: string; pattern: URLPattern; }[] ): { onRequest: ( req: IncomingMessage, res: ServerResponse, next?: () => void, ) => Promise; openapi: { info: { title: string; version: string }; openapi: string; paths: Record< string, Record< string, { parameters: { in: string; name: string; required: boolean; schema: { type: string }; }[]; requestBody?: | undefined | { content: { // eslint-disable-next-line @typescript-eslint/no-explicit-any "application/x-www-form-urlencoded"?: { schema: any }; // eslint-disable-next-line @typescript-eslint/no-explicit-any "multipart/form-data"?: { schema: any }; }; }; responses: Record< string, { content: { // eslint-disable-next-line @typescript-eslint/no-explicit-any "application/json": { schema: any }; }; description: string; } >; } > >; servers: { url: string }[]; }; }; export const text: ServerText;