@codethread/tstl-validate
Version:
Fork and adaptation of valibot for use in typescript-to-lua
19 lines (18 loc) • 602 B
TypeScript
/** @noSelfInFile */
import type { BaseSchemaAsync } from "../../types";
/**
* Literal schema async type.
*/
export type LiteralSchemaAsync<TLiteralValue extends string | number, TOutput = TLiteralValue> = BaseSchemaAsync<TLiteralValue, TOutput> & {
schema: "literal";
literal: TLiteralValue;
};
/**
* Creates an async literal schema.
*
* @param literal The literal value.
* @param error The error message.
*
* @returns An async literal schema.
*/
export declare function literalAsync<TLiteral extends string | number>(literal: TLiteral, error?: string): LiteralSchemaAsync<TLiteral>;