UNPKG

1.49 kBTypeScriptView Raw
1import React from 'react';
2import { StylingFunction } from 'react-base16-styling';
3export type Key = string | number;
4export type KeyPath = readonly (string | number)[];
5export type GetItemString = (nodeType: string, data: unknown, itemType: React.ReactNode, itemString: string, keyPath: KeyPath) => React.ReactNode;
6export type LabelRenderer = (keyPath: KeyPath, nodeType: string, expanded: boolean, expandable: boolean) => React.ReactNode;
7export type ValueRenderer = (valueAsString: unknown, value: unknown, ...keyPath: KeyPath) => React.ReactNode;
8export type ShouldExpandNodeInitially = (keyPath: KeyPath, data: unknown, level: number) => boolean;
9export type PostprocessValue = (value: unknown) => unknown;
10export type IsCustomNode = (value: unknown) => boolean;
11export type SortObjectKeys = ((a: unknown, b: unknown) => number) | boolean;
12export type Styling = StylingFunction;
13export type CircularCache = unknown[];
14export interface CommonExternalProps {
15 keyPath: KeyPath;
16 labelRenderer: LabelRenderer;
17 valueRenderer: ValueRenderer;
18 shouldExpandNodeInitially: ShouldExpandNodeInitially;
19 hideRoot: boolean;
20 getItemString: GetItemString;
21 postprocessValue: PostprocessValue;
22 isCustomNode: IsCustomNode;
23 collectionLimit: number;
24 sortObjectKeys: SortObjectKeys;
25}
26export interface CommonInternalProps extends CommonExternalProps {
27 styling: StylingFunction;
28 circularCache?: CircularCache;
29 level?: number;
30 isCircular?: boolean;
31}
32
\No newline at end of file