UNPKG

@shopify/hydrogen

Version:
62 lines (57 loc) 1.93 kB
import { IncomingMessage, ServerResponse } from 'node:http'; type WaitUntil = (promise: Promise<unknown>) => void; declare global { interface Window { privacyBanner: PrivacyBanner; Shopify: { customerPrivacy: CustomerPrivacy; }; } interface Document { addEventListener<K extends keyof CustomEventMap>( type: K, listener: (this: Document, ev: CustomEventMap[K]) => void, ): void; removeEventListener<K extends keyof CustomEventMap>( type: K, listener: (this: Document, ev: CustomEventMap[K]) => void, ): void; dispatchEvent<K extends keyof CustomEventMap>(ev: CustomEventMap[K]): void; } var __H2O_LOG_EVENT: undefined | ((event: RequestEventPayload) => void); var __remix_devServerHooks: | undefined | {getCriticalCss: (...args: unknown[]) => any}; } type RequestEventPayload = { __fromVite?: boolean; url: string; eventType: 'request' | 'subrequest'; requestId?: string | null; purpose?: string | null; startTime: number; endTime?: number; cacheStatus?: 'MISS' | 'HIT' | 'STALE' | 'PUT'; waitUntil?: WaitUntil; graphql?: string | null; stackInfo?: { file?: string; func?: string; line?: number; column?: number; }; responsePayload?: any; responseInit?: Omit<ResponseInit, 'headers'> & { headers?: [string, string][]; }; cache?: { status?: string; strategy?: string; key?: string | readonly unknown[]; }; displayName?: string; }; declare function emitRequestEvent(payload: RequestEventPayload, root: string): void; declare function clearHistory(req: IncomingMessage, res: ServerResponse<IncomingMessage>): void; declare function streamRequestEvents(req: IncomingMessage, res: ServerResponse<IncomingMessage>): void; export { type RequestEventPayload, clearHistory, emitRequestEvent, streamRequestEvents };