@carbon/utilities
Version:
Utilities and helpers to drive consistency across software products using the Carbon Design System
10 lines (9 loc) • 592 B
TypeScript
/**
* Registers swipe event handlers for a carousel element.
* Handles touch, mouse, and wheel events for navigation.
* @param {HTMLElement} carousel - The carousel element to attach event listeners to.
* @param {() => void} next - Callback function to execute when swiping right.
* @param {() => void} prev - Callback function to execute when swiping left.
* @param {boolean} destroy - If true, removes existing event listeners before adding new ones.
*/
export declare const registerSwipeEvents: (carousel: HTMLElement, next: () => void, prev: () => void, destroy: boolean) => void;