@vue/devtools-kit 7.0.25 → 7.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { VNode, App, ComponentInternalInstance, ComponentOptions, SuspenseBoundary } from 'vue';
1
+ import { App, ComponentInternalInstance, ComponentOptions, SuspenseBoundary, VNode } from 'vue';
2
2
  import { RouteLocationNormalizedLoaded, RouteRecordNormalized, Router } from 'vue-router';
3
3
  export { Router } from 'vue-router';
4
4
 
@@ -61,7 +61,281 @@ declare function addInspector(payload: Inspector): void;
61
61
  declare function getInspector(inspectorId: string): Inspector | undefined;
62
62
  declare function updateInspector(inspectorId: string, payload: Partial<Inspector>): void;
63
63
 
64
- declare function setupDevToolsPlugin(pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction): void;
64
+ type PluginApi = DevToolsPluginApi;
65
+ declare type PluginSettingsItem = {
66
+ label: string;
67
+ description?: string;
68
+ } & ({
69
+ type: 'boolean';
70
+ defaultValue: boolean;
71
+ } | {
72
+ type: 'choice';
73
+ defaultValue: string | number;
74
+ options: {
75
+ value: string | number;
76
+ label: string;
77
+ }[];
78
+ component?: 'select' | 'button-group';
79
+ } | {
80
+ type: 'text';
81
+ defaultValue: string;
82
+ });
83
+ interface PluginDescriptor {
84
+ id: string;
85
+ label: string;
86
+ app: App<any>;
87
+ packageName?: string;
88
+ homepage?: string;
89
+ componentStateTypes?: string[];
90
+ logo?: string;
91
+ disableAppScope?: boolean;
92
+ disablePluginScope?: boolean;
93
+ /**
94
+ * Run the plugin setup and expose the api even if the devtools is not opened yet.
95
+ * Useful to record timeline events early.
96
+ */
97
+ enableEarlyProxy?: boolean;
98
+ settings?: Record<string, PluginSettingsItem>;
99
+ }
100
+ type PluginSetupFunction = (api: PluginApi) => void;
101
+ type VueAppInstance = ComponentInternalInstance & {
102
+ type: {
103
+ _componentTag: string | undefined;
104
+ components: Record<string, ComponentInternalInstance['type']>;
105
+ __VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__: string;
106
+ __isKeepAlive: boolean;
107
+ devtools: {
108
+ hide: boolean;
109
+ };
110
+ mixins: ComponentOptions[];
111
+ extends: ComponentOptions;
112
+ vuex: {
113
+ getters: Record<string, unknown>;
114
+ };
115
+ computed: Record<string, unknown>;
116
+ };
117
+ __v_cache: Cache;
118
+ __VUE_DEVTOOLS_NEXT_UID__: string;
119
+ _isBeingDestroyed: boolean;
120
+ _instance: VueAppInstance;
121
+ _container: {
122
+ _vnode: {
123
+ component: VueAppInstance;
124
+ };
125
+ };
126
+ isUnmounted: boolean;
127
+ parent: VueAppInstance;
128
+ appContext: {
129
+ app: VueAppInstance & App & {
130
+ __VUE_DEVTOOLS_NEXT_APP_RECORD_ID__: string;
131
+ __VUE_DEVTOOLS_NEXT_APP_RECORD__: AppRecord;
132
+ };
133
+ };
134
+ __VUE_DEVTOOLS_NEXT_APP_RECORD__: AppRecord;
135
+ suspense: SuspenseBoundary & {
136
+ suspenseKey: string;
137
+ };
138
+ renderContext: Record<string, unknown>;
139
+ devtoolsRawSetupState: Record<string, unknown>;
140
+ setupState: Record<string, unknown>;
141
+ provides: Record<string | symbol, unknown>;
142
+ ctx: Record<string, unknown>;
143
+ } & App<any>;
144
+ interface AppRecord {
145
+ id: string | number;
146
+ name: string;
147
+ app?: App;
148
+ version?: string;
149
+ types?: Record<string, string | symbol>;
150
+ instanceMap: Map<string, VueAppInstance>;
151
+ rootInstance: VueAppInstance;
152
+ api?: PluginApi;
153
+ routerId?: string;
154
+ moduleDetectives?: {
155
+ vueRouter: boolean;
156
+ pinia: boolean;
157
+ vueI18n: boolean;
158
+ };
159
+ }
160
+
161
+ type HookAppInstance = App & VueAppInstance;
162
+ declare enum DevToolsHooks {
163
+ APP_INIT = "app:init",
164
+ APP_UNMOUNT = "app:unmount",
165
+ COMPONENT_UPDATED = "component:updated",
166
+ COMPONENT_ADDED = "component:added",
167
+ COMPONENT_REMOVED = "component:removed",
168
+ COMPONENT_EMIT = "component:emit",
169
+ PERFORMANCE_START = "perf:start",
170
+ PERFORMANCE_END = "perf:end",
171
+ ADD_ROUTE = "router:add-route",
172
+ REMOVE_ROUTE = "router:remove-route",
173
+ RENDER_TRACKED = "render:tracked",
174
+ RENDER_TRIGGERED = "render:triggered",
175
+ APP_CONNECTED = "app:connected",
176
+ SETUP_DEVTOOLS_PLUGIN = "devtools-plugin:setup"
177
+ }
178
+ interface DevToolsEvent$1 {
179
+ [DevToolsHooks.APP_INIT]: (app: VueAppInstance['appContext']['app'], version: string) => void;
180
+ [DevToolsHooks.APP_CONNECTED]: () => void;
181
+ [DevToolsHooks.COMPONENT_ADDED]: (app: HookAppInstance, uid: number, parentUid: number, component: VueAppInstance) => void;
182
+ [DevToolsHooks.COMPONENT_UPDATED]: DevToolsEvent$1['component:added'];
183
+ [DevToolsHooks.COMPONENT_REMOVED]: DevToolsEvent$1['component:added'];
184
+ [DevToolsHooks.SETUP_DEVTOOLS_PLUGIN]: (pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction, options?: {
185
+ target?: string;
186
+ }) => void;
187
+ }
188
+ interface DevToolsHook {
189
+ id: string;
190
+ enabled?: boolean;
191
+ devtoolsVersion: string;
192
+ events: Map<DevToolsHooks, Function[]>;
193
+ emit: (event: DevToolsHooks, ...payload: any[]) => void;
194
+ on: <T extends Function>(event: DevToolsHooks, handler: T) => () => void;
195
+ once: <T extends Function>(event: DevToolsHooks, handler: T) => void;
196
+ off: <T extends Function>(event: DevToolsHooks, handler: T) => void;
197
+ appRecords: AppRecord[];
198
+ apps: Record<number, {
199
+ componentCount: number;
200
+ }>;
201
+ cleanupBuffer?: (matchArg: unknown) => boolean;
202
+ }
203
+ interface VueHooks {
204
+ on: {
205
+ vueAppInit: (fn: DevToolsEvent$1[DevToolsHooks.APP_INIT]) => void;
206
+ vueAppConnected: (fn: DevToolsEvent$1[DevToolsHooks.APP_CONNECTED]) => void;
207
+ componentAdded: (fn: DevToolsEvent$1[DevToolsHooks.COMPONENT_ADDED]) => () => void;
208
+ componentUpdated: (fn: DevToolsEvent$1[DevToolsHooks.COMPONENT_UPDATED]) => () => void;
209
+ componentRemoved: (fn: DevToolsEvent$1[DevToolsHooks.COMPONENT_REMOVED]) => () => void;
210
+ setupDevtoolsPlugin: (fn: DevToolsEvent$1[DevToolsHooks.SETUP_DEVTOOLS_PLUGIN]) => void;
211
+ };
212
+ setupDevToolsPlugin: (pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction) => void;
213
+ }
214
+
215
+ interface CustomCommandAction {
216
+ type: 'url';
217
+ /**
218
+ * Url of the action, if set, execute the action will open the url
219
+ */
220
+ src: string;
221
+ }
222
+ interface CustomCommand {
223
+ /**
224
+ * The id of the command, should be unique
225
+ */
226
+ id: string;
227
+ title: string;
228
+ description?: string;
229
+ /**
230
+ * Order of the command, bigger number will be shown first
231
+ * @default 0
232
+ */
233
+ order?: number;
234
+ /**
235
+ * Icon of the tab, support any Iconify icons, or a url to an image
236
+ */
237
+ icon?: string;
238
+ /**
239
+ * - action of the command
240
+ * - __NOTE__: This will be ignored if `children` is set
241
+ */
242
+ action?: CustomCommandAction;
243
+ /**
244
+ * - children of action, if set, execute the action will show the children
245
+ */
246
+ children?: Omit<CustomCommand, 'children'>[];
247
+ }
248
+ declare function addCustomCommand(action: CustomCommand): void;
249
+ declare function removeCustomCommand(actionId: string): void;
250
+
251
+ type TabCategory = 'pinned' | 'app' | 'modules' | 'advanced';
252
+ type ModuleView = ModuleIframeView | ModuleVNodeView;
253
+ interface ModuleIframeView {
254
+ /**
255
+ * Iframe view
256
+ */
257
+ type: 'iframe';
258
+ /**
259
+ * Url of the iframe
260
+ */
261
+ src: string;
262
+ /**
263
+ * Persist the iframe instance even if the tab is not active
264
+ *
265
+ * @default true
266
+ */
267
+ persistent?: boolean;
268
+ }
269
+ interface ModuleVNodeView {
270
+ /**
271
+ * Vue's VNode view
272
+ */
273
+ type: 'vnode';
274
+ /**
275
+ * Send vnode to the client, they must be static and serializable
276
+ */
277
+ vnode: VNode;
278
+ }
279
+ interface CustomTab {
280
+ /**
281
+ * The name of the tab, must be unique
282
+ */
283
+ name: string;
284
+ /**
285
+ * Icon of the tab, support any Iconify icons, or a url to an image
286
+ */
287
+ icon?: string;
288
+ /**
289
+ * Title of the tab
290
+ */
291
+ title: string;
292
+ /**
293
+ * Main view of the tab
294
+ */
295
+ view: ModuleView;
296
+ /**
297
+ * Category of the tab
298
+ * @default 'app'
299
+ */
300
+ category?: TabCategory;
301
+ }
302
+
303
+ declare function addCustomTab(tab: CustomTab): void;
304
+
305
+ interface DevToolsState {
306
+ connected: boolean;
307
+ clientConnected: boolean;
308
+ vitePluginDetected: boolean;
309
+ appRecords: AppRecord[];
310
+ activeAppRecord: AppRecord | null;
311
+ selectedComponentId: string | null;
312
+ pluginBuffer: [PluginDescriptor, PluginSetupFunction][];
313
+ tabs: CustomTab[];
314
+ commands: CustomCommand[];
315
+ activeAppRecordId: string | null;
316
+ highPerfModeEnabled: boolean;
317
+ }
318
+
319
+ interface RouterInfo {
320
+ currentRoute: RouteLocationNormalizedLoaded | null | {};
321
+ routes: RouteRecordNormalized[];
322
+ }
323
+
324
+ interface DevToolsContext {
325
+ appRecord: AppRecord | null;
326
+ api: DevToolsPluginApi;
327
+ inspector: Inspector[];
328
+ timelineLayer: TimelineLayerItem[];
329
+ routerInfo: RouterInfo;
330
+ router: Router | null;
331
+ activeInspectorTreeId: string;
332
+ componentPluginHookBuffer: (() => void)[];
333
+ clear: () => void;
334
+ }
335
+
336
+ interface DevToolsEnv {
337
+ vitePluginDetected: boolean;
338
+ }
65
339
 
