Skip to content

Commit b09571e

Browse files
committed
chore: standardize exports and types
1 parent b795067 commit b09571e

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

packages/devtools-ui/src/components/tree.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,13 @@ const ObjectValue = ({
167167
)
168168
}
169169

170+
// web component
171+
export interface JsonTreeWebComponentProps {
172+
value: any
173+
}
174+
170175
export const registerJsonTreeComponent = (elName: string = 'tsd-json-tree') =>
171-
customElement(elName, { value: {} }, (props, { element }) => {
176+
customElement<JsonTreeWebComponentProps>(elName, { value: {} }, (props, { element }) => {
172177
noShadowDOM()
173178
function getValue(value: any) {
174179
if (typeof value === 'string') {

packages/devtools-ui/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ export { Checkbox } from './components/checkbox'
22
export { Input } from './components/input'
33
export { Select } from './components/select'
44
export { TanStackLogo } from './components/logo'
5-
export { JsonTree, registerJsonTreeComponent } from './components/tree'
5+
export { JsonTree, registerJsonTreeComponent, } from './components/tree'
66
export { Button } from './components/button'
77
export { Tag } from './components/tag'
8+
export type { JsonTreeWebComponentProps } from './components/tree'
89
export type { CustomElements } from './types'

packages/devtools-ui/src/types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { JsonTreeWebComponentProps } from "./components/tree"
2+
13
export interface CustomElements {
2-
'tsd-json-tree': { value: any }
4+
'tsd-json-tree': JsonTreeWebComponentProps
35
}

0 commit comments

Comments
 (0)