From 9fc09969db854bc0201454fbecd546637b76213a Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Thu, 10 Sep 2020 17:24:30 +0200 Subject: [PATCH] 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). --- src/index.ts | 2 +- src/router.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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}. -- 2.47.3