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

providesEncodings

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

Performs content negotiation over the content encoding of the response.

function providesEncodings<T extends string, TS extends readonly T[]>(encodings: TS): <X extends Context>(ax: Awaitable<X>) => Promise<X & ContentEncoding<TS[number]>>;
§
providesEncodings<T extends string, TS extends readonly T[]>(encodings: TS): <X extends Context>(ax: Awaitable<X>) => Promise<X & ContentEncoding<TS[number]>>
[src]

§Type Parameters

§
T extends string
[src]
§
TS extends readonly T[]
[src]

§Parameters

§
encodings: TS
[src]

The encodings provided by this endpoint.

§Return Type

§
<X extends Context>(ax: Awaitable<X>) => Promise<X & ContentEncoding<TS[number]>>
[src]