Skip to content

@pcvl/schema / InferOutput

Type Alias: InferOutput<TSchema> ​

ts
type InferOutput<TSchema> = StandardSchemaV1.InferOutput<TSchema>;

Defined in: types.ts:36

The type a successful .validate() hands back.

Type Parameters ​

TSchema ​

TSchema extends StandardSchemaV1

Example ​

ts
import { pvl, type InferOutput } from '@pcvl/schema';

const user = pvl.object({ name: pvl.string(), nickname: pvl.string().optional() });
type User = InferOutput<typeof user>; // { name: string; nickname?: string | undefined }