Skip to content

Commit

Permalink
refactor(types): Rename ScrollBehavior to RouterScrollBehavior
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
posva committed Sep 10, 2020
1 parent 8184619 commit 9fc0996
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export {
Router,
RouterOptions,
ErrorHandler,
ScrollBehavior,
RouterScrollBehavior,
} from './router'

export {
Expand Down
7 changes: 5 additions & 2 deletions src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}.
Expand Down

0 comments on commit 9fc0996

Please sign in to comment.