@carbon/ibm-products-web-components
Version:
Carbon for IBM Products Web Components
40 lines • 1.49 kB
TypeScript
/**
* Copyright IBM Corp. 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Initiates the snapScroll functionality
* @param body selector for element that contains the items
* @param child selector for the item elements
* @returns void
*/
export declare const blockClass = "c4p--snappy";
export declare function snapScroll(body: string, child: string): void;
/**
* Retreives the currently focused element
* @returns currently focused element
*/
export declare function getFocusedItem(): Element | null;
/**
* Scrolls to the next sibling element of the currently focused element
*/
export declare function scrollNext(): void;
/**
* Scrolls to the previous sibling element of the currently focused element
*/
export declare function scrollPrevious(): void;
export declare function getNextSibling(): Element | null | undefined;
export declare function getPreviousSibling(): Element | null | undefined;
/**
* Checks if there are any next siblings that are not fully in view
* @returns true if there are more items to scroll to in the next direction
*/
export declare function hasNextSiblingNotInView(): boolean;
/**
* Checks if there are any previous siblings that are not fully in view
* @returns true if there are more items to scroll to in the previous direction
*/
export declare function hasPreviousSiblingNotInView(): boolean;
//# sourceMappingURL=snapscroll.d.ts.map