|
1 |
| -import { Route, VueRouter, NavigationGuard } from './router' |
| 1 | +declare module 'vue-router/composables' { |
| 2 | + import type { Route, NavigationGuard, default as VueRouter } from 'vue-router' |
2 | 3 |
|
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 | +} |
0 commit comments