@vue/devtools-kit 7.0.14 → 7.0.15

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.cts CHANGED
@@ -1,24 +1,8 @@
1
- import * as vue from 'vue';
2
- import { VNode } from 'vue';
3
- import * as vue_router from 'vue-router';
1
+ import { App, ComponentInternalInstance, ComponentOptions, SuspenseBoundary, VNode } from 'vue';
4
2
  import { RouteLocationNormalizedLoaded, RouteRecordNormalized, Router } from 'vue-router';
5
3
  export { Router } from 'vue-router';
6
- import { AppRecord, VueAppInstance, DevToolsState, PluginDescriptor, PluginSetupFunction } from '@vue/devtools-schema';
7
- import * as _vue_devtools_schema_dist from '@vue/devtools-schema/dist';
8
- import * as _vue_devtools_schema_src_types_vue from '@vue/devtools-schema/src/types/vue';
9
4
 
10
- declare const RouterKey = "__VUE_DEVTOOLS_ROUTER__";
11
-
12
- interface RouterInfo {
13
- currentRoute: RouteLocationNormalizedLoaded | null;
14
- routes: RouteRecordNormalized[];
15
- router: Router | null;
16
- }
17
- declare const devtoolsRouterInfo: RouterInfo;
18
- declare function normalizeRouterInfo(appRecord: AppRecord): void;
19
- declare function getRouterDevToolsId(id: string): string;
20
-
21
- interface VueInspector {
5
+ interface ComponentInspector {
22
6
  enabled: boolean;
23
7
  position: {
24
8
  x: number;
@@ -36,41 +20,33 @@ interface VueInspector {
36
20
  onUpdated: () => void;
37
21
  }
38
22
  declare function toggleComponentInspectorEnabled(enabled: boolean): void;
39
- declare function getVueInspector(): Promise<VueInspector | null>;
23
+ declare function getComponentInspector(): Promise<ComponentInspector>;
40
24
 
41
- interface InspectorCustomState {
42
- _custom?: {
43
- type?: string;
44
- displayText?: string;
45
- tooltipText?: string;
46
- value?: string | InspectorCustomState;
47
- stateTypeName?: string;
48
- fields?: {
49
- abstract?: boolean;
50
- };
25
+ interface TimelineEvent {
26
+ event: {
27
+ groupId: number;
28
+ time: number;
29
+ title: string;
30
+ subtitle: string;
31
+ data: Record<string, unknown>;
51
32
  };
33
+ layerId: string;
52
34
  }
53
- interface InspectorState {
54
- key: string;
55
- value: string | number | boolean | null | Record<string, unknown> | InspectorCustomState | Array<unknown>;
56
- type: string;
57
- stateType?: string;
58
- stateTypeName?: string;
59
- meta?: Record<string, boolean | string>;
60
- raw?: string;
61
- editable?: boolean;
62
- children?: {
63
- key: string;
64
- value: string | number;
65
- type: string;
66
- }[];
35
+ interface TimelineLayerItem {
36
+ id: string;
37
+ label: string;
38
+ color: number;
67
39
  }
68
- interface InspectorStateApiPayload {
69
- app: VueAppInstance;
70
- inspectorId: string;
40
+ declare function addTimelineLayer(payload: TimelineLayerItem): void;
41
+ declare function getTimelineLayer(): TimelineLayerItem[];
42
+
43
+ interface Inspector {
44
+ id: string;
71
45
  nodeId: string;
46
+ filter: string;
47
+ treeFilterPlaceholder: string;
72
48
  }
73
- interface AddInspectorApiPayload {
49
+ interface InspectorApiPayload {
74
50
  id: string;
75
51
  label: string;
76
52
  icon?: string;
@@ -81,87 +57,193 @@ interface AddInspectorApiPayload {
81
57
  action: (payload: unknown) => void;
82
58
  }[];
83
59
  }
60
+ declare function addInspector(payload: Inspector): void;
61
+ declare function getInspector(inspectorId: string): Inspector | undefined;
62
+ declare function updateInspector(inspectorId: string, payload: Partial<Inspector>): void;
84
63
 
85
- interface InspectorNodeTag {
64
+ type PluginApi = DevToolsPluginApi;
65
+ declare type PluginSettingsItem = {
86
66
  label: string;
87
- textColor: number;
88
- backgroundColor: number;
89
- tooltip?: string;
90
- }
91
- interface ComponentTreeNode {
92
- uid: number | 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 {
93
84
  id: string;
94
- name: string;
95
- renderKey: string | number;
96
- inactive: boolean;
97
- isFragment: boolean;
98
- children: ComponentTreeNode[];
99
- domOrder?: number[];
100
- tags: InspectorNodeTag[];
101
- autoOpen: boolean;
102
- file: string;
103
- }
104
- interface InspectorTreeApiPayload {
105
- app?: VueAppInstance;
106
- inspectorId?: string;
107
- filter?: string;
108
- instanceId?: string;
109
- rootNodes?: ComponentTreeNode[];
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>;
110
99
  }
111
-
112
- type Recordable = Record<PropertyKey, any>;
113
-
114
- type PropPath = string | string[];
115
- interface InspectorStateEditorPayload {
116
- app?: AppRecord['app'];
117
- inspectorId: string;
118
- nodeId: string;
119
- type: string;
120
- path: PropPath;
121
- state: {
122
- value: unknown;
123
- newKey: string;
124
- remove?: boolean;
125
- type: string;
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_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_APP_RECORD_ID__: string;
131
+ __VUE_DEVTOOLS_APP_RECORD__: AppRecord;
132
+ };
133
+ };
134
+ __VUE_DEVTOOLS_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;
126
158
  };
127
- set?: (obj: Recordable, path: PropPath, value: unknown, cb?: (object: Recordable, field: string, value: unknown) => void) => unknown;
128
159
  }
129
160
 
130
- interface ComponentBoundingRect {
131
- left: number;
132
- top: number;
133
- right: number;
134
- bottom: number;
135
- width: number;
136
- height: number;
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"
137
177
  }
138
- interface ComponentBoundingRectApiPayload {
139
- app?: VueAppInstance;
140
- inspectorId?: string;
141
- instanceId?: string;
142
- rect?: ComponentBoundingRect;
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) => void;
143
185
  }
144
-
145
- interface TimelineEventData {
146
- data: Record<string, InspectorCustomState>;
186
+ interface DevToolsHook {
187
+ id: string;
188
+ enabled?: boolean;
189
+ events: Map<DevToolsHooks, Function[]>;
190
+ emit: (event: DevToolsHooks, ...payload: any[]) => void;
191
+ on: <T extends Function>(event: DevToolsHooks, handler: T) => () => void;
192
+ once: <T extends Function>(event: DevToolsHooks, handler: T) => void;
193
+ off: <T extends Function>(event: DevToolsHooks, handler: T) => void;
194
+ appRecords: AppRecord[];
195
+ apps: Record<number, {
196
+ componentCount: number;
197
+ }>;
198
+ cleanupBuffer?: (matchArg: unknown) => boolean;
147
199
  }
148
- interface TimelineEvent {
149
- event: {
150
- groupId: number;
151
- time: number;
152
- title: string;
153
- subtitle: string;
154
- data: TimelineEventData;
200
+ interface VueHooks {
201
+ on: {
202
+ vueAppInit: (fn: DevToolsEvent$1[DevToolsHooks.APP_INIT]) => void;
203
+ vueAppConnected: (fn: DevToolsEvent$1[DevToolsHooks.APP_CONNECTED]) => void;
204
+ componentAdded: (fn: DevToolsEvent$1[DevToolsHooks.COMPONENT_ADDED]) => () => void;
205
+ componentUpdated: (fn: DevToolsEvent$1[DevToolsHooks.COMPONENT_UPDATED]) => () => void;
206
+ componentRemoved: (fn: DevToolsEvent$1[DevToolsHooks.COMPONENT_REMOVED]) => () => void;
207
+ setupDevtoolsPlugin: (fn: DevToolsEvent$1[DevToolsHooks.SETUP_DEVTOOLS_PLUGIN]) => void;
155
208
  };
156
- layerId: string;
209
+ setupDevToolsPlugin: (pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction) => void;
157
210
  }
158
211
 
159
- interface OpenInEditorOptions {
160
- file?: string;
161
- line?: number;
162
- column?: number;
212
+ interface CustomCommandAction {
213
+ type: 'url';
214
+ /**
215
+ * Url of the action, if set, execute the action will open the url
216
+ */
217
+ src: string;
163
218
  }
164
- declare function openInEditor(options?: OpenInEditorOptions): void;
219
+ interface CustomCommand {
220
+ /**
221
+ * The id of the command, should be unique
222
+ */
223
+ id: string;
224
+ title: string;
225
+ description?: string;
226
+ /**
227
+ * Order of the command, bigger number will be shown first
228
+ * @default 0
229
+ */
230
+ order?: number;
231
+ /**
232
+ * Icon of the tab, support any Iconify icons, or a url to an image
233
+ */
234
+ icon?: string;
235
+ /**
236
+ * - action of the command
237
+ * - __NOTE__: This will be ignored if `children` is set
238
+ */
239
+ action?: CustomCommandAction;
240
+ /**
241
+ * - children of action, if set, execute the action will show the children
242
+ */
243
+ children?: Omit<CustomCommand, 'children'>[];
244
+ }
245
+ declare function addCustomCommand(action: CustomCommand): void;
246
+ declare function removeCustomCommand(actionId: string): void;
165
247
 
166
248
  type TabCategory = 'pinned' | 'app' | 'modules' | 'advanced';
167
249
  type ModuleView = ModuleIframeView | ModuleVNodeView;
@@ -215,45 +297,163 @@ interface CustomTab {
215
297
  category?: TabCategory;
216
298
  }
217
299
 
218
- interface CustomCommandAction {
219
- type: 'url';
220
- /**
221
- * Url of the action, if set, execute the action will open the url
222
- */
223
- src: string;
300
+ declare function addCustomTab(tab: CustomTab): void;
301
+
302
+ interface DevToolsState {
303
+ connected: boolean;
304
+ clientConnected: boolean;
305
+ vitePluginDetected: boolean;
306
+ appRecords: AppRecord[];
307
+ activeAppRecord: AppRecord | null;
308
+ selectedComponentId: string | null;
309
+ pluginBuffer: [PluginDescriptor, PluginSetupFunction][];
310
+ tabs: CustomTab[];
311
+ commands: CustomCommand[];
312
+ activeAppRecordId: string | null;
224
313
  }
225
- interface CustomCommand {
226
- /**
227
- * The id of the command, should be unique
228
- */
314
+
315
+ interface RouterInfo {
316
+ currentRoute: RouteLocationNormalizedLoaded | null | {};
317
+ routes: RouteRecordNormalized[];
318
+ }
319
+
320
+ interface DevToolsContext {
321
+ appRecord: AppRecord | null;
322
+ api: DevToolsPluginApi;
323
+ inspector: Inspector[];
324
+ timelineLayer: TimelineLayerItem[];
325
+ routerInfo: RouterInfo;
326
+ router: Router | null;
327
+ activeInspectorTreeId: string;
328
+ componentPluginHookBuffer: (() => void)[];
329
+ clear: () => void;
330
+ }
331
+
332
+ interface DevToolsEnv {
333
+ vitePluginDetected: boolean;
334
+ }
335
+
336
+ interface InspectorNodeTag {
337
+ label: string;
338
+ textColor: number;
339
+ backgroundColor: number;
340
+ tooltip?: string;
341
+ }
342
+ interface ComponentTreeNode {
343
+ uid: number | string;
229
344
  id: string;
230
- title: string;
231
- description?: string;
232
- /**
233
- * Order of the command, bigger number will be shown first
234
- * @default 0
235
- */
236
- order?: number;
237
- /**
238
- * Icon of the tab, support any Iconify icons, or a url to an image
239
- */
345
+ name: string;
346
+ renderKey: string | number;
347
+ inactive: boolean;
348
+ isFragment: boolean;
349
+ children: ComponentTreeNode[];
350
+ domOrder?: number[];
351
+ tags: InspectorNodeTag[];
352
+ autoOpen: boolean;
353
+ file: string;
354
+ }
355
+ interface InspectorTreeApiPayload {
356
+ app?: VueAppInstance;
357
+ inspectorId?: string;
358
+ filter?: string;
359
+ instanceId?: string;
360
+ rootNodes?: ComponentTreeNode[];
361
+ }
362
+
363
+ interface ComponentBoundingRect {
364
+ left: number;
365
+ top: number;
366
+ right: number;
367
+ bottom: number;
368
+ width: number;
369
+ height: number;
370
+ }
371
+ interface ComponentBoundingRectApiPayload {
372
+ app?: VueAppInstance;
373
+ inspectorId?: string;
374
+ instanceId?: string;
375
+ rect?: ComponentBoundingRect;
376
+ }
377
+
378
+ interface InspectorCustomState {
379
+ _custom?: {
380
+ type?: string;
381
+ displayText?: string;
382
+ tooltipText?: string;
383
+ value?: string | InspectorCustomState;
384
+ stateTypeName?: string;
385
+ fields?: {
386
+ abstract?: boolean;
387
+ };
388
+ };
389
+ }
390
+ interface InspectorState {
391
+ key: string;
392
+ value: string | number | boolean | null | Record<string, unknown> | InspectorCustomState | Array<unknown>;
393
+ type: string;
394
+ stateType?: string;
395
+ stateTypeName?: string;
396
+ meta?: Record<string, boolean | string>;
397
+ raw?: string;
398
+ editable?: boolean;
399
+ children?: {
400
+ key: string;
401
+ value: string | number;
402
+ type: string;
403
+ }[];
404
+ }
405
+ interface InspectorStateApiPayload {
406
+ app: VueAppInstance;
407
+ inspectorId: string;
408
+ nodeId: string;
409
+ state: {
410
+ id: string;
411
+ name: string;
412
+ file: string | undefined;
413
+ state: InspectorState[];
414
+ instance: VueAppInstance | undefined;
415
+ };
416
+ }
417
+ interface AddInspectorApiPayload {
418
+ id: string;
419
+ label: string;
240
420
  icon?: string;
241
- /**
242
- * - action of the command
243
- * - __NOTE__: This will be ignored if `children` is set
244
- */
245
- action?: CustomCommandAction;
246
- /**
247
- * - children of action, if set, execute the action will show the children
248
- */
249
- children?: Omit<CustomCommand, 'children'>[];
421
+ treeFilterPlaceholder?: string;
422
+ actions?: {
423
+ icon: string;
424
+ tooltip: string;
425
+ action: (payload: unknown) => void;
426
+ }[];
427
+ }
428
+
429
+ type Recordable = Record<PropertyKey, any>;
430
+
431
+ type PropPath = string | string[];
432
+ interface InspectorStateEditorPayload {
433
+ app?: AppRecord['app'];
434
+ inspectorId: string;
435
+ nodeId: string;
436
+ type: string;
437
+ path: PropPath;
438
+ state: {
439
+ value: unknown;
440
+ newKey: string;
441
+ remove?: boolean;
442
+ type: string;
443
+ };
444
+ set?: (obj: Recordable, path: PropPath, value: unknown, cb?: (object: Recordable, field: string, value: unknown) => void) => unknown;
250
445
  }
251
- declare function addCustomCommand(action: CustomCommand): void;
252
- declare function removeCustomCommand(actionId: CustomCommand['id']): void;
253
446
 
254
- declare function clear(): void;
447
+ type customTypeEnums = 'function' | 'bigint' | 'map' | 'set' | 'store' | 'router' | 'component' | 'component-definition' | 'HTMLElement' | 'component-definition';
255
448
 
256
- interface ToggleComponentInspectorOptions {
449
+ interface OpenInEditorOptions {
450
+ file?: string;
451
+ line?: number;
452
+ column?: number;
453
+ }
454
+ declare function openInEditor(options?: OpenInEditorOptions): void;
455
+
456
+ interface ComponentHighLighterOptions {
257
457
  bounds: ComponentBoundingRect;
258
458
  name?: string;
259
459
  id?: string;
@@ -263,12 +463,18 @@ interface ScrollToComponentOptions {
263
463
  id?: string;
264
464
  }
265
465
 
466
+ declare function toggleComponentHighLighter(options: ComponentHighLighterOptions): void;
467
+ declare function highlight(instance: VueAppInstance): void;
468
+ declare function unhighlight(): void;
469
+ declare function inspectComponentHighLighter(): Promise<string>;
470
+ declare function scrollToComponent(options: ScrollToComponentOptions): void;
471
+
266
472
  declare enum DevToolsEvents {
267
473
  DEVTOOLS_STATE_UPDATED = "devtools:state-updated",
268
474
  DEVTOOLS_CONNECTED_UPDATED = "devtools:connected-updated",
269
475
  ROUTER_INFO_UPDATED = "router-info:updated",
270
476
  COMPONENT_STATE_INSPECT = "component-state:inspect",
271
- TOGGLE_COMPONENT_INSPECTOR = "component-inspector:toggle",
477
+ TOGGLE_COMPONENT_HIGHLIGHTER = "component-highlighter:toggle",
272
478
  GET_COMPONENT_BOUNDING_RECT = "component-bounding-rect:get",
273
479
  SCROLL_TO_COMPONENT = "scroll-to-component",
274
480
  GET_INSPECTOR_TREE = "inspector-tree:get",
@@ -282,23 +488,18 @@ declare enum DevToolsEvents {
282
488
  CUSTOM_COMMANDS_UPDATED = "custom-commands:updated"
283
489
  }
284
490
  interface DevToolsEvent {
491
+ [DevToolsEvents.ADD_TIMELINE_EVENT]: (payload: TimelineEvent) => void;
492
+ [DevToolsEvents.ROUTER_INFO_UPDATED]: (routerInfo: RouterInfo) => void;
493
+ [DevToolsEvents.TOGGLE_COMPONENT_HIGHLIGHTER]: (payload: ComponentHighLighterOptions) => void;
494
+ [DevToolsEvents.SCROLL_TO_COMPONENT]: (payload: ScrollToComponentOptions) => void;
495
+ [DevToolsEvents.GET_COMPONENT_BOUNDING_RECT]: (payload: ComponentBoundingRectApiPayload) => void;
285
496
  [DevToolsEvents.DEVTOOLS_STATE_UPDATED]: (state: DevToolsState, oldState: DevToolsState) => void;
286
497
  [DevToolsEvents.DEVTOOLS_CONNECTED_UPDATED]: (state: DevToolsState, oldState: DevToolsState) => void;
287
- [DevToolsEvents.ROUTER_INFO_UPDATED]: (routerInfo: RouterInfo) => void;
288
498
  [DevToolsEvents.COMPONENT_STATE_INSPECT]: (payload: {
289
499
  componentInstance: VueAppInstance | undefined;
290
500
  app: VueAppInstance | undefined;
291
- instanceData: {
292
- id: string;
293
- name: string;
294
- file: string | undefined;
295
- state: InspectorState[];
296
- instance: VueAppInstance | undefined;
297
- };
501
+ instanceData: InspectorStateApiPayload['state'];
298
502
  }) => void;
299
- [DevToolsEvents.TOGGLE_COMPONENT_INSPECTOR]: (payload: ToggleComponentInspectorOptions) => void;
300
- [DevToolsEvents.GET_COMPONENT_BOUNDING_RECT]: (payload: ComponentBoundingRectApiPayload) => void;
301
- [DevToolsEvents.SCROLL_TO_COMPONENT]: (payload: ScrollToComponentOptions) => void;
302
503
  [DevToolsEvents.GET_INSPECTOR_TREE]: (payload: InspectorTreeApiPayload) => void;
303
504
  [DevToolsEvents.SEND_INSPECTOR_TREE]: (payload: string) => void;
304
505
  [DevToolsEvents.GET_INSPECTOR_STATE]: (payload: InspectorStateApiPayload) => void;
@@ -310,40 +511,42 @@ interface DevToolsEvent {
310
511
  treeNode: ComponentTreeNode;
311
512
  filter: string;
312
513
  }) => void;
313
- [DevToolsEvents.ADD_TIMELINE_EVENT]: (payload: TimelineEvent) => void;
314
514
  [DevToolsEvents.CUSTOM_TABS_UPDATED]: (payload: CustomTab[]) => void;
315
515
  [DevToolsEvents.CUSTOM_COMMANDS_UPDATED]: (payload: CustomCommand[]) => void;
316
516
  }
517
+ type DevToolsEventParams<T extends keyof DevToolsEvent> = Parameters<DevToolsEvent[T]>;
518
+
317
519
  declare const on: {
318
- devtoolsStateUpdated(fn: DevToolsEvent[DevToolsEvents.DEVTOOLS_STATE_UPDATED]): void;
319
- routerInfoUpdated(fn: DevToolsEvent[DevToolsEvents.ROUTER_INFO_UPDATED]): void;
320
- getComponentBoundingRect(fn: DevToolsEvent[DevToolsEvents.GET_COMPONENT_BOUNDING_RECT]): void;
321
- inspectComponent(fn: DevToolsEvent[DevToolsEvents.COMPONENT_STATE_INSPECT]): void;
322
- visitComponentTree(fn: DevToolsEvent[DevToolsEvents.VISIT_COMPONENT_TREE]): void;
323
- getInspectorTree(fn: DevToolsEvent[DevToolsEvents.GET_INSPECTOR_TREE]): void;
324
- getInspectorState(fn: DevToolsEvent[DevToolsEvents.GET_INSPECTOR_STATE]): void;
325
- sendInspectorTree(fn: DevToolsEvent[DevToolsEvents.SEND_INSPECTOR_TREE]): void;
326
- sendInspectorState(fn: DevToolsEvent[DevToolsEvents.SEND_INSPECTOR_STATE]): void;
327
- addTimelineEvent(fn: DevToolsEvent[DevToolsEvents.ADD_TIMELINE_EVENT]): void;
328
- editInspectorState(fn: DevToolsEvent[DevToolsEvents.EDIT_INSPECTOR_STATE]): void;
329
- editComponentState(): void;
330
- customTabsUpdated(fn: DevToolsEvent[DevToolsEvents.CUSTOM_TABS_UPDATED]): void;
331
- customCommandsUpdated(fn: DevToolsEvent[DevToolsEvents.CUSTOM_COMMANDS_UPDATED]): void;
520
+ readonly addTimelineEvent: (fn: DevToolsEvent[DevToolsEvents.ADD_TIMELINE_EVENT]) => void;
521
+ readonly inspectComponent: (fn: DevToolsEvent[DevToolsEvents.COMPONENT_STATE_INSPECT]) => void;
522
+ readonly visitComponentTree: (fn: DevToolsEvent[DevToolsEvents.VISIT_COMPONENT_TREE]) => void;
523
+ readonly getInspectorTree: (fn: DevToolsEvent[DevToolsEvents.GET_INSPECTOR_TREE]) => void;
524
+ readonly getInspectorState: (fn: DevToolsEvent[DevToolsEvents.GET_INSPECTOR_STATE]) => void;
525
+ readonly sendInspectorTree: (fn: DevToolsEvent[DevToolsEvents.SEND_INSPECTOR_TREE]) => void;
526
+ readonly sendInspectorState: (fn: DevToolsEvent[DevToolsEvents.SEND_INSPECTOR_STATE]) => void;
527
+ readonly editInspectorState: (fn: DevToolsEvent[DevToolsEvents.EDIT_INSPECTOR_STATE]) => void;
528
+ readonly editComponentState: () => void;
529
+ readonly routerInfoUpdated: (fn: DevToolsEvent[DevToolsEvents.ROUTER_INFO_UPDATED]) => void;
530
+ readonly getComponentBoundingRect: (fn: DevToolsEvent[DevToolsEvents.GET_COMPONENT_BOUNDING_RECT]) => void;
531
+ readonly customTabsUpdated: (fn: DevToolsEvent[DevToolsEvents.CUSTOM_TABS_UPDATED]) => void;
532
+ readonly customCommandsUpdated: (fn: DevToolsEvent[DevToolsEvents.CUSTOM_COMMANDS_UPDATED]) => void;
533
+ readonly devtoolsStateUpdated: (fn: DevToolsEvent[DevToolsEvents.DEVTOOLS_STATE_UPDATED]) => void;
332
534
  };
333
535
 
334
- declare function setupDevToolsPlugin(pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction): Promise<any>;
536
+ declare function remove(): void;
537
+
538
+ declare function setupDevToolsPlugin(pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction): void;
335
539
 
336
540
  declare class DevToolsPluginApi {
337
541
  on: typeof on;
338
- clear: typeof clear;
542
+ clear: typeof remove;
339
543
  constructor();
340
- toggleApp(id: string): Promise<void>;
341
- addTimelineEvent(payload: TimelineEvent): void;
342
- toggleComponentInspector(payload: Parameters<DevToolsEvent[DevToolsEvents.TOGGLE_COMPONENT_INSPECTOR]>[0]): void;
343
- inspectComponentInspector(): Promise<string>;
344
- scrollToComponent(payload: Parameters<DevToolsEvent[DevToolsEvents.SCROLL_TO_COMPONENT]>[0]): void;
345
- getComponentBoundingRect(payload: Parameters<DevToolsEvent[DevToolsEvents.GET_COMPONENT_BOUNDING_RECT]>[0]): string;
346
- getInspectorTree(payload?: Parameters<DevToolsEvent[DevToolsEvents.GET_INSPECTOR_TREE]>[0]): Promise<string>;
544
+ addTimelineLayer(payload: TimelineLayerItem): void;
545
+ addTimelineEvent(...params: DevToolsEventParams<DevToolsEvents.ADD_TIMELINE_EVENT>): void;
546
+ addInspector(payload: InspectorApiPayload): void;
547
+ highlightElement(instance: VueAppInstance): void;
548
+ unhighlightElement(): void;
549
+ getInspectorTree(payload?: DevToolsEventParams<DevToolsEvents.GET_INSPECTOR_TREE>[0]): Promise<string>;
347
550
  getInspectorState(payload?: {
348
551
  inspectorId?: string;
349
552
  nodeId?: string;
@@ -351,276 +554,54 @@ declare class DevToolsPluginApi {
351
554
  editInspectorState(payload: InspectorStateEditorPayload): Promise<void>;
352
555
  sendInspectorTree(inspectorId: string): Promise<void>;
353
556
  sendInspectorState(inspectorId: string): Promise<void>;
354
- addCustomTab(tab: CustomTab): void;
355
- addCustomCommand(action: CustomCommand): void;
356
- removeCustomCommand(actionId: CustomCommand['id']): void;
357
- addInspector(payload: AddInspectorApiPayload): void;
358
- openInEditor(payload: OpenInEditorOptions): void;
359
- highlightElement(instance: any): void;
360
- unhighlightElement(): void;
361
- getComponentInstances(app: any): Promise<any[]>;
362
- getVueInspector(): Promise<VueInspector | null>;
363
- visitComponentTree(payload: Parameters<DevToolsEvent[DevToolsEvents.VISIT_COMPONENT_TREE]>[0]): void;
364
- addTimelineLayer(payload: {
365
- id: string;
366
- label: string;
367
- color: number;
368
- }): void;
557
+ getComponentInstances(app: VueAppInstance): Promise<VueAppInstance[]>;
558
+ visitComponentTree(...params: DevToolsEventParams<DevToolsEvents.VISIT_COMPONENT_TREE>): void;
369
559
  notifyComponentUpdate(): void;
370
560
  now(): number;
371
561
  getSettings(): {
372
562
  logStoreChanges: null;
373
563
  };
564
+ toggleComponentInspector(...params: DevToolsEventParams<DevToolsEvents.TOGGLE_COMPONENT_HIGHLIGHTER>): void;
565
+ inspectComponentInspector(): Promise<string>;
566
+ scrollToComponent(...params: DevToolsEventParams<DevToolsEvents.SCROLL_TO_COMPONENT>): void;
567
+ getComponentBoundingRect(...params: DevToolsEventParams<DevToolsEvents.GET_COMPONENT_BOUNDING_RECT>): string;
568
+ toggleApp(id: string): Promise<void>;
569
+ addCustomTab(tab: CustomTab): void;
570
+ addCustomCommand(action: CustomCommand): void;
571
+ removeCustomCommand(actionId: CustomCommand['id']): void;
572
+ openInEditor(payload: OpenInEditorOptions): void;
573
+ getVueInspector(): Promise<ComponentInspector>;
374
574
  }
375
575
 
576
+ declare function setDevToolsEnv(env: Partial<DevToolsEnv>): void;
577
+
376
578
  declare function initDevTools(): void;
377
579
  declare function onDevToolsConnected(fn: () => void): Promise<void>;
378
580
  declare function onDevToolsClientConnected(fn: () => void): Promise<void>;
379
581
 
380
- declare function addCustomTab(tab: CustomTab): void;
381
-
382
582
  declare function getInspectorStateValueType(value: any, raw?: boolean): string;
383
583
  declare function formatInspectorStateValue(value: any, quotes?: boolean): any;
384
- declare function getRawValue(value: InspectorState['value']): any;
385
- declare function toEdit(value: unknown): string;
386
- declare function toSubmit(value: string): any;
584
+ declare function getRaw(value: InspectorState['value']): {
585
+ value: object | string | number | boolean | null;
586
+ inherit: {} | {
587
+ abstract: true;
588
+ };
589
+ customType?: customTypeEnums;
590
+ };
591
+ declare function toEdit(value: unknown, customType?: customTypeEnums): string;
592
+ declare function toSubmit(value: string, customType?: customTypeEnums): any;
387
593
 
388
594
  declare function stringify<T extends object = Record<string, unknown>>(data: T): string | string[];
389
595
  declare function parse(data: string, revive?: boolean): any;
390
596
 
391
- declare function now(): number;
392
-
393
- declare const vueBuiltins: Set<string>;
394
- declare const symbolRE: RegExp;
395
- declare const rawTypeRE: RegExp;
396
- declare const specialTypeRE: RegExp;
397
- declare const fnTypeRE: RegExp;
398
- declare const MAX_STRING_SIZE = 10000;
399
- declare const MAX_ARRAY_SIZE = 5000;
400
597
  declare const UNDEFINED = "__vue_devtool_undefined__";
401
- declare const INFINITY = "__vue_devtool_infinity__";
402
- declare const NEGATIVE_INFINITY = "__vue_devtool_negative_infinity__";
403
- declare const NAN = "__vue_devtool_nan__";
404
- declare const ESC: {
405
- '<': string;
406
- '>': string;
407
- '"': string;
408
- '&': string;
409
- };
410
598
 
411
599
  declare const devtools: {
412
- state: _vue_devtools_schema_src_types_vue.DevToolsState;
413
- context: {
414
- appRecord: _vue_devtools_schema_dist.AppRecord;
415
- api: DevToolsPluginApi;
416
- inspector: {
417
- id: string;
418
- nodeId: string;
419
- filter: string;
420
- treeFilterPlaceholder: string;
421
- }[];
422
- timelineLayer: {
423
- id: string;
424
- label: string;
425
- color: number;
426
- }[];
427
- routerInfo: RouterInfo;
428
- router: vue_router.Router;
429
- activeInspectorTreeId: string;
430
- componentPluginHookBuffer: (() => void)[];
431
- clear: () => void;
432
- };
600
+ state: DevToolsState;
601
+ context: DevToolsContext;
602
+ hook: VueHooks;
433
603
  init: typeof initDevTools;
434
- hook: {
435
- on: {
436
- vueAppInit(fn: (app: vue.App<any> & vue.ComponentInternalInstance & {
437
- type: {
438
- _componentTag: string | undefined;
439
- components: Record<string, vue.ConcreteComponent<{}, any, any, vue.ComputedOptions, vue.MethodOptions, {}, any>>;
440
- __VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__: string;
441
- __isKeepAlive: boolean;
442
- devtools: {
443
- hide: boolean;
444
- };
445
- mixins: vue.ComponentOptions[];
446
- extends: vue.ComponentOptions;
447
- vuex: {
448
- getters: Record<string, unknown>;
449
- };
450
- computed: Record<string, unknown>;
451
- };
452
- __v_cache: Map<string | number | symbol | vue.ConcreteComponent, globalThis.VNode<vue.RendererNode, vue.RendererElement, {
453
- [key: string]: any;
454
- }>>;
455
- __VUE_DEVTOOLS_UID__: string;
456
- _isBeingDestroyed: boolean;
457
- _instance: _vue_devtools_schema_dist.VueAppInstance;
458
- _container: {
459
- _vnode: {
460
- component: _vue_devtools_schema_dist.VueAppInstance;
461
- };
462
- };
463
- isUnmounted: boolean;
464
- parent: _vue_devtools_schema_dist.VueAppInstance;
465
- appContext: {
466
- app: vue.ComponentInternalInstance & any & vue.App<any> & {
467
- __VUE_DEVTOOLS_APP_RECORD_ID__: string;
468
- __VUE_DEVTOOLS_APP_RECORD__: _vue_devtools_schema_dist.AppRecord;
469
- };
470
- };
471
- __VUE_DEVTOOLS_APP_RECORD__: _vue_devtools_schema_dist.AppRecord;
472
- suspense: vue.SuspenseBoundary & {
473
- suspenseKey: string;
474
- };
475
- renderContext: Record<string, unknown>;
476
- devtoolsRawSetupState: Record<string, unknown>;
477
- setupState: Record<string, unknown>;
478
- provides: Record<string | symbol, unknown>;
479
- ctx: Record<string, unknown>;
480
- } & {
481
- __VUE_DEVTOOLS_APP_RECORD_ID__: string;
482
- __VUE_DEVTOOLS_APP_RECORD__: _vue_devtools_schema_dist.AppRecord;
483
- }, version: string) => void): void;
484
- vueAppConnected(fn: () => void): void;
485
- componentAdded(fn: (app: vue.App<any> & vue.ComponentInternalInstance & {
486
- type: {
487
- _componentTag: string | undefined;
488
- components: Record<string, vue.ConcreteComponent<{}, any, any, vue.ComputedOptions, vue.MethodOptions, {}, any>>;
489
- __VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__: string;
490
- __isKeepAlive: boolean;
491
- devtools: {
492
- hide: boolean;
493
- };
494
- mixins: vue.ComponentOptions[];
495
- extends: vue.ComponentOptions;
496
- vuex: {
497
- getters: Record<string, unknown>;
498
- };
499
- computed: Record<string, unknown>;
500
- };
501
- __v_cache: Map<string | number | symbol | vue.ConcreteComponent, globalThis.VNode<vue.RendererNode, vue.RendererElement, {
502
- [key: string]: any;
503
- }>>;
504
- __VUE_DEVTOOLS_UID__: string;
505
- _isBeingDestroyed: boolean;
506
- _instance: _vue_devtools_schema_dist.VueAppInstance;
507
- _container: {
508
- _vnode: {
509
- component: _vue_devtools_schema_dist.VueAppInstance;
510
- };
511
- };
512
- isUnmounted: boolean;
513
- parent: _vue_devtools_schema_dist.VueAppInstance;
514
- appContext: {
515
- app: vue.ComponentInternalInstance & any & vue.App<any> & {
516
- __VUE_DEVTOOLS_APP_RECORD_ID__: string;
517
- __VUE_DEVTOOLS_APP_RECORD__: _vue_devtools_schema_dist.AppRecord;
518
- };
519
- };
520
- __VUE_DEVTOOLS_APP_RECORD__: _vue_devtools_schema_dist.AppRecord;
521
- suspense: vue.SuspenseBoundary & {
522
- suspenseKey: string;
523
- };
524
- renderContext: Record<string, unknown>;
525
- devtoolsRawSetupState: Record<string, unknown>;
526
- setupState: Record<string, unknown>;
527
- provides: Record<string | symbol, unknown>;
528
- ctx: Record<string, unknown>;
529
- }, uid: number, parentUid: number, component: _vue_devtools_schema_dist.VueAppInstance) => void): () => void;
530
- componentUpdated(fn: (app: vue.App<any> & vue.ComponentInternalInstance & {
531
- type: {
532
- _componentTag: string | undefined;
533
- components: Record<string, vue.ConcreteComponent<{}, any, any, vue.ComputedOptions, vue.MethodOptions, {}, any>>;
534
- __VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__: string;
535
- __isKeepAlive: boolean;
536
- devtools: {
537
- hide: boolean;
538
- };
539
- mixins: vue.ComponentOptions[];
540
- extends: vue.ComponentOptions;
541
- vuex: {
542
- getters: Record<string, unknown>;
543
- };
544
- computed: Record<string, unknown>;
545
- };
546
- __v_cache: Map<string | number | symbol | vue.ConcreteComponent, globalThis.VNode<vue.RendererNode, vue.RendererElement, {
547
- [key: string]: any;
548
- }>>;
549
- __VUE_DEVTOOLS_UID__: string;
550
- _isBeingDestroyed: boolean;
551
- _instance: _vue_devtools_schema_dist.VueAppInstance;
552
- _container: {
553
- _vnode: {
554
- component: _vue_devtools_schema_dist.VueAppInstance;
555
- };
556
- };
557
- isUnmounted: boolean;
558
- parent: _vue_devtools_schema_dist.VueAppInstance;
559
- appContext: {
560
- app: vue.ComponentInternalInstance & any & vue.App<any> & {
561
- __VUE_DEVTOOLS_APP_RECORD_ID__: string;
562
- __VUE_DEVTOOLS_APP_RECORD__: _vue_devtools_schema_dist.AppRecord;
563
- };
564
- };
565
- __VUE_DEVTOOLS_APP_RECORD__: _vue_devtools_schema_dist.AppRecord;
566
- suspense: vue.SuspenseBoundary & {
567
- suspenseKey: string;
568
- };
569
- renderContext: Record<string, unknown>;
570
- devtoolsRawSetupState: Record<string, unknown>;
571
- setupState: Record<string, unknown>;
572
- provides: Record<string | symbol, unknown>;
573
- ctx: Record<string, unknown>;
574
- }, uid: number, parentUid: number, component: _vue_devtools_schema_dist.VueAppInstance) => void): () => void;
575
- componentRemoved(fn: (app: vue.App<any> & vue.ComponentInternalInstance & {
576
- type: {
577
- _componentTag: string | undefined;
578
- components: Record<string, vue.ConcreteComponent<{}, any, any, vue.ComputedOptions, vue.MethodOptions, {}, any>>;
579
- __VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__: string;
580
- __isKeepAlive: boolean;
581
- devtools: {
582
- hide: boolean;
583
- };
584
- mixins: vue.ComponentOptions[];
585
- extends: vue.ComponentOptions;
586
- vuex: {
587
- getters: Record<string, unknown>;
588
- };
589
- computed: Record<string, unknown>;
590
- };
591
- __v_cache: Map<string | number | symbol | vue.ConcreteComponent, globalThis.VNode<vue.RendererNode, vue.RendererElement, {
592
- [key: string]: any;
593
- }>>;
594
- __VUE_DEVTOOLS_UID__: string;
595
- _isBeingDestroyed: boolean;
596
- _instance: _vue_devtools_schema_dist.VueAppInstance;
597
- _container: {
598
- _vnode: {
599
- component: _vue_devtools_schema_dist.VueAppInstance;
600
- };
601
- };
602
- isUnmounted: boolean;
603
- parent: _vue_devtools_schema_dist.VueAppInstance;
604
- appContext: {
605
- app: vue.ComponentInternalInstance & any & vue.App<any> & {
606
- __VUE_DEVTOOLS_APP_RECORD_ID__: string;
607
- __VUE_DEVTOOLS_APP_RECORD__: _vue_devtools_schema_dist.AppRecord;
608
- };
609
- };
610
- __VUE_DEVTOOLS_APP_RECORD__: _vue_devtools_schema_dist.AppRecord;
611
- suspense: vue.SuspenseBoundary & {
612
- suspenseKey: string;
613
- };
614
- renderContext: Record<string, unknown>;
615
- devtoolsRawSetupState: Record<string, unknown>;
616
- setupState: Record<string, unknown>;
617
- provides: Record<string | symbol, unknown>;
618
- ctx: Record<string, unknown>;
619
- }, uid: number, parentUid: number, component: _vue_devtools_schema_dist.VueAppInstance) => void): () => void;
620
- setupDevtoolsPlugin(fn: (pluginDescriptor: _vue_devtools_schema_dist.PluginDescriptor, setupFn: _vue_devtools_schema_dist.PluginSetupFunction) => void): void;
621
- };
622
- };
623
604
  readonly api: DevToolsPluginApi;
624
605
  };
625
606
 
626
- export { type AddInspectorApiPayload, type ComponentBoundingRect, type ComponentBoundingRectApiPayload, type ComponentTreeNode, type CustomCommand, type CustomCommandAction, type CustomTab, ESC, INFINITY, type InspectorCustomState, type InspectorNodeTag, type InspectorState, type InspectorStateApiPayload, type InspectorStateEditorPayload, type InspectorTreeApiPayload, MAX_ARRAY_SIZE, MAX_STRING_SIZE, type ModuleIframeView, type ModuleVNodeView, type ModuleView, NAN, NEGATIVE_INFINITY, type OpenInEditorOptions, type PropPath, type RouterInfo, RouterKey, type ScrollToComponentOptions, type TimelineEvent, type TimelineEventData, type ToggleComponentInspectorOptions, UNDEFINED, type VueInspector, addCustomCommand, addCustomTab, devtools, devtoolsRouterInfo, fnTypeRE, formatInspectorStateValue, getInspectorStateValueType, getRawValue, getRouterDevToolsId, getVueInspector, normalizeRouterInfo, now, onDevToolsClientConnected, onDevToolsConnected, openInEditor, parse, rawTypeRE, removeCustomCommand, setupDevToolsPlugin, specialTypeRE, stringify, symbolRE, toEdit, toSubmit, toggleComponentInspectorEnabled, vueBuiltins };
607
+ 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 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, unhighlight, updateInspector };