Skip to content

Commit c004070

Browse files
authored
types: fix module and typescript compatibility and add missing crawler definition (nuxt#7590)
[release]
1 parent 68e7285 commit c004070

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

packages/types/config/generate.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ type NuxtOptionsGenerateRoutesFunctionWithCallback = (callback: (err: Error, rou
1010

1111
export interface NuxtOptionsGenerate {
1212
concurrency?: number
13+
crawler?: boolean
1314
devtools?: boolean
1415
dir?: string
1516
exclude?: RegExp[]

packages/types/config/index.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { NuxtOptionsModule } from './module'
1313
import { NuxtOptionsPlugin } from './plugin'
1414
import { NuxtOptionsRender } from './render'
1515
import { NuxtOptionsRouter } from './router'
16-
import { NuxtConfigurationRuntimeConfig } from './runtime'
16+
import { NuxtOptionsRuntimeConfig } from './runtime'
1717
import { NuxtOptionsServer } from './server'
1818
import { NuxtOptionsServerMiddleware } from './server-middleware'
1919
import { NuxtOptionsVueConfiguration } from './vue-configuration'
@@ -22,7 +22,12 @@ import { NuxtOptionsWatchers } from './watchers'
2222
export { Module } from './module'
2323
export { ServerMiddleware } from './server-middleware'
2424

25-
export interface NuxtOptions extends Record<string, any> {
25+
/**
26+
* @deprecated Use NuxtConfig instead
27+
*/
28+
export interface Configuration extends Record<string, any> {}
29+
30+
export interface NuxtOptions extends Configuration {
2631
build: NuxtOptionsBuild
2732
buildDir: string
2833
buildModules: NuxtOptionsModule[]
@@ -51,8 +56,8 @@ export interface NuxtOptions extends Record<string, any> {
5156
modules: NuxtOptionsModule[]
5257
modulesDir: string[]
5358
plugins: NuxtOptionsPlugin[]
54-
privateRuntimeConfig?: NuxtConfigurationRuntimeConfig
55-
publicRuntimeConfig?: NuxtConfigurationRuntimeConfig
59+
privateRuntimeConfig: NuxtOptionsRuntimeConfig
60+
publicRuntimeConfig: NuxtOptionsRuntimeConfig
5661
render: NuxtOptionsRender
5762
rootDir: string
5863
router: NuxtOptionsRouter
@@ -66,8 +71,3 @@ export interface NuxtOptions extends Record<string, any> {
6671
}
6772

6873
export type NuxtConfig = Partial<NuxtOptions>
69-
70-
/**
71-
* @deprecated Use NuxtConfig instead
72-
*/
73-
export type Configuration = NuxtConfig // Legacy alias

packages/types/config/runtime.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/**
2-
* NuxtConfigurationRuntimeConfig
2+
* NuxtOptionsRuntimeConfig
33
* NuxtRuntimeConfig interface can be extended by users to enable intellisense on $config
44
*/
55

66
export interface NuxtRuntimeConfig {
77
[key: string]: any
88
}
99

10-
export type NuxtConfigurationRuntimeConfig = NuxtRuntimeConfig | ((env: typeof process.env) => NuxtRuntimeConfig)
10+
export type NuxtOptionsRuntimeConfig = NuxtRuntimeConfig | ((env: typeof process.env) => NuxtRuntimeConfig)

packages/types/index.d.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
import './process'
22

3-
export * from './app'
4-
export * from './config'
3+
/**
4+
* Note: `export * from './app'` does not work well with TypeScript < 3.9
5+
* TODO: When 3.9 considered stable with Nuxt, require it and use `export *`
6+
*/
7+
8+
export { Context, Middleware, NuxtAppOptions, NuxtError, Plugin, Transition } from './app'
9+
export { Configuration, Module, NuxtConfig, NuxtOptions, ServerMiddleware } from './config'

0 commit comments

Comments
 (0)