@@ -2,6 +2,7 @@ import Vue, { ComponentOptions, PluginFunction, AsyncComponent } from "vue";
2
2
3
3
type Component = ComponentOptions < Vue > | typeof Vue | AsyncComponent ;
4
4
type Dictionary < T > = { [ key : string ] : T } ;
5
+ type ErrorHandler = ( err : Error ) => void ;
5
6
6
7
export type RouterMode = "hash" | "history" | "abstract" ;
7
8
export type RawLocation = string | Location ;
@@ -22,14 +23,14 @@ export declare class VueRouter {
22
23
beforeEach ( guard : NavigationGuard ) : Function ;
23
24
beforeResolve ( guard : NavigationGuard ) : Function ;
24
25
afterEach ( hook : ( to : Route , from : Route ) => any ) : Function ;
25
- push ( location : RawLocation , onComplete ?: Function , onAbort ?: Function ) : void ;
26
- replace ( location : RawLocation , onComplete ?: Function , onAbort ?: Function ) : void ;
26
+ push ( location : RawLocation , onComplete ?: Function , onAbort ?: ErrorHandler ) : void ;
27
+ replace ( location : RawLocation , onComplete ?: Function , onAbort ?: ErrorHandler ) : void ;
27
28
go ( n : number ) : void ;
28
29
back ( ) : void ;
29
30
forward ( ) : void ;
30
31
getMatchedComponents ( to ?: RawLocation | Route ) : Component [ ] ;
31
- onReady ( cb : Function , errorCb ?: Function ) : void ;
32
- onError ( cb : Function ) : void ;
32
+ onReady ( cb : Function , errorCb ?: ErrorHandler ) : void ;
33
+ onError ( cb : ErrorHandler ) : void ;
33
34
addRoutes ( routes : RouteConfig [ ] ) : void ;
34
35
resolve ( to : RawLocation , current ?: Route , append ?: boolean ) : {
35
36
location : Location ;
0 commit comments