UNPKG

@codethread/tstl-validate

Version:

Fork and adaptation of valibot for use in typescript-to-lua

19 lines (18 loc) 557 B
/** @noSelfInFile */ import type { BaseSchema } from "../../types"; /** * Literal schema type. */ export type LiteralSchema<TLiteralValue extends string | number, TOutput = TLiteralValue> = BaseSchema<TLiteralValue, TOutput> & { schema: "literal"; literal: TLiteralValue; }; /** * Creates a literal schema. * * @param literal The literal value. * @param error The error message. * * @returns A literal schema. */ export declare function literal<TLiteral extends string | number>(literal: TLiteral, error?: string): LiteralSchema<TLiteral>;