Skip to content

Commit

Permalink
fix(types): correctly extend client
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Feb 13, 2024
1 parent 4d20fa0 commit d226cf9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion client.d.ts
@@ -1,4 +1,5 @@
import 'vue-router'
import 'unplugin-vue-router/runtime'
export {}

declare module 'vue-router/auto-routes' {
Expand Down Expand Up @@ -102,7 +103,7 @@ declare module 'vue-router/auto' {

// Experimental Data Fetching
export {
_definePage as definePage,
definePage,
DataLoaderPlugin,
_setupLoaderGuard as setupLoaderGuard,
_defineBasicLoader as defineBasicLoader,
Expand Down
3 changes: 1 addition & 2 deletions src/codegen/vueRouterModule.ts
Expand Up @@ -19,8 +19,7 @@ export {
_stopDataFetchingScope as stopDataFetchingScope,
_defineBasicLoader as defineBasicLoader,
// FIXME: remove in next major
_definePage as definePage,
definePage,
// new data fetching
_setupLoaderGuard as setupLoaderGuard,
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -185,7 +185,7 @@ export const VueRouterAutoImports: Record<
// 'definePage',
],
'unplugin-vue-router/runtime': [
['_definePage', 'definePage'],
['definePage', 'definePage'],
// FIXME: remove after deprecation
['_defineLoader', 'defineLoader'],
],
Expand Down
7 changes: 7 additions & 0 deletions src/runtime.ts
Expand Up @@ -30,8 +30,15 @@ export * from './data-fetching_new/defineColadaLoader'
* Defines properties of the route for the current page component.
*
* @param route - route information to be added to this page
* @deprecated - use `definePage` instead
*/
export const _definePage = (route: DefinePage) => route
/**
* Defines properties of the route for the current page component.
*
* @param route - route information to be added to this page
*/
export const definePage = (route: DefinePage) => route

/**
* Merges route records.
Expand Down

0 comments on commit d226cf9

Please sign in to comment.