Skip to content

Commit 922065f

Browse files
committed
feat: expose dataTypes, themes and utils in browser build
1 parent 6a69326 commit 922065f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/browser.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import type { Root } from 'react-dom/client'
22
import { createRoot } from 'react-dom/client'
33

44
import { JsonViewer as JsonViewerComponent } from '.'
5+
import * as dataTypes from './components/DataTypes'
6+
import * as base16 from './theme/base16'
57
import type { JsonViewerProps } from './type'
8+
import { applyValue, defineDataType, deleteValue, isCycleReference, safeStringify } from './utils'
69

710
const getElementFromConfig = (el?: string | Element) => (el
811
? (typeof el === 'string' ? document.querySelector(el) : el)
@@ -13,6 +16,15 @@ export default class JsonViewer {
1316
private root?: Root
1417

1518
static Component = JsonViewerComponent
19+
static DataTypes = dataTypes
20+
static Themes = base16
21+
static Utils = {
22+
applyValue,
23+
defineDataType,
24+
deleteValue,
25+
isCycleReference,
26+
safeStringify
27+
}
1628

1729
constructor (props: JsonViewerProps) {
1830
this.props = props

0 commit comments

Comments
 (0)