export type JsonPrimitive = string | number | boolean | null; export type JsonValue = JsonPrimitive | JsonValue[] | { [key: string]: JsonValue; }; export type PrimitiveKind = 'string' | 'number' | 'boolean' | 'null'; export type SearchMatch = { self: boolean; descendant: boolean; }; export type JsonViewerAppearance = 'dark' | 'light'; export interface JsonViewerProps { value: unknown; defaultExpandedDepth?: number; expandAll?: boolean; searchDebounceMs?: number; helperText?: string; searchPlaceholder?: string; emptySearchText?: string; className?: string; maxHeight?: number | string; /** Initial appearance. The user can toggle it via the kebab menu; defaults to 'dark'. */ appearance?: JsonViewerAppearance; /** * When set, the user's appearance choice is persisted to localStorage * under `${storageKey}:appearance`. */ storageKey?: string; /** * Removes the outer border, shadow, corner radius and padding, so the * viewer sits flush in a container that already provides its own framing * (e.g. a modal). */ borderless?: boolean; } export type JsonNodeProps = { keyName?: string; path: string[]; value: JsonValue; depth: number; defaultExpandedDepth: number; query: string; matches: Map; expandedNodeIds: Set; onToggleNode: (nodeId: string) => void; copiedId: string | null; onCopy: (nodeId: string, rawValue: string) => void; };