diff --git a/src/types/index.ts b/src/types/index.ts index 0ddd8866b..9bfad6bc1 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -370,7 +370,7 @@ export interface NavigationGuardNext { (): void (error: Error): void (location: RouteLocationRaw): void - (valid: boolean): void + (valid: boolean | undefined): void (cb: NavigationGuardNextCallback): void /** * Allows to detect if `next` isn't called in a resolved guard. Used diff --git a/test-dts/navigationGuards.test-d.ts b/test-dts/navigationGuards.test-d.ts index b2057fe82..71a244eb8 100644 --- a/test-dts/navigationGuards.test-d.ts +++ b/test-dts/navigationGuards.test-d.ts @@ -26,6 +26,10 @@ router.beforeEach((to, from) => { return false }) +router.beforeEach((to, from, next) => { + next(undefined) +}) + // @ts-expect-error router.beforeEach((to, from, next) => { return Symbol('not supported')