// @ts-nocheck import type { HTTPMethod } from "../../types"; import { BaseRequest } from "../request"; import { BaseResponse } from "../response"; import { SessionContainerInterface } from "../../recipe/session/types"; type RequestInfo = { url: string; method: HTTPMethod; headers: Headers; cookies: Record; query: Record; getJSONBody: () => Promise; getFormBody: () => Promise; setSession?: (session: SessionContainerInterface) => void; }; export declare class PreParsedRequest extends BaseRequest { private request; private _session?; get session(): SessionContainerInterface | undefined; set session(value: SessionContainerInterface | undefined); constructor(request: RequestInfo); protected getJSONFromRequestBody: () => Promise; protected getFormDataFromRequestBody: () => Promise; getKeyValueFromQuery: (key: string) => string | undefined; getMethod: () => HTTPMethod; getCookieValue: (key: string) => string | undefined; getHeaderValue: (key: string) => string | undefined; getOriginalURL: () => string; } export type CookieInfo = { key: string; value: string; domain: string | undefined; secure: boolean; httpOnly: boolean; expires: number; path: string; sameSite: "strict" | "lax" | "none"; }; export declare class CollectingResponse extends BaseResponse { statusCode: number; readonly headers: Headers; readonly cookies: CookieInfo[]; body?: string; private responseSet; constructor(); sendHTMLResponse: (html: string) => void; setHeader: (key: string, value: string, allowDuplicateKey: boolean) => void; removeHeader: (key: string) => void; setCookie: (key: string, value: string, domain: string | undefined, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none") => void; /** * @param {number} statusCode */ setStatusCode: (statusCode: number) => void; sendJSONResponse: (content: any) => void; } export type NextFunction = (err?: any) => void; export declare const middleware: (wrapRequest?: (req: OrigReqType) => BaseRequest, wrapResponse?: (req: OrigRespType) => BaseResponse) => (request: OrigReqType, response: OrigRespType, next?: NextFunction) => Promise<{ handled: boolean; error?: undefined; } | { error: any; handled?: undefined; }>; export declare const errorHandler: () => (err: any, request: BaseRequest, response: BaseResponse, next: NextFunction) => Promise; export declare const CustomFrameworkWrapper: { middleware: (wrapRequest?: (req: OrigReqType) => BaseRequest, wrapResponse?: (req: OrigRespType) => BaseResponse) => (request: OrigReqType, response: OrigRespType, next?: NextFunction) => Promise<{ handled: boolean; error?: undefined; } | { error: any; handled?: undefined; }>; errorHandler: () => (err: any, request: BaseRequest, response: BaseResponse, next: NextFunction) => Promise; }; export {};