UNPKG

@specprotected/spec-proxy-service-worker

Version:

Server Worker API implementation for integrating with Spec Proxy from an Edge Worker

14 lines (13 loc) 898 B
export type PlatformRequest = new (url: RequestInfo, info?: RequestInit, original?: Request, config?: SpecConfiguration) => Request; export interface SpecConfiguration { disableSpecProxy?: boolean; inlineMode?: boolean; percentageOfIPs?: number; customerKey?: string; disableSpecTraffic?: boolean; domainOverride?: string; } export declare function specProxyProcessRequest(event: FetchEvent, config?: SpecConfiguration, requestConstructor?: PlatformRequest): Request; export declare function specProxyProcessResponse(request: Request, response: Response, config?: SpecConfiguration): Response; export declare function specProxyProcess(event: FetchEvent, config: SpecConfiguration, requestConstructor: PlatformRequest): Promise<Response>; export declare function specMakeRequestWithFallback(event: FetchEvent, request: Request, config: SpecConfiguration): Promise<Response>;