Skip to content

Commit

Permalink
types: Add server renderer types
Browse files Browse the repository at this point in the history
  • Loading branch information
frandiox committed Feb 16, 2021
1 parent add169f commit de1ba60
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/entry-server.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ declare module 'vite-ssr/entry-server' {
import Vue, { App } from 'vue'
import { RouteLocationNormalized, RouteLocationRaw, Router } from 'vue-router'

type Renderer = (params: {
request: Request
manifest?: Record<string, string[]>
preload?: boolean
[key: string]: any
}) => Promise<{ html: string; dependencies: string[] }>

const handlerSSR: (
App: typeof Vue,
options: {
Expand All @@ -16,7 +23,7 @@ declare module 'vite-ssr/entry-server' {
initialRoute: RouteLocationNormalized
[key: string]: any
}) => Promise<void>
) => Promise<() => Promise<{ html: string }>>
) => Promise<Renderer>

export default handlerSSR
}

0 comments on commit de1ba60

Please sign in to comment.