import { type ConstExpr } from '@skyleague/axioms'; import { NodeTrait } from '../../cst/mixin.js'; import type { Node } from '../../cst/node.js'; import type { Intrinsic } from '../../cst/types.js'; import type { SchemaOptions } from '../base.js'; export type UnionOptions = object; type ToInfer = { [K in keyof Elements]: Elements[K]['infer']; }; type ToInput = { [K in keyof Elements]: Elements[K]['input']; }; type ConstExprTuple = { [K in keyof Elements]: ConstExpr; }; type _TupleElements[]]> = { [K in keyof Elements]: Elements[K] extends Node ? Elements[K] : never; }; export type TupleElements[]]> = _TupleElements<{ [K in keyof Elements]: Elements[K] extends (...args: any[]) => infer R ? R : Elements[K]; }>; export declare class UnionType extends NodeTrait { _type: "union"; _children: Node[]; _isCommutative: boolean; _options: UnionOptions; infer: ToInfer[number]; input: ToInput[number]; intrinsic: Intrinsic; protected _discriminator?: string | undefined; constructor(union: ConstExprTuple, options: SchemaOptions[number]>); get options(): Node[]; } export declare class DiscriminatedUnionType extends UnionType { _discriminator?: string; } /** * Create a new `UnionType` instance with the given options. * * ### Example * ```ts * $union([$integer, $string]) * * $union([$object({foo: $integer}), $object({bar: $string}]) * ``` * * @param union - The items in the union. * @param options - Additional options to pass to the tuple. * * @group Primitives */ export declare function $union[]]>(union: Elements, options?: SchemaOptions>[number]>>): UnionType>; export {};