@nuxt/kit 3.5.2 → 3.6.0
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.ts +33 -5
- package/dist/index.mjs +2050 -36
- package/package.json +16 -16
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModuleOptions, ModuleDefinition, NuxtModule, Nuxt, NuxtConfig, NuxtOptions, SchemaDefinition, ImportPresetWithDeprecation, NuxtCompatibility, NuxtCompatibilityIssues, ComponentsDir, Component, NuxtTemplate, NuxtHooks, NuxtMiddleware, NuxtPlugin, NuxtPluginTemplate, ResolvedNuxtTemplate } from '@nuxt/schema';
|
|
1
|
+
import { ModuleOptions, ModuleDefinition, NuxtModule, Nuxt, ModuleMeta, NuxtConfig, NuxtOptions, SchemaDefinition, ImportPresetWithDeprecation, NuxtCompatibility, NuxtCompatibilityIssues, ComponentsDir, Component, NuxtTemplate, NuxtHooks, NuxtMiddleware, NuxtPlugin, NuxtPluginTemplate, ResolvedNuxtTemplate } from '@nuxt/schema';
|
|
2
2
|
import { LoadConfigOptions } from 'c12';
|
|
3
3
|
import { Import } from 'unimport';
|
|
4
4
|
import { Configuration, WebpackPluginInstance } from 'webpack';
|
|
@@ -12,11 +12,33 @@ import { genSafeVariableName } from 'knitwork';
|
|
|
12
12
|
* Define a Nuxt module, automatically merging defaults with user provided options, installing
|
|
13
13
|
* any hooks that are provided, and calling an optional setup function for full control.
|
|
14
14
|
*/
|
|
15
|
-
declare function defineNuxtModule<OptionsT extends ModuleOptions>(definition: ModuleDefinition<OptionsT>): NuxtModule<OptionsT>;
|
|
15
|
+
declare function defineNuxtModule<OptionsT extends ModuleOptions>(definition: ModuleDefinition<OptionsT> | NuxtModule<OptionsT>): NuxtModule<OptionsT>;
|
|
16
16
|
|
|
17
17
|
/** Installs a module on a Nuxt instance. */
|
|
18
|
-
declare function installModule(moduleToInstall: string | NuxtModule,
|
|
18
|
+
declare function installModule(moduleToInstall: string | NuxtModule, inlineOptions?: any, nuxt?: Nuxt): Promise<void>;
|
|
19
19
|
declare const normalizeModuleTranspilePath: (p: string) => string;
|
|
20
|
+
declare function loadNuxtModuleInstance(nuxtModule: string | NuxtModule, nuxt?: Nuxt): Promise<{
|
|
21
|
+
nuxtModule: NuxtModule<any>;
|
|
22
|
+
buildTimeModuleMeta: ModuleMeta;
|
|
23
|
+
}>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Check if a Nuxt module is installed by name.
|
|
27
|
+
*
|
|
28
|
+
* This will check both the installed modules and the modules to be installed. Note
|
|
29
|
+
* that it cannot detect if a module is _going to be_ installed programmatically by another module.
|
|
30
|
+
*/
|
|
31
|
+
declare function hasNuxtModule(moduleName: string, nuxt?: Nuxt): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Checks if a Nuxt Module is compatible with a given semver version.
|
|
34
|
+
*/
|
|
35
|
+
declare function hasNuxtModuleCompatibility(module: string | NuxtModule, semverVersion: string, nuxt?: Nuxt): Promise<boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* Get the version of a Nuxt module.
|
|
38
|
+
*
|
|
39
|
+
* 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.
|
|
40
|
+
*/
|
|
41
|
+
declare function getNuxtModuleVersion(module: string | NuxtModule, nuxt?: Nuxt | any): Promise<string | false>;
|
|
20
42
|
|
|
21
43
|
interface LoadNuxtConfigOptions extends LoadConfigOptions<NuxtConfig> {
|
|
22
44
|
}
|
|
@@ -102,6 +124,7 @@ interface AddBuildPluginFactory {
|
|
|
102
124
|
}
|
|
103
125
|
declare function addBuildPlugin(pluginFactory: AddBuildPluginFactory, options?: ExtendConfigOptions): void;
|
|
104
126
|
|
|
127
|
+
declare function normalizeSemanticVersion(version: string): string;
|
|
105
128
|
/**
|
|
106
129
|
* Check version constraints and return incompatibility issues as an array
|
|
107
130
|
*/
|
|
@@ -301,6 +324,11 @@ declare function useNitro(): Nitro;
|
|
|
301
324
|
* Renders given template using lodash template during build into the project buildDir
|
|
302
325
|
*/
|
|
303
326
|
declare function addTemplate(_template: NuxtTemplate<any> | string): ResolvedNuxtTemplate<any>;
|
|
327
|
+
/**
|
|
328
|
+
* Renders given types using lodash template during build into the project buildDir
|
|
329
|
+
* and register them as types.
|
|
330
|
+
*/
|
|
331
|
+
declare function addTypeTemplate(_template: NuxtTemplate<any>): ResolvedNuxtTemplate<any>;
|
|
304
332
|
/**
|
|
305
333
|
* Normalize a nuxt template object
|
|
306
334
|
*/
|
|
@@ -345,7 +373,7 @@ declare function tryRequireModule(id: string, opts?: RequireModuleOptions): any;
|
|
|
345
373
|
*
|
|
346
374
|
* @internal
|
|
347
375
|
*/
|
|
348
|
-
declare function tryResolveModule(id: string, url?: string | string[]): Promise<
|
|
376
|
+
declare function tryResolveModule(id: string, url?: string | string[]): Promise<string | undefined>;
|
|
349
377
|
|
|
350
378
|
/** @deprecated */
|
|
351
379
|
declare function compileTemplate(template: NuxtTemplate, ctx: any): Promise<string>;
|
|
@@ -358,4 +386,4 @@ declare const templateUtils: {
|
|
|
358
386
|
}) => string;
|
|
359
387
|
};
|
|
360
388
|
|
|
361
|
-
export { AddComponentOptions, AddPluginOptions, AddRouteMiddlewareOptions, ExtendConfigOptions, ExtendRouteRulesOptions, ExtendViteConfigOptions, ExtendWebpackConfigOptions, LoadNuxtConfigOptions, LoadNuxtOptions, RequireModuleOptions, ResolveModuleOptions, ResolvePathOptions, Resolver, addBuildPlugin, addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerPlugin, addTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createResolver, defineNuxtModule, extendNuxtSchema, extendPages, extendRouteRules, extendViteConfig, extendWebpackConfig, findPath, getNuxtVersion, hasNuxtCompatibility, importModule, installModule, isIgnored, isNuxt2, isNuxt3, loadNuxt, loadNuxtConfig, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveModule, resolvePath, templateUtils, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateTemplates, useLogger, useNitro, useNuxt };
|
|
389
|
+
export { AddComponentOptions, AddPluginOptions, AddRouteMiddlewareOptions, ExtendConfigOptions, ExtendRouteRulesOptions, ExtendViteConfigOptions, ExtendWebpackConfigOptions, LoadNuxtConfigOptions, LoadNuxtOptions, RequireModuleOptions, ResolveModuleOptions, ResolvePathOptions, Resolver, addBuildPlugin, addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerPlugin, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createResolver, defineNuxtModule, extendNuxtSchema, extendPages, extendRouteRules, extendViteConfig, extendWebpackConfig, findPath, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, importModule, installModule, isIgnored, isNuxt2, isNuxt3, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveModule, resolvePath, templateUtils, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateTemplates, useLogger, useNitro, useNuxt };
|