Skip to content

Commit

Permalink
Export DOMNodePreview, ObjectPreview, TreeView and TreeNode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim de Koning committed Feb 8, 2023
1 parent a37ae07 commit e7330d6
Showing 1 changed file with 29 additions and 14 deletions.
43 changes: 29 additions & 14 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
export { chromeLight, chromeDark } from './styles/themes';
import React, { ComponentProps, FC } from 'react';
import isDOM from 'is-dom';

import { ObjectInspector } from './object-inspector/ObjectInspector';
import { TableInspector } from './table-inspector/TableInspector';
import { DOMInspector } from './dom-inspector/DOMInspector';

import { ObjectLabel } from './object-inspector/ObjectLabel';
import { ObjectPreview } from './object-inspector/ObjectPreview';
import { ObjectRootLabel } from './object-inspector/ObjectRootLabel';

import { TableInspector } from './table-inspector/TableInspector';

import { DOMInspector } from './dom-inspector/DOMInspector';
import { DOMNodePreview } from './dom-inspector/DOMNodePreview';

import { ObjectValue } from './object/ObjectValue';
import { ObjectName } from './object/ObjectName';

export { TableInspector, ObjectInspector, ObjectLabel, ObjectPreview, ObjectRootLabel, ObjectValue, ObjectName };
import { TreeView } from './tree-view/TreeView';
import { TreeNode } from './tree-view/TreeNode';

import React, { ComponentProps, FC } from 'react';
import isDOM from 'is-dom';
interface TableInspectorProps extends ComponentProps<typeof TableInspector> {
table: true;
}
interface ObjectInspectorProps extends ComponentProps<typeof ObjectInspector> {
table: false;
}

export const Inspector: FC<TableInspectorProps | ObjectInspectorProps> = ({ table = false, data, ...rest }) => {
const Inspector: FC<TableInspectorProps | ObjectInspectorProps> = ({ table = false, data, ...rest }) => {
if (table) {
return <TableInspector data={data} {...rest} />;
}
Expand All @@ -26,9 +34,16 @@ export const Inspector: FC<TableInspectorProps | ObjectInspectorProps> = ({ tabl
return <ObjectInspector data={data} {...rest} />;
};

interface TableInspectorProps extends ComponentProps<typeof TableInspector> {
table: true;
}
interface ObjectInspectorProps extends ComponentProps<typeof ObjectInspector> {
table: false;
}
export {
DOMNodePreview,
Inspector,
ObjectInspector,
ObjectLabel,
ObjectName,
ObjectPreview,
ObjectRootLabel,
ObjectValue,
TableInspector,
TreeNode,
TreeView,
};

0 comments on commit e7330d6

Please sign in to comment.