diff --git a/types/router.d.ts b/types/router.d.ts index 054dca896..080707d1b 100644 --- a/types/router.d.ts +++ b/types/router.d.ts @@ -23,10 +23,10 @@ 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?: ErrorHandler): void; - replace (location: RawLocation, onComplete?: Function, onAbort?: ErrorHandler): void; push (location: RawLocation): Promise; replace (location: RawLocation): Promise; + push (location: RawLocation, onComplete?: Function, onAbort?: ErrorHandler): void; + replace (location: RawLocation, onComplete?: Function, onAbort?: ErrorHandler): void; go (n: number): void; back (): void; forward (): void; diff --git a/types/test/index.ts b/types/test/index.ts index abb5395b3..ba169f9b8 100644 --- a/types/test/index.ts +++ b/types/test/index.ts @@ -159,7 +159,16 @@ router.push({ router.replace({ name: "home" }); router.push('/', () => {}, () => {}) -router.replace('/foo', () => {}, () => {}); +router.replace('/foo', () => {}, () => {}) + +// promises + +router + .push('/') + .then(route => { + route.fullPath + }) + .catch(() => {}) router.onReady(() => {});