import type { Schema, Infer } from '../base.ts'; import { SCHEMA_KIND } from '../base.ts'; type InferUnion[]> = Infer; /** * Schema for union types (one of multiple possible schemas). * Validates against each schema until one succeeds. * * @template T - Array of schema types * * @example * ```typescript * const idSchema = s.union(s.string(), s.number()); * idSchema.parse('abc123'); // 'abc123' * idSchema.parse(123); // 123 * * const roleSchema = s.union( * s.literal('admin'), * s.literal('user'), * s.literal('guest') * ); * ``` */ export declare class UnionSchema[]> implements Schema, InferUnion> { private schemas; readonly [SCHEMA_KIND] = "UnionSchema"; description?: string; private parseMethods; constructor(schemas: T); readonly '~standard': { version: 1; vendor: string; validate: (value: unknown) => any; types: { input: InferUnion; output: InferUnion; }; }; describe(description: string): this; optional(): import("../index.ts").OptionalSchema; nullable(): import("../index.ts").NullableSchema; parse: (this: Schema>, value: unknown) => InferUnion; safeParse: (this: Schema>, value: unknown) => import("../base.ts").SafeParseResult>; } /** * Create a union schema (one of multiple possible types). * * @param schemas - Variable number of schemas to union * * @example * ```typescript * const idSchema = s.union(s.string(), s.number()); * * const roleSchema = s.union( * s.literal('admin'), * s.literal('user'), * s.literal('guest') * ); * ``` */ export declare function union[]>(...schemas: T): UnionSchema; export {}; //# sourceMappingURL=union.d.ts.map