]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor(types): Rename ScrollBehavior to RouterScrollBehavior
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 10 Sep 2020 15:24:30 +0000 (17:24 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 10 Sep 2020 15:24:34 +0000 (17:24 +0200)
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
src/router.ts

index 210be735ac3575d57590f574cd075773ba538bfc..8b8665c06a16e7024a11a1f65de573ef91cd3f5f 100644 (file)
@@ -41,7 +41,7 @@ export {
   Router,
   RouterOptions,
   ErrorHandler,
-  ScrollBehavior,
+  RouterScrollBehavior,
 } from './router'
 
 export {
index e1ab99f8334bbce83b1bccd5de670faa52b7d371..953055fb93a03b600a3728e69f70dd6d65d433cc 100644 (file)
@@ -68,7 +68,10 @@ type OnReadyCallback = [() => void, (reason?: any) => void]
 
 type Awaitable<T> = T | Promise<T>
 
-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}.