@@ -2,6 +2,7 @@ import Vue, { ComponentOptions, PluginFunction, AsyncComponent } from "vue";
22
33type Component = ComponentOptions < Vue > | typeof Vue | AsyncComponent ;
44type Dictionary < T > = { [ key : string ] : T } ;
5+ type ErrorHandler = ( err : Error ) => void ;
56
67export type RouterMode = "hash" | "history" | "abstract" ;
78export type RawLocation = string | Location ;
@@ -22,14 +23,14 @@ export declare class VueRouter {
2223 beforeEach ( guard : NavigationGuard ) : Function ;
2324 beforeResolve ( guard : NavigationGuard ) : Function ;
2425 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 ;
2728 go ( n : number ) : void ;
2829 back ( ) : void ;
2930 forward ( ) : void ;
3031 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 ;
3334 addRoutes ( routes : RouteConfig [ ] ) : void ;
3435 resolve ( to : RawLocation , current ?: Route , append ?: boolean ) : {
3536 location : Location ;
0 commit comments