UNPKG

clickable-json

Version:

Interactive JSON and JSON CRDT viewer and editor

24 lines (23 loc) 794 B
import * as React from 'react'; import { StyleContextValue } from '../context/style'; import type { OnChange } from './types'; export interface ClickableJsonProps extends StyleContextValue { /** * The JSON to display. Can be any JSON value. */ doc: unknown; /** * Prefix specified by the parent JSON. Used internally. */ pfx?: string; /** * Callback called when the JSON is changed. The callback receives a [JSON Patch * (RFC 6902)](https://datatracker.ietf.org/doc/html/rfc6902) as an argument. */ onChange?: OnChange; /** * Callback called when the JSON is clicked, returns the clicked JSON pointer. */ onFocus?: (pointer: string | null) => void; } export declare const ClickableJson: React.FC<ClickableJsonProps>;