/** * api-diff-openapi-schema-read — the schema-node readers behind * `api-diff-openapi.ts`. * * Hoisted verbatim by the wave-5 file-size split * (rid 2026-10-01-wave5-w5-2-slice-scan): the `$ref` / composition primitives a * schema node is read with, the flat-field-set constants, the content and * parameter accessors, and `loadApiDocument` (which the parent re-exports so * `./api-diff-openapi.js` stays the public import path). The analysis that * *judges* a document — `schemaToTypeString`, `collectFields`, * `parseOpenApiDocument`, `splitTopLevel`, `normalizeType` — stays in the * parent, because those carry the file's lint findings. * * The parent <-> sibling import is a deliberate cycle, safe under * `module: NodeNext`: every cross-boundary reference is a hoisted function * declaration read at call time, never at module init (lint-gate.md 4e). */ import { type ParsedDocument } from './api-diff-types.js'; /** * OpenAPI scalar types mapped to their TypeScript spelling. `integer` is NOT a * TypeScript type — an unmapped `integer` produced a false `number -> integer` * exact line against a recorded `id: number`. */ declare const SCALAR_TYPES: Readonly>; declare const COMPOSITION_KEYS: readonly ["allOf", "oneOf", "anyOf"]; declare function refName(ref: string): string; /** Resolves a `$ref` chain. Callers that only need the NAME must not use this — see `schemaToTypeString`. */ declare function deref(schema: unknown, doc: Record, depth: number): Record | null; /** The composition/open-shape construct a schema node carries, if any — those cannot be flattened without a compiler. */ declare function unreadableConstruct(node: Record): string | null; export { COMPOSITION_KEYS, deref, refName, SCALAR_TYPES, unreadableConstruct }; type SchemaRead = { fields: Map; incompleteReason: string | null; }; /** * Flat leaf fields of a body/response schema. Arrays descend one level into * `items`. The ROOT `$ref` is resolved on purpose — a top-level `$ref` response * IS the interface — while nested refs stay named (see `schemaToTypeString`). * * A node carrying `allOf`/`oneOf`/`anyOf` or `additionalProperties` alongside its * own `properties` is INCOMPLETE: the sibling properties made the location look * non-empty, so there was neither suppression nor a note, and a field declared * under `allOf` was reported as an exact `-> (absent)`. */ declare const UNRESOLVED_REF = "its schema is a `$ref` chain deeper than the reader resolves"; declare const NO_PROPERTIES = "its schema lists no `properties`, so no field set could be read from it"; export { NO_PROPERTIES, type SchemaRead, UNRESOLVED_REF }; declare function jsonContent(content: unknown): unknown; declare function schemaOf(media: unknown): unknown; /** * The `parameters` array of an OpenAPI object, or `[]` when absent. * * S10 (2026-09-20): the call sites used to inline * `Array.isArray(x['parameters']) ? x['parameters'] : []`, and because * `Array.isArray` is typed `arg is any[]` the ternary's type was `any[]` — * which then flowed into `collectParameters`. Returning `readonly unknown[]` * stops the `any` at this function boundary without asserting anything about * the elements: `collectParameters` already narrows each entry itself * (`Array.isArray` + `isRecord`), and that is the only place that knows what a * parameter may contain. */ declare function parametersOf(record: Record): readonly unknown[]; declare function collectParameters(parameters: unknown, locations: Map>): void; export { collectParameters, jsonContent, parametersOf, schemaOf }; /** Reads and parses `.json` / `.yaml` / `.yml`. Throws `ApiDiffInputError` on anything else. */ export declare function loadApiDocument(file: string): ParsedDocument;