@nuxt/devtools-kit 4.0.0-alpha.10 → 4.0.0-alpha.12

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 DELETED
@@ -1,277 +0,0 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
- import { ViteDevToolsNodeContext } from '@vitejs/devtools-kit';
3
- import { BirpcGroup } from 'birpc';
4
- import { ChildProcess } from 'node:child_process';
5
- import { Result } from 'tinyexec';
6
- import { N as NuxtDevtoolsServerContext, M as ModuleCustomTab, a as NuxtDevtoolsInfo, S as SubprocessOptions, T as TerminalState } from './shared/devtools-kit.DepvFgru.cjs';
7
- import * as nostics from 'nostics';
8
- import { defineDiagnostics } from 'nostics';
9
- export { createConsoleReporter, defineDiagnostics } from 'nostics';
10
- import { Nuxt } from 'nuxt/schema';
11
- import 'vue';
12
- import 'unimport';
13
- import 'vue-router';
14
- import 'unstorage';
15
- import 'vite';
16
- import 'nitro/types';
17
- import 'nitropack';
18
-
19
- /**
20
- * Canonical docs URL for a Nuxt DevTools diagnostic code.
21
- *
22
- * Each code links to a per-code anchor in the v4 migration guide, e.g.
23
- * `NDT_DEP_0001` → `.../module/migration-v4#ndt_dep_0001`.
24
- */
25
- declare function diagnosticsDocsBase(code: string | number): string;
26
- /**
27
- * Parameters shared by every deprecation code: the API being used and its
28
- * recommended replacement. Interpolated into the `why`/`fix` messages.
29
- */
30
- interface DeprecationParams {
31
- /** The deprecated API / option being used. */
32
- api: string;
33
- /** The recommended replacement to migrate to. */
34
- replacement: string;
35
- }
36
- /**
37
- * The Nuxt DevTools diagnostics catalog.
38
- *
39
- * Codes are grouped by prefix:
40
- * - `NDT_DEP_xxxx` — soft/hard deprecations (this is the only range used today).
41
- *
42
- * Severity is **not** encoded here; it is chosen per emission via the reporter
43
- * `method` (`warn` by default, `error` for hard breaks).
44
- */
45
- declare const diagnosticCodes: {
46
- /** `startSubprocess().getProcess()` → `getResult()`. */
47
- NDT_DEP_0001: {
48
- why: (p: DeprecationParams) => string;
49
- fix: (p: DeprecationParams) => string;
50
- };
51
- /** `extendServerRpc` → `onDevtoolsReady((ctx) => ctx.rpc.register(...))`. */
52
- NDT_DEP_0003: {
53
- why: (p: DeprecationParams) => string;
54
- fix: (p: DeprecationParams) => string;
55
- };
56
- /** `startSubprocess` → `onDevtoolsReady((ctx) => ctx.terminals.startChildProcess(...))`. */
57
- NDT_DEP_0004: {
58
- why: (p: DeprecationParams) => string;
59
- fix: (p: DeprecationParams) => string;
60
- };
61
- /** `addCustomTab` → `onDevtoolsReady((ctx) => ctx.docks.register(...))`. */
62
- NDT_DEP_0005: {
63
- why: (p: DeprecationParams) => string;
64
- fix: (p: DeprecationParams) => string;
65
- };
66
- /** `refreshCustomTabs` → `onDevtoolsReady((ctx) => ctx.docks.register(...))`. */
67
- NDT_DEP_0006: {
68
- why: (p: DeprecationParams) => string;
69
- fix: (p: DeprecationParams) => string;
70
- };
71
- /** Direct `nuxt.devtools.rpc` access (`broadcast` / `functions`). */
72
- NDT_DEP_0007: {
73
- why: (p: DeprecationParams) => string;
74
- fix: (p: DeprecationParams) => string;
75
- };
76
- /** Removed `vscode` module option → `codeServer`. */
77
- NDT_DEP_0008: {
78
- why: (p: DeprecationParams) => string;
79
- fix: (p: DeprecationParams) => string;
80
- };
81
- /** `getServerData()` RPC → the Data Inspector panel's `Nuxt Application` source. */
82
- NDT_DEP_0009: {
83
- why: (p: DeprecationParams) => string;
84
- fix: (p: DeprecationParams) => string;
85
- };
86
- };
87
- type NuxtDiagnosticCode = keyof typeof diagnosticCodes;
88
- /**
89
- * Standalone catalog that prints to the terminal via nostics'
90
- * {@link createConsoleReporter} (default method `warn`). Works before the Vite
91
- * DevTools kit connects, so it is the fallback sink for pre-connect emissions.
92
- */
93
- declare const consoleDiagnostics: nostics.Diagnostics<{
94
- /** `startSubprocess().getProcess()` → `getResult()`. */
95
- NDT_DEP_0001: {
96
- why: (p: DeprecationParams) => string;
97
- fix: (p: DeprecationParams) => string;
98
- };
99
- /** `extendServerRpc` → `onDevtoolsReady((ctx) => ctx.rpc.register(...))`. */
100
- NDT_DEP_0003: {
101
- why: (p: DeprecationParams) => string;
102
- fix: (p: DeprecationParams) => string;
103
- };
104
- /** `startSubprocess` → `onDevtoolsReady((ctx) => ctx.terminals.startChildProcess(...))`. */
105
- NDT_DEP_0004: {
106
- why: (p: DeprecationParams) => string;
107
- fix: (p: DeprecationParams) => string;
108
- };
109
- /** `addCustomTab` → `onDevtoolsReady((ctx) => ctx.docks.register(...))`. */
110
- NDT_DEP_0005: {
111
- why: (p: DeprecationParams) => string;
112
- fix: (p: DeprecationParams) => string;
113
- };
114
- /** `refreshCustomTabs` → `onDevtoolsReady((ctx) => ctx.docks.register(...))`. */
115
- NDT_DEP_0006: {
116
- why: (p: DeprecationParams) => string;
117
- fix: (p: DeprecationParams) => string;
118
- };
119
- /** Direct `nuxt.devtools.rpc` access (`broadcast` / `functions`). */
120
- NDT_DEP_0007: {
121
- why: (p: DeprecationParams) => string;
122
- fix: (p: DeprecationParams) => string;
123
- };
124
- /** Removed `vscode` module option → `codeServer`. */
125
- NDT_DEP_0008: {
126
- why: (p: DeprecationParams) => string;
127
- fix: (p: DeprecationParams) => string;
128
- };
129
- /** `getServerData()` RPC → the Data Inspector panel's `Nuxt Application` source. */
130
- NDT_DEP_0009: {
131
- why: (p: DeprecationParams) => string;
132
- fix: (p: DeprecationParams) => string;
133
- };
134
- }, readonly [nostics.DiagnosticReporter<{
135
- method?: nostics.ConsoleMethod;
136
- }>]>;
137
- /**
138
- * Register the Nuxt deprecation codes into the connected Vite DevTools kit's
139
- * diagnostics host so they are known to DevTools and post-connect emissions
140
- * surface in the DevTools diagnostics UI. Safe to call when no host is present.
141
- *
142
- * Called from `connectDevToolsKit`.
143
- */
144
- declare function registerHostDiagnostics(ctx: NuxtDevtoolsServerContext): void;
145
- /**
146
- * Options for {@link deprecate}.
147
- */
148
- interface DeprecateOptions {
149
- /**
150
- * Dedupe key appended to the code. Defaults to the code itself, i.e. the
151
- * deprecation warns once per process. Pass a finer key (e.g. a subprocess id)
152
- * to warn once per distinct call site instead.
153
- */
154
- key?: string;
155
- /**
156
- * Reporter method / severity. `warn` (default) for soft deprecations, `error`
157
- * for hard breaks. The returned {@link Diagnostic} can be thrown to abort.
158
- */
159
- method?: 'warn' | 'error';
160
- }
161
- /**
162
- * Emit a Nuxt DevTools deprecation diagnostic.
163
- *
164
- * Routing: when the Vite DevTools kit is connected the emission goes through the
165
- * DevTools host catalog (terminal **and** the DevTools diagnostics UI); before
166
- * connect it falls back to the terminal-only console catalog. A single emission
167
- * per call — no double printing.
168
- *
169
- * Deduped per `${code}:${key ?? code}` on the resolved server context, so a hot
170
- * path warns only once.
171
- *
172
- * @returns the built `Diagnostic` (which extends `Error`, so it can be thrown
173
- * for hard breaks), or `undefined` if the emission was deduped.
174
- */
175
- declare function deprecate(nuxt: Nuxt, code: NuxtDiagnosticCode, params: DeprecationParams, options?: DeprecateOptions): Error | undefined;
176
- /**
177
- * Build a standalone nostics catalog that prints to the terminal.
178
- *
179
- * Used by the connect-safe `nuxt.devtools.diagnostics` accessor so module
180
- * authors can define + emit diagnostics before the Vite DevTools kit connects.
181
- * A `createConsoleReporter()` is added automatically unless the caller supplies
182
- * its own `reporters`.
183
- */
184
- declare function defineStandaloneDiagnostics(options: Parameters<typeof defineDiagnostics>[0]): ReturnType<typeof defineDiagnostics>;
185
- /**
186
- * Convenience wrapper for call sites that don't already hold the Nuxt instance.
187
- */
188
- declare function deprecateWithNuxt(code: NuxtDiagnosticCode, params: DeprecationParams, options?: DeprecateOptions): Error | undefined;
189
-
190
- /**
191
- * The public `Nuxt` dock group id registered on the Vite DevTools framework
192
- * category. Module authors join the group natively by pointing their own
193
- * dock entries at it — no special Nuxt API required:
194
- *
195
- * @example
196
- * ```ts
197
- * import { NUXT_DEVTOOLS_GROUP_ID, onDevtoolsReady } from '@nuxt/devtools-kit'
198
- *
199
- * onDevtoolsReady((ctx) => {
200
- * ctx.docks.register({
201
- * id: 'my-module',
202
- * type: 'iframe',
203
- * title: 'My Module',
204
- * icon: 'i-ph-puzzle-piece',
205
- * url: '/my-module/',
206
- * groupId: NUXT_DEVTOOLS_GROUP_ID,
207
- * })
208
- * })
209
- * ```
210
- */
211
- declare const NUXT_DEVTOOLS_GROUP_ID = "nuxt";
212
- /**
213
- * Hooks to extend a custom tab in devtools.
214
- *
215
- * Provide a function to pass a factory that can be updated dynamically.
216
- *
217
- * @deprecated Register a dock entry from the `devtools:ready` hook instead:
218
- * `onDevtoolsReady((ctx) => ctx.docks.register(...))`. Still works as a shim, but
219
- * emits the `NDT_DEP_0005` deprecation diagnostic. Note the docks host does not
220
- * yet cover `vnode` views or tab categories.
221
- */
222
- declare function addCustomTab(tab: ModuleCustomTab | (() => ModuleCustomTab | Promise<ModuleCustomTab>), nuxt?: _nuxt_schema.Nuxt): void;
223
- /**
224
- * Retrigger update for custom tabs, `devtools:customTabs` will be called again.
225
- *
226
- * @deprecated Update dock entries directly via the handle returned by
227
- * `ctx.docks.register(...)` inside the `devtools:ready` hook. Still works as a
228
- * shim, but emits the `NDT_DEP_0006` deprecation diagnostic.
229
- */
230
- declare function refreshCustomTabs(nuxt?: _nuxt_schema.Nuxt): void | Promise<any>;
231
- interface StartSubprocessReturn {
232
- /** @deprecated Use `getResult()` instead */
233
- getProcess: () => ChildProcess | undefined;
234
- getResult: () => Result;
235
- terminate: () => void;
236
- restart: () => void;
237
- clear: () => void;
238
- }
239
- /**
240
- * Create a subprocess that handled by the DevTools.
241
- *
242
- * @deprecated Use the Vite DevTools terminals host from the `devtools:ready`
243
- * hook instead: `onDevtoolsReady((ctx) => ctx.terminals.startChildProcess(...))`.
244
- * Still works as a shim, but emits the `NDT_DEP_0004` deprecation diagnostic.
245
- */
246
- declare function startSubprocess(execaOptions: SubprocessOptions, tabOptions: TerminalState, nuxt?: _nuxt_schema.Nuxt): StartSubprocessReturn;
247
- /**
248
- * Extend server RPC with namespaced functions.
249
- *
250
- * Returns an object with a `broadcast` proxy for calling client functions.
251
- *
252
- * @deprecated Register RPC functions from the `devtools:ready` hook instead:
253
- * `onDevtoolsReady((ctx) => ctx.rpc.register(defineRpcFunction(...)))`. Still
254
- * works as a shim, but emits the `NDT_DEP_0003` deprecation diagnostic.
255
- */
256
- declare function extendServerRpc<ClientFunctions extends object = Record<string, unknown>, ServerFunctions extends object = Record<string, unknown>>(namespace: string, functions: ServerFunctions, nuxt?: _nuxt_schema.Nuxt): BirpcGroup<ClientFunctions, ServerFunctions>;
257
- declare function onDevToolsInitialized(fn: (info: NuxtDevtoolsInfo) => void, nuxt?: _nuxt_schema.Nuxt): void;
258
- /**
259
- * Run a callback once the Vite DevTools kit has connected, receiving the
260
- * connected `ViteDevToolsNodeContext`.
261
- *
262
- * This is the recommended entry point for DevTools integration: the kit is
263
- * guaranteed available, so you can use `ctx.docks` / `ctx.terminals` /
264
- * `ctx.messages` / `ctx.commands` / `ctx.rpc` / `ctx.diagnostics` directly
265
- * without the connect-safe accessors on `nuxt.devtools`.
266
- *
267
- * @example
268
- * ```ts
269
- * onDevtoolsReady((ctx) => {
270
- * ctx.docks.register({ id: 'my-module', title: 'My Module', type: 'iframe', url: '/…' })
271
- * })
272
- * ```
273
- */
274
- declare function onDevtoolsReady(fn: (ctx: ViteDevToolsNodeContext) => void | Promise<void>, nuxt?: _nuxt_schema.Nuxt): void;
275
-
276
- export { NUXT_DEVTOOLS_GROUP_ID, addCustomTab, consoleDiagnostics, defineStandaloneDiagnostics, deprecate, deprecateWithNuxt, diagnosticCodes, diagnosticsDocsBase, extendServerRpc, onDevToolsInitialized, onDevtoolsReady, refreshCustomTabs, registerHostDiagnostics, startSubprocess };
277
- export type { DeprecateOptions, DeprecationParams, NuxtDiagnosticCode, StartSubprocessReturn };
package/dist/index.d.ts DELETED
@@ -1,277 +0,0 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
- import { ViteDevToolsNodeContext } from '@vitejs/devtools-kit';
3
- import { BirpcGroup } from 'birpc';
4
- import { ChildProcess } from 'node:child_process';
5
- import { Result } from 'tinyexec';
6
- import { N as NuxtDevtoolsServerContext, M as ModuleCustomTab, a as NuxtDevtoolsInfo, S as SubprocessOptions, T as TerminalState } from './shared/devtools-kit.DepvFgru.js';
7
- import * as nostics from 'nostics';
8
- import { defineDiagnostics } from 'nostics';
9
- export { createConsoleReporter, defineDiagnostics } from 'nostics';
10
- import { Nuxt } from 'nuxt/schema';
11
- import 'vue';
12
- import 'unimport';
13
- import 'vue-router';
14
- import 'unstorage';
15
- import 'vite';
16
- import 'nitro/types';
17
- import 'nitropack';
18
-
19
- /**
20
- * Canonical docs URL for a Nuxt DevTools diagnostic code.
21
- *
22
- * Each code links to a per-code anchor in the v4 migration guide, e.g.
23
- * `NDT_DEP_0001` → `.../module/migration-v4#ndt_dep_0001`.
24
- */
25
- declare function diagnosticsDocsBase(code: string | number): string;
26
- /**
27
- * Parameters shared by every deprecation code: the API being used and its
28
- * recommended replacement. Interpolated into the `why`/`fix` messages.
29
- */
30
- interface DeprecationParams {
31
- /** The deprecated API / option being used. */
32
- api: string;
33
- /** The recommended replacement to migrate to. */
34
- replacement: string;
35
- }
36
- /**
37
- * The Nuxt DevTools diagnostics catalog.
38
- *
39
- * Codes are grouped by prefix:
40
- * - `NDT_DEP_xxxx` — soft/hard deprecations (this is the only range used today).
41
- *
42
- * Severity is **not** encoded here; it is chosen per emission via the reporter
43
- * `method` (`warn` by default, `error` for hard breaks).
44
- */
45
- declare const diagnosticCodes: {
46
- /** `startSubprocess().getProcess()` → `getResult()`. */
47
- NDT_DEP_0001: {
48
- why: (p: DeprecationParams) => string;
49
- fix: (p: DeprecationParams) => string;
50
- };
51
- /** `extendServerRpc` → `onDevtoolsReady((ctx) => ctx.rpc.register(...))`. */
52
- NDT_DEP_0003: {
53
- why: (p: DeprecationParams) => string;
54
- fix: (p: DeprecationParams) => string;
55
- };
56
- /** `startSubprocess` → `onDevtoolsReady((ctx) => ctx.terminals.startChildProcess(...))`. */
57
- NDT_DEP_0004: {
58
- why: (p: DeprecationParams) => string;
59
- fix: (p: DeprecationParams) => string;
60
- };
61
- /** `addCustomTab` → `onDevtoolsReady((ctx) => ctx.docks.register(...))`. */
62
- NDT_DEP_0005: {
63
- why: (p: DeprecationParams) => string;
64
- fix: (p: DeprecationParams) => string;
65
- };
66
- /** `refreshCustomTabs` → `onDevtoolsReady((ctx) => ctx.docks.register(...))`. */
67
- NDT_DEP_0006: {
68
- why: (p: DeprecationParams) => string;
69
- fix: (p: DeprecationParams) => string;
70
- };
71
- /** Direct `nuxt.devtools.rpc` access (`broadcast` / `functions`). */
72
- NDT_DEP_0007: {
73
- why: (p: DeprecationParams) => string;
74
- fix: (p: DeprecationParams) => string;
75
- };
76
- /** Removed `vscode` module option → `codeServer`. */
77
- NDT_DEP_0008: {
78
- why: (p: DeprecationParams) => string;
79
- fix: (p: DeprecationParams) => string;
80
- };
81
- /** `getServerData()` RPC → the Data Inspector panel's `Nuxt Application` source. */
82
- NDT_DEP_0009: {
83
- why: (p: DeprecationParams) => string;
84
- fix: (p: DeprecationParams) => string;
85
- };
86
- };
87
- type NuxtDiagnosticCode = keyof typeof diagnosticCodes;
88
- /**
89
- * Standalone catalog that prints to the terminal via nostics'
90
- * {@link createConsoleReporter} (default method `warn`). Works before the Vite
91
- * DevTools kit connects, so it is the fallback sink for pre-connect emissions.
92
- */
93
- declare const consoleDiagnostics: nostics.Diagnostics<{
94
- /** `startSubprocess().getProcess()` → `getResult()`. */
95
- NDT_DEP_0001: {
96
- why: (p: DeprecationParams) => string;
97
- fix: (p: DeprecationParams) => string;
98
- };
99
- /** `extendServerRpc` → `onDevtoolsReady((ctx) => ctx.rpc.register(...))`. */
100
- NDT_DEP_0003: {
101
- why: (p: DeprecationParams) => string;
102
- fix: (p: DeprecationParams) => string;
103
- };
104
- /** `startSubprocess` → `onDevtoolsReady((ctx) => ctx.terminals.startChildProcess(...))`. */
105
- NDT_DEP_0004: {
106
- why: (p: DeprecationParams) => string;
107
- fix: (p: DeprecationParams) => string;
108
- };
109
- /** `addCustomTab` → `onDevtoolsReady((ctx) => ctx.docks.register(...))`. */
110
- NDT_DEP_0005: {
111
- why: (p: DeprecationParams) => string;
112
- fix: (p: DeprecationParams) => string;
113
- };
114
- /** `refreshCustomTabs` → `onDevtoolsReady((ctx) => ctx.docks.register(...))`. */
115
- NDT_DEP_0006: {
116
- why: (p: DeprecationParams) => string;
117
- fix: (p: DeprecationParams) => string;
118
- };
119
- /** Direct `nuxt.devtools.rpc` access (`broadcast` / `functions`). */
120
- NDT_DEP_0007: {
121
- why: (p: DeprecationParams) => string;
122
- fix: (p: DeprecationParams) => string;
123
- };
124
- /** Removed `vscode` module option → `codeServer`. */
125
- NDT_DEP_0008: {
126
- why: (p: DeprecationParams) => string;
127
- fix: (p: DeprecationParams) => string;
128
- };
129
- /** `getServerData()` RPC → the Data Inspector panel's `Nuxt Application` source. */
130
- NDT_DEP_0009: {
131
- why: (p: DeprecationParams) => string;
132
- fix: (p: DeprecationParams) => string;
133
- };
134
- }, readonly [nostics.DiagnosticReporter<{
135
- method?: nostics.ConsoleMethod;
136
- }>]>;
137
- /**
138
- * Register the Nuxt deprecation codes into the connected Vite DevTools kit's
139
- * diagnostics host so they are known to DevTools and post-connect emissions
140
- * surface in the DevTools diagnostics UI. Safe to call when no host is present.
141
- *
142
- * Called from `connectDevToolsKit`.
143
- */
144
- declare function registerHostDiagnostics(ctx: NuxtDevtoolsServerContext): void;
145
- /**
146
- * Options for {@link deprecate}.
147
- */
148
- interface DeprecateOptions {
149
- /**
150
- * Dedupe key appended to the code. Defaults to the code itself, i.e. the
151
- * deprecation warns once per process. Pass a finer key (e.g. a subprocess id)
152
- * to warn once per distinct call site instead.
153
- */
154
- key?: string;
155
- /**
156
- * Reporter method / severity. `warn` (default) for soft deprecations, `error`
157
- * for hard breaks. The returned {@link Diagnostic} can be thrown to abort.
158
- */
159
- method?: 'warn' | 'error';
160
- }
161
- /**
162
- * Emit a Nuxt DevTools deprecation diagnostic.
163
- *
164
- * Routing: when the Vite DevTools kit is connected the emission goes through the
165
- * DevTools host catalog (terminal **and** the DevTools diagnostics UI); before
166
- * connect it falls back to the terminal-only console catalog. A single emission
167
- * per call — no double printing.
168
- *
169
- * Deduped per `${code}:${key ?? code}` on the resolved server context, so a hot
170
- * path warns only once.
171
- *
172
- * @returns the built `Diagnostic` (which extends `Error`, so it can be thrown
173
- * for hard breaks), or `undefined` if the emission was deduped.
174
- */
175
- declare function deprecate(nuxt: Nuxt, code: NuxtDiagnosticCode, params: DeprecationParams, options?: DeprecateOptions): Error | undefined;
176
- /**
177
- * Build a standalone nostics catalog that prints to the terminal.
178
- *
179
- * Used by the connect-safe `nuxt.devtools.diagnostics` accessor so module
180
- * authors can define + emit diagnostics before the Vite DevTools kit connects.
181
- * A `createConsoleReporter()` is added automatically unless the caller supplies
182
- * its own `reporters`.
183
- */
184
- declare function defineStandaloneDiagnostics(options: Parameters<typeof defineDiagnostics>[0]): ReturnType<typeof defineDiagnostics>;
185
- /**
186
- * Convenience wrapper for call sites that don't already hold the Nuxt instance.
187
- */
188
- declare function deprecateWithNuxt(code: NuxtDiagnosticCode, params: DeprecationParams, options?: DeprecateOptions): Error | undefined;
189
-
190
- /**
191
- * The public `Nuxt` dock group id registered on the Vite DevTools framework
192
- * category. Module authors join the group natively by pointing their own
193
- * dock entries at it — no special Nuxt API required:
194
- *
195
- * @example
196
- * ```ts
197
- * import { NUXT_DEVTOOLS_GROUP_ID, onDevtoolsReady } from '@nuxt/devtools-kit'
198
- *
199
- * onDevtoolsReady((ctx) => {
200
- * ctx.docks.register({
201
- * id: 'my-module',
202
- * type: 'iframe',
203
- * title: 'My Module',
204
- * icon: 'i-ph-puzzle-piece',
205
- * url: '/my-module/',
206
- * groupId: NUXT_DEVTOOLS_GROUP_ID,
207
- * })
208
- * })
209
- * ```
210
- */
211
- declare const NUXT_DEVTOOLS_GROUP_ID = "nuxt";
212
- /**
213
- * Hooks to extend a custom tab in devtools.
214
- *
215
- * Provide a function to pass a factory that can be updated dynamically.
216
- *
217
- * @deprecated Register a dock entry from the `devtools:ready` hook instead:
218
- * `onDevtoolsReady((ctx) => ctx.docks.register(...))`. Still works as a shim, but
219
- * emits the `NDT_DEP_0005` deprecation diagnostic. Note the docks host does not
220
- * yet cover `vnode` views or tab categories.
221
- */
222
- declare function addCustomTab(tab: ModuleCustomTab | (() => ModuleCustomTab | Promise<ModuleCustomTab>), nuxt?: _nuxt_schema.Nuxt): void;
223
- /**
224
- * Retrigger update for custom tabs, `devtools:customTabs` will be called again.
225
- *
226
- * @deprecated Update dock entries directly via the handle returned by
227
- * `ctx.docks.register(...)` inside the `devtools:ready` hook. Still works as a
228
- * shim, but emits the `NDT_DEP_0006` deprecation diagnostic.
229
- */
230
- declare function refreshCustomTabs(nuxt?: _nuxt_schema.Nuxt): void | Promise<any>;
231
- interface StartSubprocessReturn {
232
- /** @deprecated Use `getResult()` instead */
233
- getProcess: () => ChildProcess | undefined;
234
- getResult: () => Result;
235
- terminate: () => void;
236
- restart: () => void;
237
- clear: () => void;
238
- }
239
- /**
240
- * Create a subprocess that handled by the DevTools.
241
- *
242
- * @deprecated Use the Vite DevTools terminals host from the `devtools:ready`
243
- * hook instead: `onDevtoolsReady((ctx) => ctx.terminals.startChildProcess(...))`.
244
- * Still works as a shim, but emits the `NDT_DEP_0004` deprecation diagnostic.
245
- */
246
- declare function startSubprocess(execaOptions: SubprocessOptions, tabOptions: TerminalState, nuxt?: _nuxt_schema.Nuxt): StartSubprocessReturn;
247
- /**
248
- * Extend server RPC with namespaced functions.
249
- *
250
- * Returns an object with a `broadcast` proxy for calling client functions.
251
- *
252
- * @deprecated Register RPC functions from the `devtools:ready` hook instead:
253
- * `onDevtoolsReady((ctx) => ctx.rpc.register(defineRpcFunction(...)))`. Still
254
- * works as a shim, but emits the `NDT_DEP_0003` deprecation diagnostic.
255
- */
256
- declare function extendServerRpc<ClientFunctions extends object = Record<string, unknown>, ServerFunctions extends object = Record<string, unknown>>(namespace: string, functions: ServerFunctions, nuxt?: _nuxt_schema.Nuxt): BirpcGroup<ClientFunctions, ServerFunctions>;
257
- declare function onDevToolsInitialized(fn: (info: NuxtDevtoolsInfo) => void, nuxt?: _nuxt_schema.Nuxt): void;
258
- /**
259
- * Run a callback once the Vite DevTools kit has connected, receiving the
260
- * connected `ViteDevToolsNodeContext`.
261
- *
262
- * This is the recommended entry point for DevTools integration: the kit is
263
- * guaranteed available, so you can use `ctx.docks` / `ctx.terminals` /
264
- * `ctx.messages` / `ctx.commands` / `ctx.rpc` / `ctx.diagnostics` directly
265
- * without the connect-safe accessors on `nuxt.devtools`.
266
- *
267
- * @example
268
- * ```ts
269
- * onDevtoolsReady((ctx) => {
270
- * ctx.docks.register({ id: 'my-module', title: 'My Module', type: 'iframe', url: '/…' })
271
- * })
272
- * ```
273
- */
274
- declare function onDevtoolsReady(fn: (ctx: ViteDevToolsNodeContext) => void | Promise<void>, nuxt?: _nuxt_schema.Nuxt): void;
275
-
276
- export { NUXT_DEVTOOLS_GROUP_ID, addCustomTab, consoleDiagnostics, defineStandaloneDiagnostics, deprecate, deprecateWithNuxt, diagnosticCodes, diagnosticsDocsBase, extendServerRpc, onDevToolsInitialized, onDevtoolsReady, refreshCustomTabs, registerHostDiagnostics, startSubprocess };
277
- export type { DeprecateOptions, DeprecationParams, NuxtDiagnosticCode, StartSubprocessReturn };
@@ -1,4 +0,0 @@
1
- import type { NuxtDevtoolsHostClient } from '@nuxt/devtools-kit/types';
2
- import type { Ref } from 'vue';
3
- export declare function onDevtoolsHostClientConnected(fn: (client: NuxtDevtoolsHostClient) => void): (() => void) | undefined;
4
- export declare function useDevtoolsHostClient(): Ref<NuxtDevtoolsHostClient | undefined>;
@@ -1,22 +0,0 @@
1
- import type { DevToolsRpcClient } from '@vitejs/devtools-kit/client';
2
- import type { Ref } from 'vue';
3
- import type { NuxtDevtoolsIframeClient } from '../types';
4
- export declare function onDevtoolsClientConnected(fn: (client: NuxtDevtoolsIframeClient) => void): (() => void) | undefined;
5
- /**
6
- * Run a callback once the Vite DevTools client is ready, receiving the connected
7
- * `DevToolsRpcClient` — the client-side mirror of the server's
8
- * `onDevtoolsReady((ctx) => …)`.
9
- *
10
- * This is the recommended way to do client-side DevTools integration (register
11
- * client RPC functions, call server functions, shared state, streaming, …):
12
- *
13
- * ```ts
14
- * import { onDevtoolsReady } from '@nuxt/devtools-kit/iframe-client'
15
- *
16
- * onDevtoolsReady((kit) => {
17
- * kit.client.register({ name: 'my-module:on-update', type: 'event', handler })
18
- * })
19
- * ```
20
- */
21
- export declare function onDevtoolsReady(fn: (kit: DevToolsRpcClient) => void): (() => void) | undefined;
22
- export declare function useDevtoolsClient(): Ref<NuxtDevtoolsIframeClient | undefined, NuxtDevtoolsIframeClient | undefined>;