11/* eslint-disable @typescript-eslint/no-explicit-any */
2- import type { RouteLocationNormalizedLoaded , Router , RouteRecord , RouteMeta , NavigationGuard } from 'vue-router'
2+ import type { RouteLocationNormalizedLoaded , Router , RouteRecord , RouteMeta , NavigationGuard , RouteLocationRaw , LocationQuery , RouteParams } from 'vue-router'
33
44/**
55 * shim vue-router@3 typings
@@ -14,22 +14,22 @@ declare interface VueRouter {
1414 beforeEach ( guard : NavigationGuard ) : Function
1515 beforeResolve ( guard : NavigationGuard ) : Function
1616 afterEach ( hook : ( to : Route , from : Route ) => any ) : Function
17- push ( location : RawLocation ) : Promise < Route >
18- push ( location : RawLocation , onComplete ?: Function , onAbort ?: ErrorHandler ) : void
19- replace ( location : RawLocation ) : Promise < Route >
20- replace ( location : RawLocation , onComplete ?: Function , onAbort ?: ErrorHandler ) : void
17+ push ( location : RouteLocationRaw ) : Promise < Route >
18+ push ( location : RouteLocationRaw , onComplete ?: Function , onAbort ?: ErrorHandler ) : void
19+ replace ( location : RouteLocationRaw ) : Promise < Route >
20+ replace ( location : RouteLocationRaw , onComplete ?: Function , onAbort ?: ErrorHandler ) : void
2121 go ( n : number ) : void
2222 back ( ) : void
2323 forward ( ) : void
24- match ( raw : RawLocation , current ?: Route , redirectedFrom ?: Location ) : Route
25- getMatchedComponents ( to ?: RawLocation | Route ) : Component [ ]
24+ match ( raw : RouteLocationRaw , current ?: Route , redirectedFrom ?: Location ) : Route
25+ getMatchedComponents ( to ?: RouteLocationRaw | Route ) : Component [ ]
2626 onReady ( cb : Function , errorCb ?: ErrorHandler ) : void
2727 onError ( cb : ErrorHandler ) : void
2828 addRoutes ( routes : RouteConfig [ ] ) : void
2929 AddRoute ( parent : string , route : RouteConfig ) : void
3030 AddRoute ( route : RouteConfig ) : void
3131 resolve (
32- to : RawLocation ,
32+ to : RouteLocationRaw ,
3333 current ?: Route ,
3434 append ?: boolean
3535 ) : {
@@ -52,19 +52,19 @@ declare interface Location {
5252 append ?: boolean
5353 replace ?: boolean
5454}
55- declare type RawLocation = string | Location
55+ declare type RawLocation = RouteLocationRaw
5656declare interface Route {
5757 path : string
5858 name ?: string | null
5959 hash : string
60- query : Dictionary < string | ( string | null ) [ ] >
61- params : Dictionary < string >
60+ query : LocationQuery
61+ params : RouteParams
6262 fullPath : string
6363 matched : RouteRecord [ ]
6464 redirectedFrom ?: string
6565 meta ?: RouteMeta
6666}
67- declare type RedirectOption = RawLocation | ( ( to : Route ) => RawLocation )
67+ declare type RedirectOption = RouteLocationRaw | ( ( to : Route ) => RouteLocationRaw )
6868declare interface PathToRegexpOptions {
6969 sensitive ?: boolean
7070 strict ?: boolean
@@ -117,7 +117,7 @@ declare interface RouteRecordPublic {
117117 name ?: string
118118 redirect ?: RedirectOption
119119 meta : any
120- beforeEnter ?: ( route : Route , redirect : ( location : RawLocation ) => void , next : ( ) => void ) => any
120+ beforeEnter ?: ( route : Route , redirect : ( location : RouteLocationRaw ) => void , next : ( ) => void ) => any
121121 props :
122122 | boolean
123123 | Record < string , any >
@@ -161,6 +161,7 @@ export {
161161 isVueRouter4 ,
162162 RouterMode ,
163163 RawLocation ,
164+ RouteLocationRaw ,
164165 RedirectOption ,
165166 RouteConfig ,
166167 RouteRecordPublic ,
0 commit comments