import { S as SchemaOrBoolean } from './types-Dzi0PpYX.js'; /** * Known JSON Schema 2020-12 (+ OpenAPI) positions that hold a single * subschema. Used by any tree-walker that needs to descend only through * schema-valued fields, not arbitrary user data in `enum` / `const` / * `default` / `examples`. * * @internal */ declare const SUBSCHEMA_SINGLE_POSITIONS: readonly ["additionalProperties", "propertyNames", "contains", "not", "if", "then", "else", "items", "unevaluatedProperties", "unevaluatedItems"]; /** * Known JSON Schema 2020-12 positions that hold an array of subschemas. * * @internal */ declare const SUBSCHEMA_ARRAY_POSITIONS: readonly ["allOf", "anyOf", "oneOf", "prefixItems"]; /** * Known JSON Schema 2020-12 positions that hold a `string -> subschema` * map. Callers that treat `properties` specially (e.g. validator's * direction transform) should filter it out themselves; it's included * here so generic walkers see the complete set of schema positions. * * @internal */ declare const SUBSCHEMA_MAP_POSITIONS: readonly ["properties", "patternProperties", "dependentSchemas", "$defs", "definitions"]; /** * Visitor callback shape for {@link walkSubschemas}. Receives each * visited subschema plus the dotted-path string leading to it (relative * to the walk root; empty string for the root itself). Returning * `false` from the visitor prunes the subtree; any other value (or * `void`) continues the walk. * * @public */ type SubschemaVisitor = (schema: SchemaOrBoolean, path: string) => void | boolean; /** * Walk every subschema reachable from `root`, in pre-order, descending * through every schema-valued key the JSON Schema 2020-12 vocabulary * (plus the keys OpenAPI adds on top) declares. Boolean schemas and * `$ref` nodes are visited but not descended. * * Intended for tooling (linters, introspection, tree rewriters) that * would otherwise re-derive the set of schema-valued keys and risk * drifting from the vocabulary. Callers that need to *rewrite* schemas * in place can instead reach for the underlying * `SUBSCHEMA_*_POSITIONS` constants exported from * `oav/schema/internals`. * * @public */ declare function walkSubschemas(root: SchemaOrBoolean, visit: SubschemaVisitor): void; export { SUBSCHEMA_ARRAY_POSITIONS as S, SUBSCHEMA_MAP_POSITIONS as a, SUBSCHEMA_SINGLE_POSITIONS as b, type SubschemaVisitor as c, walkSubschemas as w };