66
340
  interface InspectorNodeTag {
67
341
  label: string;
@@ -174,111 +448,31 @@ interface InspectorStateEditorPayload {
174
448
  set?: (obj: Recordable, path: PropPath, value: unknown, cb?: (object: Recordable, field: string, value: unknown) => void) => unknown;
175
449
  }
176
450
 
177
- type customTypeEnums = 'function' | 'bigint' | 'map' | 'set' | 'store' | 'router' | 'component' | 'component-definition' | 'HTMLElement' | 'component-definition' | 'date';
178
-
179
- interface ComponentHighLighterOptions {
180
- bounds: ComponentBoundingRect;
181
- name?: string;
182
- id?: string;
183
- visible?: boolean;
184
- }
185
- interface ScrollToComponentOptions {
186
- id?: string;
187
- }
188
-
189
- declare function toggleComponentHighLighter(options: ComponentHighLighterOptions): void;
190
- declare function highlight(instance: VueAppInstance): void;
191
- declare function unhighlight(): void;
192
- declare function inspectComponentHighLighter(): Promise<string>;
193
- declare function scrollToComponent(options: ScrollToComponentOptions): void;
194
-
195
- type TabCategory = 'pinned' | 'app' | 'modules' | 'advanced';
196
- type ModuleView = ModuleIframeView | ModuleVNodeView;
197
- interface ModuleIframeView {
198
- /**
199
- * Iframe view
200
- */
201
- type: 'iframe';
202
- /**
203
- * Url of the iframe
204
- */
205
- src: string;
206
- /**
207
- * Persist the iframe instance even if the tab is not active
208
- *
209
- * @default true
210
- */
211
- persistent?: boolean;
212
- }
213
- interface ModuleVNodeView {
214
- /**
215
- * Vue's VNode view
216
- */
217
- type: 'vnode';
218
- /**
219
- * Send vnode to the client, they must be static and serializable
220
- */
221
- vnode: VNode;
222
- }
223
- interface CustomTab {
224
- /**
225
- * The name of the tab, must be unique
226
- */
227
- name: string;
228
- /**
229
- * Icon of the tab, support any Iconify icons, or a url to an image
230
- */
231
- icon?: string;
232
- /**
233
- * Title of the tab
234
- */
235
- title: string;
236
- /**
237
- * Main view of the tab
238
- */
239
- view: ModuleView;
240
- /**
241
- * Category of the tab
242
- * @default 'app'
243
- */
244
- category?: TabCategory;
245
- }
246
-
247
- interface CustomCommandAction {
248
- type: 'url';
249
- /**
250
- * Url of the action, if set, execute the action will open the url
251
- */
252
- src: string;
451
+ type customTypeEnums = 'function' | 'bigint' | 'map' | 'set' | 'store' | 'router' | 'component' | 'component-definition' | 'HTMLElement' | 'component-definition' | 'date';
452
+
453
+ interface OpenInEditorOptions {
454
+ baseUrl?: string;
455
+ file?: string;
456
+ line?: number;
457
+ column?: number;
253
458
  }
254
- interface CustomCommand {
255
- /**
256
- * The id of the command, should be unique
257
- */
258
- id: string;
259
- title: string;
260
- description?: string;
261
- /**
262
- * Order of the command, bigger number will be shown first
263
- * @default 0
264
- */
265
- order?: number;
266
- /**
267
- * Icon of the tab, support any Iconify icons, or a url to an image
268
- */
269
- icon?: string;
270
- /**
271
- * - action of the command
272
- * - __NOTE__: This will be ignored if `children` is set
273
- */
274
- action?: CustomCommandAction;
275
- /**
276
- * - children of action, if set, execute the action will show the children
277
- */
278
- children?: Omit<CustomCommand, 'children'>[];
459
+ declare function openInEditor(options?: OpenInEditorOptions): void;
460
+
461
+ interface ComponentHighLighterOptions {
462
+ bounds: ComponentBoundingRect;
463
+ name?: string;
464
+ id?: string;
465
+ visible?: boolean;
279
466
  }
280
- declare function addCustomCommand(action: CustomCommand): void;
281
- declare function removeCustomCommand(actionId: string): void;
467
+ interface ScrollToComponentOptions {
468
+ id?: string;
469
+ }
470
+
471
+ declare function toggleComponentHighLighter(options: ComponentHighLighterOptions): void;
472
+ declare function highlight(instance: VueAppInstance): void;
473
+ declare function unhighlight(): void;
474
+ declare function inspectComponentHighLighter(): Promise<string>;
475
+ declare function scrollToComponent(options: ScrollToComponentOptions): void;
282
476
 
283
477
  declare enum DevToolsEvents {
284
478
  DEVTOOLS_STATE_UPDATED = "devtools:state-updated",
@@ -299,7 +493,7 @@ declare enum DevToolsEvents {
299
493
  CUSTOM_TABS_UPDATED = "custom-tabs:updated",
300
494
  CUSTOM_COMMANDS_UPDATED = "custom-commands:updated"
301
495
  }
302
- interface DevToolsEvent$1 {
496
+ interface DevToolsEvent {
303
497
  [DevToolsEvents.ADD_TIMELINE_EVENT]: (payload: TimelineEvent) => void;
304
498
  [DevToolsEvents.ROUTER_INFO_UPDATED]: (routerInfo: RouterInfo) => void;
305
499
  [DevToolsEvents.TOGGLE_COMPONENT_HIGHLIGHTER]: (payload: ComponentHighLighterOptions) => void;
@@ -330,224 +524,30 @@ interface DevToolsEvent$1 {
330
524
  [DevToolsEvents.CUSTOM_COMMANDS_UPDATED]: (payload: CustomCommand[]) => void;
331
525
  [DevToolsEvents.COMPONENT_UPDATED]: () => void;
332
526
  }
333
- type DevToolsEventParams<T extends keyof DevToolsEvent$1> = Parameters<DevToolsEvent$1[T]>;
334
-
335
- type PluginApi = DevToolsPluginApi;
336
- declare type PluginSettingsItem = {
337
- label: string;
338
- description?: string;
339
- } & ({
340
- type: 'boolean';
341
- defaultValue: boolean;
342
- } | {
343
- type: 'choice';
344
- defaultValue: string | number;
345
- options: {
346
- value: string | number;
347
- label: string;
348
- }[];
349
- component?: 'select' | 'button-group';
350
- } | {
351
- type: 'text';
352
- defaultValue: string;
353
- });
354
- interface PluginDescriptor {
355
- id: string;
356
- label: string;
357
- app: App<any>;
358
- packageName?: string;
359
- homepage?: string;
360
- componentStateTypes?: string[];
361
- logo?: string;
362
- disableAppScope?: boolean;
363
- disablePluginScope?: boolean;
364
- /**
365
- * Run the plugin setup and expose the api even if the devtools is not opened yet.
366
- * Useful to record timeline events early.
367
- */
368
- enableEarlyProxy?: boolean;
369
- settings?: Record<string, PluginSettingsItem>;
370
- }
371
- type PluginSetupFunction = (api: PluginApi) => void;
372
- type VueAppInstance = ComponentInternalInstance & {
373
- type: {
374
- _componentTag: string | undefined;
375
- components: Record<string, ComponentInternalInstance['type']>;
376
- __VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__: string;
377
- __isKeepAlive: boolean;
378
- devtools: {
379
- hide: boolean;
380
- };
381
- mixins: ComponentOptions[];
382
- extends: ComponentOptions;
383
- vuex: {
384
- getters: Record<string, unknown>;
385
- };
386
- computed: Record<string, unknown>;
387
- };
388
- __v_cache: Cache;
389
- __VUE_DEVTOOLS_NEXT_UID__: string;
390
- _isBeingDestroyed: boolean;
391
- _instance: VueAppInstance;
392
- _container: {
393
- _vnode: {
394
- component: VueAppInstance;
395
- };
396
- };
397
- isUnmounted: boolean;
398
- parent: VueAppInstance;
399
- appContext: {
400
- app: VueAppInstance & App & {
401
- __VUE_DEVTOOLS_NEXT_APP_RECORD_ID__: string;
402
- __VUE_DEVTOOLS_NEXT_APP_RECORD__: AppRecord;
403
- };
404
- };
405
- __VUE_DEVTOOLS_NEXT_APP_RECORD__: AppRecord;
406
- suspense: SuspenseBoundary & {
407
- suspenseKey: string;
408
- };
409
- renderContext: Record<string, unknown>;
410
- devtoolsRawSetupState: Record<string, unknown>;
411
- setupState: Record<string, unknown>;
412
- provides: Record<string | symbol, unknown>;
413
- ctx: Record<string, unknown>;
414
- } & App<any>;
415
- interface AppRecord {
416
- id: string | number;
417
- name: string;
418
- app?: App;
419
- version?: string;
420
- types?: Record<string, string | symbol>;
421
- instanceMap: Map<string, VueAppInstance>;
422
- rootInstance: VueAppInstance;
423
- api?: PluginApi;
424
- routerId?: string;
425
- moduleDetectives?: {
426
- vueRouter: boolean;
427
- pinia: boolean;
428
- vueI18n: boolean;
429
- };
430
- }
431
-
432
- type HookAppInstance = App & VueAppInstance;
433
- declare enum DevToolsHooks {
434
- APP_INIT = "app:init",
435
- APP_UNMOUNT = "app:unmount",
436
- COMPONENT_UPDATED = "component:updated",
437
- COMPONENT_ADDED = "component:added",
438
- COMPONENT_REMOVED = "component:removed",
439
- COMPONENT_EMIT = "component:emit",
440
- PERFORMANCE_START = "perf:start",
441
- PERFORMANCE_END = "perf:end",
442
- ADD_ROUTE = "router:add-route",
443
- REMOVE_ROUTE = "router:remove-route",
444
- RENDER_TRACKED = "render:tracked",
445
- RENDER_TRIGGERED = "render:triggered",
446
- APP_CONNECTED = "app:connected",
447
- SETUP_DEVTOOLS_PLUGIN = "devtools-plugin:setup"
448
- }
449
- interface DevToolsEvent {
450
- [DevToolsHooks.APP_INIT]: (app: VueAppInstance['appContext']['app'], version: string) => void;
451
- [DevToolsHooks.APP_CONNECTED]: () => void;
452
- [DevToolsHooks.COMPONENT_ADDED]: (app: HookAppInstance, uid: number, parentUid: number, component: VueAppInstance) => void;
453
- [DevToolsHooks.COMPONENT_UPDATED]: DevToolsEvent['component:added'];
454
- [DevToolsHooks.COMPONENT_REMOVED]: DevToolsEvent['component:added'];
455
- [DevToolsHooks.SETUP_DEVTOOLS_PLUGIN]: (pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction, options?: {
456
- target?: string;
457
- }) => void;
458
- }
459
- interface DevToolsHook {
460
- id: string;
461
- enabled?: boolean;
462
- devtoolsVersion: string;
463
- events: Map<DevToolsHooks, Function[]>;
464
- emit: (event: DevToolsHooks, ...payload: any[]) => void;
465
- on: <T extends Function>(event: DevToolsHooks, handler: T) => () => void;
466
- once: <T extends Function>(event: DevToolsHooks, handler: T) => void;
467
- off: <T extends Function>(event: DevToolsHooks, handler: T) => void;
468
- appRecords: AppRecord[];
469
- apps: Record<number, {
470
- componentCount: number;
471
- }>;
472
- cleanupBuffer?: (matchArg: unknown) => boolean;
473
- }
474
- interface VueHooks {
475
- on: {
476
- vueAppInit: (fn: DevToolsEvent[DevToolsHooks.APP_INIT]) => void;
477
- vueAppConnected: (fn: DevToolsEvent[DevToolsHooks.APP_CONNECTED]) => void;
478
- componentAdded: (fn: DevToolsEvent[DevToolsHooks.COMPONENT_ADDED]) => () => void;
479
- componentUpdated: (fn: DevToolsEvent[DevToolsHooks.COMPONENT_UPDATED]) => () => void;
480
- componentRemoved: (fn: DevToolsEvent[DevToolsHooks.COMPONENT_REMOVED]) => () => void;
481
- setupDevtoolsPlugin: (fn: DevToolsEvent[DevToolsHooks.SETUP_DEVTOOLS_PLUGIN]) => void;
482
- };
483
- setupDevToolsPlugin: (pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction) => void;
484
- }
485
-
486
- declare function addCustomTab(tab: CustomTab): void;
487
-
488
- interface DevToolsState {
489
- connected: boolean;
490
- clientConnected: boolean;
491
- vitePluginDetected: boolean;
492
- appRecords: AppRecord[];
493
- activeAppRecord: AppRecord | null;
494
- selectedComponentId: string | null;
495
- pluginBuffer: [PluginDescriptor, PluginSetupFunction][];
496
- tabs: CustomTab[];
497
- commands: CustomCommand[];
498
- activeAppRecordId: string | null;
499
- highPerfModeEnabled: boolean;
500
- }
501
-
502
- interface RouterInfo {
503
- currentRoute: RouteLocationNormalizedLoaded | null | {};
504
- routes: RouteRecordNormalized[];
505
- }
506
-
507
- interface DevToolsContext {
508
- appRecord: AppRecord | null;
509
- api: DevToolsPluginApi;
510
- inspector: Inspector[];
511
- timelineLayer: TimelineLayerItem[];
512
- routerInfo: RouterInfo;
513
- router: Router | null;
514
- activeInspectorTreeId: string;
515
- componentPluginHookBuffer: (() => void)[];
516
- clear: () => void;
517
- }
518
-
519
- interface DevToolsEnv {
520
- vitePluginDetected: boolean;
521
- }
522
-
523
- interface OpenInEditorOptions {
524
- baseUrl?: string;
525
- file?: string;
526
- line?: number;
527
- column?: number;
528
- }
529
- declare function openInEditor(options?: OpenInEditorOptions): void;
527
+ type DevToolsEventParams<T extends keyof DevToolsEvent> = Parameters<DevToolsEvent[T]>;
530
528
 
531
529
  declare const on: {
532
- readonly addTimelineEvent: (fn: DevToolsEvent$1[DevToolsEvents.ADD_TIMELINE_EVENT]) => void;
533
- readonly inspectComponent: (fn: DevToolsEvent$1[DevToolsEvents.COMPONENT_STATE_INSPECT]) => void;
534
- readonly visitComponentTree: (fn: DevToolsEvent$1[DevToolsEvents.VISIT_COMPONENT_TREE]) => void;
535
- readonly getInspectorTree: (fn: DevToolsEvent$1[DevToolsEvents.GET_INSPECTOR_TREE]) => void;
536
- readonly getInspectorState: (fn: DevToolsEvent$1[DevToolsEvents.GET_INSPECTOR_STATE]) => void;
537
- readonly sendInspectorTree: (fn: DevToolsEvent$1[DevToolsEvents.SEND_INSPECTOR_TREE]) => void;
538
- readonly sendInspectorState: (fn: DevToolsEvent$1[DevToolsEvents.SEND_INSPECTOR_STATE]) => void;
539
- readonly editInspectorState: (fn: DevToolsEvent$1[DevToolsEvents.EDIT_INSPECTOR_STATE]) => void;
530
+ readonly addTimelineEvent: (fn: DevToolsEvent[DevToolsEvents.ADD_TIMELINE_EVENT]) => void;
531
+ readonly inspectComponent: (fn: DevToolsEvent[DevToolsEvents.COMPONENT_STATE_INSPECT]) => void;
532
+ readonly visitComponentTree: (fn: DevToolsEvent[DevToolsEvents.VISIT_COMPONENT_TREE]) => void;
533
+ readonly getInspectorTree: (fn: DevToolsEvent[DevToolsEvents.GET_INSPECTOR_TREE]) => void;
534
+ readonly getInspectorState: (fn: DevToolsEvent[DevToolsEvents.GET_INSPECTOR_STATE]) => void;
535
+ readonly sendInspectorTree: (fn: DevToolsEvent[DevToolsEvents.SEND_INSPECTOR_TREE]) => void;
536
+ readonly sendInspectorState: (fn: DevToolsEvent[DevToolsEvents.SEND_INSPECTOR_STATE]) => void;
537
+ readonly editInspectorState: (fn: DevToolsEvent[DevToolsEvents.EDIT_INSPECTOR_STATE]) => void;
540
538
  readonly editComponentState: () => void;
541
- readonly componentUpdated: (fn: DevToolsEvent$1[DevToolsEvents.COMPONENT_UPDATED]) => void;
542
- readonly routerInfoUpdated: (fn: DevToolsEvent$1[DevToolsEvents.ROUTER_INFO_UPDATED]) => void;
543
- readonly getComponentBoundingRect: (fn: DevToolsEvent$1[DevToolsEvents.GET_COMPONENT_BOUNDING_RECT]) => void;
544
- readonly customTabsUpdated: (fn: DevToolsEvent$1[DevToolsEvents.CUSTOM_TABS_UPDATED]) => void;
545
- readonly customCommandsUpdated: (fn: DevToolsEvent$1[DevToolsEvents.CUSTOM_COMMANDS_UPDATED]) => void;
546
- readonly devtoolsStateUpdated: (fn: DevToolsEvent$1[DevToolsEvents.DEVTOOLS_STATE_UPDATED]) => void;
539
+ readonly componentUpdated: (fn: DevToolsEvent[DevToolsEvents.COMPONENT_UPDATED]) => void;
540
+ readonly routerInfoUpdated: (fn: DevToolsEvent[DevToolsEvents.ROUTER_INFO_UPDATED]) => void;
541
+ readonly getComponentBoundingRect: (fn: DevToolsEvent[DevToolsEvents.GET_COMPONENT_BOUNDING_RECT]) => void;
542
+ readonly customTabsUpdated: (fn: DevToolsEvent[DevToolsEvents.CUSTOM_TABS_UPDATED]) => void;
543
+ readonly customCommandsUpdated: (fn: DevToolsEvent[DevToolsEvents.CUSTOM_COMMANDS_UPDATED]) => void;
544
+ readonly devtoolsStateUpdated: (fn: DevToolsEvent[DevToolsEvents.DEVTOOLS_STATE_UPDATED]) => void;
547
545
  };
548
546
 
549
547
  declare function remove(): void;
550
548
 
549
+ declare function setupDevToolsPlugin(pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction): void;
550
+
551
551
  declare class DevToolsPluginApi {
552
552
  on: typeof on;
553
553
  clear: typeof remove;
@@ -584,10 +584,6 @@ declare class DevToolsPluginApi {
584
584
  getVueInspector(): Promise<ComponentInspector>;
585
585
  }
586
586
 
587
- declare function initDevTools(): void;
588
- declare function onDevToolsConnected(fn: () => void): Promise<void>;
589
- declare function onDevToolsClientConnected(fn: () => void): Promise<void>;
590
-
591
587
  declare const hook: VueHooks;
592
588
 
593
589
  declare const devtoolsState: DevToolsState;
@@ -596,6 +592,10 @@ declare const devtoolsContext: DevToolsContext;
596
592
 
597
593
  declare function setDevToolsEnv(env: Partial<DevToolsEnv>): void;
598
594
 
595
+ declare function initDevTools(): void;
596
+ declare function onDevToolsConnected(fn: () => void): Promise<void>;
597
+ declare function onDevToolsClientConnected(fn: () => void): Promise<void>;
598
+
599
599
  declare function toggleHighPerfMode(state?: boolean): void;
600
600
 
601
601
  declare function getInspectorStateValueType(value: any, raw?: boolean): string;
@@ -631,4 +631,4 @@ declare const devtools: {
631
631
  readonly api: DevToolsPluginApi;
632
632
  };
633
633
 
634
- export { type AddInspectorApiPayload, type AppRecord, type ComponentBoundingRect, type ComponentBoundingRectApiPayload, type ComponentHighLighterOptions, type ComponentInspector, type ComponentTreeNode, type CustomCommand, type CustomCommandAction, type CustomTab, type DevToolsContext, type DevToolsEnv, type DevToolsEvent, type DevToolsHook, DevToolsHooks, type DevToolsState, type DevToolsType, type Inspector, type InspectorApiPayload, type InspectorCustomState, type InspectorNodeTag, type InspectorState, type InspectorStateApiPayload, type InspectorStateEditorPayload, type InspectorTreeApiPayload, type OpenInEditorOptions, type PluginApi, type PluginDescriptor, type PluginSettingsItem, type PluginSetupFunction, type PropPath, type RouterInfo, type ScrollToComponentOptions, type TimelineEvent, type TimelineLayerItem, UNDEFINED, type VueAppInstance, type VueHooks, addCustomCommand, addCustomTab, addInspector, addTimelineLayer, type customTypeEnums, devtools, formatInspectorStateValue, getComponentInspector, getInspector, getInspectorStateValueType, getRaw, getTimelineLayer, highlight, inspectComponentHighLighter, onDevToolsClientConnected, onDevToolsConnected, openInEditor, parse, removeCustomCommand, scrollToComponent, setDevToolsEnv, setupDevToolsPlugin, stringify, toEdit, toSubmit, toggleComponentHighLighter, toggleComponentInspectorEnabled, toggleHighPerfMode, unhighlight, updateInspector };
634
+ export { type AddInspectorApiPayload, type AppRecord, type ComponentBoundingRect, type ComponentBoundingRectApiPayload, type ComponentHighLighterOptions, type ComponentInspector, type ComponentTreeNode, type CustomCommand, type CustomCommandAction, type CustomTab, type DevToolsContext, type DevToolsEnv, type DevToolsEvent$1 as DevToolsEvent, type DevToolsHook, DevToolsHooks, type DevToolsState, type DevToolsType, type Inspector, type InspectorApiPayload, type InspectorCustomState, type InspectorNodeTag, type InspectorState, type InspectorStateApiPayload, type InspectorStateEditorPayload, type InspectorTreeApiPayload, type OpenInEditorOptions, type PluginApi, type PluginDescriptor, type PluginSettingsItem, type PluginSetupFunction, type PropPath, type RouterInfo, type ScrollToComponentOptions, type TimelineEvent, type TimelineLayerItem, UNDEFINED, type VueAppInstance, type VueHooks, addCustomCommand, addCustomTab, addInspector, addTimelineLayer, type customTypeEnums, devtools, formatInspectorStateValue, getComponentInspector, getInspector, getInspectorStateValueType, getRaw, getTimelineLayer, highlight, inspectComponentHighLighter, onDevToolsClientConnected, onDevToolsConnected, openInEditor, parse, removeCustomCommand, scrollToComponent, setDevToolsEnv, setupDevToolsPlugin, stringify, toEdit, toSubmit, toggleComponentHighLighter, toggleComponentInspectorEnabled, toggleHighPerfMode, unhighlight, updateInspector };