import { SchemaNodeData } from '../../types/schema'; import { SchemaTreeBranchLineVariant } from './SchemaTreeBranch'; import { SchemaAncestors } from './schemaUtils'; export interface SchemaNodeProps { schema: SchemaNodeData; path: string; depth: number; required?: boolean; refStack: Set; deref: (ref: string) => unknown; /** When true, skip this node's row and render only its children. */ suppressRow?: boolean; /** Left border style for nested branches; muted uses a grey dotted line. */ branchLineVariant?: SchemaTreeBranchLineVariant; /** Whether this node (and its descendants) start expanded. Defaults to false. */ defaultExpanded?: boolean; /** * Schemas already on the render path above this node. When this node's * schema is among them (by object identity or by $ref string), it is a * cycle — render a circular row instead of recursing forever. */ ancestors?: SchemaAncestors; /** * Remaining steps toward a search-selected node, matching searchIndex.ts's * schemaFocusTokens convention — `null` once off the target path, `[]` * when this node IS the target. Consumed one "properties"+name / "items" / * "oneOf[i]"/"anyOf[i]" step at a time as it's threaded into children. */ focusTokens?: string[] | null; /** The target node's DOM id — constant for the whole walk, applied once focusTokens is empty. */ focusId?: string | null; } /** Recursively renders one schema node and its descendants. */ export default function SchemaNode({ schema: rawSchema, path, depth, required, refStack, deref, suppressRow, branchLineVariant, defaultExpanded, ancestors, focusTokens, focusId, }: SchemaNodeProps): import("react").JSX.Element | null;