mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
types: fix module and typescript compatibility and add missing crawler definition (#7590)
[release]
This commit is contained in:
parent
68e7285358
commit
c00407090a
1
packages/types/config/generate.d.ts
vendored
1
packages/types/config/generate.d.ts
vendored
@ -10,6 +10,7 @@ type NuxtOptionsGenerateRoutesFunctionWithCallback = (callback: (err: Error, rou
|
||||
|
||||
export interface NuxtOptionsGenerate {
|
||||
concurrency?: number
|
||||
crawler?: boolean
|
||||
devtools?: boolean
|
||||
dir?: string
|
||||
exclude?: RegExp[]
|
||||
|
18
packages/types/config/index.d.ts
vendored
18
packages/types/config/index.d.ts
vendored
@ -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
|
||||
|
4
packages/types/config/runtime.d.ts
vendored
4
packages/types/config/runtime.d.ts
vendored
@ -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)
|
||||
|
9
packages/types/index.d.ts
vendored
9
packages/types/index.d.ts
vendored
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user