types: fix module and typescript compatibility and add missing crawler definition (#7590)

[release]
This commit is contained in:
Kevin Marrec 2020-06-23 17:44:23 +02:00 committed by GitHub
parent 68e7285358
commit c00407090a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 13 deletions

View File

@ -10,6 +10,7 @@ type NuxtOptionsGenerateRoutesFunctionWithCallback = (callback: (err: Error, rou
export interface NuxtOptionsGenerate {
concurrency?: number
crawler?: boolean
devtools?: boolean
dir?: string
exclude?: RegExp[]

View File

@ -13,7 +13,7 @@ import { NuxtOptionsModule } from './module'
import { NuxtOptionsPlugin } from './plugin'
import { NuxtOptionsRender } from './render'
import { NuxtOptionsRouter } from './router'
import { NuxtConfigurationRuntimeConfig } from './runtime'
import { NuxtOptionsRuntimeConfig } from './runtime'
import { NuxtOptionsServer } from './server'
import { NuxtOptionsServerMiddleware } from './server-middleware'
import { NuxtOptionsVueConfiguration } from './vue-configuration'
@ -22,7 +22,12 @@ import { NuxtOptionsWatchers } from './watchers'
export { Module } from './module'
export { ServerMiddleware } from './server-middleware'
export interface NuxtOptions extends Record<string, any> {
/**
* @deprecated Use NuxtConfig instead
*/
export interface Configuration extends Record<string, any> {}
export interface NuxtOptions extends Configuration {
build: NuxtOptionsBuild
buildDir: string
buildModules: NuxtOptionsModule[]
@ -51,8 +56,8 @@ export interface NuxtOptions extends Record<string, any> {
modules: NuxtOptionsModule[]
modulesDir: string[]
plugins: NuxtOptionsPlugin[]
privateRuntimeConfig?: NuxtConfigurationRuntimeConfig
publicRuntimeConfig?: NuxtConfigurationRuntimeConfig
privateRuntimeConfig: NuxtOptionsRuntimeConfig
publicRuntimeConfig: NuxtOptionsRuntimeConfig
render: NuxtOptionsRender
rootDir: string
router: NuxtOptionsRouter
@ -66,8 +71,3 @@ export interface NuxtOptions extends Record<string, any> {
}
export type NuxtConfig = Partial<NuxtOptions>
/**
* @deprecated Use NuxtConfig instead
*/
export type Configuration = NuxtConfig // Legacy alias

View File

@ -1,5 +1,5 @@
/**
* NuxtConfigurationRuntimeConfig
* NuxtOptionsRuntimeConfig
* NuxtRuntimeConfig interface can be extended by users to enable intellisense on $config
*/
@ -7,4 +7,4 @@ export interface NuxtRuntimeConfig {
[key: string]: any
}
export type NuxtConfigurationRuntimeConfig = NuxtRuntimeConfig | ((env: typeof process.env) => NuxtRuntimeConfig)
export type NuxtOptionsRuntimeConfig = NuxtRuntimeConfig | ((env: typeof process.env) => NuxtRuntimeConfig)

View File

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