diff --git a/types/scroll-into-view/index.d.ts b/types/scroll-into-view/index.d.ts index 1d53597c27..d237089151 100644 --- a/types/scroll-into-view/index.d.ts +++ b/types/scroll-into-view/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for scroll-into-view 1.6.0 // Project: https://github.com/KoryNunn/scroll-into-view // Definitions by: zivni +// Thibaut // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module __ScrollIntoView { @@ -17,6 +18,10 @@ declare module __ScrollIntoView { top?: number /** 0 to 1, default 0.5 (center) */ left?: number + /** pixels to offset top alignment */ + topOffset?: number + /** pixels to offset left alignment */ + leftOffset?: number } /** type will be 'complete' if the scroll completed or 'canceled' if the current scroll was canceled by a new scroll */ diff --git a/types/scroll-into-view/scroll-into-view-tests.ts b/types/scroll-into-view/scroll-into-view-tests.ts index bd50abb011..bf0bdf5283 100644 --- a/types/scroll-into-view/scroll-into-view-tests.ts +++ b/types/scroll-into-view/scroll-into-view-tests.ts @@ -13,11 +13,13 @@ scrollIntoView(someElement, { }, align: { top: 0, - left: 1 + left: 1, + topOffset: 20, + leftOffset: 20 } }); scrollIntoView(someElement, function (type) { // Scrolling done. // type will be 'complete' if the scroll completed or 'canceled' if the current scroll was canceled by a new scroll -}); \ No newline at end of file +});