import { Readable } from 'node:stream'; /** * Cookie options can that can be set on the response */ export type CookieOptions = { domain: string; expires: Date | (() => Date); httpOnly: boolean; maxAge: number | string; path: string; sameSite: boolean | 'lax' | 'none' | 'strict'; secure: boolean; partitioned?: boolean; priority?: 'low' | 'medium' | 'high'; }; /** * Types from which response header can be casted to a * string */ export type CastableHeader = string | number | boolean | string[] | number[] | boolean[]; /** * Config accepted by response the class */ export type ResponseConfig = { /** * Whether or not to generate etags for responses. Etags can be * enabled/disabled when sending response as well. * * Defaults to false */ etag: boolean; /** * The callback name for the JSONP response. * * Defaults to 'callback' */ jsonpCallbackName: string; /** * Options to set cookies */ cookie: Partial; /** * Configuration for HTTP redirects */ redirect: { /** * Array of allowed hosts for referrer-based redirects. * When empty, only the request's own host is allowed. * * Defaults to [] */ allowedHosts: string[]; /** * Whether to forward the query string from the current request * by default on redirects. * * Defaults to false */ forwardQueryString: boolean; }; }; /** * Stream that can be piped to the "response.stream" method */ export type ResponseStream = Readable;