react-json-view-lite
Version:
JSON viewer component for React focused on performance for large volume input while still providing few customiziation features
25 lines (24 loc) • 963 B
TypeScript
import * as React from 'react';
import { StyleProps } from './DataRenderer';
export interface NodeExpandingEvent {
level: number;
value: any;
field?: string;
newExpandValue: boolean;
}
export interface AriaLabels {
collapseJson: string;
expandJson: string;
}
export interface Props extends React.AriaAttributes {
data: Object | Array<any>;
style?: Partial<StyleProps>;
shouldExpandNode?: (level: number, value: any, field?: string) => boolean;
clickToExpandNode?: boolean;
beforeExpandChange?: (event: NodeExpandingEvent) => boolean;
}
export declare const defaultStyles: StyleProps;
export declare const darkStyles: StyleProps;
export declare const allExpanded: () => boolean;
export declare const collapseAllNested: (level: number) => boolean;
export declare const JsonView: ({ data, style, shouldExpandNode, clickToExpandNode, beforeExpandChange, ...ariaAttrs }: Props) => React.JSX.Element;