From: Eduardo San Martin Morote Date: Thu, 10 Sep 2020 15:24:30 +0000 (+0200) Subject: refactor(types): Rename ScrollBehavior to RouterScrollBehavior X-Git-Tag: v4.0.0-beta.10~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9fc09969db854bc0201454fbecd546637b76213a;p=thirdparty%2Fvuejs%2Frouter.git refactor(types): Rename ScrollBehavior to RouterScrollBehavior BREAKING CHANGE: there is already an existing type named `ScrollBehavior`, so we are renaming our type to avoid any confusions and allow the user to use both types at the same type (which given what the existing `ScrollBehavior` type is designed for, will likely happen). --- diff --git a/src/index.ts b/src/index.ts index 210be735..8b8665c0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -41,7 +41,7 @@ export { Router, RouterOptions, ErrorHandler, - ScrollBehavior, + RouterScrollBehavior, } from './router' export { diff --git a/src/router.ts b/src/router.ts index e1ab99f8..953055fb 100644 --- a/src/router.ts +++ b/src/router.ts @@ -68,7 +68,10 @@ type OnReadyCallback = [() => void, (reason?: any) => void] type Awaitable = T | Promise -export interface ScrollBehavior { +/** + * Type of the `scrollBehavior` option that can be passed to `createRouter`. + */ +export interface RouterScrollBehavior { /** * @param to - Route location where we are navigating to * @param from - Route location where we are navigating from @@ -114,7 +117,7 @@ export interface RouterOptions extends PathParserOptions { * } * ``` */ - scrollBehavior?: ScrollBehavior + scrollBehavior?: RouterScrollBehavior /** * Custom implementation to parse a query. See its counterpart, * {@link RouterOptions.stringifyQuery}.