Skip to content

Commit

Permalink
types: error handlers get an Error as first argument (#2377)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirlancelot authored and posva committed Sep 10, 2018
1 parent 9196bb0 commit 8dadf97
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions types/router.d.ts
Expand Up @@ -2,6 +2,7 @@ import Vue, { ComponentOptions, PluginFunction, AsyncComponent } from "vue";

type Component = ComponentOptions<Vue> | typeof Vue | AsyncComponent;
type Dictionary<T> = { [key: string]: T };
type ErrorHandler = (err: Error) => void;

export type RouterMode = "hash" | "history" | "abstract";
export type RawLocation = string | Location;
Expand All @@ -22,14 +23,14 @@ export declare class VueRouter {
beforeEach (guard: NavigationGuard): Function;
beforeResolve (guard: NavigationGuard): Function;
afterEach (hook: (to: Route, from: Route) => any): Function;
push (location: RawLocation, onComplete?: Function, onAbort?: Function): void;
replace (location: RawLocation, onComplete?: Function, onAbort?: Function): void;
push (location: RawLocation, onComplete?: Function, onAbort?: ErrorHandler): void;
replace (location: RawLocation, onComplete?: Function, onAbort?: ErrorHandler): void;
go (n: number): void;
back (): void;
forward (): void;
getMatchedComponents (to?: RawLocation | Route): Component[];
onReady (cb: Function, errorCb?: Function): void;
onError (cb: Function): void;
onReady (cb: Function, errorCb?: ErrorHandler): void;
onError (cb: ErrorHandler): void;
addRoutes (routes: RouteConfig[]): void;
resolve (to: RawLocation, current?: Route, append?: boolean): {
location: Location;
Expand Down

0 comments on commit 8dadf97

Please sign in to comment.