From: Eduardo San Martin Morote Date: Mon, 6 May 2019 09:27:35 +0000 (+0200) Subject: test: fix types X-Git-Tag: v4.0.0-alpha.0~396 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9192be11fd046d0fd3f73478b4452846f266fa5e;p=thirdparty%2Fvuejs%2Frouter.git test: fix types --- diff --git a/__tests__/extractComponentsGuards.spec.js b/__tests__/extractComponentsGuards.spec.js index 0367d9bb..0cc9863b 100644 --- a/__tests__/extractComponentsGuards.spec.js +++ b/__tests__/extractComponentsGuards.spec.js @@ -6,6 +6,8 @@ const { START_LOCATION_NORMALIZED } = require('../src/types') const { components } = require('./utils') /** @typedef {import('../src/types').RouteRecord} RouteRecord */ +/** @typedef {import('../src/types').MatchedRouteRecord} MatchedRouteRecord */ +/** @typedef {import('../src/types').RouteRecordRedirect} RouteRecordRedirect */ const beforeRouteEnter = jest.fn() @@ -31,8 +33,8 @@ const SingleGuardNamed = { /** * - * @param {RouteRecord} record - * @returns {RouteRecord} + * @param {MatchedRouteRecord} record + * @returns {MatchedRouteRecord} */ function makeAsync(record) { if ('components' in record) { @@ -64,7 +66,7 @@ beforeEach(() => { /** * - * @param {import('../src/types').RouteRecord[]} components + * @param {MatchedRouteRecord[]} components */ async function checkGuards(components, n) { beforeRouteEnter.mockClear() diff --git a/src/types/index.ts b/src/types/index.ts index 593530eb..0aa8e254 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -103,7 +103,7 @@ interface RouteRecordCommon { export type RouteRecordRedirectOption = | RouteLocation | ((to: RouteLocationNormalized) => RouteLocation) -interface RouteRecordRedirect extends RouteRecordCommon { +export interface RouteRecordRedirect extends RouteRecordCommon { redirect: RouteRecordRedirectOption }