import type { Ajv } from 'ajv'; import type { JSONSchemaDefinition, SchemaContext } from './schema-context'; /** * Result of oneOf branch detection */ export interface OneOfBranchDetectionResult { /** Index of the matching branch, or -1 if no single match */ matchingBranch: number; /** Array of all branches that validate against the current value */ validBranches: number[]; /** Whether multiple branches match (ambiguous for oneOf) */ isAmbiguous: boolean; /** Whether no branches match */ hasNoMatch: boolean; } /** * Detect which oneOf branch(es) the current value matches. * This works with both inline schemas and $ref schemas by resolving references first. * * @param ctx - Schema context containing oneOf definition * @param value - Current value to test against branches * @param ajv - AJV instance for validation (optional, falls back to heuristics) * @returns Branch detection result */ export declare function detectOneOfBranch(ctx: SchemaContext, value: unknown, ajv?: Ajv): OneOfBranchDetectionResult; /** * Get a human-readable label for a oneOf branch. * Prioritizes title, then discriminator values, then type, then fallback. */ export declare function getOneOfBranchLabel(branch: JSONSchemaDefinition, index: number, fallback?: string): string; /** * Auto-select the best oneOf branch for a given value. * Returns the branch index, or -1 if no clear choice can be made. */ export declare function autoSelectOneOfBranch(ctx: SchemaContext, value: unknown, ajv?: Ajv): number;