import type { OasSchema } from '../schema/Schema.js'; import type { OasRef } from '../ref/Ref.js'; import type { SchemaPath } from '../../types/SchemaPath.js'; /** * Walk an {@link SchemaPath} into a schema, resolving `$ref`s as it descends. * * The shared engine behind `OasOperation.traverse` and every `OasSchema` * variant's `traverse`. A ref — or a `OasSchema | OasRef<'schema'>` union value — * is passed straight to this function, which resolves refs itself, so `OasRef` * needs no `traverse` method of its own. Navigation rules per segment, keyed by * the schema currently under the cursor: * * - **empty path** → returns `value` unchanged (it may still be a ref — the * final value is never force-resolved, so a target's refName survives). * - **object** → the segment is a property name; descends into * `properties[segment]`. * - **array** → the segment must be the literal `'items'`; descends into the * element schema. * - **union** → the segment selects a member ({@link selectUnionMember}): * `'$Circle'` by refName, `'{type:circle}'` by discriminator, `'[0]'` by index. * * A ref is resolved only when the path needs to descend *through* it. Anything * the path cannot navigate throws a descriptive, segment-named error: a missing * property, a {@link import('@/dsl/CustomValue.ts').CustomValue} property, a * non-`'items'` segment on an array, a union member that doesn't match, or * descending into a scalar. * * @throws Error when a segment cannot be navigated. */ export declare const traverseSchema: (value: OasSchema | OasRef<"schema">, path: SchemaPath) => OasSchema | OasRef<"schema">;