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.
Infer
Schema
import { Infer, object, string } from "typerun/schema";const schema = object({ name: string });type SchemaType = Infer<typeof schema>; // { name: string } Copy
import { Infer, object, string } from "typerun/schema";const schema = object({ name: string });type SchemaType = Infer<typeof schema>; // { name: string }
The
Infer
type is a utility type to extract the return type of aSchema
. Use it to get the TypeScript type of any defined schema.Example