Skip to main content
Module

x/cav/dom.ts>Unpack

A server framework for Deno
Go to Latest
type alias Unpack
import { type Unpack } from "https://deno.land/x/cav@0.2.3/dom.ts";

Calculates the type returned when unpacking a PackedResponse.

definition: (R extends (PackedResponse<infer B, infer CT, infer CD> | PackedRequest<infer B, infer CT, infer CD>) ? (B extends (
| ArrayBuffer
| ArrayBufferView
| string
) ? (CD extends `attachment; filename=${string}` ? File : CD extends `attachment${string}` ? Blob : CT extends `text/plain${string}` ? string : CT extends `application/x-www-form-urlencoded${string}` ? (Record<string, string | string[]>) : CT extends `multipart/form-data${string}` ? (Record<string, string | File | (string | File)[]>) : CT extends `application/json${string}` ? unknown : string extends CT ? unknown : CT extends string ? Blob : B extends string ? string : unknown) : B extends URLSearchParams ? (Record<string, string | string[]>) : B extends FormData ? (Record<string, string | File | (string | File)[]>) : B) : unknown)