import * as workersMiddleware from "https://email@example.com/context.ts";
Type-enforcing left-to-right function composition function. The first parameter can be a function of any arity, but the remaining parameters must be unary functions. The return type of one function must be compatible with the argument of next function in the argument list (i.e. types flow from left-to-right)
A helper function to create user-defined middleware.
Takes a handler function of the form
Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.
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.