Skip to content

Commit

Permalink
feat(nuxt): add types for nuxt-defined nitro runtime hooks (#21666)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jun 21, 2023
1 parent 5460873 commit aa2fd01
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/nuxt/types.d.ts
Expand Up @@ -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']
Expand All @@ -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>
}
}

0 comments on commit aa2fd01

Please sign in to comment.