import { SchemaNodeData } from '../../types/schema'; /** Extracts the schema name from a JSON Pointer, e.g. "#/components/schemas/sentAt" → "sentAt". */ export declare const refNameFromPath: (ref: string) => string; export interface NormalizedSchema { schema: SchemaNodeData; refLabel?: string; circular?: boolean; } /** * Badge label for schemas whose $ref was already inlined upstream (by * @asyncapi/parser or resolveDocument), which both stamp x-parser-schema-id * on resolved targets. Named schemas carry their real name; parser-generated * anonymous ids ("") are not badges. */ export declare const schemaIdLabel: (schema: SchemaNodeData) => string | undefined; /** * Schema nodes already on the active render path, tracked per branch as * SchemaNode recurses. Two keys catch the two ways a schema can reach itself: * `refs` for `$ref` strings in lazily-resolved documents, and * `objects` for identity cycles in pre-resolved documents where a schema * contains itself as a plain object reference (no $ref string to key on). */ export interface SchemaAncestors { objects: ReadonlySet; refs: ReadonlySet; } export declare const EMPTY_ANCESTORS: SchemaAncestors; /** Resolves $ref inline via deref; refStack tracks the active chain to detect circular refs. */ export declare const normalizeSchema: (raw: SchemaNodeData, deref: (ref: string) => unknown, refStack: Set) => NormalizedSchema; /** Returns the first item schema from an array definition, if any. */ export declare const getItemSchema: (schema: SchemaNodeData) => SchemaNodeData | null; /** Returns all positional item schemas when items is an array (tuple mode). */ export declare const getTupleItemSchemas: (schema: SchemaNodeData) => SchemaNodeData[] | null; /** Returns additionalItems subschema when in tuple mode (items is an array). */ export declare const getAdditionalItemsSchema: (schema: SchemaNodeData) => SchemaNodeData | boolean | null; /** * Returns the contains subschema (or boolean) when present. * JSON Schema allows contains:true (any item satisfies), contains:false (impossible), * or an object schema. Absent means no constraint. */ export declare const getContainsSchema: (schema: SchemaNodeData) => SchemaNodeData | boolean | null; /** Whether the schema defines a contains keyword. */ export declare const hasContains: (schema: SchemaNodeData) => boolean; /** Combines array- and item-level descriptions when they differ. */ export declare const mergeDescriptions: (arrayDescription?: string, itemDescription?: string) => string | undefined; /** Merges two schema records for display; later values win on scalar conflicts. */ export declare const mergeSchemaObjects: (a: SchemaNodeData, b: SchemaNodeData, deref: (ref: string) => unknown, refStack: Set) => SchemaNodeData; /** Merges allOf subschemas into one; no allOf key in the result. */ export declare const flattenAllOf: (schema: SchemaNodeData, deref: (ref: string) => unknown, refStack: Set, seen?: Set) => SchemaNodeData; /** Returns oneOf subschemas when present. */ export declare const getOneOfItems: (schema: SchemaNodeData) => SchemaNodeData[] | null; /** Returns anyOf subschemas when present. */ export declare const getAnyOfItems: (schema: SchemaNodeData) => SchemaNodeData[] | null; /** Returns the not subschema when present. */ export declare const getNotSchema: (schema: SchemaNodeData) => SchemaNodeData | boolean | null; /** Whether the schema defines a not keyword. */ export declare const hasNotSchema: (schema: SchemaNodeData) => boolean; /** Returns a copy of the schema without not (for shape detection). */ export declare const omitNot: (schema: SchemaNodeData) => SchemaNodeData; /** Returns a copy of the schema without if/then/else (for shape detection). */ export declare const omitIfThenElse: (schema: SchemaNodeData) => SchemaNodeData; /** Whether the schema defines an if keyword. */ export declare const hasIfThenElse: (schema: SchemaNodeData) => boolean; /** Safely casts an unknown schema value to SchemaNodeData | boolean | null. */ export declare const getSubschema: (value: unknown) => SchemaNodeData | boolean | null; /** Returns _allOfConditionals set during allOf flattening. */ export declare const getAllOfConditionals: (schema: SchemaNodeData) => SchemaNodeData[]; /** * Whether the schema has additional conditionals from allOf flattening. * O(1) check — reads the array length directly rather than allocating a * filtered copy via getAllOfConditionals. */ export declare const hasAllOfConditionals: (schema: SchemaNodeData) => boolean; /** Returns the propertyNames subschema when present. */ export declare const getPropertyNamesSchema: (schema: SchemaNodeData) => SchemaNodeData | boolean | null; /** Returns the additionalProperties subschema when present. */ export declare const getAdditionalPropertiesSchema: (schema: SchemaNodeData) => SchemaNodeData | boolean | null; /** Returns patternProperties entries whose values are schema objects. */ export declare const getPatternPropertiesEntries: (schema: SchemaNodeData) => [string, SchemaNodeData][]; /** Path segment for a patternProperties row. */ export declare const patternPropertyPath: (path: string, pattern: string) => string; /** True when the schema defines explicit named properties. */ export declare const hasExplicitProperties: (schema: SchemaNodeData) => boolean; /** True when map keywords yield tree rows (not boolean-only pills). */ export declare const hasObjectMapContent: (schema: SchemaNodeData) => boolean; /** True when the schema has a renderable shape besides not. */ export declare const hasStructuralShape: (schema: SchemaNodeData) => boolean; /** True when a schema has no nested structure worth expanding. */ export declare const isLeafItemSchema: (schema: SchemaNodeData) => boolean; /** Whether a schema (and optional array item schema) has constraints to show. */ export declare const hasConstraints: (schema: SchemaNodeData, itemSchema?: SchemaNodeData | null) => boolean; /** Whether a schema node has children worth showing behind an expand toggle. */ export declare const hasExpandableContent: (schema: SchemaNodeData, deref?: (ref: string) => unknown) => boolean;