/// import type { Rect } from 'rangefix'; export interface Options { minBottom?: number; minTop?: number; padding?: number; skipWhenDoesNotFitView?: boolean; } /** * This one is slightly different than `Element.prototype.scrollIntoView`. * * The built-in function does not take sticky or fixed positioned elements around the page * into account. You may call `element.scrollIntoView()` and then the element will still * be covered by something with greater z-index, so the `element` is not really in view. * This function right here additionally supports `minTop` and `minBottom` parameters * which can be used when you know up front how much room is taken at the top or bottom * of the scrolling parent (e.g. some sticky/fixed header or sticky/fixed footer). * * One other difference is that this function only works in Y axis, while * `Element.prototype.scrollIntoView` works in X axis as well. Support for that can * be added too though, in case we need it in the future. */ export declare function scrollIntoView(parent: HTMLElement, rect: ClientRect | Rect, { minTop, minBottom, padding, skipWhenDoesNotFitView }: Options): void;