diff --git a/examples/auth/pages/PageContext.ts b/examples/auth/pages/PageContext.ts index bf3f6cd3cc6..d7de31f953a 100644 --- a/examples/auth/pages/PageContext.ts +++ b/examples/auth/pages/PageContext.ts @@ -1,3 +1,4 @@ +// https://vike.dev/pageContext#typescript declare global { namespace Vike { interface PageContext { diff --git a/examples/auth/pages/_error/+Page.tsx b/examples/auth/pages/_error/+Page.tsx index 36b30b1290c..fe168ccc081 100644 --- a/examples/auth/pages/_error/+Page.tsx +++ b/examples/auth/pages/_error/+Page.tsx @@ -34,6 +34,7 @@ function Page() { ) } +// https://vike.dev/pageContext#typescript declare global { namespace Vike { interface PageContext { diff --git a/examples/path-aliases-v1/renderer/+config.h.ts b/examples/path-aliases-v1/renderer/+config.h.ts index 90972e2f027..19647cee952 100644 --- a/examples/path-aliases-v1/renderer/+config.h.ts +++ b/examples/path-aliases-v1/renderer/+config.h.ts @@ -1,6 +1,6 @@ import type { Config } from 'vike/types' -import onRenderClient from '#root/renderer/onRenderClient' -import onRenderHtml from '#root/renderer/onRenderHtml' +import { onRenderClient } from '#root/renderer/onRenderClient' +import { onRenderHtml } from '#root/renderer/onRenderHtml' export default { onRenderClient, diff --git a/examples/path-aliases-v1/renderer/onRenderClient.tsx b/examples/path-aliases-v1/renderer/onRenderClient.tsx index 5dc1318b06f..1d8ea9c5710 100644 --- a/examples/path-aliases-v1/renderer/onRenderClient.tsx +++ b/examples/path-aliases-v1/renderer/onRenderClient.tsx @@ -1,12 +1,12 @@ // https://vike.dev/onRenderClient -export default onRenderClient +export { onRenderClient } import React from 'react' import { hydrateRoot } from 'react-dom/client' import { PageLayout } from './PageLayout' -import type { PageContext } from '#root/types' +import type { OnRenderClientSync } from 'vike/types' -async function onRenderClient(pageContext: PageContext) { +const onRenderClient: OnRenderClientSync = (pageContext): ReturnType => { const { Page } = pageContext hydrateRoot( document.getElementById('page-view')!, diff --git a/examples/path-aliases-v1/renderer/onRenderHtml.tsx b/examples/path-aliases-v1/renderer/onRenderHtml.tsx index 54311461473..8397318461b 100644 --- a/examples/path-aliases-v1/renderer/onRenderHtml.tsx +++ b/examples/path-aliases-v1/renderer/onRenderHtml.tsx @@ -1,13 +1,13 @@ // https://vike.dev/onRenderHtml -export default onRenderHtml +export { onRenderHtml } import ReactDOMServer from 'react-dom/server' import React from 'react' import { escapeInject, dangerouslySkipEscape } from 'vike/server' import { PageLayout } from './PageLayout' -import type { PageContext } from '#root/types' +import type { OnRenderHtmlSync } from 'vike/types' -function onRenderHtml(pageContext: PageContext) { +const onRenderHtml: OnRenderHtmlSync = (pageContext): ReturnType => { const { Page } = pageContext const pageHtml = ReactDOMServer.renderToString( diff --git a/examples/path-aliases-v1/types/PageContext.ts b/examples/path-aliases-v1/types/PageContext.ts index a1799d817f4..d0d6e56e30b 100644 --- a/examples/path-aliases-v1/types/PageContext.ts +++ b/examples/path-aliases-v1/types/PageContext.ts @@ -1,4 +1,12 @@ +export type { PageContextClient, PageContextServer } from 'vike/types' + export type ReactComponent = () => JSX.Element -export type PageContext = { - Page: ReactComponent + +// https://vike.dev/pageContext#typescript +declare global { + namespace Vike { + interface PageContext { + Page: ReactComponent + } + } } diff --git a/examples/react-full-v1/pages/hello/+guard.ts b/examples/react-full-v1/pages/hello/+guard.ts index 419f757eadb..bcaf4fb8080 100644 --- a/examples/react-full-v1/pages/hello/+guard.ts +++ b/examples/react-full-v1/pages/hello/+guard.ts @@ -1,14 +1,16 @@ -export default guard +export { guard } +import type { GuardAsync } from 'vike/types' import { render } from 'vike/abort' // The guard() hook enables to protect pages -async function guard(pageContext: { urlPathname: string }) { +const guard: GuardAsync = async (pageContext): ReturnType => { if (pageContext.urlPathname === '/hello/forbidden') { await sleep(2 * 1000) // Unlike Route Functions, guard() can be async throw render(401, 'This page is forbidden.') } } + function sleep(milliseconds: number): Promise { return new Promise((r) => setTimeout(r, milliseconds)) } diff --git a/examples/react-full-v1/pages/hello/+onBeforeRender.ts b/examples/react-full-v1/pages/hello/+onBeforeRender.ts index 14df5790753..b91ef2b9c5c 100644 --- a/examples/react-full-v1/pages/hello/+onBeforeRender.ts +++ b/examples/react-full-v1/pages/hello/+onBeforeRender.ts @@ -1,11 +1,11 @@ -export default onBeforeRender +// https://vike.dev/onBeforeRender +export { onBeforeRender } -import type { PageContextBuiltInServer } from 'vike/types' +import type { OnBeforeRenderAsync } from 'vike/types' import { render } from 'vike/abort' - import { names } from './names' -async function onBeforeRender(pageContext: PageContextBuiltInServer) { +const onBeforeRender: OnBeforeRenderAsync = async (pageContext): ReturnType => { const { name } = pageContext.routeParams if (name !== 'anonymous' && !names.includes(name)) { throw render(404, `Unknown name: ${name}.`) diff --git a/examples/react-full-v1/pages/hello/+route.ts b/examples/react-full-v1/pages/hello/+route.ts index 73c28951ee6..9d5aeae024f 100644 --- a/examples/react-full-v1/pages/hello/+route.ts +++ b/examples/react-full-v1/pages/hello/+route.ts @@ -1,9 +1,10 @@ -export default route +export { route } +import type { Route } from 'vike/types' import { resolveRoute } from 'vike/routing' // Route Functions enables advanced routing logic -function route(pageContext: { urlPathname: string }) { +const route: Route = (pageContext): ReturnType => { if (pageContext.urlPathname === '/hello' || pageContext.urlPathname === '/hello/') { const name = 'anonymous' return { routeParams: { name } } diff --git a/examples/react-full-v1/pages/star-wars/@id/+onBeforeRender.tsx b/examples/react-full-v1/pages/star-wars/@id/+onBeforeRender.tsx index 8cbc0abd414..fc713819659 100644 --- a/examples/react-full-v1/pages/star-wars/@id/+onBeforeRender.tsx +++ b/examples/react-full-v1/pages/star-wars/@id/+onBeforeRender.tsx @@ -1,15 +1,17 @@ // https://vike.dev/onBeforeRender -export default onBeforeRender +export { onBeforeRender } import fetch from 'cross-fetch' import { filterMovieData } from '../filterMovieData' -import type { PageContextBuiltInServer } from 'vike/types' +import type { OnBeforeRenderAsync, PageContextClient, PageContextServer } from 'vike/types' import type { MovieDetails } from '../types' import { render } from 'vike/abort' import React from 'react' -async function onBeforeRender(pageContext: PageContextBuiltInServer) { - const dataUrl = `https://star-wars.brillout.com/api/films/${pageContext.routeParams.id}.json` +const onBeforeRender: OnBeforeRenderAsync = async ( + pageContext: PageContextServer | PageContextClient +): ReturnType => { + const dataUrl = `https://star-wars.brillout.com/api/films/${pageContext.routeParams?.id}.json` let movie: MovieDetails try { const response = await fetch(dataUrl) diff --git a/examples/react-full-v1/pages/star-wars/index/+onBeforePrerenderStart.ts b/examples/react-full-v1/pages/star-wars/index/+onBeforePrerenderStart.ts index e6380df2722..7161317a2e9 100644 --- a/examples/react-full-v1/pages/star-wars/index/+onBeforePrerenderStart.ts +++ b/examples/react-full-v1/pages/star-wars/index/+onBeforePrerenderStart.ts @@ -1,10 +1,11 @@ // https://vike.dev/onBeforePrerenderStart -export default onBeforePrerenderStart +export { onBeforePrerenderStart } +import type { OnBeforePrerenderStartAsync } from 'vike/types' import { filterMovieData } from '../filterMovieData' import { filterMoviesData, getStarWarsMovies, getTitle } from './getStarWarsMovies' -async function onBeforePrerenderStart() { +const onBeforePrerenderStart: OnBeforePrerenderStartAsync = async (): ReturnType => { const movies = await getStarWarsMovies() return [ diff --git a/examples/react-full-v1/pages/star-wars/index/+onBeforeRender.ts b/examples/react-full-v1/pages/star-wars/index/+onBeforeRender.ts index bf4b3bf0e91..53ba0d881dc 100644 --- a/examples/react-full-v1/pages/star-wars/index/+onBeforeRender.ts +++ b/examples/react-full-v1/pages/star-wars/index/+onBeforeRender.ts @@ -1,9 +1,10 @@ // https://vike.dev/onBeforeRender -export default onBeforeRender +export { onBeforeRender } +import type { OnBeforeRenderAsync } from 'vike/types' import { filterMoviesData, getStarWarsMovies, getTitle } from './getStarWarsMovies' -async function onBeforeRender() { +const onBeforeRender: OnBeforeRenderAsync = async (pageContext): ReturnType => { await sleep(700) // Simulate slow network const movies = await getStarWarsMovies() return { diff --git a/examples/react-full-v1/renderer/+onHydrationEnd.ts b/examples/react-full-v1/renderer/+onHydrationEnd.ts index 8ac921b98e6..d040a8acd0a 100644 --- a/examples/react-full-v1/renderer/+onHydrationEnd.ts +++ b/examples/react-full-v1/renderer/+onHydrationEnd.ts @@ -1,5 +1,7 @@ -export default onHydrationEnd +export { onHydrationEnd } -function onHydrationEnd() { +import type { OnHydrationEndSync } from 'vike/types' + +const onHydrationEnd: OnHydrationEndSync = (): ReturnType => { console.log('Hydration finished; page is now interactive.') } diff --git a/examples/react-full-v1/renderer/+onPageTransitionEnd.ts b/examples/react-full-v1/renderer/+onPageTransitionEnd.ts index 28032a8065b..b92b724ea5e 100644 --- a/examples/react-full-v1/renderer/+onPageTransitionEnd.ts +++ b/examples/react-full-v1/renderer/+onPageTransitionEnd.ts @@ -1,6 +1,8 @@ -export default onPageTransitionEnd +export { onPageTransitionEnd } -function onPageTransitionEnd() { +import type { OnPageTransitionEndSync } from 'vike/types' + +const onPageTransitionEnd: OnPageTransitionEndSync = (): ReturnType => { console.log('Page transition end') document.querySelector('body')!.classList.remove('page-is-transitioning') } diff --git a/examples/react-full-v1/renderer/+onPageTransitionStart.ts b/examples/react-full-v1/renderer/+onPageTransitionStart.ts index 7a863420ac0..83cee57b901 100644 --- a/examples/react-full-v1/renderer/+onPageTransitionStart.ts +++ b/examples/react-full-v1/renderer/+onPageTransitionStart.ts @@ -1,6 +1,8 @@ -export default onPageTransitionStart +export { onPageTransitionStart } -function onPageTransitionStart() { +import type { OnPageTransitionStartSync } from 'vike/types' + +const onPageTransitionStart: OnPageTransitionStartSync = (): ReturnType => { console.log('Page transition start') document.querySelector('body')!.classList.add('page-is-transitioning') } diff --git a/examples/react-full-v1/renderer/+onRenderClient.tsx b/examples/react-full-v1/renderer/+onRenderClient.tsx index 445cdc02a2a..5b616535b55 100644 --- a/examples/react-full-v1/renderer/+onRenderClient.tsx +++ b/examples/react-full-v1/renderer/+onRenderClient.tsx @@ -1,15 +1,15 @@ // https://vike.dev/onRenderClient -export default onRenderClient +export { onRenderClient } import './css/index.css' import React from 'react' import ReactDOM from 'react-dom/client' import { PageShell } from './PageShell' import { getPageTitle } from './getPageTitle' -import type { PageContextClient } from 'vike/types' +import type { OnRenderClientAsync } from 'vike/types' let root: ReactDOM.Root -async function onRenderClient(pageContext: PageContextClient) { +const onRenderClient: OnRenderClientAsync = async (pageContext): ReturnType => { const { Page, pageProps } = pageContext const page = ( diff --git a/examples/react-full-v1/renderer/+onRenderHtml.tsx b/examples/react-full-v1/renderer/+onRenderHtml.tsx index 78f5e4749f5..9fd3713750e 100644 --- a/examples/react-full-v1/renderer/+onRenderHtml.tsx +++ b/examples/react-full-v1/renderer/+onRenderHtml.tsx @@ -1,14 +1,14 @@ // https://vike.dev/onRenderHtml -export default onRenderHtml +export { onRenderHtml } import { renderToStream } from 'react-streaming/server' import React from 'react' import { escapeInject } from 'vike/server' import { PageShell } from './PageShell' import { getPageTitle } from './getPageTitle' -import type { PageContextServer } from 'vike/types' +import type { OnRenderHtmlAsync } from 'vike/types' -async function onRenderHtml(pageContext: PageContextServer) { +const onRenderHtml: OnRenderHtmlAsync = async (pageContext): ReturnType => { const { Page, pageProps } = pageContext const stream = await renderToStream( diff --git a/examples/react-full-v1/renderer/PageContext.ts b/examples/react-full-v1/renderer/PageContext.ts index 3d48e20b169..54eb7c208cb 100644 --- a/examples/react-full-v1/renderer/PageContext.ts +++ b/examples/react-full-v1/renderer/PageContext.ts @@ -1,3 +1,4 @@ +// https://vike.dev/pageContext#typescript declare global { namespace Vike { interface PageContext { @@ -10,6 +11,7 @@ declare global { /** Title defined dynamically by onBeforeRender() */ title?: string abortReason?: string + someAsyncProps?: number } } } diff --git a/examples/vue-full-v1/renderer/types.ts b/examples/vue-full-v1/renderer/types.ts index 3c0b7fa7cfa..4bd0a94c7cc 100644 --- a/examples/vue-full-v1/renderer/types.ts +++ b/examples/vue-full-v1/renderer/types.ts @@ -7,6 +7,7 @@ type Component = ComponentPublicInstance // https://stackoverflow.com/questions/ type Page = Component type PageProps = Record +// https://vike.dev/pageContext#typescript declare global { namespace Vike { interface PageContext { diff --git a/vike/shared/page-configs/Config.ts b/vike/shared/page-configs/Config.ts index f740d26b8d9..ed031f2949f 100644 --- a/vike/shared/page-configs/Config.ts +++ b/vike/shared/page-configs/Config.ts @@ -4,10 +4,36 @@ export type { ConfigNameBuiltIn } export type { ConfigMeta } export type { HookName } +export type { GuardAsync } +export type { GuardSync } +export type { OnBeforePrerenderStartAsync } +export type { OnBeforePrerenderStartSync } +export type { OnBeforeRenderAsync } +export type { OnBeforeRenderSync } +export type { OnBeforeRouteAsync } +export type { OnBeforeRouteSync } +export type { OnHydrationEndAsync } +export type { OnHydrationEndSync } +export type { OnPageTransitionEndAsync } +export type { OnPageTransitionEndSync } +export type { OnPageTransitionStartAsync } +export type { OnPageTransitionStartSync } +export type { OnPrerenderStartAsync } +export type { OnPrerenderStartSync } +export type { OnRenderClientAsync } +export type { OnRenderClientSync } +export type { OnRenderHtmlAsync } +export type { OnRenderHtmlSync } +export type { RouteAsync } +export type { RouteSync } +export type { Route } + import type { PrefetchStaticAssets } from '../../client/client-routing-runtime/prefetch/getPrefetchSettings.js' import type { ConfigDefinition } from '../../node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js' +import type { DocumentHtml } from '../../node/runtime/html/renderHtml.js' import type { ConfigVikeUserProvided } from '../ConfigVike.js' import type { Vike, VikePackages } from '../VikeNamespace.js' +import type { PageContextClient, PageContextServer } from '../types.js' type HookName = | 'onHydrationEnd' @@ -39,6 +65,153 @@ type Config = ConfigBuiltIn & | VikePackages.ConfigVikeSvelte ) +// Purposeful code duplication for improving QuickInfo IntelliSense +/** Protect page(s), e.g. forbid unauthorized access. + * + * https://vike.dev/guard + */ +type GuardAsync = (pageContext: PageContextServer) => Promise +/** Protect page(s), e.g. forbid unauthorized access. + * + * https://vike.dev/guard + */ +type GuardSync = (pageContext: PageContextServer) => void +/** Global Hook called before the whole pre-rendering process starts. + * + * https://vike.dev/onBeforePrerenderStart + */ +type OnBeforePrerenderStartAsync = () => Promise< + ( + | string + | { + url: string + pageContext: Partial + } + )[] +> +/** Global Hook called before the whole pre-rendering process starts. + * + * https://vike.dev/onBeforePrerenderStart + */ +type OnBeforePrerenderStartSync = () => ( + | string + | { + url: string + pageContext: Partial + } +)[] +/** Hook called before the page is rendered, usually for fetching data. + * + * https://vike.dev/onBeforeRender + */ +type OnBeforeRenderAsync = ( + pageContext: PageContextServer +) => Promise<{ pageContext: Partial } | void> +/** Hook called before the page is rendered, usually for fetching data. + * + * https://vike.dev/onBeforeRender + */ +type OnBeforeRenderSync = (pageContext: PageContextServer) => { pageContext: Partial } | void +/** Hook called before the URL is routed to a page. + * + * https://vike.dev/onBeforeRoute + */ +type OnBeforeRouteAsync = (pageContext: PageContextServer) => Promise<{ pageContext: Partial }> +/** Hook called before the URL is routed to a page. + * + * https://vike.dev/onBeforeRoute + */ +type OnBeforeRouteSync = (pageContext: PageContextServer) => { pageContext: Partial } +/** Hook called after the page is hydrated. + * + * https://vike.dev/clientRouting + */ +type OnHydrationEndAsync = (pageContext: PageContextClient) => Promise +/** Hook called after the page is hydrated. + * + * https://vike.dev/clientRouting + */ +type OnHydrationEndSync = (pageContext: PageContextClient) => void +/** Hook called after the user navigates to a new page. + * + * https://vike.dev/clientRouting + */ +type OnPageTransitionEndAsync = (pageContext: PageContextClient) => Promise +/** Hook called after the user navigates to a new page. + * + * https://vike.dev/clientRouting + */ +type OnPageTransitionEndSync = (pageContext: PageContextClient) => void +/** Hook called before the user navigates to a new page. + * + * https://vike.dev/clientRouting + */ +type OnPageTransitionStartAsync = (pageContext: PageContextClient) => Promise +/** Hook called before the user navigates to a new page. + * + * https://vike.dev/clientRouting + */ +type OnPageTransitionStartSync = (pageContext: PageContextClient) => void +/** Page Hook called when pre-rendering starts. + * + * https://vike.dev/onPrerenderStart + */ +type OnPrerenderStartAsync = (prerenderContext: { + pageContexts: PageContextServer[] +}) => Promise<{ prerenderContext: { pageContexts: PageContextServer[] } }> +/** Page Hook called when pre-rendering starts. + * + * https://vike.dev/onPrerenderStart + */ +type OnPrerenderStartSync = (prerenderContext: { pageContexts: PageContextServer[] }) => { + prerenderContext: { pageContexts: PageContextServer[] } +} +/** Hook called when page is rendered on the client-side. + * + * https://vike.dev/onRenderClient + */ +type OnRenderClientAsync = (pageContext: PageContextClient) => Promise +/** Hook called when page is rendered on the client-side. + * + * https://vike.dev/onRenderClient + */ +type OnRenderClientSync = (pageContext: PageContextClient) => void +/** Hook called when page is rendered to HTML on the server-side. + * + * https://vike.dev/onRenderHtml + */ +type OnRenderHtmlAsync = (pageContext: PageContextServer) => Promise< + | DocumentHtml + | { + documentHtml: DocumentHtml + // See https://vike.dev/stream#initial-data-after-stream-end + pageContext: Partial | (() => Promise>) + } +> +/** Hook called when page is rendered to HTML on the server-side. + * + * https://vike.dev/onRenderHtml + */ +type OnRenderHtmlSync = (pageContext: PageContextServer) => + | DocumentHtml + | { + documentHtml: DocumentHtml + // See https://vike.dev/stream#initial-data-after-stream-end + pageContext: Partial | (() => Promise>) + } +/** @deprecated Use a sync route() with an async guard() instead */ +type RouteAsync = (pageContext: PageContextServer | PageContextClient) => Promise<{ routeParams: Record }> +/** The page's URL(s). + * + * https://vike.dev/route + */ +type RouteSync = (pageContext: PageContextServer | PageContextClient) => { routeParams: Record } +/** The page's URL(s). + * + * https://vike.dev/route + */ +type Route = RouteSync + // TODO: write docs of links below /** Page configuration. @@ -53,13 +226,13 @@ type ConfigBuiltIn = { * * https://vike.dev/route */ - route?: string | Function | ImportString + route?: string | RouteAsync | RouteSync | ImportString /** Protect page(s), e.g. forbid unauthorized access. * * https://vike.dev/guard */ - guard?: Function | ImportString + guard?: GuardAsync | GuardSync | ImportString /** * Whether to pre-render the page(s). * @@ -78,7 +251,7 @@ type ConfigBuiltIn = { * * https://vike.dev/onBeforeRender */ - onBeforeRender?: Function | ImportString | null + onBeforeRender?: OnBeforeRenderAsync | OnBeforeRenderSync | ImportString | null /** Determines what pageContext properties are sent to the client-side. * @@ -90,12 +263,12 @@ type ConfigBuiltIn = { * * https://vike.dev/onRenderClient */ - onRenderClient?: Function | ImportString + onRenderClient?: OnRenderClientAsync | OnRenderClientSync | ImportString /** Hook called when page is rendered to HTML on the server-side. * * https://vike.dev/onRenderHtml */ - onRenderHtml?: Function | ImportString + onRenderHtml?: OnRenderHtmlAsync | OnRenderHtmlSync | ImportString /** Enable async Route Functions. * @@ -113,34 +286,34 @@ type ConfigBuiltIn = { * * https://vike.dev/onPrerenderStart */ - onPrerenderStart?: Function | ImportString + onPrerenderStart?: OnPrerenderStartAsync | OnPrerenderStartSync | ImportString /** Global Hook called before the whole pre-rendering process starts. * * https://vike.dev/onBeforePrerenderStart */ - onBeforePrerenderStart?: Function | ImportString + onBeforePrerenderStart?: OnBeforePrerenderStartAsync | OnBeforePrerenderStartSync | ImportString /** Hook called before the URL is routed to a page. * * https://vike.dev/onBeforeRoute */ - onBeforeRoute?: Function | ImportString + onBeforeRoute?: OnBeforeRouteAsync | OnBeforeRouteSync | ImportString /** Hook called after the page is hydrated. * * https://vike.dev/clientRouting */ - onHydrationEnd?: Function | ImportString + onHydrationEnd?: OnHydrationEndAsync | OnHydrationEndSync | ImportString /** Hook called before the user navigates to a new page. * * https://vike.dev/clientRouting */ - onPageTransitionStart?: Function | ImportString + onPageTransitionStart?: OnPageTransitionStartAsync | OnPageTransitionStartSync | ImportString /** Hook called after the user navigates to a new page. * * https://vike.dev/clientRouting */ - onPageTransitionEnd?: Function | ImportString + onPageTransitionEnd?: OnPageTransitionEndAsync | OnPageTransitionEndSync | ImportString /** Whether the UI framework (React/Vue/Solid/...) allows the page's hydration to be aborted. * diff --git a/vike/types/index.ts b/vike/types/index.ts index 1981e10346c..a7e72843612 100644 --- a/vike/types/index.ts +++ b/vike/types/index.ts @@ -12,7 +12,33 @@ export type { PageContextBuiltInServer } from '../shared/types.js' export type { PageContextBuiltInClientWithClientRouting } from '../shared/types.js' export type { PageContextBuiltInClientWithServerRouting } from '../shared/types.js' -export type { Config, ConfigMeta as Meta } from '../shared/page-configs/Config.js' +export type { + Config, + ConfigMeta as Meta, + GuardAsync, + GuardSync, + OnBeforePrerenderStartAsync, + OnBeforePrerenderStartSync, + OnBeforeRenderAsync, + OnBeforeRenderSync, + OnBeforeRouteAsync, + OnBeforeRouteSync, + OnHydrationEndAsync, + OnHydrationEndSync, + OnPageTransitionEndAsync, + OnPageTransitionEndSync, + OnPageTransitionStartAsync, + OnPageTransitionStartSync, + OnPrerenderStartAsync, + OnPrerenderStartSync, + OnRenderClientAsync, + OnRenderClientSync, + OnRenderHtmlAsync, + OnRenderHtmlSync, + RouteAsync, + RouteSync, + Route +} from '../shared/page-configs/Config.js' export type { ConfigEnv } from '../shared/page-configs/PageConfig.js' export type { ConfigDefinition,