Skip to main content
Module

x/shed/index.ts

All Worker Tools under a single roof
Latest
import * as shed from "https://deno.land/x/shed@v0.1.0-pre.10/index.ts";

Classes

c
AbstractHTML
abstract

If for any reason you don't want to use streaming response bodies, you can use this class instead, which will buffer the entire body before releasing it to the network. Note that headers will still be sent immediately.

If for any reason you don't want to use streaming response bodies, you can use this class instead, which will buffer the entire body before releasing it to the network. Note that headers will still be sent immediately.

If for any reason you don't want to use streaming response bodies, you can use this class instead, which will buffer the entire body before releasing it to the network. Note that headers will still be sent immediately.

Encrypted Cookie Store

A partial implementation of the Cookie Store API that transparently encrypts and decrypts cookies via AES-GCM.

TBD

c
JSONParseNexus
deprecated

Like URL, but accepts a params argument that is added to the search parameters/query string.

An implementation of the Cookie Store API for request handlers.

Like URL, but accepts a params argument that is added to the search parameters/query string.

Like URL, but accepts a params argument that is added to the search parameters/query string.

Signed Cookie Store

A partial implementation of the Cookie Store API that transparently signs and verifies cookies via the Web Cryptography API.

Variables

A CORS middleware that gives clients exactly the permissions they ask for, unless constrained by the definitions in options.

Standard MIME type for binary data

A CORS middleware that gives clients exactly the permissions they ask for, unless constrained by the definitions in options.

A CORS middleware that only grants the permissions defined via options.

v
urlWithParams
deprecated

Non-standard MIME type for binary data. Sometimes used, so included anyway.

Functions

Determines if a request body content type is acceptable to this endpoint.

Determines if a request body content encoding is acceptable to this endpoint.

Determines if a request body content language is acceptable to this endpoint.

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)

Performs content negotiation over the content encoding of the response.

Performs content negotiation over the content language of the response.

Performs content negotiation over the content type of the response.

Cookie session middleware for worker runtimes.

A helper function to create user-defined middleware.

f
executeEffects
deprecated

Performs content negotiation over the content type of the response.

Performs content negotiation over the content encoding of the response.

Performs content negotiation over the content language of the response.

Session middleware for worker runtimes.

f
withMiddleware
deprecated

Takes a handler function of the form (x: Request, ctx: Context) => Awaitable<Response> and applies middleware to it.

Interfaces

A verbatim TypeScript translation of the interfaces defined in the WICG Cookie Store API working draft.

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.

Type Aliases

The Cache-Control HTTP header field holds directives (instructions) — in both requests and responses — that control caching in browsers and shared caches (e.g. Proxies, CDNs).

Helper type to get the context type of a given middleware function.

An object of the cookies sent with this request. It is for reading convenience only. To make changes, use the associated cookie store instead (provided by the middleware along with this object)

T
ErrorContext
deprecated

Any record of unknown values