bea75b9532
| Error | Success | |--------|--------| |  |  | Closes https://github.com/twentyhq/core-team-issues/issues/716
21 lines
646 B
TypeScript
21 lines
646 B
TypeScript
import { GetJsonNodeHighlighting } from '@ui/json-visualizer/types/GetJsonNodeHighlighting';
|
|
import { createContext } from 'react';
|
|
|
|
export type ShouldExpandNodeInitiallyProps = { keyPath: string; depth: number };
|
|
|
|
export type JsonTreeContextType = {
|
|
getNodeHighlighting?: GetJsonNodeHighlighting;
|
|
shouldExpandNodeInitially: (
|
|
params: ShouldExpandNodeInitiallyProps,
|
|
) => boolean;
|
|
emptyStringLabel: string;
|
|
emptyArrayLabel: string;
|
|
emptyObjectLabel: string;
|
|
arrowButtonCollapsedLabel: string;
|
|
arrowButtonExpandedLabel: string;
|
|
};
|
|
|
|
export const JsonTreeContext = createContext<JsonTreeContextType | undefined>(
|
|
undefined,
|
|
);
|