/** The abstraction that oak uses when dealing with requests and responses * within the Bun runtime that leverages the built in HTTP server. * * @module */ import * as dntShim from "./_dnt.shims.js"; import { type Application } from "./application.js"; import type { Listener, OakServer, ServeOptions, ServerRequest, ServeTlsOptions } from "./types.js"; interface BunServer { development: boolean; hostname: string; port: number; pendingRequests: number; requestIP(req: dntShim.Request): SocketAddress | null; stop(): void; upgrade(req: dntShim.Request, options?: { headers?: dntShim.HeadersInit; data?: any; }): boolean; } interface SocketAddress { address: string; port: number; family: "IPv4" | "IPv6"; } declare class BunRequest implements ServerRequest { #private; get body(): ReadableStream | null; get headers(): dntShim.Headers; get method(): string; get remoteAddr(): string | undefined; get request(): dntShim.Request; get response(): Promise; get url(): string; get rawUrl(): string; constructor(request: dntShim.Request, server: BunServer); error(reason?: any): void; getBody(): ReadableStream | null; respond(response: dntShim.Response): void | Promise; } /** An implementation of the oak server abstraction for handling requests on * Bun using the built in Bun http server. */ export declare class Server implements OakServer { #private; constructor(_app: Application, options: Omit); close(): void | Promise; listen(): Listener | Promise; [Symbol.asyncIterator](): AsyncIterableIterator; static type: "bun"; } export {};