Skip to content

Commit 7a57597

Browse files
committed
feat: make definePage() globally available
1 parent a5d1546 commit 7a57597

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

client.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,9 @@ declare module 'vue-router/auto' {
3232
// export { defineColadaLoader } from 'unplugin-vue-router/data-loaders/pinia-colada'
3333
}
3434

35+
// Make the macros globally available
36+
declare global {
37+
const definePage: (typeof import('unplugin-vue-router/runtime'))['definePage']
38+
}
39+
3540
export {}

playground/auto-imports.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
export {}
77
declare global {
88
const defineBasicLoader: typeof import('unplugin-vue-router/data-loaders/basic')['defineBasicLoader']
9-
const definePage: typeof import('unplugin-vue-router/runtime')['definePage']
109
const onBeforeRouteLeave: typeof import('vue-router/auto')['onBeforeRouteLeave']
1110
const onBeforeRouteUpdate: typeof import('vue-router/auto')['onBeforeRouteUpdate']
1211
const useRoute: typeof import('vue-router/auto')['useRoute']

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,5 +181,5 @@ export const VueRouterAutoImports: Record<
181181
// NOTE: the typing seems broken locally, so instead we export it directly from unplugin-vue-router/runtime
182182
// 'definePage',
183183
],
184-
'unplugin-vue-router/runtime': ['definePage'],
184+
'unplugin-vue-router/runtime': [],
185185
}

src/runtime.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export * from './data-loaders'
1313
* @deprecated - use `definePage` instead
1414
*/
1515
export const _definePage = (route: DefinePage) => route
16+
1617
/**
1718
* Defines properties of the route for the current page component.
1819
*

0 commit comments

Comments
 (0)