/** * S1 / rid=api-diff-report — OpenAPI 3.x parsing for `peaks scan api-diff`. * * `.json` via `JSON.parse`; `.yaml` / `.yml` via the `yaml` runtime dependency. * A document that is not OpenAPI 3.x, or that declares no operations, raises * `ApiDiffInputError` — the command must never print an empty-but-successful * diff. * * THE SAME INVERTED COMPLETENESS RULE THE RECORDED SIDE GETS APPLIES HERE * (QA final gate): `collectFields` returns a *partial* field set just as easily * as a complete one, and the two are indistinguishable downstream. Any schema * construct this reader cannot fully account for marks its LOCATION as * incomplete, which suppresses every exact line for that location. Partial is * never presented as complete. */ import { type ParsedDocument } from './api-diff-types.js'; import { loadApiDocument } from './api-diff-openapi-schema-read.js'; export { loadApiDocument }; /** * Renders an OpenAPI schema as a TypeScript-ish type text. Arrays render as * `Array` (not `X[]`) on purpose: `normalizeType` rewrites both sides * identically, so a recorded `X[]` and a document `Array` still compare equal. * * A `$ref` is answered with its referenced NAME and never dereferenced. Checking * after `deref()` made `refName` unreachable for every ref inside * `MAX_REF_DEPTH`, so a nested `owner: {$ref: User}` was reported as `object` * against a recorded `owner: User` — an exact line for a field that did not * change. The name is the faithful reading, and it is what a recorded interface * writes. */ declare function schemaToTypeString(schema: unknown, doc: Record, depth: number): string; export { schemaToTypeString }; export declare function parseOpenApiDocument(file: string, doc: Record): ParsedDocument; /** * Normalizes type text so `Array`, `string[]`, `string | null` and * `string|null` compare equal. * * Quote style is unified because it is a RENDERING artifact, not a change: the * document renders enums via `JSON.stringify` (`"a"`) while hand-written * recorded types use single quotes (`'a'`), so the same project written with * double quotes emitted nothing and with single quotes emitted an exact * CHANGED. Duplicate union members are collapsed for the same reason — a * recorded `a?: X` normalises to `X | undefined`, which against a document's * `X | undefined` used to become `X | undefined | undefined`. */ export declare function normalizeType(text: string): string;