@@ -3,29 +3,12 @@ import { Portal, render } from 'solid-js/web'
33import { ClientEventBus } from '@tanstack/devtools-event-bus/client'
44import { DevtoolsProvider } from './context/devtools-context'
55import { initialState } from './context/devtools-store'
6+ import type { ClientEventBusConfig } from '@tanstack/devtools-event-bus/client'
67import type {
78 TanStackDevtoolsConfig ,
89 TanStackDevtoolsPlugin ,
910} from './context/devtools-context'
1011
11- export interface EventBusConfig {
12- /**
13- * Optional flag to indicate if the devtools server event bus is available to connect to.
14- * This is used to determine if the devtools can connect to the server for real-time event streams.
15- */
16- hasServer ?: boolean
17-
18- /**
19- * Optional flag to enable debug mode for the event bus.
20- */
21- debug ?: boolean
22-
23- /**
24- * Optional port to connect to the devtools server event bus.
25- * Defaults to 42069.
26- */
27- port ?: number
28- }
2912export interface TanStackDevtoolsInit {
3013 /**
3114 * Configuration for the devtools shell. These configuration options are used to set the
@@ -53,7 +36,7 @@ export interface TanStackDevtoolsInit {
5336 * ```
5437 */
5538 plugins ?: Array < TanStackDevtoolsPlugin >
56- eventBusConfig ?: EventBusConfig
39+ eventBusConfig ?: ClientEventBusConfig
5740}
5841
5942export class TanStackDevtoolsCore {
@@ -65,7 +48,7 @@ export class TanStackDevtoolsCore {
6548 #dispose?: ( ) => void
6649 #Component: any
6750 #eventBus: ClientEventBus | undefined
68- #eventBusConfig: EventBusConfig | undefined
51+ #eventBusConfig: ClientEventBusConfig | undefined
6952
7053 constructor ( init : TanStackDevtoolsInit ) {
7154 this . #plugins = init . plugins || [ ]
@@ -83,10 +66,9 @@ export class TanStackDevtoolsCore {
8366 const mountTo = el
8467 const dispose = render ( ( ) => {
8568 this . #Component = lazy ( ( ) => import ( './devtools' ) )
86- const { hasServer, ...rest } = this . #eventBusConfig || { }
8769 const Devtools = this . #Component
88- this . #eventBus = new ClientEventBus ( rest )
89- this . #eventBus. start ( hasServer )
70+ this . #eventBus = new ClientEventBus ( this . #eventBusConfig )
71+ this . #eventBus. start ( )
9072 return (
9173 < DevtoolsProvider plugins = { this . #plugins} config = { this . #config} >
9274 < Portal mount = { mountTo } >
@@ -116,3 +98,5 @@ export class TanStackDevtoolsCore {
11698 }
11799 }
118100}
101+
102+ export type { ClientEventBusConfig }
0 commit comments