import { i as DiagnosticsOptions } from "../diagnostics-mftUZI7c.mjs"; //#region src/core/merge.d.ts /** * Annotation keywords that can appear as siblings of `$ref` per * Draft 2020-12 / OpenAPI 3.1. Structural keywords (type, properties, * etc.) are NOT annotation siblings and should not be merged. */ declare const ANNOTATION_SIBLINGS: ReadonlySet; /** * Merge annotation siblings from the referencing node onto the * resolved target's annotations. The referencer wins for annotations. * * Structural keywords on the referencer are NOT merged — per spec, * `$ref` with structural siblings was invalid pre-2019-09. * * Returns a new meta object with the merged annotations. */ declare function mergeRefSiblings(referencer: Record, resolvedMeta: Record): Record; /** * Merge multiple JSON Schema objects from allOf into one. * Merges: properties, required, meta fields, and constraints. * * Semantics are first-write-wins for meta and constraint keywords. * When a later branch redefines a keyword with a non-equal value the * later value is silently dropped — an `allof-conflict` diagnostic is * emitted so the loss is visible to consumers. * * Boolean branches (valid per Draft 06+) collapse the composite: * - `false` makes the entire \`allOf\` unsatisfiable — return \`false\`, * which the walker turns into a \`NeverField\`. * - \`true\` is the always-valid schema and contributes no constraints — * skip silently. * * Type compatibility is enforced rather than papered over: two * branches asserting incompatible primitive `type` keywords * (e.g. `string` ∩ `number`) describe an unsatisfiable conjunction. * `mergeAllOf` returns `false` and emits * `schema-allof-incompatible` so the walker produces the same * `NeverField` shape it gives a top-level `false` schema. Pretending * the first type wins silently would silently weaken the constraint * for any consumer that reads the merged result. * * Non-boolean, non-object entries (e.g. arrays, numbers) are malformed * inputs that cannot represent a schema; skip them as before. */ declare function mergeAllOf(schemas: unknown[], diagnostics?: DiagnosticsOptions, pointer?: string): Record | false; /** * Result returned by {@link normaliseAnyOf} when an `anyOf` schema * collapses to a nullable shape: the non-null branch and the nullable * flag. */ interface NormalisedAnyOf { inner: Record; isNullable: boolean; } /** * Detect `anyOf: [T, { type: "null" }]` → nullable T. * Returns the non-null schema and a nullable flag. */ declare function normaliseAnyOf(options: unknown[]): NormalisedAnyOf | undefined; /** * Result returned by {@link detectDiscriminated} when a `oneOf` schema * is structurally a discriminated union: the option schemas plus the * shared property name carrying the const discriminator. */ interface Discriminated { options: Record[]; discriminator: string; } /** * Detect oneOf where every option is an object with a property * that has a `const` value → discriminated union. * * When options carry inconsistent discriminator candidates (e.g. one * uses `kind` while another uses `type`) detection fails and a * `discriminator-inconsistent` diagnostic is emitted so callers can * see why the union falls back to a generic oneOf. * * When two or more options share the same discriminator `const` value, * the union is still treated as discriminated — the first-match * behaviour in `resolveDiscriminatedActive` (in `core/unionMatch.ts`) * resolves the active option — but a `discriminator-duplicate` * diagnostic is emitted so the unreachable branch is visible to the * consumer. Changing the behaviour to fall back to a generic union * would be a silent regression for the much commoner case of two * intentionally-identical discriminator values appearing in distinct * sub-schemas (e.g. an `allOf`-driven hierarchy where the base option * duplicates the leaf). */ declare function detectDiscriminated(options: unknown[], diagnostics?: DiagnosticsOptions, pointer?: string): Discriminated | undefined; //#endregion export { ANNOTATION_SIBLINGS, Discriminated, NormalisedAnyOf, detectDiscriminated, mergeAllOf, mergeRefSiblings, normaliseAnyOf };