-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from AurelienLourot/quality/pagecontext-interf…
…ace-merging qual: interface merging for Vike.PageContext
- Loading branch information
Showing
12 changed files
with
43 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,16 @@ | ||
export type { PageContextServer }; | ||
export type { PageContextClient }; | ||
export type { PageContext }; | ||
export type { PageProps }; | ||
export type { Page }; | ||
export type { Component } from "solid-js"; | ||
|
||
import type { | ||
PageContextBuiltInServer, | ||
PageContextBuiltInClientWithClientRouting as PageContextBuiltInClient, | ||
} from "vite-plugin-ssr/types"; | ||
import type { JSX } from "solid-js"; | ||
|
||
export type { Component } from "solid-js"; | ||
|
||
type Page = (pageProps: PageProps) => JSX.Element; | ||
type PageProps = Record<string, unknown>; | ||
type WrapperComponent = ({ children }: { children: any }) => JSX.Element; | ||
|
||
export type PageContextCommon = { | ||
Page: Page; | ||
pageProps?: PageProps; | ||
config: { | ||
Layout?: WrapperComponent; | ||
Wrapper?: WrapperComponent; | ||
}; | ||
}; | ||
|
||
type PageContextServer = PageContextBuiltInServer<Page> & PageContextCommon; | ||
type PageContextClient = PageContextBuiltInClient<Page> & PageContextCommon; | ||
type PageContext = PageContextClient | PageContextServer; | ||
declare global { | ||
namespace Vike { | ||
interface PageContext { | ||
Page: Page; | ||
pageProps: Record<string, unknown>; | ||
title?: string; | ||
} | ||
} | ||
} |