/** * CustomScrollbar - Reusable scrollbar utility * * Attaches a custom rendered scrollbar (vertical and/or horizontal) to any * scrollable element. Uses the overlay approach: native overflow:auto is * preserved for scroll physics, native scrollbar is hidden via CSS, * and custom track/thumb elements are synced on top. * * Usage: * const scrollbar = new CustomScrollbar(scrollEl, { vertical: true }) * // scrollbar.trackY, scrollbar.thumbY — append these to your DOM * // scrollbar.trackX, scrollbar.thumbX — for horizontal * scrollbar.destroy() // cleanup * * CSS classes applied: * .ty-scrollbar-track-y / .ty-scrollbar-track-x * .ty-scrollbar-thumb-y / .ty-scrollbar-thumb-x * .has-overflow — when content overflows * .dragging — during thumb drag * .scrolling — briefly after scroll (auto-hide) */ export interface CustomScrollbarOptions { vertical?: boolean; horizontal?: boolean; autoHideDelay?: number; } /** * Check if custom scrollbar is enabled globally. * Default: true (custom scrollbar on). * Set data-ty-scrollbar="native" on to opt out. */ export declare function isCustomScrollbarEnabled(): boolean; export declare class CustomScrollbar { private _scrollEl; private _vertical; private _horizontal; private _autoHideDelay; readonly trackY: HTMLElement | null; readonly thumbY: HTMLElement | null; readonly trackX: HTMLElement | null; readonly thumbX: HTMLElement | null; private _isDragging; private _dragAxis; private _dragStartPos; private _dragStartScroll; private _rafId; private _hideTimeout; private _resizeObserver; private _onScroll; private _onThumbYDown; private _onThumbXDown; private _onTrackYDown; private _onTrackXDown; private _onDragMove; private _onDragEnd; constructor(scrollEl: HTMLElement, options?: CustomScrollbarOptions); private _createTrack; private _createThumb; /** Force update thumb size and position */ update(): void; /** Reset scroll position */ scrollToTop(smooth?: boolean): void; scrollToBottom(smooth?: boolean): void; scrollToLeft(smooth?: boolean): void; scrollToRight(smooth?: boolean): void; /** Cleanup all listeners and observers */ destroy(): void; private _handleScroll; private _updateVertical; private _updateHorizontal; private _updateThumbPositions; private _updateThumbY; private _updateThumbX; private _showScrollbars; private _handleThumbYDown; private _handleThumbXDown; private _handleDragMove; private _handleDragEnd; private _handleTrackYDown; private _handleTrackXDown; } //# sourceMappingURL=custom-scrollbar.d.ts.map