Skip to content

Commit 5613b77

Browse files
committed
chore: add missing module for ts
1 parent 4f01b01 commit 5613b77

File tree

2 files changed

+28
-21
lines changed

2 files changed

+28
-21
lines changed

Diff for: types/composables.d.ts

+26-21
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
import { Route, VueRouter, NavigationGuard } from './router'
1+
declare module 'vue-router/composables' {
2+
import type { Route, NavigationGuard, default as VueRouter } from 'vue-router'
23

3-
/**
4-
* Returns the current route location. Equivalent to using `$route` inside templates.
5-
*/
6-
export declare function useRoute(): Route
7-
/**
8-
* Returns the router instance. Equivalent to using `$router` inside templates.
9-
*/
10-
export declare function useRouter(): VueRouter
11-
/**
12-
* Add a navigation guard that triggers whenever the current location is about to be updated. Similar to beforeRouteUpdate but can be used in any component. The guard is removed when the component is unmounted.
13-
*
14-
* @param updateGuard NavigationGuard
15-
*/
16-
export declare function onBeforeRouteUpdate(updateGuard: NavigationGuard): void
17-
/**
18-
* Add a navigation guard that triggers whenever the component for the current location is about to be left. Similar to beforeRouteLeave but can be used in any component. The guard is removed when the component is unmounted.
19-
*
20-
* @param leaveGuard NavigationGuard
21-
*/
22-
export declare function onBeforeRouteLeave(leaveGuard: NavigationGuard): void
4+
/**
5+
* Returns the current route location. Equivalent to using `$route` inside templates.
6+
*/
7+
export function useRoute(): Route
8+
9+
/**
10+
* Returns the router instance. Equivalent to using `$router` inside templates.
11+
*/
12+
export function useRouter(): VueRouter
13+
14+
/**
15+
* Add a navigation guard that triggers whenever the current location is about to be updated. Similar to beforeRouteUpdate but can be used in any component. The guard is removed when the component is unmounted.
16+
*
17+
* @param updateGuard NavigationGuard
18+
*/
19+
export function onBeforeRouteUpdate(updateGuard: NavigationGuard): void
20+
21+
/**
22+
* Add a navigation guard that triggers whenever the component for the current location is about to be left. Similar to beforeRouteLeave but can be used in any component. The guard is removed when the component is unmounted.
23+
*
24+
* @param leaveGuard NavigationGuard
25+
*/
26+
export function onBeforeRouteLeave(leaveGuard: NavigationGuard): void
27+
}

Diff for: types/index.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ export type {
2121
NavigationFailureType,
2222
NavigationFailure
2323
} from './router'
24+
25+
import './composables'

0 commit comments

Comments
 (0)