UNPKG

@selldone/sdk-storefront

Version:

A TypeScript SDK to connect to your shop and build a fully functional storefront and website by simply developing a frontend web application. All backend operations are seamlessly managed by the serverless Selldone solution.

14 lines (13 loc) 825 B
export default class ScrollHelper { static scrollToTop(top?: number, behavior?: ScrollBehavior): Promise<void>; /** * Scrolls the page to the specified element with an optional offset and behavior. * If the center option is true, the element will be centered in the viewport. * * @param {string | HTMLElement} selector - The selector string or the HTML element to scroll to. * @param {number} [offset=0] - The offset in pixels to adjust the scroll position. * @param {ScrollBehavior} [behavior="auto"] - The scroll behavior, either "auto" or "smooth". * @param {boolean} [center=false] - Whether to center the element in the viewport. */ static scrollToElement(selector: string | HTMLElement, offset?: number, behavior?: ScrollBehavior, center?: boolean): Promise<void>; }