Skip to content

@pcvl/schema / EnumSource

Type Alias: EnumSource ​

ts
type EnumSource = EnumObjectSource | EnumArraySource;

Defined in: schemas/enumInterpretedSchema.ts:39

Either source form pvl.enum() accepts. Both produce the same kind of schema; only the shape you hand the factory differs.

Example ​

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

const fromObject: EnumSource = { OWNER: 'OWNER' } as const;
const fromArray: EnumSource = ['OWNER'];

pvl.enum(fromArray);