@@ -14,6 +14,13 @@ export interface Route {
1414 meta ?: Record < string , any > ;
1515}
1616
17+ export interface PageData {
18+ basePath : string ;
19+ routePath : string ;
20+ filePath : string ;
21+ meta ?: Record < string , any > ;
22+ }
23+
1724export interface PagesConfigItem {
1825 /**
1926 * base route path
@@ -59,21 +66,24 @@ export interface UserConfig {
5966 * Defines files/paths to be ignored.
6067 */
6168 ignore ?: string | string [ ] ;
62- onCreatePage ?: (
63- page : Page
64- ) => Page | null | undefined | Promise < Page | null | undefined > ;
65- onCreatePages ?: (
66- pages : Page [ ]
67- ) => Page [ ] | null | undefined | Promise < Page [ ] | null | undefined > ;
68- onCreateRoute ?: (
69- route : Route
70- ) => Route | null | undefined | Promise < Route | null | undefined > ;
69+ onCreatePage ?: ( page : Page ) => Page | void | Promise < Page | void > ;
70+ onCreatePages ?: ( pages : Page [ ] ) => Page [ ] | void | Promise < Page [ ] | void > ;
71+ onCreateRoute ?: ( route : Route ) => Route | void | Promise < Route | void > ;
7172 onCreateRoutes ?: (
7273 routes : Route [ ]
73- ) => Route [ ] | null | undefined | Promise < Route [ ] | null | undefined > ;
74+ ) => Route [ ] | void | Promise < Route [ ] | void > ;
7475 onGenerateRoutesCode ?: (
7576 code : string
76- ) => string | null | undefined | Promise < string | null | undefined > ;
77+ ) => string | void | Promise < string | void > ;
78+ onCreatePageData ?: (
79+ pageData : PageData
80+ ) => PageData | void | Promise < PageData | void > ;
81+ onCreatePagesData ?: (
82+ pagesData : Record < string , PageData >
83+ ) =>
84+ | Record < string , PageData >
85+ | void
86+ | Promise < Record < string , PageData > | void > ;
7787}
7888
7989export interface ResolvedConfig extends Omit < UserConfig , 'pages' > {
0 commit comments