mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-18 06:31:27 +00:00
fix(nuxt): add declaration file with correct node16 imports (#25266)
This commit is contained in:
parent
210a559350
commit
8e4905c2fe
@ -17,7 +17,7 @@
|
|||||||
},
|
},
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"types": "./types.d.ts",
|
"types": "./types.d.mts",
|
||||||
"import": "./dist/index.mjs"
|
"import": "./dist/index.mjs"
|
||||||
},
|
},
|
||||||
"./config": {
|
"./config": {
|
||||||
@ -49,6 +49,7 @@
|
|||||||
"app.d.ts",
|
"app.d.ts",
|
||||||
"bin",
|
"bin",
|
||||||
"types.d.ts",
|
"types.d.ts",
|
||||||
|
"types.d.mts",
|
||||||
"dist",
|
"dist",
|
||||||
"config.*",
|
"config.*",
|
||||||
"kit.*",
|
"kit.*",
|
||||||
|
@ -17,7 +17,7 @@ import type { RouteMiddleware } from '../app/composables/router'
|
|||||||
import type { NuxtError } from '../app/composables/error'
|
import type { NuxtError } from '../app/composables/error'
|
||||||
import type { AsyncDataRequestStatus } from '../app/composables/asyncData'
|
import type { AsyncDataRequestStatus } from '../app/composables/asyncData'
|
||||||
import type { NuxtAppManifestMeta } from '../app/composables/manifest'
|
import type { NuxtAppManifestMeta } from '../app/composables/manifest'
|
||||||
import type { LoadingIndicator } from '#app/composables/loading-indicator'
|
import type { LoadingIndicator } from '../app/composables/loading-indicator'
|
||||||
|
|
||||||
import type { NuxtAppLiterals } from '#app'
|
import type { NuxtAppLiterals } from '#app'
|
||||||
|
|
||||||
|
33
packages/nuxt/types.d.mts
Normal file
33
packages/nuxt/types.d.mts
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/// <reference types="nitropack" />
|
||||||
|
export * from './dist/index.js'
|
||||||
|
|
||||||
|
import type { DefineNuxtConfig } from 'nuxt/config'
|
||||||
|
import type { RuntimeConfig, SchemaDefinition } from 'nuxt/schema'
|
||||||
|
import type { H3Event } from 'h3'
|
||||||
|
import type { NuxtIslandContext, NuxtIslandResponse, NuxtRenderHTMLContext } from './dist/core/runtime/nitro/renderer.js'
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
const defineNuxtConfig: DefineNuxtConfig
|
||||||
|
const defineNuxtSchema: (schema: SchemaDefinition) => SchemaDefinition
|
||||||
|
}
|
||||||
|
|
||||||
|
// Note: Keep in sync with packages/nuxt/src/core/templates.ts
|
||||||
|
declare module 'nitropack' {
|
||||||
|
interface NitroRuntimeConfigApp {
|
||||||
|
buildAssetsDir: string
|
||||||
|
cdnURL: string
|
||||||
|
}
|
||||||
|
interface NitroRuntimeConfig extends RuntimeConfig {}
|
||||||
|
interface NitroRouteConfig {
|
||||||
|
ssr?: boolean
|
||||||
|
experimentalNoScripts?: boolean
|
||||||
|
}
|
||||||
|
interface NitroRouteRules {
|
||||||
|
ssr?: boolean
|
||||||
|
experimentalNoScripts?: boolean
|
||||||
|
}
|
||||||
|
interface NitroRuntimeHooks {
|
||||||
|
'render:html': (htmlContext: NuxtRenderHTMLContext, context: { event: H3Event }) => void | Promise<void>
|
||||||
|
'render:island': (islandResponse: NuxtIslandResponse, context: { event: H3Event, islandContext: NuxtIslandContext }) => void | Promise<void>
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user