Skip to content

Commit 929f83e

Browse files
renovate[bot]renovate-botstipsan
authored
chore(deps): update devdependencies (non-major) (#950)
* chore(deps): update devdependencies (non-major) * fix: typing Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Cody Olsen <[email protected]>
1 parent 6538ede commit 929f83e

File tree

3 files changed

+396
-283
lines changed

3 files changed

+396
-283
lines changed

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,36 +35,36 @@
3535
"scroll-into-view-if-needed": "^2.2.28"
3636
},
3737
"devDependencies": {
38-
"@babel/cli": "7.12.10",
39-
"@babel/core": "7.12.10",
40-
"@babel/plugin-external-helpers": "7.12.1",
41-
"@babel/preset-env": "7.12.11",
42-
"@babel/preset-typescript": "7.12.7",
43-
"@types/jest": "24.0.25",
38+
"@babel/cli": "7.13.10",
39+
"@babel/core": "7.13.10",
40+
"@babel/plugin-external-helpers": "7.12.13",
41+
"@babel/preset-env": "7.13.12",
42+
"@babel/preset-typescript": "7.13.0",
43+
"@types/jest": "24.9.1",
4444
"babel-eslint": "10.1.0",
4545
"babel-plugin-add-module-exports": "1.0.4",
4646
"babel-plugin-dev-expression": "0.2.2",
4747
"concurrently": "6.0.0",
48-
"eslint": "7.18.0",
48+
"eslint": "7.22.0",
4949
"eslint-config-prettier": "8.1.0",
5050
"eslint-plugin-import": "2.22.1",
5151
"eslint-plugin-react": "7.22.0",
5252
"husky": "5.2.0",
5353
"jest": "26.6.3",
5454
"jest-junit": "12.0.0",
55-
"lint-staged": "10.5.3",
55+
"lint-staged": "10.5.4",
5656
"prettier": "2.2.1",
5757
"prettier-package-json": "2.1.3",
5858
"rimraf": "3.0.2",
59-
"rollup": "2.36.2",
59+
"rollup": "2.42.3",
6060
"rollup-plugin-babel": "4.4.0",
6161
"rollup-plugin-commonjs": "10.1.0",
6262
"rollup-plugin-node-resolve": "5.2.0",
6363
"rollup-plugin-replace": "2.2.0",
6464
"rollup-plugin-terser": "7.0.2",
65-
"semantic-release": "17.3.3",
66-
"ts-jest": "26.4.4",
67-
"typescript": "3.5.3"
65+
"semantic-release": "17.4.2",
66+
"ts-jest": "26.5.4",
67+
"typescript": "3.9.9"
6868
},
6969
"keywords": [
7070
"behavior-smooth",

src/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ const now = () => {
2323
return memoizedNow()
2424
}
2525

26+
type SmoothScrollAction = {
27+
el: Element;
28+
// [start, end] tuples of the distance animated
29+
left: [number, number];
30+
top: [number, number];
31+
}
32+
2633
type Context = {
2734
scrollable: Element
2835
method: Function
@@ -103,15 +110,14 @@ function scroll(target: Element, options: StandardBehaviorOptions): void
103110
function scroll<T>(target: Element, options?: any) {
104111
const overrides = options || {}
105112
if (shouldSmoothScroll<SmoothBehaviorOptions>(overrides)) {
106-
// @TODO replace <any> in promise signatures with better information
107-
return scrollIntoView<Promise<any>>(target, {
113+
return scrollIntoView<Promise<SmoothScrollAction[]>>(target, {
108114
block: overrides.block,
109115
inline: overrides.inline,
110116
scrollMode: overrides.scrollMode,
111117
boundary: overrides.boundary,
112118
behavior: actions =>
113119
Promise.all(
114-
actions.reduce((results: Promise<any>[], { el, left, top }) => {
120+
actions.reduce((results: Promise<SmoothScrollAction>[], { el, left, top }) => {
115121
const startLeft = el.scrollLeft
116122
const startTop = el.scrollTop
117123
if (startLeft === left && startTop === top) {

0 commit comments

Comments
 (0)