import { VineUnion } from './main.js'; import { UnionConditional } from './conditional.js'; import type { FieldContext, SchemaTypes } from '../../types.js'; /** * Create a new union schema type. A union is a collection of conditionals * and schema associated with it. * * Unions evaluate conditionals in order and apply the first matching schema. * Use `union.if()` to define conditional branches and `union.else()` for * the default fallback. * * @template Conditional - The union conditional type * @param conditionals - Array of conditional branches to evaluate * * @example * const schema = vine.union([ * vine.union.if( * (value) => typeof value === 'string', * vine.string() * ), * vine.union.if( * (value) => typeof value === 'number', * vine.number() * ) * ]) */ export declare function union>(conditionals: Conditional[]): VineUnion; export declare namespace union { var _a: (conditon: (value: Record, field: FieldContext) => any, schema: Schema) => UnionConditional; var _b: (schema: Schema) => UnionConditional; export { _a as if, _b as else }; }