Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

FetchEvent

import type { FetchEvent } from "https://raw.githubusercontent.com/worker-tools/middleware/master/index.ts";

This is the event type for fetch events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the event.respondWith() method, which allows us to provide a response to this fetch.

interface FetchEvent extends ExtendableEvent {
readonly clientId: string;
readonly handled: Promise<void>;
readonly preloadResponse: Promise<any>;
readonly replacesClientId: string;
readonly request: Request;
readonly resultingClientId: string;
respondWith(r: Response | Promise<Response>): void;
}

§Extends

§Properties

§
readonly clientId: string
[src]
§
readonly handled: Promise<void>
[src]
§
readonly preloadResponse: Promise<any>
[src]
§
readonly replacesClientId: string
[src]
§
readonly request: Request
[src]
§
readonly resultingClientId: string
[src]

§Methods

§
respondWith(r: Response | Promise<Response>): void
[src]