-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
client.d.ts
62 lines (53 loc) · 1.7 KB
/
client.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
declare module 'vue-router/auto-routes' {
import type { RouteRecordRaw, Router } from 'vue-router'
/**
* Array of routes generated by unplugin-vue-router
*/
export const routes: RouteRecordRaw[]
/**
* Setups hot module replacement for routes.
* @param router - The router instance
* @example
* ```ts
* import { createRouter, createWebHistory } from 'vue-router'
* import { routes, handleHotUpdate } from 'vue-router/auto-routes'
* const router = createRouter({
* history: createWebHistory(),
* routes,
* })
* if (import.meta.hot) {
* handleHotUpdate(router)
* }
* ```
*/
export function handleHotUpdate(router: Router): void
}
declare module 'vue-router' {
import type { RouteNamedMap } from 'vue-router/auto-routes'
export interface TypesConfig {
RouteNamedMap: RouteNamedMap
}
}
// FIXME: remove vue-router/auto in next major
/**
* @deprecated Directly import from 'vue-router' instead
*/
declare module 'vue-router/auto' {
// reexport all types that are not augmented by unplugin-vue-router
export * from 'vue-router'
export { definePage } from 'unplugin-vue-router/runtime'
// Experimental Data Fetching
export {
DataLoaderPlugin,
NavigationResult,
} from 'unplugin-vue-router/data-loaders'
// must be added to the virtual vue-router/auto
// FIXME: is there a way to achieve this without losing the types?
// export { defineBasicLoader } from 'unplugin-vue-router/data-loaders/basic'
// export { defineColadaLoader } from 'unplugin-vue-router/data-loaders/pinia-colada'
}
// Make the macros globally available
declare global {
const definePage: (typeof import('unplugin-vue-router/runtime'))['definePage']
}
export {}