Skip to main content
Module

x/valita/mod.ts>Infer

A typesafe validation & parsing library for TypeScript.
Go to Latest
type alias Infer
import { type Infer } from "https://deno.land/x/valita@v0.3.6/mod.ts";

Return the inferred output type of a validator.

Examples

Example 1

const t = v.union(v.literal(1), v.string());

type T = v.Infer<typeof t>;
// type T = 1 | string;

Type Parameters

T extends AbstractType
definition: T extends AbstractType<infer I> ? I : never