mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
feat(nuxt): add types for nuxt-defined nitro runtime hooks (#21666)
This commit is contained in:
parent
5460873161
commit
aa2fd0112d
5
packages/nuxt/types.d.ts
vendored
5
packages/nuxt/types.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
export * from './dist/index'
|
||||
|
||||
import type { SchemaDefinition } from 'nuxt/schema'
|
||||
import type { NuxtIslandContext, NuxtIslandResponse, NuxtRenderHTMLContext } from './dist/core/runtime/nitro/renderer'
|
||||
|
||||
declare global {
|
||||
const defineNuxtConfig: typeof import('nuxt/config')['defineNuxtConfig']
|
||||
@ -17,4 +18,8 @@ declare module 'nitropack' {
|
||||
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