/** * `JsonDiff` — a GENERIC, kind-agnostic structural diff of two JSON values, * hand-rolled (no diff library). It recursively walks OBJECT keys and emits one row * per leaf difference: a key present only on one side is `added`/`removed`, a key * whose value differs is `changed`. * * ARRAYS ARE LEAVES: an unequal array (by deep compare) emits exactly ONE `changed` * row at the array's path carrying both whole array values — there are no per-index * rows and no LCS alignment. A container object whose descendants differ emits rows * only for the differing leaves, never for the container itself. * * Rendered as a table: the dotted `path` (e.g. `fixed_kwargs.city`) as code, the * kind as a Badge (removed → danger, added → success, changed → neutral), and the * before/after values as a `JsonTree` for objects/arrays or escaped text for * scalars. Every value renders as React TEXT, so payload markup is escaped and this * is never an HTML sink. * * Each row also carries its `tai-diff-*` tint, but the tint only REINFORCES the * kind — the Badge spells the kind out in words, so a row is never identified by * color alone. */ import { type ReactNode } from 'react'; /** One leaf difference between the two JSON values. */ export interface JsonDiffRow { /** The dotted path to the differing key, e.g. `fixed_kwargs.city` (`''` = root). */ readonly path: string; readonly kind: 'added' | 'removed' | 'changed'; /** The value on the LEFT side — set for `removed` and `changed` rows. */ readonly before?: unknown; /** The value on the RIGHT side — set for `added` and `changed` rows. */ readonly after?: unknown; } /** The pure structural diff — every leaf difference between `before` and `after`. */ export declare function diffJson(before: unknown, after: unknown): JsonDiffRow[]; export interface JsonDiffProps { readonly before: unknown; readonly after: unknown; } export declare function JsonDiff({ before, after }: JsonDiffProps): ReactNode; //# sourceMappingURL=json-diff.d.ts.map