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 { export interface NuxtOptionsGenerate {
concurrency?: number concurrency?: number
crawler?: boolean
devtools?: boolean devtools?: boolean
dir?: string dir?: string
exclude?: RegExp[] exclude?: RegExp[]

View File

@ -13,7 +13,7 @@ import { NuxtOptionsModule } from './module'
import { NuxtOptionsPlugin } from './plugin' import { NuxtOptionsPlugin } from './plugin'
import { NuxtOptionsRender } from './render' import { NuxtOptionsRender } from './render'
import { NuxtOptionsRouter } from './router' import { NuxtOptionsRouter } from './router'
import { NuxtConfigurationRuntimeConfig } from './runtime' import { NuxtOptionsRuntimeConfig } from './runtime'
import { NuxtOptionsServer } from './server' import { NuxtOptionsServer } from './server'
import { NuxtOptionsServerMiddleware } from './server-middleware' import { NuxtOptionsServerMiddleware } from './server-middleware'
import { NuxtOptionsVueConfiguration } from './vue-configuration' import { NuxtOptionsVueConfiguration } from './vue-configuration'
@ -22,7 +22,12 @@ import { NuxtOptionsWatchers } from './watchers'
export { Module } from './module' export { Module } from './module'
export { ServerMiddleware } from './server-middleware' 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 build: NuxtOptionsBuild
buildDir: string buildDir: string
buildModules: NuxtOptionsModule[] buildModules: NuxtOptionsModule[]
@ -51,8 +56,8 @@ export interface NuxtOptions extends Record<string, any> {
modules: NuxtOptionsModule[] modules: NuxtOptionsModule[]
modulesDir: string[] modulesDir: string[]
plugins: NuxtOptionsPlugin[] plugins: NuxtOptionsPlugin[]
privateRuntimeConfig?: NuxtConfigurationRuntimeConfig privateRuntimeConfig: NuxtOptionsRuntimeConfig
publicRuntimeConfig?: NuxtConfigurationRuntimeConfig publicRuntimeConfig: NuxtOptionsRuntimeConfig
render: NuxtOptionsRender render: NuxtOptionsRender
rootDir: string rootDir: string
router: NuxtOptionsRouter router: NuxtOptionsRouter
@ -66,8 +71,3 @@ export interface NuxtOptions extends Record<string, any> {
} }
export type NuxtConfig = Partial<NuxtOptions> 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 * NuxtRuntimeConfig interface can be extended by users to enable intellisense on $config
*/ */
@ -7,4 +7,4 @@ export interface NuxtRuntimeConfig {
[key: string]: any [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' 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'