import { Type, TypeUnion } from '../reflection/type.js'; /** * Threshold for optimizing unions with literal members. * When a union has this many or more literal members, we use Set.has() * instead of generating individual if-else statements. */ export declare const UNION_LITERAL_THRESHOLD = 5; /** * Information about a discriminator property in a union. * A discriminator is a property with distinct literal values for each member, * allowing O(1) lookup to determine which union member to use. */ export interface DiscriminatorInfo { property: string; valueToMember: Map; } /** * Detect if a union has a discriminator property. * A discriminator is a property with distinct literal values for each member. * * This allows for O(1) union member lookup instead of trying each member in sequence. * * @param type The union type to analyze * @returns DiscriminatorInfo if a discriminator property is found, undefined otherwise */ export declare function detectDiscriminator(type: TypeUnion): DiscriminatorInfo | undefined; /** * Check if all members of a union are literals. * * @param type The union type to check * @returns true if all union members are literal types */ export declare function isAllLiterals(type: TypeUnion): boolean; /** * Check if a type is primitive for union handling purposes. * This includes symbol unlike the base isPrimitive from reflection/type.js. * Primitive types include: string, number, boolean, bigint, null, undefined, literal, symbol. * * @param type The type to check * @returns true if the type is a primitive type (including symbol) */ export declare function isUnionPrimitive(type: Type): boolean; /** * Check if a type is object-like. * Object-like types include: objectLiteral, class, array, tuple. * * @param type The type to check * @returns true if the type is an object-like type */ export declare function isObjectLike(type: Type): boolean; export declare type __ΩDiscriminatorInfo = any[];