Files
klz-cables.com/.pnpm-store/v10/files/fb/292fa9755f2b0c9f060b68b6d9a85eff639b95f72fc7165850e7824e77b129ea52de6d66a7fdf79b8b26a45a86e0a9b4c81aa4427845aaa418217b03bdcef8
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

72 lines
1.8 KiB
Plaintext

/**
* Event-like interface that's usable in browser and node.
*
* Note: Here we mean the kind of events handled by event listeners, not our `Event` type.
*
* Property availability taken from https://developer.mozilla.org/en-US/docs/Web/API/Event#browser_compatibility
*/
export interface PolymorphicEvent {
[key: string]: unknown;
readonly type: string;
readonly target?: unknown;
readonly currentTarget?: unknown;
}
/** A `Request` type compatible with Node, Express, browser, etc., because everything is optional */
export type PolymorphicRequest = BaseRequest & BrowserRequest & NodeRequest & ExpressRequest & KoaRequest & NextjsRequest;
type BaseRequest = {
method?: string;
url?: string;
};
type BrowserRequest = BaseRequest;
type NodeRequest = BaseRequest & {
headers?: {
[key: string]: string | string[] | undefined;
};
protocol?: string;
socket?: {
encrypted?: boolean;
remoteAddress?: string;
};
};
type KoaRequest = NodeRequest & {
host?: string;
hostname?: string;
ip?: string;
originalUrl?: string;
};
type NextjsRequest = NodeRequest & {
cookies?: {
[key: string]: string;
};
query?: {
[key: string]: any;
};
};
type ExpressRequest = NodeRequest & {
baseUrl?: string;
body?: string | {
[key: string]: any;
};
host?: string;
hostname?: string;
ip?: string;
originalUrl?: string;
route?: {
path: string;
stack: [
{
name: string;
}
];
};
query?: {
[key: string]: any;
};
user?: {
[key: string]: any;
};
_reconstructedRoute?: string;
};
export {};
//# sourceMappingURL=polymorphics.d.ts.map