@@ -144,7 +144,8 @@ export type {
144144} from './typed-routes'
145145
146146export { createRouter } from './router'
147- export type { Router , RouterOptions } from './router'
147+ export type { RouterOptions } from './router'
148+ export type { Router as _RouterClassic } from './router'
148149export type { RouterScrollBehavior } from './scrollBehavior'
149150
150151export { NavigationFailureType , isNavigationFailure } from './errors'
@@ -174,7 +175,7 @@ export * from './useApi'
174175
175176// Global extensions for Vue
176177import type { TypesConfig } from './config'
177- import type { Router } from './router'
178+ import type { Router as RouterClassic } from './router'
178179import type { RouterLink } from './RouterLink'
179180import type { RouterView } from './RouterView'
180181import type {
@@ -183,6 +184,25 @@ import type {
183184 RouteLocationNormalizedLoaded ,
184185} from './typed-routes'
185186
187+ /**
188+ * Router instance.
189+ *
190+ * By default this resolves to the classic {@link RouterClassic}. Augment
191+ * {@link TypesConfig} with a `Router` slot to swap the public type — for
192+ * example to the experimental router:
193+ *
194+ * ```ts
195+ * import type { EXPERIMENTAL_Router } from 'vue-router/experimental'
196+ * declare module 'vue-router' {
197+ * interface TypesConfig {
198+ * Router: EXPERIMENTAL_Router
199+ * }
200+ * }
201+ * ```
202+ */
203+ export type Router =
204+ TypesConfig extends Record < 'Router' , infer T > ? T : RouterClassic
205+
186206declare module 'vue' {
187207 export interface ComponentCustomOptions {
188208 /**
0 commit comments