Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/valibot/src/index.ts>EnumSchema

The modular and type safe schema library for validating structural data 🤖
Extremely Popular
Latest
interface EnumSchema
implements BaseSchema<TEnum[keyof TEnum], TEnum[keyof TEnum], EnumIssue>
import { type EnumSchema } from "https://deno.land/x/valibot@v1.0.0-beta.2-to-json-schema/src/index.ts";

Enum schema type.

Type Parameters

TEnum extends Enum
TMessage extends ErrorMessage<EnumIssue> | undefined

Properties

readonly
type: "enum"

The schema type.

readonly
reference: enum_

The schema reference.

readonly
enum: TEnum

The enum object.

readonly
options: TEnum[keyof TEnum][]

The enum options.

readonly
message: TMessage

The error message.