import type { LiteralNode, RefsStore } from '@vinejs/compiler/types'; import type { FieldOptions, ParserOptions, ConstructableSchema, WithJSONSchema } from '../../types.js'; import { OTYPE, COTYPE, PARSE, ITYPE, SUBTYPE, UNIQUE_NAME, IS_OF_TYPE } from '../../symbols.js'; import { type JSONSchema7 } from 'json-schema'; /** * VineNull represents a schema type that only accepts null values. * Typically used inside union types to explicitly allow null as a valid value. * * @example * const schema = vine.union([ * vine.string(), * vine.null() * ]) * * const result = await vine.validate({ * schema, * data: null * }) */ export declare class VineNull implements ConstructableSchema, WithJSONSchema { /** * The input type of the schema (type-only property) */ [ITYPE]: null; /** * The output type of the schema (type-only property) */ [OTYPE]: null; /** * The camelCase output type of the schema (type-only property) */ [COTYPE]: null; /** * The subtype identifier for the literal schema field */ [SUBTYPE]: string; /** * Unique name identifier for union type resolution */ [UNIQUE_NAME]: string; /** * Type checker function to determine if a value is null. * Required for "unionOfTypes" functionality. * * @param value - The value to check * @returns True if the value is null */ [IS_OF_TYPE]: (value: unknown) => value is null; /** * Field configuration options */ protected options: FieldOptions; /** * Creates a new VineNull instance with optional configuration. * * @param options - Field options like bail mode (defaults allow null) */ constructor(options?: Partial); /** * Creates a shallow clone of the field options. */ protected cloneOptions(): FieldOptions; /** * Clones the VineNull schema type. The applied options * are copied to the new instance. * * @returns A cloned instance of this VineNull schema */ clone(): this; /** * Converts the schema to JSON Schema format. * Returns a schema with type 'null'. */ toJSONSchema(): JSONSchema7; /** * Compiles the schema type to a compiler node for validation. * * @param propertyName - The name of the property being validated * @param refs - Reference store for tracking parsers and validators * @param options - Parser options including camelCase conversion */ [PARSE](propertyName: string, refs: RefsStore, options: ParserOptions): LiteralNode & { subtype: string; }; }