Skip to content

Commit

Permalink
fix types for hooks
Browse files Browse the repository at this point in the history
Signed-off-by: Chris-Robin Ennen <[email protected]>
  • Loading branch information
4350pChris committed Jun 4, 2024
1 parent 88e98e1 commit 74d3c5f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/vike-vue/src/hooks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type {
OnBeforeRenderClientAsync,
}

import type { PageContext } from 'vike/types'
import type { PageContext, PageContextClient, PageContextServer } from 'vike/types'
type PageContextWithApp = PageContext & { app: NonNullable<PageContext['app']> }

// Purposeful code duplication for improving QuickInfo IntelliSense
Expand All @@ -34,24 +34,24 @@ type OnCreateAppAsync = (pageContext: PageContextWithApp) => Promise<void>
*
* Typically used for dehydrating state management libraries.
*/
type OnAfterRenderHtmlSync = (pageContext: PageContext) => PageContext['fromHtmlRenderer']
type OnAfterRenderHtmlSync = (pageContext: PageContextServer) => PageContextServer['fromHtmlRenderer']
/**
* Hook called right after rendering the page's root Vue component.
* The hook can return additional page context that will be passed to the client under `pageContext.fromHtmlRenderer`.
*
* Typically used for dehydrating state management libraries.
*/
type OnAfterRenderHtmlAsync = (pageContext: PageContext) => Promise<PageContext['fromHtmlRenderer']>
type OnAfterRenderHtmlAsync = (pageContext: PageContextServer) => Promise<PageContextServer['fromHtmlRenderer']>

/**
* Hook called right before mounting the page's root Vue component.
*
* Typically used for hydrating state management libraries.
*/
type OnBeforeRenderClientSync = (pageContext: PageContext) => void
type OnBeforeRenderClientSync = (pageContext: PageContextClient) => void
/**
* Hook called right before mounting the page's root Vue component.
*
* Typically used for hydrating state management libraries.
*/
type OnBeforeRenderClientAsync = (pageContext: PageContext) => Promise<void>
type OnBeforeRenderClientAsync = (pageContext: PageContextClient) => Promise<void>

0 comments on commit 74d3c5f

Please sign in to comment.