import { BaseLiteralType } from '../base/literal.js'; import type { EnumLike, FieldOptions, Validation } from '../../types.js'; import { SUBTYPE } from '../../symbols.js'; /** * VineNativeEnum represents an enum data type that performs validation * against a pre-defined choices list. * * The choices list is derived from TypeScript enum data type or an * object with string or number values. This allows you to validate * against native TypeScript enums. * * @template Values - The enum-like type containing allowed values * * @example * enum Status { * Active = 'active', * Inactive = 'inactive' * } * * const schema = vine.nativeEnum(Status) * * @example * const Colors = { * RED: 'red', * BLUE: 'blue', * GREEN: 'green' * } as const * * const schema = vine.nativeEnum(Colors) */ export declare class VineNativeEnum extends BaseLiteralType { #private; /** * Static collection of all available validation rules for native enums */ static rules: { enum: (options: { choices: readonly any[] | ((field: import("@vinejs/compiler/types").FieldContext) => readonly any[]); }) => Validation<{ choices: readonly any[] | ((field: import("@vinejs/compiler/types").FieldContext) => readonly any[]); }>; }; /** * The subtype identifier for the literal schema field */ [SUBTYPE]: string; /** * Creates a new VineNativeEnum instance with the specified enum values. * * @param values - The enum or enum-like object containing allowed values * @param options - Field options like bail mode and nullability * @param validations - Initial set of validations to apply */ constructor(values: Values, options?: FieldOptions, validations?: Validation[]); /** * Clones the VineNativeEnum schema type. The applied options * and validations are copied to the new instance. * * @returns A cloned instance of this VineNativeEnum schema */ clone(): this; }