import http from "node:http"; import { FritterContext } from "./FritterContext.js"; import { FritterMiddlewareFunction } from "../types/FritterMiddlewareFunction.js"; /** Options for a Fritter instance. */ export type FritterOptions = { /** The name of the header containing one or more IP addresses of proxies. Optional, defaults to X-Forwarded-For. */ proxyIpHeaderName?: string; /** The amount of segments in the hostname that are considered the base domain. Optional, defaults to 2. */ subdomainOffset?: number; /** Whether to trust the X-Forwarded-For and X-Forwarded-Proto headers. Optional, defaults to false. */ trustProxyHeaders?: boolean; }; /** A web server. */ export declare class Fritter { #private; /** The name of the header containing one or more IP addresses of proxies. */ proxyIpHeaderName: string; /** The amount of segments in the hostname that are considered the base domain. */ subdomainOffset: number; /** Whether to trust the proxy IP header. */ trustProxyHeaders: boolean; /** The middleware stack. */ middlewareStack: FritterMiddlewareFunction[]; /** The underlying Node.js HTTP server. */ server: http.Server; /** Constructs a new Fritter instance. */ constructor(options?: FritterOptions); /** * Starts an HTTP server on the specified port. * * @param port The port to listen on. */ start(port: number): Promise; /** * Stops the HTTP server. */ stop(): Promise; /** * Adds a middleware to the stack. * * @param fritterMiddleware A Fritter middleware function. */ use(fritterMiddleware: FritterMiddlewareFunction): void; } //# sourceMappingURL=Fritter.d.ts.map