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