mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(kit): correct render result types (#170)
This commit is contained in:
parent
6bde903273
commit
4c0ba0151d
@ -18,6 +18,19 @@ type TemplateFile = string | {
|
||||
}
|
||||
|
||||
type WatchEvent = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir'
|
||||
interface PreloadFile {
|
||||
asType: 'script' | 'style' | 'font'
|
||||
extension: string
|
||||
file: string
|
||||
fileWithoutQuery: string
|
||||
}
|
||||
type RenderResult = {
|
||||
html: string
|
||||
cspScriptSrcHashes: string[]
|
||||
error: any
|
||||
redirected: boolean
|
||||
preloadFiles: PreloadFile[]
|
||||
}
|
||||
|
||||
export interface NuxtHooks {
|
||||
// Don't break usage of untyped hooks
|
||||
@ -64,9 +77,9 @@ export interface NuxtHooks {
|
||||
'render:done': (server: Server) => HookResult
|
||||
'listen': (listenerServer: any, listener: any) => HookResult
|
||||
'server:nuxt:renderLoading': (req: IncomingMessage, res: ServerResponse) => HookResult
|
||||
'render:route': (url: string, result: string, context: any) => HookResult
|
||||
'render:routeDone': (url: string, result: string, context: any) => HookResult
|
||||
'render:beforeResponse': (url: string, result: string, context: any) => HookResult
|
||||
'render:route': (url: string, result: RenderResult, context: any) => HookResult
|
||||
'render:routeDone': (url: string, result: RenderResult, context: any) => HookResult
|
||||
'render:beforeResponse': (url: string, result: RenderResult, context: any) => HookResult
|
||||
|
||||
// @nuxt/vue-renderer
|
||||
'render:resourcesLoaded': (resources: any) => HookResult
|
||||
|
Loading…
Reference in New Issue
Block a user