UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

18 lines (17 loc) 658 B
import type { SchemaOptions } from "./Schema.js"; import { Schema } from "./Schema.js"; /** Allowed options for `BooleanSchema` */ export interface BooleanSchemaOptions extends SchemaOptions { readonly value?: boolean | undefined; readonly required?: boolean | undefined; } /** Define a valid boolean. */ export declare class BooleanSchema extends Schema<boolean> { readonly value: boolean; readonly required: boolean; constructor({ value, required, ...options }: BooleanSchemaOptions); validate(unsafeValue?: unknown): boolean; format(value: boolean): string; } /** Valid boolean. */ export declare const BOOLEAN: BooleanSchema;