@nuxt/kit 4.2.2 → 4.3.1
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/README.md +5 -3
- package/dist/THIRD-PARTY-LICENSES.md +1129 -0
- package/dist/_chunks/libs/@oxc-project/types.d.mts +1300 -0
- package/dist/_chunks/libs/@rolldown/pluginutils.d.mts +63 -0
- package/dist/_chunks/libs/@rollup/plugin-commonjs.d.mts +1345 -0
- package/dist/_chunks/libs/@vercel/nft.d.mts +114 -0
- package/dist/_chunks/libs/chokidar.d.mts +34 -0
- package/dist/_chunks/libs/compatx.d.mts +47 -0
- package/dist/_chunks/libs/crossws.d.mts +7 -0
- package/dist/_chunks/libs/db0.d.mts +8 -0
- package/dist/_chunks/libs/esbuild.d.mts +137 -0
- package/dist/_chunks/libs/httpxy.d.mts +79 -0
- package/dist/_chunks/libs/ioredis.d.mts +6 -0
- package/dist/_chunks/libs/listhen.d.mts +7 -0
- package/dist/_chunks/libs/magic-string.d.mts +220 -0
- package/dist/_chunks/libs/nitro.d.mts +9879 -0
- package/dist/_chunks/libs/nitropack.d.mts +3343 -0
- package/dist/index.d.mts +444 -402
- package/dist/index.mjs +1451 -1754
- package/package.json +18 -20
- package/dist/index.d.ts +0 -552
package/dist/index.d.mts
CHANGED
|
@@ -1,552 +1,594 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { ConsolaOptions } from
|
|
1
|
+
import { i as NitroRouteConfig$1, n as NitroDevEventHandler$1, r as NitroEventHandler$1, t as Nitro$1 } from "./_chunks/libs/nitro.mjs";
|
|
2
|
+
import { i as NitroRouteConfig$2, n as NitroDevEventHandler$2, r as NitroEventHandler$2, t as Nitro$2 } from "./_chunks/libs/nitropack.mjs";
|
|
3
|
+
import "./_chunks/libs/db0.mjs";
|
|
4
|
+
import "./_chunks/libs/chokidar.mjs";
|
|
5
|
+
import "./_chunks/libs/ioredis.mjs";
|
|
6
|
+
import "./_chunks/libs/@rollup/plugin-commonjs.mjs";
|
|
7
|
+
import "./_chunks/libs/httpxy.mjs";
|
|
8
|
+
import "./_chunks/libs/esbuild.mjs";
|
|
9
|
+
import "./_chunks/libs/crossws.mjs";
|
|
10
|
+
import "./_chunks/libs/listhen.mjs";
|
|
11
|
+
import "./_chunks/libs/@vercel/nft.mjs";
|
|
12
|
+
import { ConsolaInstance, ConsolaOptions } from "consola";
|
|
13
|
+
import { UseContext } from "unctx";
|
|
14
|
+
import { TSConfig } from "pkg-types";
|
|
15
|
+
import { GlobOptions } from "tinyglobby";
|
|
16
|
+
import { LoadConfigOptions } from "c12";
|
|
17
|
+
import { Component, ComponentsDir, ModuleDefinition, ModuleMeta, ModuleOptions, Nuxt, NuxtAppConfig, NuxtCompatibility, NuxtCompatibilityIssues, NuxtConfig, NuxtHooks, NuxtMiddleware, NuxtModule, NuxtOptions, NuxtPlugin, NuxtPluginTemplate, NuxtServerTemplate, NuxtTemplate, NuxtTypeTemplate, ResolvedNuxtTemplate, SchemaDefinition } from "@nuxt/schema";
|
|
18
|
+
import { Import, InlinePreset } from "unimport";
|
|
19
|
+
import { Configuration, WebpackPluginInstance } from "webpack";
|
|
20
|
+
import { RspackPluginInstance } from "@rspack/core";
|
|
21
|
+
import { Plugin, UserConfig } from "vite";
|
|
13
22
|
|
|
23
|
+
//#region src/module/define.d.ts
|
|
14
24
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
* Define a Nuxt module, automatically merging defaults with user provided options, installing
|
|
26
|
+
* any hooks that are provided, and calling an optional setup function for full control.
|
|
27
|
+
*/
|
|
18
28
|
declare function defineNuxtModule<TOptions extends ModuleOptions>(definition: ModuleDefinition<TOptions, Partial<TOptions>, false> | NuxtModule<TOptions, Partial<TOptions>, false>): NuxtModule<TOptions, TOptions, false>;
|
|
19
29
|
declare function defineNuxtModule<TOptions extends ModuleOptions>(): {
|
|
20
|
-
|
|
30
|
+
with: <TOptionsDefaults extends Partial<TOptions>>(definition: ModuleDefinition<TOptions, TOptionsDefaults, true> | NuxtModule<TOptions, TOptionsDefaults, true>) => NuxtModule<TOptions, TOptionsDefaults, true>;
|
|
21
31
|
};
|
|
22
|
-
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/module/install.d.ts
|
|
23
34
|
type ModuleToInstall = string | NuxtModule<ModuleOptions, Partial<ModuleOptions>, false>;
|
|
24
35
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
* Installs a set of modules on a Nuxt instance.
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
28
39
|
declare function installModules(modulesToInstall: Map<ModuleToInstall, Record<string, any>>, resolvedModulePaths: Set<string>, nuxt?: Nuxt): Promise<void>;
|
|
29
40
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
declare function installModule<T extends string | NuxtModule, Config extends Extract<NonNullable<NuxtConfig[
|
|
41
|
+
* Installs a module on a Nuxt instance.
|
|
42
|
+
* @deprecated Use module dependencies.
|
|
43
|
+
*/
|
|
44
|
+
declare function installModule<T extends string | NuxtModule, Config extends Extract<NonNullable<NuxtConfig["modules"]>[number], [T, any]>>(moduleToInstall: T, inlineOptions?: [Config] extends [never] ? any : Config[1], nuxt?: Nuxt): Promise<void>;
|
|
34
45
|
declare function resolveModuleWithOptions(definition: NuxtModule<any> | string | false | undefined | null | [(NuxtModule | string)?, Record<string, any>?], nuxt: Nuxt): {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
resolvedPath?: string;
|
|
47
|
+
module: string | NuxtModule<any>;
|
|
48
|
+
options: Record<string, any>;
|
|
38
49
|
} | undefined;
|
|
39
50
|
declare function loadNuxtModuleInstance(nuxtModule: string | NuxtModule, nuxt?: Nuxt): Promise<{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
51
|
+
nuxtModule: NuxtModule<any>;
|
|
52
|
+
buildTimeModuleMeta: ModuleMeta;
|
|
53
|
+
resolvedModulePath?: string;
|
|
43
54
|
}>;
|
|
44
55
|
declare function getDirectory(p: string): string;
|
|
45
56
|
declare const normalizeModuleTranspilePath: (p: string) => string;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/module/compatibility.d.ts
|
|
59
|
+
/**
|
|
60
|
+
* Check if a Nuxt module is installed by name.
|
|
61
|
+
*
|
|
62
|
+
* This will check both the installed modules and the modules to be installed. Note
|
|
63
|
+
* that it cannot detect if a module is _going to be_ installed programmatically by another module.
|
|
64
|
+
*/
|
|
53
65
|
declare function hasNuxtModule(moduleName: string, nuxt?: Nuxt): boolean;
|
|
54
66
|
/**
|
|
55
|
-
|
|
56
|
-
|
|
67
|
+
* Checks if a Nuxt module is compatible with a given semver version.
|
|
68
|
+
*/
|
|
57
69
|
declare function hasNuxtModuleCompatibility(module: string | NuxtModule, semverVersion: string, nuxt?: Nuxt): Promise<boolean>;
|
|
58
70
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
71
|
+
* Get the version of a Nuxt module.
|
|
72
|
+
*
|
|
73
|
+
* Scans installed modules for the version, if it's not found it will attempt to load the module instance and get the version from there.
|
|
74
|
+
*/
|
|
63
75
|
declare function getNuxtModuleVersion(module: string | NuxtModule, nuxt?: Nuxt | any): Promise<string | false>;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/loader/config.d.ts
|
|
78
|
+
interface LoadNuxtConfigOptions extends Omit<LoadConfigOptions<NuxtConfig>, "overrides"> {
|
|
79
|
+
overrides?: Exclude<LoadConfigOptions<NuxtConfig>["overrides"], Promise<any> | Function>;
|
|
67
80
|
}
|
|
68
81
|
declare function loadNuxtConfig(opts: LoadNuxtConfigOptions): Promise<NuxtOptions>;
|
|
69
|
-
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/loader/schema.d.ts
|
|
70
84
|
declare function extendNuxtSchema(def: SchemaDefinition | (() => SchemaDefinition)): void;
|
|
71
|
-
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/loader/nuxt.d.ts
|
|
72
87
|
interface LoadNuxtOptions extends LoadNuxtConfigOptions {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
88
|
+
/** Load nuxt with development mode */
|
|
89
|
+
dev?: boolean;
|
|
90
|
+
/** Use lazy initialization of nuxt if set to false */
|
|
91
|
+
ready?: boolean;
|
|
77
92
|
}
|
|
78
93
|
declare function loadNuxt(opts: LoadNuxtOptions): Promise<Nuxt>;
|
|
79
94
|
declare function buildNuxt(nuxt: Nuxt): Promise<any>;
|
|
80
|
-
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/layers.d.ts
|
|
81
97
|
interface LayerDirectories {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
/** Nuxt rootDir (`/` by default) */
|
|
99
|
+
readonly root: string;
|
|
100
|
+
/** Nitro source directory (`/server` by default) */
|
|
101
|
+
readonly server: string;
|
|
102
|
+
/** Local modules directory (`/modules` by default) */
|
|
103
|
+
readonly modules: string;
|
|
104
|
+
/** Shared directory (`/shared` by default) */
|
|
105
|
+
readonly shared: string;
|
|
106
|
+
/** Public directory (`/public` by default) */
|
|
107
|
+
readonly public: string;
|
|
108
|
+
/** Nuxt srcDir (`/app/` by default) */
|
|
109
|
+
readonly app: string;
|
|
110
|
+
/** Layouts directory (`/app/layouts` by default) */
|
|
111
|
+
readonly appLayouts: string;
|
|
112
|
+
/** Middleware directory (`/app/middleware` by default) */
|
|
113
|
+
readonly appMiddleware: string;
|
|
114
|
+
/** Pages directory (`/app/pages` by default) */
|
|
115
|
+
readonly appPages: string;
|
|
116
|
+
/** Plugins directory (`/app/plugins` by default) */
|
|
117
|
+
readonly appPlugins: string;
|
|
102
118
|
}
|
|
103
119
|
/**
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
declare function getLayerDirectories(nuxt?:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
* Get the resolved directory paths for all layers in a Nuxt application.
|
|
121
|
+
*
|
|
122
|
+
* Returns an array of LayerDirectories objects, ordered by layer priority:
|
|
123
|
+
* - The first layer is the user/project layer (highest priority)
|
|
124
|
+
* - Earlier layers override later layers in the array
|
|
125
|
+
* - Base layers appear last in the array (lowest priority)
|
|
126
|
+
*
|
|
127
|
+
* @param nuxt - The Nuxt instance to get layers from. Defaults to the current Nuxt context.
|
|
128
|
+
* @returns Array of LayerDirectories objects, ordered by priority (user layer first)
|
|
129
|
+
*/
|
|
130
|
+
declare function getLayerDirectories(nuxt?: Nuxt): LayerDirectories[];
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/head.d.ts
|
|
133
|
+
declare function setGlobalHead(head: NuxtAppConfig["head"]): void;
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/imports.d.ts
|
|
118
136
|
declare function addImports(imports: Import | Import[]): void;
|
|
119
137
|
declare function addImportsDir(dirs: string | string[], opts?: {
|
|
120
|
-
|
|
138
|
+
prepend?: boolean;
|
|
121
139
|
}): void;
|
|
122
140
|
declare function addImportsSources(presets: InlinePreset | InlinePreset[]): void;
|
|
123
|
-
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/runtime-config.d.ts
|
|
124
143
|
/**
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
144
|
+
* Access 'resolved' Nuxt runtime configuration, with values updated from environment.
|
|
145
|
+
*
|
|
146
|
+
* This mirrors the runtime behavior of Nitro.
|
|
147
|
+
*/
|
|
129
148
|
declare function useRuntimeConfig(): Record<string, any>;
|
|
130
149
|
/**
|
|
131
|
-
|
|
132
|
-
|
|
150
|
+
* Update Nuxt runtime configuration.
|
|
151
|
+
*/
|
|
133
152
|
declare function updateRuntimeConfig(runtimeConfig: Record<string, unknown>): void | Promise<void>;
|
|
134
|
-
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region src/build.d.ts
|
|
155
|
+
type Arrayable<T> = T | T[];
|
|
156
|
+
type Thenable<T> = T | Promise<T>;
|
|
135
157
|
interface ExtendConfigOptions {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
interface ExtendWebpackConfigOptions extends ExtendConfigOptions {
|
|
158
|
+
/**
|
|
159
|
+
* Install plugin on dev
|
|
160
|
+
* @default true
|
|
161
|
+
*/
|
|
162
|
+
dev?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Install plugin on build
|
|
165
|
+
* @default true
|
|
166
|
+
*/
|
|
167
|
+
build?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Install plugin on server side
|
|
170
|
+
* @default true
|
|
171
|
+
*/
|
|
172
|
+
server?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Install plugin on client side
|
|
175
|
+
* @default true
|
|
176
|
+
*/
|
|
177
|
+
client?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Prepends the plugin to the array with `unshift()` instead of `push()`.
|
|
180
|
+
*/
|
|
181
|
+
prepend?: boolean;
|
|
162
182
|
}
|
|
163
|
-
interface
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
183
|
+
interface ExtendWebpackConfigOptions extends ExtendConfigOptions {}
|
|
184
|
+
interface ExtendViteConfigOptions extends Omit<ExtendConfigOptions, "server" | "client"> {
|
|
185
|
+
/**
|
|
186
|
+
* Extend server Vite configuration
|
|
187
|
+
* @default true
|
|
188
|
+
* @deprecated calling \`extendViteConfig\` with only server/client environment is deprecated.
|
|
189
|
+
* Nuxt 5+ uses the Vite Environment API which shares a configuration between environments.
|
|
190
|
+
* You can likely use a Vite plugin to achieve the same result.
|
|
191
|
+
*/
|
|
192
|
+
server?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Extend client Vite configuration
|
|
195
|
+
* @default true
|
|
196
|
+
* @deprecated calling \`extendViteConfig\` with only server/client environment is deprecated.
|
|
197
|
+
* Nuxt 5+ uses the Vite Environment API which shares a configuration between environments.
|
|
198
|
+
* You can likely use a Vite plugin to achieve the same result.
|
|
199
|
+
*/
|
|
200
|
+
client?: boolean;
|
|
180
201
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
202
|
+
type ExtendWebpacklikeConfig = (fn: (config: Configuration) => void, options?: ExtendWebpackConfigOptions) => void;
|
|
203
|
+
/**
|
|
204
|
+
* Extend webpack config
|
|
205
|
+
*
|
|
206
|
+
* The fallback function might be called multiple times
|
|
207
|
+
* when applying to both client and server builds.
|
|
208
|
+
*/
|
|
209
|
+
declare const extendWebpackConfig: ExtendWebpacklikeConfig;
|
|
210
|
+
/**
|
|
211
|
+
* Extend rspack config
|
|
212
|
+
*
|
|
213
|
+
* The fallback function might be called multiple times
|
|
214
|
+
* when applying to both client and server builds.
|
|
215
|
+
*/
|
|
216
|
+
declare const extendRspackConfig: ExtendWebpacklikeConfig;
|
|
217
|
+
/**
|
|
218
|
+
* Extend Vite config
|
|
219
|
+
*/
|
|
220
|
+
declare function extendViteConfig(fn: ((config: UserConfig) => Thenable<void>), options?: ExtendViteConfigOptions): (() => void) | undefined;
|
|
221
|
+
/**
|
|
222
|
+
* Append webpack plugin to the config.
|
|
223
|
+
*/
|
|
224
|
+
declare function addWebpackPlugin(pluginOrGetter: Arrayable<WebpackPluginInstance> | (() => Thenable<Arrayable<WebpackPluginInstance>>), options?: ExtendWebpackConfigOptions): void;
|
|
225
|
+
/**
|
|
226
|
+
* Append rspack plugin to the config.
|
|
227
|
+
*/
|
|
228
|
+
declare function addRspackPlugin(pluginOrGetter: Arrayable<RspackPluginInstance> | (() => Thenable<Arrayable<RspackPluginInstance>>), options?: ExtendWebpackConfigOptions): void;
|
|
229
|
+
/**
|
|
230
|
+
* Append Vite plugin to the config.
|
|
231
|
+
*/
|
|
232
|
+
declare function addVitePlugin(pluginOrGetter: Arrayable<Plugin> | (() => Thenable<Arrayable<Plugin>>), options?: ExtendConfigOptions): void;
|
|
211
233
|
interface AddBuildPluginFactory {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
234
|
+
vite?: () => Thenable<Arrayable<Plugin>>;
|
|
235
|
+
webpack?: () => Thenable<Arrayable<WebpackPluginInstance>>;
|
|
236
|
+
rspack?: () => Thenable<Arrayable<RspackPluginInstance>>;
|
|
215
237
|
}
|
|
216
238
|
declare function addBuildPlugin(pluginFactory: AddBuildPluginFactory, options?: ExtendConfigOptions): void;
|
|
217
|
-
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region src/compatibility.d.ts
|
|
218
241
|
declare function normalizeSemanticVersion(version: string): string;
|
|
219
242
|
/**
|
|
220
|
-
|
|
221
|
-
|
|
243
|
+
* Check version constraints and return incompatibility issues as an array
|
|
244
|
+
*/
|
|
222
245
|
declare function checkNuxtCompatibility(constraints: NuxtCompatibility, nuxt?: Nuxt): Promise<NuxtCompatibilityIssues>;
|
|
223
246
|
/**
|
|
224
|
-
|
|
225
|
-
|
|
247
|
+
* Check version constraints and throw a detailed error if has any, otherwise returns true
|
|
248
|
+
*/
|
|
226
249
|
declare function assertNuxtCompatibility(constraints: NuxtCompatibility, nuxt?: Nuxt): Promise<true>;
|
|
227
250
|
/**
|
|
228
|
-
|
|
229
|
-
|
|
251
|
+
* Check version constraints and return true if passed, otherwise returns false
|
|
252
|
+
*/
|
|
230
253
|
declare function hasNuxtCompatibility(constraints: NuxtCompatibility, nuxt?: Nuxt): Promise<boolean>;
|
|
254
|
+
type NuxtMajorVersion = 2 | 3 | 4;
|
|
231
255
|
/**
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
declare function isNuxtMajorVersion(majorVersion:
|
|
256
|
+
* Check if current Nuxt instance is of specified major version
|
|
257
|
+
*/
|
|
258
|
+
declare function isNuxtMajorVersion(majorVersion: NuxtMajorVersion, nuxt?: Nuxt): boolean;
|
|
235
259
|
/**
|
|
236
|
-
|
|
237
|
-
|
|
260
|
+
* @deprecated Use `isNuxtMajorVersion(2, nuxt)` instead. This may be removed in \@nuxt/kit v5 or a future major version.
|
|
261
|
+
*/
|
|
238
262
|
declare function isNuxt2(nuxt?: Nuxt): boolean;
|
|
239
263
|
/**
|
|
240
|
-
|
|
241
|
-
|
|
264
|
+
* @deprecated Use `isNuxtMajorVersion(3, nuxt)` instead. This may be removed in \@nuxt/kit v5 or a future major version.
|
|
265
|
+
*/
|
|
242
266
|
declare function isNuxt3(nuxt?: Nuxt): boolean;
|
|
243
267
|
/**
|
|
244
|
-
|
|
245
|
-
|
|
268
|
+
* Get nuxt version
|
|
269
|
+
*/
|
|
246
270
|
declare function getNuxtVersion(nuxt?: Nuxt | any): string;
|
|
247
|
-
|
|
271
|
+
//#endregion
|
|
272
|
+
//#region src/components.d.ts
|
|
248
273
|
/**
|
|
249
|
-
|
|
250
|
-
|
|
274
|
+
* Register a directory to be scanned for components and imported only when used.
|
|
275
|
+
*/
|
|
251
276
|
declare function addComponentsDir(dir: ComponentsDir, opts?: {
|
|
252
|
-
|
|
277
|
+
prepend?: boolean;
|
|
253
278
|
}): void;
|
|
254
279
|
type AddComponentOptions = {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
} & Partial<Exclude<Component,
|
|
258
|
-
/**
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
declare function addComponentExports(opts: Omit<AddComponentOptions,
|
|
262
|
-
|
|
280
|
+
name: string;
|
|
281
|
+
filePath: string;
|
|
282
|
+
} & Partial<Exclude<Component, "shortPath" | "async" | "level" | "import" | "asyncImport">>;
|
|
283
|
+
/**
|
|
284
|
+
* This utility takes a file path or npm package that is scanned for named exports, which are get added automatically
|
|
285
|
+
*/
|
|
286
|
+
declare function addComponentExports(opts: Omit<AddComponentOptions, "name"> & {
|
|
287
|
+
prefix?: string;
|
|
263
288
|
}): void;
|
|
264
289
|
/**
|
|
265
|
-
|
|
266
|
-
|
|
290
|
+
* Register a component by its name and filePath.
|
|
291
|
+
*/
|
|
267
292
|
declare function addComponent(opts: AddComponentOptions): void;
|
|
268
|
-
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/context.d.ts
|
|
269
295
|
/**
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
declare const nuxtCtx:
|
|
296
|
+
* Direct access to the Nuxt global context - see https://github.com/unjs/unctx.
|
|
297
|
+
* @deprecated Use `getNuxtCtx` instead
|
|
298
|
+
*/
|
|
299
|
+
declare const nuxtCtx: UseContext<Nuxt>;
|
|
274
300
|
/** Direct access to the Nuxt context with asyncLocalStorage - see https://github.com/unjs/unctx. */
|
|
275
301
|
declare const getNuxtCtx: () => Nuxt | null;
|
|
276
302
|
/**
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
303
|
+
* Get access to Nuxt instance.
|
|
304
|
+
*
|
|
305
|
+
* Throws an error if Nuxt instance is unavailable.
|
|
306
|
+
* @example
|
|
307
|
+
* ```js
|
|
308
|
+
* const nuxt = useNuxt()
|
|
309
|
+
* ```
|
|
310
|
+
*/
|
|
285
311
|
declare function useNuxt(): Nuxt;
|
|
286
312
|
/**
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
313
|
+
* Get access to Nuxt instance.
|
|
314
|
+
*
|
|
315
|
+
* Returns null if Nuxt instance is unavailable.
|
|
316
|
+
* @example
|
|
317
|
+
* ```js
|
|
318
|
+
* const nuxt = tryUseNuxt()
|
|
319
|
+
* if (nuxt) {
|
|
320
|
+
* // Do something
|
|
321
|
+
* }
|
|
322
|
+
* ```
|
|
323
|
+
*/
|
|
298
324
|
declare function tryUseNuxt(): Nuxt | null;
|
|
299
325
|
declare function runWithNuxtContext<T extends (...args: any[]) => any>(nuxt: Nuxt, fn: T): ReturnType<T>;
|
|
300
|
-
|
|
301
|
-
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/ignore.d.ts
|
|
328
|
+
declare function createIsIgnored(nuxt?: Nuxt | null | undefined): (pathname: string, stats?: unknown) => boolean;
|
|
302
329
|
/**
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
declare function isIgnored(pathname: string, _stats?: unknown, nuxt?:
|
|
330
|
+
* Return a filter function to filter an array of paths
|
|
331
|
+
*/
|
|
332
|
+
declare function isIgnored(pathname: string, _stats?: unknown, nuxt?: Nuxt | null | undefined): boolean;
|
|
306
333
|
declare function resolveIgnorePatterns(relativePath?: string): string[];
|
|
307
|
-
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/layout.d.ts
|
|
308
336
|
declare function addLayout(template: NuxtTemplate | string, name?: string): void;
|
|
309
|
-
|
|
310
|
-
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region src/nitro-types.d.ts
|
|
339
|
+
type isNitroV2 = "options" extends keyof Nitro$2 ? "___INVALID" extends keyof Nitro$2 ? false : true : false;
|
|
340
|
+
type isNitroV3 = "options" extends keyof Nitro$1 ? "___INVALID" extends keyof Nitro$1 ? false : true : false;
|
|
341
|
+
type Nitro = isNitroV2 extends true ? isNitroV3 extends true ? Nitro$2 | Nitro$1 : Nitro$2 : Nitro$1;
|
|
342
|
+
type NitroDevEventHandler = isNitroV2 extends true ? isNitroV3 extends true ? NitroDevEventHandler$2 | NitroDevEventHandler$1 : NitroDevEventHandler$2 : NitroDevEventHandler$1;
|
|
343
|
+
type NitroEventHandler = isNitroV2 extends true ? isNitroV3 extends true ? NitroEventHandler$2 | NitroEventHandler$1 : NitroEventHandler$2 : NitroEventHandler$1;
|
|
344
|
+
type NitroRouteConfig = isNitroV2 extends true ? isNitroV3 extends true ? NitroRouteConfig$2 | NitroRouteConfig$1 : NitroRouteConfig$2 : NitroRouteConfig$1;
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region src/pages.d.ts
|
|
347
|
+
declare function extendPages(cb: NuxtHooks["pages:extend"]): void;
|
|
311
348
|
interface ExtendRouteRulesOptions {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
349
|
+
/**
|
|
350
|
+
* Override route rule config
|
|
351
|
+
* @default false
|
|
352
|
+
*/
|
|
353
|
+
override?: boolean;
|
|
317
354
|
}
|
|
318
355
|
declare function extendRouteRules(route: string, rule: NitroRouteConfig, options?: ExtendRouteRulesOptions): void;
|
|
319
356
|
interface AddRouteMiddlewareOptions {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
357
|
+
/**
|
|
358
|
+
* Override existing middleware with the same name, if it exists
|
|
359
|
+
* @default false
|
|
360
|
+
*/
|
|
361
|
+
override?: boolean;
|
|
362
|
+
/**
|
|
363
|
+
* Prepend middleware to the list
|
|
364
|
+
* @default false
|
|
365
|
+
*/
|
|
366
|
+
prepend?: boolean;
|
|
330
367
|
}
|
|
331
368
|
declare function addRouteMiddleware(input: NuxtMiddleware | NuxtMiddleware[], options?: AddRouteMiddlewareOptions): void;
|
|
332
|
-
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region src/plugin.d.ts
|
|
333
371
|
declare function normalizePlugin(plugin: NuxtPlugin | string): NuxtPlugin;
|
|
334
372
|
/**
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
373
|
+
* Registers a nuxt plugin and to the plugins array.
|
|
374
|
+
*
|
|
375
|
+
* Note: You can use mode or .client and .server modifiers with fileName option
|
|
376
|
+
* to use plugin only in client or server side.
|
|
377
|
+
*
|
|
378
|
+
* Note: By default plugin is prepended to the plugins array. You can use second argument to append (push) instead.
|
|
379
|
+
* @example
|
|
380
|
+
* ```js
|
|
381
|
+
* import { createResolver } from '@nuxt/kit'
|
|
382
|
+
* const resolver = createResolver(import.meta.url)
|
|
383
|
+
*
|
|
384
|
+
* addPlugin({
|
|
385
|
+
* src: resolver.resolve('templates/foo.js'),
|
|
386
|
+
* filename: 'foo.server.js' // [optional] only include in server bundle
|
|
387
|
+
* })
|
|
388
|
+
* ```
|
|
389
|
+
*/
|
|
352
390
|
interface AddPluginOptions {
|
|
353
|
-
|
|
391
|
+
append?: boolean;
|
|
354
392
|
}
|
|
355
393
|
declare function addPlugin(_plugin: NuxtPlugin | string, opts?: AddPluginOptions): NuxtPlugin;
|
|
356
394
|
/**
|
|
357
|
-
|
|
358
|
-
|
|
395
|
+
* Adds a template and registers as a nuxt plugin.
|
|
396
|
+
*/
|
|
359
397
|
declare function addPluginTemplate(plugin: NuxtPluginTemplate | string, opts?: AddPluginOptions): NuxtPlugin;
|
|
360
|
-
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region src/resolve.d.ts
|
|
361
400
|
interface ResolvePathOptions {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
401
|
+
/** Base for resolving paths from. Default is Nuxt rootDir. */
|
|
402
|
+
cwd?: string;
|
|
403
|
+
/** An object of aliases. Default is Nuxt configured aliases. */
|
|
404
|
+
alias?: Record<string, string>;
|
|
405
|
+
/**
|
|
406
|
+
* The file extensions to try.
|
|
407
|
+
* Default is Nuxt configured extensions.
|
|
408
|
+
*
|
|
409
|
+
* Isn't considered when `type` is set to `'dir'`.
|
|
410
|
+
*/
|
|
411
|
+
extensions?: string[];
|
|
412
|
+
/**
|
|
413
|
+
* Whether to resolve files that exist in the Nuxt VFS (for example, as a Nuxt template).
|
|
414
|
+
* @default false
|
|
415
|
+
*/
|
|
416
|
+
virtual?: boolean;
|
|
417
|
+
/**
|
|
418
|
+
* Whether to fallback to the original path if the resolved path does not exist instead of returning the normalized input path.
|
|
419
|
+
* @default false
|
|
420
|
+
*/
|
|
421
|
+
fallbackToOriginal?: boolean;
|
|
422
|
+
/**
|
|
423
|
+
* The type of the path to be resolved.
|
|
424
|
+
* @default 'file'
|
|
425
|
+
*/
|
|
426
|
+
type?: PathType;
|
|
388
427
|
}
|
|
389
428
|
/**
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
429
|
+
* Resolve the full path to a file or a directory (based on the provided type), respecting Nuxt alias and extensions options.
|
|
430
|
+
*
|
|
431
|
+
* If a path cannot be resolved, normalized input will be returned unless the `fallbackToOriginal` option is set to `true`,
|
|
432
|
+
* in which case the original input path will be returned.
|
|
433
|
+
*/
|
|
395
434
|
declare function resolvePath(path: string, opts?: ResolvePathOptions): Promise<string>;
|
|
396
435
|
/**
|
|
397
|
-
|
|
398
|
-
|
|
436
|
+
* Try to resolve first existing file in paths
|
|
437
|
+
*/
|
|
399
438
|
declare function findPath(paths: string | string[], opts?: ResolvePathOptions, pathType?: PathType): Promise<string | null>;
|
|
400
439
|
/**
|
|
401
|
-
|
|
402
|
-
|
|
440
|
+
* Resolve path aliases respecting Nuxt alias options
|
|
441
|
+
*/
|
|
403
442
|
declare function resolveAlias(path: string, alias?: Record<string, string>): string;
|
|
404
443
|
interface Resolver {
|
|
405
|
-
|
|
406
|
-
|
|
444
|
+
resolve(...path: string[]): string;
|
|
445
|
+
resolvePath(path: string, opts?: ResolvePathOptions): Promise<string>;
|
|
407
446
|
}
|
|
408
447
|
/**
|
|
409
|
-
|
|
410
|
-
|
|
448
|
+
* Create a relative resolver
|
|
449
|
+
*/
|
|
411
450
|
declare function createResolver(base: string | URL): Resolver;
|
|
412
451
|
declare function resolveNuxtModule(base: string, paths: string[]): Promise<string[]>;
|
|
413
|
-
type PathType =
|
|
414
|
-
/**
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
452
|
+
type PathType = "file" | "dir";
|
|
453
|
+
/**
|
|
454
|
+
* Resolve absolute file paths in the provided directory with respect to `.nuxtignore` and return them sorted.
|
|
455
|
+
* @param path path to the directory to resolve files in
|
|
456
|
+
* @param pattern glob pattern or an array of glob patterns to match files
|
|
457
|
+
* @param opts options for globbing
|
|
458
|
+
* @param opts.followSymbolicLinks whether to follow symbolic links, default is `true`
|
|
459
|
+
* @param opts.ignore additional glob patterns to ignore
|
|
460
|
+
* @returns sorted array of absolute file paths
|
|
461
|
+
*/
|
|
423
462
|
declare function resolveFiles(path: string, pattern: string | string[], opts?: {
|
|
424
|
-
|
|
425
|
-
|
|
463
|
+
followSymbolicLinks?: boolean;
|
|
464
|
+
ignore?: GlobOptions["ignore"];
|
|
426
465
|
}): Promise<string[]>;
|
|
427
|
-
|
|
466
|
+
//#endregion
|
|
467
|
+
//#region src/nitro.d.ts
|
|
428
468
|
/**
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
469
|
+
* Adds a nitro server handler
|
|
470
|
+
*
|
|
471
|
+
*/
|
|
432
472
|
declare function addServerHandler(handler: NitroEventHandler): void;
|
|
433
473
|
/**
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
474
|
+
* Adds a nitro server handler for development-only
|
|
475
|
+
*
|
|
476
|
+
*/
|
|
437
477
|
declare function addDevServerHandler(handler: NitroDevEventHandler): void;
|
|
438
478
|
/**
|
|
439
|
-
|
|
440
|
-
|
|
479
|
+
* Adds a Nitro plugin
|
|
480
|
+
*/
|
|
441
481
|
declare function addServerPlugin(plugin: string): void;
|
|
442
482
|
/**
|
|
443
|
-
|
|
444
|
-
|
|
483
|
+
* Adds routes to be prerendered
|
|
484
|
+
*/
|
|
445
485
|
declare function addPrerenderRoutes(routes: string | string[]): void;
|
|
446
486
|
/**
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
487
|
+
* Access to the Nitro instance
|
|
488
|
+
*
|
|
489
|
+
* **Note:** You can call `useNitro()` only after `ready` hook.
|
|
490
|
+
*
|
|
491
|
+
* **Note:** Changes to the Nitro instance configuration are not applied.
|
|
492
|
+
* @example
|
|
493
|
+
*
|
|
494
|
+
* ```ts
|
|
495
|
+
* nuxt.hook('ready', () => {
|
|
496
|
+
* console.log(useNitro())
|
|
497
|
+
* })
|
|
498
|
+
* ```
|
|
499
|
+
*/
|
|
460
500
|
declare function useNitro(): Nitro;
|
|
461
501
|
/**
|
|
462
|
-
|
|
463
|
-
|
|
502
|
+
* Add server imports to be auto-imported by Nitro
|
|
503
|
+
*/
|
|
464
504
|
declare function addServerImports(imports: Import | Import[]): void;
|
|
465
505
|
/**
|
|
466
|
-
|
|
467
|
-
|
|
506
|
+
* Add directories to be scanned for auto-imports by Nitro
|
|
507
|
+
*/
|
|
468
508
|
declare function addServerImportsDir(dirs: string | string[], opts?: {
|
|
469
|
-
|
|
509
|
+
prepend?: boolean;
|
|
470
510
|
}): void;
|
|
471
511
|
/**
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
512
|
+
* Add directories to be scanned by Nitro. It will check for subdirectories,
|
|
513
|
+
* which will be registered just like the `~~/server` folder is.
|
|
514
|
+
*/
|
|
475
515
|
declare function addServerScanDir(dirs: string | string[], opts?: {
|
|
476
|
-
|
|
516
|
+
prepend?: boolean;
|
|
477
517
|
}): void;
|
|
478
|
-
|
|
518
|
+
//#endregion
|
|
519
|
+
//#region src/template.d.ts
|
|
479
520
|
/**
|
|
480
|
-
|
|
481
|
-
|
|
521
|
+
* Renders given template during build into the virtual file system (and optionally to disk in the project `buildDir`)
|
|
522
|
+
*/
|
|
482
523
|
declare function addTemplate<T>(_template: NuxtTemplate<T> | string): ResolvedNuxtTemplate<T>;
|
|
483
524
|
/**
|
|
484
|
-
|
|
485
|
-
|
|
525
|
+
* Adds a virtual file that can be used within the Nuxt Nitro server build.
|
|
526
|
+
*/
|
|
486
527
|
declare function addServerTemplate(template: NuxtServerTemplate): NuxtServerTemplate;
|
|
487
528
|
/**
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
529
|
+
* Renders given types during build to disk in the project `buildDir`
|
|
530
|
+
* and register them as types.
|
|
531
|
+
*
|
|
532
|
+
* You can pass a second context object to specify in which context the type should be added.
|
|
533
|
+
*
|
|
534
|
+
* If no context object is passed, then it will only be added to the nuxt context.
|
|
535
|
+
*/
|
|
495
536
|
declare function addTypeTemplate<T>(_template: NuxtTypeTemplate<T>, context?: {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
537
|
+
nitro?: boolean;
|
|
538
|
+
nuxt?: boolean;
|
|
539
|
+
node?: boolean;
|
|
540
|
+
shared?: boolean;
|
|
500
541
|
}): ResolvedNuxtTemplate<T>;
|
|
501
542
|
/**
|
|
502
|
-
|
|
503
|
-
|
|
543
|
+
* Normalize a nuxt template object
|
|
544
|
+
*/
|
|
504
545
|
declare function normalizeTemplate<T>(template: NuxtTemplate<T> | string, buildDir?: string): ResolvedNuxtTemplate<T>;
|
|
505
546
|
/**
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
547
|
+
* Trigger rebuilding Nuxt templates
|
|
548
|
+
*
|
|
549
|
+
* You can pass a filter within the options to selectively regenerate a subset of templates.
|
|
550
|
+
*/
|
|
510
551
|
declare function updateTemplates(options?: {
|
|
511
|
-
|
|
512
|
-
}): Promise<
|
|
552
|
+
filter?: (template: ResolvedNuxtTemplate<any>) => boolean;
|
|
553
|
+
}): Promise<void>;
|
|
513
554
|
declare function writeTypes(nuxt: Nuxt): Promise<void>;
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
declare
|
|
517
|
-
|
|
555
|
+
//#endregion
|
|
556
|
+
//#region src/logger.d.ts
|
|
557
|
+
declare const logger: ConsolaInstance;
|
|
558
|
+
declare function useLogger(tag?: string, options?: Partial<ConsolaOptions>): ConsolaInstance;
|
|
559
|
+
//#endregion
|
|
560
|
+
//#region src/internal/esm.d.ts
|
|
518
561
|
interface ResolveModuleOptions {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
562
|
+
/** @deprecated use `url` with URLs pointing at a file - never a directory */
|
|
563
|
+
paths?: string | string[];
|
|
564
|
+
url?: URL | URL[];
|
|
565
|
+
/** @default ['.js', '.mjs', '.cjs', '.ts', '.mts', '.cts'] */
|
|
566
|
+
extensions?: string[];
|
|
524
567
|
}
|
|
525
568
|
declare function directoryToURL(dir: string): URL;
|
|
526
569
|
/**
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
570
|
+
* Resolve a module from a given root path using an algorithm patterned on
|
|
571
|
+
* the upcoming `import.meta.resolve`. It returns a file URL
|
|
572
|
+
*
|
|
573
|
+
* @internal
|
|
574
|
+
*/
|
|
532
575
|
declare function tryResolveModule(id: string, url: URL | URL[]): Promise<string | undefined>;
|
|
533
576
|
/** @deprecated pass URLs pointing at files */
|
|
534
577
|
declare function tryResolveModule(id: string, url: string | string[]): Promise<string | undefined>;
|
|
535
578
|
declare function resolveModule(id: string, options?: ResolveModuleOptions): string;
|
|
536
579
|
interface ImportModuleOptions extends ResolveModuleOptions {
|
|
537
|
-
|
|
538
|
-
|
|
580
|
+
/** Automatically de-default the result of requiring the module. */
|
|
581
|
+
interopDefault?: boolean;
|
|
539
582
|
}
|
|
540
583
|
declare function importModule<T = unknown>(id: string, opts?: ImportModuleOptions): Promise<T>;
|
|
541
584
|
declare function tryImportModule<T = unknown>(id: string, opts?: ImportModuleOptions): Promise<T | undefined> | undefined;
|
|
542
585
|
/**
|
|
543
|
-
|
|
544
|
-
|
|
586
|
+
* @deprecated Please use `importModule` instead.
|
|
587
|
+
*/
|
|
545
588
|
declare function requireModule<T = unknown>(id: string, opts?: ImportModuleOptions): T;
|
|
546
589
|
/**
|
|
547
|
-
|
|
548
|
-
|
|
590
|
+
* @deprecated Please use `tryImportModule` instead.
|
|
591
|
+
*/
|
|
549
592
|
declare function tryRequireModule<T = unknown>(id: string, opts?: ImportModuleOptions): T | undefined;
|
|
550
|
-
|
|
551
|
-
export { addBuildPlugin, addComponent, addComponentExports, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addRspackPlugin, addServerHandler, addServerImports, addServerImportsDir, addServerPlugin, addServerScanDir, addServerTemplate, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, createIsIgnored, createResolver, defineNuxtModule, directoryToURL, extendNuxtSchema, extendPages, extendRouteRules, extendRspackConfig, extendViteConfig, extendWebpackConfig, findPath, getDirectory, getLayerDirectories, getNuxtCtx, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, importModule, installModule, installModules, isIgnored, isNuxt2, isNuxt3, isNuxtMajorVersion, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveIgnorePatterns, resolveModule, resolveModuleWithOptions, resolveNuxtModule, resolvePath, runWithNuxtContext, setGlobalHead, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateRuntimeConfig, updateTemplates, useLogger, useNitro, useNuxt, useRuntimeConfig, writeTypes };
|
|
552
|
-
export type { AddComponentOptions, AddPluginOptions, AddRouteMiddlewareOptions, ExtendConfigOptions, ExtendRouteRulesOptions, ExtendViteConfigOptions, ExtendWebpackConfigOptions, ImportModuleOptions, LayerDirectories, LoadNuxtConfigOptions, LoadNuxtOptions, ResolveModuleOptions, ResolvePathOptions, Resolver };
|
|
593
|
+
//#endregion
|
|
594
|
+
export { type AddComponentOptions, type AddPluginOptions, type AddRouteMiddlewareOptions, type ExtendConfigOptions, type ExtendRouteRulesOptions, type ExtendViteConfigOptions, type ExtendWebpackConfigOptions, type ImportModuleOptions, type LayerDirectories, type LoadNuxtConfigOptions, type LoadNuxtOptions, type NuxtMajorVersion, type ResolveModuleOptions, type ResolvePathOptions, type Resolver, addBuildPlugin, addComponent, addComponentExports, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addRspackPlugin, addServerHandler, addServerImports, addServerImportsDir, addServerPlugin, addServerScanDir, addServerTemplate, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, createIsIgnored, createResolver, defineNuxtModule, directoryToURL, extendNuxtSchema, extendPages, extendRouteRules, extendRspackConfig, extendViteConfig, extendWebpackConfig, findPath, getDirectory, getLayerDirectories, getNuxtCtx, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, importModule, installModule, installModules, isIgnored, isNuxt2, isNuxt3, isNuxtMajorVersion, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveIgnorePatterns, resolveModule, resolveModuleWithOptions, resolveNuxtModule, resolvePath, runWithNuxtContext, setGlobalHead, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateRuntimeConfig, updateTemplates, useLogger, useNitro, useNuxt, useRuntimeConfig, writeTypes };
|