Type alias Infer<S>

Infer<S>: S extends Schema<infer R>
    ? R
    : never

The Infer type is a utility type to extract the return type of a Schema. Use it to get the TypeScript type of any defined schema.

Example

import { Infer, object, string } from "typerun/schema";

const schema = object({ name: string });
type SchemaType = Infer<typeof schema>; // { name: string }

Type Parameters

  • S