@nuxt/devtools-kit-nightly 2.0.0-28980754.13f6fd0

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.
@@ -0,0 +1,773 @@
1
+ import { VNode, MaybeRefOrGetter } from 'vue';
2
+ import { BirpcGroup } from 'birpc';
3
+ import { Component, NuxtOptions, NuxtPage, NuxtLayout, NuxtApp, Nuxt } from 'nuxt/schema';
4
+ import { Import, UnimportMeta } from 'unimport';
5
+ import { VitePluginInspectorOptions } from 'vite-plugin-vue-inspector';
6
+ import { RouteRecordNormalized } from 'vue-router';
7
+ import { StorageMounts, Nitro } from 'nitropack';
8
+ import { StorageValue } from 'unstorage';
9
+ import { ResolvedConfig } from 'vite';
10
+ import { NuxtAnalyzeMeta } from '@nuxt/schema';
11
+ import { Options } from 'execa';
12
+
13
+ type TabCategory = 'pinned' | 'app' | 'vue-devtools' | 'analyze' | 'server' | 'modules' | 'documentation' | 'advanced';
14
+
15
+ interface ModuleCustomTab {
16
+ /**
17
+ * The name of the tab, must be unique
18
+ */
19
+ name: string;
20
+ /**
21
+ * Icon of the tab, support any Iconify icons, or a url to an image
22
+ */
23
+ icon?: string;
24
+ /**
25
+ * Title of the tab
26
+ */
27
+ title: string;
28
+ /**
29
+ * Main view of the tab
30
+ */
31
+ view: ModuleView;
32
+ /**
33
+ * Category of the tab
34
+ * @default 'app'
35
+ */
36
+ category?: TabCategory;
37
+ /**
38
+ * Insert static vnode to the tab entry
39
+ *
40
+ * Advanced options. You don't usually need this.
41
+ */
42
+ extraTabVNode?: VNode;
43
+ /**
44
+ * Require local authentication to access the tab
45
+ * It's highly recommended to enable this if the tab have sensitive information or have access to the OS
46
+ *
47
+ * @default false
48
+ */
49
+ requireAuth?: boolean;
50
+ }
51
+ interface ModuleLaunchView {
52
+ /**
53
+ * A view for module to lazy launch some actions
54
+ */
55
+ type: 'launch';
56
+ title?: string;
57
+ icon?: string;
58
+ description: string;
59
+ /**
60
+ * Action buttons
61
+ */
62
+ actions: ModuleLaunchAction[];
63
+ }
64
+ interface ModuleIframeView {
65
+ /**
66
+ * Iframe view
67
+ */
68
+ type: 'iframe';
69
+ /**
70
+ * Url of the iframe
71
+ */
72
+ src: string;
73
+ /**
74
+ * Persist the iframe instance even if the tab is not active
75
+ *
76
+ * @default true
77
+ */
78
+ persistent?: boolean;
79
+ }
80
+ interface ModuleVNodeView {
81
+ /**
82
+ * Vue's VNode view
83
+ */
84
+ type: 'vnode';
85
+ /**
86
+ * Send vnode to the client, they must be static and serializable
87
+ *
88
+ * Call `nuxt.hook('devtools:customTabs:refresh')` to trigger manual refresh
89
+ */
90
+ vnode: VNode;
91
+ }
92
+ interface ModuleLaunchAction {
93
+ /**
94
+ * Label of the action button
95
+ */
96
+ label: string;
97
+ /**
98
+ * Additional HTML attributes to the action button
99
+ */
100
+ attrs?: Record<string, string>;
101
+ /**
102
+ * Indicate if the action is pending, will show a loading indicator and disable the button
103
+ */
104
+ pending?: boolean;
105
+ /**
106
+ * Function to handle the action, this is executed on the server side.
107
+ * Will automatically refresh the tabs after the action is resolved.
108
+ */
109
+ handle?: () => void | Promise<void>;
110
+ /**
111
+ * Treat the action as a link, will open the link in a new tab
112
+ */
113
+ src?: string;
114
+ }
115
+ type ModuleView = ModuleIframeView | ModuleLaunchView | ModuleVNodeView;
116
+ interface ModuleIframeTabLazyOptions {
117
+ description?: string;
118
+ onLoad?: () => Promise<void>;
119
+ }
120
+ interface ModuleBuiltinTab {
121
+ name: string;
122
+ icon?: string;
123
+ title?: string;
124
+ path?: string;
125
+ category?: TabCategory;
126
+ show?: () => MaybeRefOrGetter<any>;
127
+ badge?: () => MaybeRefOrGetter<number | string | undefined>;
128
+ onClick?: () => void;
129
+ }
130
+ type ModuleTabInfo = ModuleCustomTab | ModuleBuiltinTab;
131
+ type CategorizedTabs = [TabCategory, (ModuleCustomTab | ModuleBuiltinTab)[]][];
132
+
133
+ interface HookInfo {
134
+ name: string;
135
+ start: number;
136
+ end?: number;
137
+ duration?: number;
138
+ listeners: number;
139
+ executions: number[];
140
+ }
141
+ interface ImageMeta {
142
+ width: number;
143
+ height: number;
144
+ orientation?: number;
145
+ type?: string;
146
+ mimeType?: string;
147
+ }
148
+ interface PackageUpdateInfo {
149
+ name: string;
150
+ current: string;
151
+ latest: string;
152
+ needsUpdate: boolean;
153
+ }
154
+ type PackageManagerName = 'npm' | 'yarn' | 'pnpm' | 'bun';
155
+ type NpmCommandType = 'install' | 'uninstall' | 'update';
156
+ interface NpmCommandOptions {
157
+ dev?: boolean;
158
+ global?: boolean;
159
+ }
160
+ interface AutoImportsWithMetadata {
161
+ imports: Import[];
162
+ metadata?: UnimportMeta;
163
+ dirs: string[];
164
+ }
165
+ interface RouteInfo extends Pick<RouteRecordNormalized, 'name' | 'path' | 'meta' | 'props' | 'children'> {
166
+ file?: string;
167
+ }
168
+ interface ServerRouteInfo {
169
+ route: string;
170
+ filepath: string;
171
+ method?: string;
172
+ type: 'api' | 'route' | 'runtime' | 'collection';
173
+ routes?: ServerRouteInfo[];
174
+ }
175
+ type ServerRouteInputType = 'string' | 'number' | 'boolean' | 'file' | 'date' | 'time' | 'datetime-local';
176
+ interface ServerRouteInput {
177
+ active: boolean;
178
+ key: string;
179
+ value: any;
180
+ type?: ServerRouteInputType;
181
+ }
182
+ interface Payload {
183
+ url: string;
184
+ time: number;
185
+ data?: Record<string, any>;
186
+ state?: Record<string, any>;
187
+ functions?: Record<string, any>;
188
+ }
189
+ interface ServerTaskInfo {
190
+ name: string;
191
+ handler: string;
192
+ description: string;
193
+ type: 'collection' | 'task';
194
+ tasks?: ServerTaskInfo[];
195
+ }
196
+ interface ScannedNitroTasks {
197
+ tasks: {
198
+ [name: string]: {
199
+ handler: string;
200
+ description: string;
201
+ };
202
+ };
203
+ scheduledTasks: {
204
+ [cron: string]: string[];
205
+ };
206
+ }
207
+ interface PluginInfoWithMetic {
208
+ src: string;
209
+ mode?: 'client' | 'server' | 'all';
210
+ ssr?: boolean;
211
+ metric?: PluginMetric;
212
+ }
213
+ interface PluginMetric {
214
+ src: string;
215
+ start: number;
216
+ end: number;
217
+ duration: number;
218
+ }
219
+ interface LoadingTimeMetric {
220
+ ssrStart?: number;
221
+ appInit?: number;
222
+ appLoad?: number;
223
+ pageStart?: number;
224
+ pageEnd?: number;
225
+ pluginInit?: number;
226
+ hmrStart?: number;
227
+ hmrEnd?: number;
228
+ }
229
+ interface BasicModuleInfo {
230
+ entryPath?: string;
231
+ meta?: {
232
+ name?: string;
233
+ };
234
+ }
235
+ interface InstalledModuleInfo {
236
+ name?: string;
237
+ isPackageModule: boolean;
238
+ isUninstallable: boolean;
239
+ info?: ModuleStaticInfo;
240
+ entryPath?: string;
241
+ timings?: Record<string, number | undefined>;
242
+ meta?: {
243
+ name?: string;
244
+ };
245
+ }
246
+ interface ModuleStaticInfo {
247
+ name: string;
248
+ description: string;
249
+ repo: string;
250
+ npm: string;
251
+ icon?: string;
252
+ github: string;
253
+ website: string;
254
+ learn_more: string;
255
+ category: string;
256
+ type: ModuleType;
257
+ stats: ModuleStats;
258
+ maintainers: MaintainerInfo[];
259
+ contributors: GitHubContributor[];
260
+ compatibility: ModuleCompatibility;
261
+ }
262
+ interface ModuleCompatibility {
263
+ nuxt: string;
264
+ requires: {
265
+ bridge?: boolean | 'optional';
266
+ };
267
+ }
268
+ interface ModuleStats {
269
+ downloads: number;
270
+ stars: number;
271
+ publishedAt: number;
272
+ createdAt: number;
273
+ }
274
+ type CompatibilityStatus = 'working' | 'wip' | 'unknown' | 'not-working';
275
+ type ModuleType = 'community' | 'official' | '3rd-party';
276
+ interface MaintainerInfo {
277
+ name: string;
278
+ github: string;
279
+ twitter?: string;
280
+ }
281
+ interface GitHubContributor {
282
+ login: string;
283
+ name?: string;
284
+ avatar_url?: string;
285
+ }
286
+ interface VueInspectorClient {
287
+ enabled: boolean;
288
+ position: {
289
+ x: number;
290
+ y: number;
291
+ };
292
+ linkParams: {
293
+ file: string;
294
+ line: number;
295
+ column: number;
296
+ };
297
+ enable: () => void;
298
+ disable: () => void;
299
+ toggleEnabled: () => void;
300
+ openInEditor: (url: URL) => void;
301
+ onUpdated: () => void;
302
+ }
303
+ type VueInspectorData = VueInspectorClient['linkParams'] & VueInspectorClient['position'];
304
+ type AssetType = 'image' | 'font' | 'video' | 'audio' | 'text' | 'json' | 'other';
305
+ interface AssetInfo {
306
+ path: string;
307
+ type: AssetType;
308
+ publicPath: string;
309
+ filePath: string;
310
+ size: number;
311
+ mtime: number;
312
+ layer?: string;
313
+ }
314
+ interface AssetEntry {
315
+ path: string;
316
+ content: string;
317
+ encoding?: BufferEncoding;
318
+ override?: boolean;
319
+ }
320
+ interface CodeSnippet {
321
+ code: string;
322
+ lang: string;
323
+ name: string;
324
+ docs?: string;
325
+ }
326
+ interface ComponentRelationship {
327
+ id: string;
328
+ deps: string[];
329
+ }
330
+ interface ComponentWithRelationships {
331
+ component: Component;
332
+ dependencies?: string[];
333
+ dependents?: string[];
334
+ }
335
+ interface CodeServerOptions {
336
+ codeBinary: string;
337
+ launchArg: string;
338
+ licenseTermsArg: string;
339
+ connectionTokenArg: string;
340
+ }
341
+
342
+ type CodeServerType = 'ms-code-cli' | 'ms-code-server' | 'coder-code-server';
343
+ interface ModuleOptions {
344
+ /**
345
+ * Enable DevTools
346
+ *
347
+ * @default true
348
+ */
349
+ enabled?: boolean;
350
+ /**
351
+ * Custom tabs
352
+ *
353
+ * This is in static format, for dynamic injection, call `nuxt.hook('devtools:customTabs')` instead
354
+ */
355
+ customTabs?: ModuleCustomTab[];
356
+ /**
357
+ * VS Code Server integration options.
358
+ */
359
+ vscode?: VSCodeIntegrationOptions;
360
+ /**
361
+ * Enable Vue Component Inspector
362
+ *
363
+ * @default true
364
+ */
365
+ componentInspector?: boolean | VitePluginInspectorOptions;
366
+ /**
367
+ * Enable vite-plugin-inspect
368
+ *
369
+ * @default true
370
+ */
371
+ viteInspect?: boolean;
372
+ /**
373
+ * Disable dev time authorization check.
374
+ *
375
+ * **NOT RECOMMENDED**, only use this if you know what you are doing.
376
+ *
377
+ * @see https://github.com/nuxt/devtools/pull/257
378
+ * @default false
379
+ */
380
+ disableAuthorization?: boolean;
381
+ /**
382
+ * Props for the iframe element, useful for environment with stricter CSP
383
+ */
384
+ iframeProps?: Record<string, string | boolean>;
385
+ /**
386
+ * Experimental features
387
+ */
388
+ experimental?: {
389
+ /**
390
+ * Timeline tab
391
+ * @deprecated Use `timeline.enable` instead
392
+ */
393
+ timeline?: boolean;
394
+ };
395
+ /**
396
+ * Options for the timeline tab
397
+ */
398
+ timeline?: {
399
+ /**
400
+ * Enable timeline tab
401
+ *
402
+ * @default false
403
+ */
404
+ enabled?: boolean;
405
+ /**
406
+ * Track on function calls
407
+ */
408
+ functions?: {
409
+ include?: (string | RegExp | ((item: Import) => boolean))[];
410
+ /**
411
+ * Include from specific modules
412
+ *
413
+ * @default ['#app', '@unhead/vue']
414
+ */
415
+ includeFrom?: string[];
416
+ exclude?: (string | RegExp | ((item: Import) => boolean))[];
417
+ };
418
+ };
419
+ /**
420
+ * Options for assets tab
421
+ */
422
+ assets?: {
423
+ /**
424
+ * Allowed file extensions for assets tab to upload.
425
+ * To security concern.
426
+ *
427
+ * Set to '*' to disbale this limitation entirely
428
+ *
429
+ * @default Common media and txt files
430
+ */
431
+ uploadExtensions?: '*' | string[];
432
+ };
433
+ /**
434
+ * Enable anonymous telemetry, helping us improve Nuxt DevTools.
435
+ *
436
+ * By default it will respect global Nuxt telemetry settings.
437
+ */
438
+ telemetry?: boolean;
439
+ }
440
+ interface ModuleGlobalOptions {
441
+ /**
442
+ * List of projects to enable devtools for. Only works when devtools is installed globally.
443
+ */
444
+ projects?: string[];
445
+ }
446
+ interface VSCodeIntegrationOptions {
447
+ /**
448
+ * Enable VS Code Server integration
449
+ */
450
+ enabled?: boolean;
451
+ /**
452
+ * Start VS Code Server on boot
453
+ *
454
+ * @default false
455
+ */
456
+ startOnBoot?: boolean;
457
+ /**
458
+ * Port to start VS Code Server
459
+ *
460
+ * @default 3080
461
+ */
462
+ port?: number;
463
+ /**
464
+ * Reuse existing server if available (same port)
465
+ */
466
+ reuseExistingServer?: boolean;
467
+ /**
468
+ * Determine whether to use code-server or vs code tunnel
469
+ *
470
+ * @default 'local-serve'
471
+ */
472
+ mode?: 'local-serve' | 'tunnel';
473
+ /**
474
+ * Options for VS Code tunnel
475
+ */
476
+ tunnel?: VSCodeTunnelOptions;
477
+ /**
478
+ * Determines which binary and arguments to use for VS Code.
479
+ *
480
+ * By default, uses the MS Code Server (ms-code-server).
481
+ * Can alternatively use the open source Coder code-server (coder-code-server),
482
+ * or the MS VS Code CLI (ms-code-cli)
483
+ * @default 'ms-code-server'
484
+ */
485
+ codeServer?: CodeServerType;
486
+ /**
487
+ * Host address to listen on. Unspecified by default.
488
+ */
489
+ host?: string;
490
+ }
491
+ interface VSCodeTunnelOptions {
492
+ /**
493
+ * the machine name for port forwarding service
494
+ *
495
+ * default: device hostname
496
+ */
497
+ name?: string;
498
+ }
499
+ interface NuxtDevToolsOptions {
500
+ behavior: {
501
+ telemetry: boolean | null;
502
+ openInEditor: string | undefined;
503
+ };
504
+ ui: {
505
+ componentsGraphShowGlobalComponents: boolean;
506
+ componentsGraphShowLayouts: boolean;
507
+ componentsGraphShowNodeModules: boolean;
508
+ componentsGraphShowPages: boolean;
509
+ componentsGraphShowWorkspace: boolean;
510
+ componentsView: 'list' | 'graph';
511
+ hiddenTabCategories: string[];
512
+ hiddenTabs: string[];
513
+ interactionCloseOnOutsideClick: boolean;
514
+ minimizePanelInactive: number;
515
+ pinnedTabs: string[];
516
+ scale: number;
517
+ showExperimentalFeatures: boolean;
518
+ showHelpButtons: boolean;
519
+ showPanel: boolean | null;
520
+ sidebarExpanded: boolean;
521
+ sidebarScrollable: boolean;
522
+ };
523
+ serverRoutes: {
524
+ selectedRoute: ServerRouteInfo | null;
525
+ view: 'tree' | 'list';
526
+ inputDefaults: Record<string, ServerRouteInput[]>;
527
+ sendFrom: 'app' | 'devtools';
528
+ };
529
+ serverTasks: {
530
+ enabled: boolean;
531
+ selectedTask: ServerTaskInfo | null;
532
+ view: 'tree' | 'list';
533
+ inputDefaults: Record<string, ServerRouteInput[]>;
534
+ };
535
+ assets: {
536
+ view: 'grid' | 'list';
537
+ };
538
+ }
539
+
540
+ interface AnalyzeBuildMeta extends NuxtAnalyzeMeta {
541
+ features: {
542
+ bundleClient: boolean;
543
+ bundleNitro: boolean;
544
+ viteInspect: boolean;
545
+ };
546
+ size: {
547
+ clientBundle?: number;
548
+ nitroBundle?: number;
549
+ };
550
+ }
551
+ interface AnalyzeBuildsInfo {
552
+ isBuilding: boolean;
553
+ builds: AnalyzeBuildMeta[];
554
+ }
555
+
556
+ interface TerminalBase {
557
+ id: string;
558
+ name: string;
559
+ description?: string;
560
+ icon?: string;
561
+ }
562
+ type TerminalAction = 'restart' | 'terminate' | 'clear' | 'remove';
563
+ interface SubprocessOptions extends Options {
564
+ command: string;
565
+ args?: string[];
566
+ }
567
+ interface TerminalInfo extends TerminalBase {
568
+ /**
569
+ * Whether the terminal can be restarted
570
+ */
571
+ restartable?: boolean;
572
+ /**
573
+ * Whether the terminal can be terminated
574
+ */
575
+ terminatable?: boolean;
576
+ /**
577
+ * Whether the terminal is terminated
578
+ */
579
+ isTerminated?: boolean;
580
+ /**
581
+ * Content buffer
582
+ */
583
+ buffer?: string;
584
+ }
585
+ interface TerminalState extends TerminalInfo {
586
+ /**
587
+ * User action to restart the terminal, when not provided, this action will be disabled
588
+ */
589
+ onActionRestart?: () => Promise<void> | void;
590
+ /**
591
+ * User action to terminate the terminal, when not provided, this action will be disabled
592
+ */
593
+ onActionTerminate?: () => Promise<void> | void;
594
+ }
595
+
596
+ interface WizardFunctions {
597
+ enablePages: (nuxt: any) => Promise<void>;
598
+ }
599
+ type WizardActions = keyof WizardFunctions;
600
+ type GetWizardArgs<T extends WizardActions> = WizardFunctions[T] extends (nuxt: any, ...args: infer A) => any ? A : never;
601
+
602
+ interface ServerFunctions {
603
+ getServerConfig: () => NuxtOptions;
604
+ getServerData: (token: string) => Promise<NuxtServerData>;
605
+ getServerRuntimeConfig: () => Record<string, any>;
606
+ getModuleOptions: () => ModuleOptions;
607
+ getComponents: () => Component[];
608
+ getComponentsRelationships: () => Promise<ComponentRelationship[]>;
609
+ getAutoImports: () => AutoImportsWithMetadata;
610
+ getServerPages: () => NuxtPage[];
611
+ getCustomTabs: () => ModuleCustomTab[];
612
+ getServerHooks: () => HookInfo[];
613
+ getServerLayouts: () => NuxtLayout[];
614
+ getStaticAssets: () => Promise<AssetInfo[]>;
615
+ getServerRoutes: () => ServerRouteInfo[];
616
+ getServerTasks: () => ScannedNitroTasks | null;
617
+ getServerApp: () => NuxtApp | undefined;
618
+ getOptions: <T extends keyof NuxtDevToolsOptions>(tab: T) => Promise<NuxtDevToolsOptions[T]>;
619
+ updateOptions: <T extends keyof NuxtDevToolsOptions>(tab: T, settings: Partial<NuxtDevToolsOptions[T]>) => Promise<void>;
620
+ clearOptions: () => Promise<void>;
621
+ checkForUpdateFor: (name: string) => Promise<PackageUpdateInfo | undefined>;
622
+ getNpmCommand: (command: NpmCommandType, packageName: string, options?: NpmCommandOptions) => Promise<string[] | undefined>;
623
+ runNpmCommand: (token: string, command: NpmCommandType, packageName: string, options?: NpmCommandOptions) => Promise<{
624
+ processId: string;
625
+ } | undefined>;
626
+ getTerminals: () => TerminalInfo[];
627
+ getTerminalDetail: (token: string, id: string) => Promise<TerminalInfo | undefined>;
628
+ runTerminalAction: (token: string, id: string, action: TerminalAction) => Promise<boolean>;
629
+ getStorageMounts: () => Promise<StorageMounts>;
630
+ getStorageKeys: (base?: string) => Promise<string[]>;
631
+ getStorageItem: (token: string, key: string) => Promise<StorageValue>;
632
+ setStorageItem: (token: string, key: string, value: StorageValue) => Promise<void>;
633
+ removeStorageItem: (token: string, key: string) => Promise<void>;
634
+ getAnalyzeBuildInfo: () => Promise<AnalyzeBuildsInfo>;
635
+ generateAnalyzeBuildName: () => Promise<string>;
636
+ startAnalyzeBuild: (token: string, name: string) => Promise<string>;
637
+ clearAnalyzeBuilds: (token: string, names?: string[]) => Promise<void>;
638
+ getImageMeta: (token: string, filepath: string) => Promise<ImageMeta | undefined>;
639
+ getTextAssetContent: (token: string, filepath: string, limit?: number) => Promise<string | undefined>;
640
+ writeStaticAssets: (token: string, file: AssetEntry[], folder: string) => Promise<string[]>;
641
+ deleteStaticAsset: (token: string, filepath: string) => Promise<void>;
642
+ renameStaticAsset: (token: string, oldPath: string, newPath: string) => Promise<void>;
643
+ telemetryEvent: (payload: object, immediate?: boolean) => void;
644
+ customTabAction: (name: string, action: number) => Promise<boolean>;
645
+ runWizard: <T extends WizardActions>(token: string, name: T, ...args: GetWizardArgs<T>) => Promise<void>;
646
+ openInEditor: (filepath: string) => Promise<boolean>;
647
+ restartNuxt: (token: string, hard?: boolean) => Promise<void>;
648
+ installNuxtModule: (token: string, name: string, dry?: boolean) => Promise<InstallModuleReturn>;
649
+ uninstallNuxtModule: (token: string, name: string, dry?: boolean) => Promise<InstallModuleReturn>;
650
+ enableTimeline: (dry: boolean) => Promise<[string, string]>;
651
+ requestForAuth: (info?: string, origin?: string) => Promise<void>;
652
+ verifyAuthToken: (token: string) => Promise<boolean>;
653
+ }
654
+ interface ClientFunctions {
655
+ refresh: (event: ClientUpdateEvent) => void;
656
+ callHook: (hook: string, ...args: any[]) => Promise<void>;
657
+ navigateTo: (path: string) => void;
658
+ onTerminalData: (_: {
659
+ id: string;
660
+ data: string;
661
+ }) => void;
662
+ onTerminalExit: (_: {
663
+ id: string;
664
+ code?: number;
665
+ }) => void;
666
+ }
667
+ interface NuxtServerData {
668
+ nuxt: NuxtOptions;
669
+ nitro?: Nitro['options'];
670
+ vite: {
671
+ server?: ResolvedConfig;
672
+ client?: ResolvedConfig;
673
+ };
674
+ }
675
+ type ClientUpdateEvent = keyof ServerFunctions;
676
+
677
+ /**
678
+ * @internal
679
+ */
680
+ interface NuxtDevtoolsServerContext {
681
+ nuxt: Nuxt;
682
+ options: ModuleOptions;
683
+ rpc: BirpcGroup<ClientFunctions, ServerFunctions>;
684
+ /**
685
+ * Hook to open file in editor
686
+ */
687
+ openInEditorHooks: ((filepath: string) => boolean | void | Promise<boolean | void>)[];
688
+ /**
689
+ * Invalidate client cache for a function and ask for re-fetching
690
+ */
691
+ refresh: (event: keyof ServerFunctions) => void;
692
+ /**
693
+ * Ensure dev auth token is valid, throw if not
694
+ */
695
+ ensureDevAuthToken: (token: string) => Promise<void>;
696
+ extendServerRpc: <ClientFunctions = Record<string, never>, ServerFunctions = Record<string, never>>(name: string, functions: ServerFunctions) => BirpcGroup<ClientFunctions, ServerFunctions>;
697
+ }
698
+ interface NuxtDevtoolsInfo {
699
+ version: string;
700
+ packagePath: string;
701
+ isGlobalInstall: boolean;
702
+ }
703
+ interface InstallModuleReturn {
704
+ configOriginal: string;
705
+ configGenerated: string;
706
+ commands: string[];
707
+ processId: string;
708
+ }
709
+
710
+ declare module '@nuxt/schema' {
711
+ interface NuxtHooks {
712
+ /**
713
+ * Called before devtools starts. Useful to detect if devtools is enabled.
714
+ */
715
+ 'devtools:before': () => void;
716
+ /**
717
+ * Called after devtools is initialized.
718
+ */
719
+ 'devtools:initialized': (info: NuxtDevtoolsInfo) => void;
720
+ /**
721
+ * Hooks to extend devtools tabs.
722
+ */
723
+ 'devtools:customTabs': (tabs: ModuleCustomTab[]) => void;
724
+ /**
725
+ * Retrigger update for custom tabs, `devtools:customTabs` will be called again.
726
+ */
727
+ 'devtools:customTabs:refresh': () => void;
728
+ /**
729
+ * Register a terminal.
730
+ */
731
+ 'devtools:terminal:register': (terminal: TerminalState) => void;
732
+ /**
733
+ * Write to a terminal.
734
+ *
735
+ * Returns true if terminal is found.
736
+ */
737
+ 'devtools:terminal:write': (_: {
738
+ id: string;
739
+ data: string;
740
+ }) => void;
741
+ /**
742
+ * Remove a terminal from devtools.
743
+ *
744
+ * Returns true if terminal is found and deleted.
745
+ */
746
+ 'devtools:terminal:remove': (_: {
747
+ id: string;
748
+ }) => void;
749
+ /**
750
+ * Mark a terminal as terminated.
751
+ */
752
+ 'devtools:terminal:exit': (_: {
753
+ id: string;
754
+ code?: number;
755
+ }) => void;
756
+ }
757
+ }
758
+ declare module '@nuxt/schema' {
759
+ /**
760
+ * Runtime Hooks
761
+ */
762
+ interface RuntimeNuxtHooks {
763
+ /**
764
+ * On terminal data.
765
+ */
766
+ 'devtools:terminal:data': (payload: {
767
+ id: string;
768
+ data: string;
769
+ }) => void;
770
+ }
771
+ }
772
+
773
+ export type { CodeServerType as $, AnalyzeBuildMeta as A, BasicModuleInfo as B, ClientFunctions as C, ModuleStaticInfo as D, ModuleCompatibility as E, ModuleStats as F, CompatibilityStatus as G, HookInfo as H, ImageMeta as I, ModuleType as J, MaintainerInfo as K, LoadingTimeMetric as L, ModuleCustomTab as M, NuxtDevtoolsInfo as N, GitHubContributor as O, PluginMetric as P, AssetType as Q, RouteInfo as R, SubprocessOptions as S, TerminalState as T, AssetInfo as U, VueInspectorData as V, AssetEntry as W, CodeSnippet as X, ComponentRelationship as Y, ComponentWithRelationships as Z, CodeServerOptions as _, VueInspectorClient as a, ModuleOptions as a0, ModuleGlobalOptions as a1, VSCodeIntegrationOptions as a2, VSCodeTunnelOptions as a3, NuxtDevToolsOptions as a4, NuxtServerData as a5, ClientUpdateEvent as a6, NuxtDevtoolsServerContext as a7, InstallModuleReturn as a8, TerminalBase as a9, TerminalAction as aa, TerminalInfo as ab, WizardFunctions as ac, WizardActions as ad, GetWizardArgs as ae, ServerFunctions as b, AnalyzeBuildsInfo as c, TabCategory as d, ModuleLaunchView as e, ModuleIframeView as f, ModuleVNodeView as g, ModuleLaunchAction as h, ModuleView as i, ModuleIframeTabLazyOptions as j, ModuleBuiltinTab as k, ModuleTabInfo as l, CategorizedTabs as m, PackageUpdateInfo as n, PackageManagerName as o, NpmCommandType as p, NpmCommandOptions as q, AutoImportsWithMetadata as r, ServerRouteInfo as s, ServerRouteInputType as t, ServerRouteInput as u, Payload as v, ServerTaskInfo as w, ScannedNitroTasks as x, PluginInfoWithMetic as y, InstalledModuleInfo as z };