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

ContextOf

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

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

Example:

const mw = combine(basics(), contentTypes(['text/html', 'application/json']))
type MWContext = ContextOf<typeof mw>;
const handler = (req: Request, context: MWContext) => ok()
new WorkerRouter().get('/', mw, handler)
type ContextOf<MW extends (...args: any[]) => Awaitable<Context>> = Awaited<ReturnType<MW>>;

§Type Parameters

§
MW extends (...args: any[]) => Awaitable<Context>
[src]

§Type

§
Awaited<ReturnType<MW>>
[src]