Files
twenty/packages/twenty-ui/src/json-visualizer/contexts/JsonTreeContext.tsx
T
2025-04-03 08:58:56 +02:00

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,
);