import type { ReadStream } from 'node:fs' import type { IncomingMessage, ServerResponse, RequestListener, } from 'node:http' export type Config = { root?: string port?: number static?: string | string[] analytics?: boolean admin?: { login: string password: string } plugins?: RequestListener[] routes?: Route[] } export type Route = { method?: string route: string handler: RouteHandler | string } export type RoutesOfMethod = Map export type Routes = Map export type RouteHandlerOptions = { route: Record query: Record error: { statusCode: number message: string } | null } export type RouteHandler = ( req: IncomingMessage, res: ServerResponse, options?: RouteHandlerOptions ) => any export type cmsConfig = { contentRoot?: string sweynRoot?: string username: string password: string }