From 8d19609eb6546f4b90850dbf86f5ceaa82e5711b Mon Sep 17 00:00:00 2001 From: Dmytro Kulyk Date: Sun, 9 Sep 2018 23:40:18 +0300 Subject: [PATCH 1/2] Added resolving a component type. --- types/router.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/router.d.ts b/types/router.d.ts index c6c8eef65..844b91150 100644 --- a/types/router.d.ts +++ b/types/router.d.ts @@ -6,10 +6,10 @@ type Dictionary = { [key: string]: T }; export type RouterMode = "hash" | "history" | "abstract"; export type RawLocation = string | Location; export type RedirectOption = RawLocation | ((to: Route) => RawLocation); -export type NavigationGuard = ( +export type NavigationGuard = ( to: Route, from: Route, - next: (to?: RawLocation | false | ((vm: Vue) => any) | void) => void + next: (to?: RawLocation | false | ((vm: V) => any) | void) => void ) => any export declare class VueRouter { From 069bd0eeb741a928f4f764d587ca43e3a6d62b8b Mon Sep 17 00:00:00 2001 From: Dmytro Kulyk Date: Sun, 9 Sep 2018 23:49:02 +0300 Subject: [PATCH 2/2] Pass the template parameter. --- types/vue.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/vue.d.ts b/types/vue.d.ts index 0210c9f0e..4e57eec79 100644 --- a/types/vue.d.ts +++ b/types/vue.d.ts @@ -15,8 +15,8 @@ declare module "vue/types/vue" { declare module "vue/types/options" { interface ComponentOptions { router?: VueRouter; - beforeRouteEnter?: NavigationGuard; - beforeRouteLeave?: NavigationGuard; - beforeRouteUpdate?: NavigationGuard; + beforeRouteEnter?: NavigationGuard; + beforeRouteLeave?: NavigationGuard; + beforeRouteUpdate?: NavigationGuard; } }