import { IncomingHttpHeaders, IncomingMessage, OutgoingHttpHeaders, ServerResponse } from "http"; import { Http2ServerRequest, Http2ServerResponse } from "http2"; import { SessionUser } from "./SessionUser.js"; import { SerializeOptions } from "cookie"; import { LocalFile } from "./LocalFile.js"; import { Readable } from "stream"; type UnwrappedRequest = IncomingMessage | Http2ServerRequest; type UnwrappedResponse = ServerResponse | Http2ServerResponse; export interface IFormData { fields: { [key: string]: string; }; files: LocalFile[]; } export interface IWrappedRequest extends Disposable { signal?: AbortSignal; headers?: IncomingHttpHeaders; disposables?: Disposable[]; response?: WrappedResponse; trustProxy?: boolean; /** host name without port */ get hostName(): string; /** host name with port if present */ get host(): string; get path(): string; get sessionUser(): SessionUser; get body(): any; get form(): IFormData; get params(): any; get query(): { [key: string]: string; }; get queryCaseInsensitive(): { [key: string]: string; }; get cookies(): { [key: string]: string; }; get URL(): URL; get remoteIPAddress(): string; accepts(): string[]; accepts(...types: string[]): boolean; get acceptEncodings(): string[]; } export interface IWrappedResponse extends Disposable { request?: WrappedRequest; compress?: boolean; sendReader(status: number, headers: OutgoingHttpHeaders, readable: Readable): Promise; sendRedirect(url: string, status?: number, headers?: OutgoingHttpHeaders): void; cookie(name: string, value: string, options?: SerializeOptions, override?: boolean): any; sendFile(filePath: string, options?: { acceptRanges?: boolean; cacheControl?: string; maxAge?: number; etag?: boolean; immutable?: boolean; headers?: { [key: string]: string | string[] | number; }; lastModified?: boolean; }): Promise; } export type WrappedRequest = IWrappedRequest & UnwrappedRequest; export type WrappedResponse = IWrappedResponse & UnwrappedResponse; export declare const Wrapped: { request: (req: UnwrappedRequest) => WrappedRequest; response: (req: WrappedRequest, res: UnwrappedResponse) => WrappedResponse; }; export {}; //# sourceMappingURL=Wrapped.d.ts.map