import { OnInit, AfterViewChecked, OnDestroy, NgZone, ElementRef, EventEmitter, ChangeDetectorRef } from '@angular/core'; import { Directionality } from '@angular/cdk/bidi'; import { Observable } from 'rxjs'; import { SmoothScrollElement, SmoothScrollManager, SmoothScrollToOptions } from '@madbrothers/ngx-scrollbar/smooth-scroll'; import { ScrollbarAppearance, ScrollbarTrack, ScrollbarPosition, ScrollbarVisibility, NgScrollbarState, EventContext } from './ng-scrollbar.model'; import { ScrollbarManager } from './utils/scrollbar-manager'; import { NativeScrollbarSizeFactory } from './utils/native-scrollbar-size-factory'; export declare class NgScrollbar implements OnInit, AfterViewChecked, OnDestroy { private el; private zone; private changeDetectorRef; private dir; private smoothScroll; manager: ScrollbarManager; nativeScrollbarSizeFactory: NativeScrollbarSizeFactory; /** Default viewport reference */ private defaultViewPort; /** Custom viewport reference */ private customViewPort; /** A class forwarded to scrollable viewport element */ viewClass: string; /** A class forwarded to the scrollbar track element */ trackClass: string; /** A class forwarded to the scrollbar thumb element */ thumbClass: string; /** Minimum scrollbar thumb size */ minThumbSize: number; /** The duration which the scrolling takes to reach its target when scrollbar rail is clicked */ trackClickScrollDuration: number; /** A flag used to enable/disable the scrollbar track clicked event */ trackClickDisabled: boolean; /** A flag used to enable/disable the scrollbar thumb dragged event */ thumbDragDisabled: boolean; /** Disable custom scrollbar and switch back to native scrollbar */ disabled: boolean; /** * Sets the supported scroll track of the viewport, there are 3 options: * * - `vertical` Use both vertical and horizontal scrollbar * - `horizontal` Use both vertical and horizontal scrollbar * - `all` Use both vertical and horizontal scrollbar */ track: ScrollbarTrack; /** * When to show the scrollbar, and there are 3 options: * * - `native` (default) Scrollbar will be visible when viewport is scrollable like with native scrollbar * - `hover` Scrollbars are hidden by default, only visible on scrolling or hovering * - `always` Scrollbars are always shown even if the viewport is not scrollable */ visibility: ScrollbarVisibility; /** * Sets the appearance of the scrollbar, there are 2 options: * * - `standard` (default) scrollbar space will be reserved just like with native scrollbar. * - `compact` scrollbar doesn't reserve any space, they are placed over the viewport. */ appearance: ScrollbarAppearance; /** * Sets the position of each scrollbar, there are 4 options: * * - `native` (Default) Use the default position like in native scrollbar. * - `invertY` Inverts vertical scrollbar position * - `invertX` Inverts Horizontal scrollbar position * - `invertAll` Inverts both scrollbar positions */ eventContext: EventContext; position: ScrollbarPosition; /** Debounce interval for detecting changes via ResizeObserver */ sensorDebounce: number; /** Whether ResizeObserver is disabled */ sensorDisabled: boolean; /** Steam that emits when scrollbar is updated */ updated: EventEmitter; /** Viewport Element */ viewport: HTMLElement; /** Content Wrapper element */ contentWrapper: HTMLElement | undefined; /** stream that emits on scroll event */ scrolled: Observable; /** Steam that emits scroll event for vertical scrollbar */ verticalScrolled: Observable; /** Steam that emits scroll event for horizontal scrollbar */ horizontalScrolled: Observable; /** Default viewport classes */ viewportClasses: any; /** Set of attributes added on the scrollbar wrapper */ state: NgScrollbarState; /** Stream that destroys components' observables */ private destroyed; constructor(el: ElementRef, zone: NgZone, changeDetectorRef: ChangeDetectorRef, dir: Directionality, smoothScroll: SmoothScrollManager, manager: ScrollbarManager, nativeScrollbarSizeFactory: NativeScrollbarSizeFactory); private getScrolledByDirection; /** * Update local state with each change detection */ private updateState; private _updateState; setHovered(hovered: ScrollbarHovered): void; setDragging(dragging: ScrollbarDragging): void; /** * Set the viewport based on user choice */ private setViewport; ngOnInit(): void; ngAfterViewChecked(): void; ngOnDestroy(): void; /** * Update local state and the internal scrollbar controls */ update(): void; /** * Smooth scroll functions */ scrollTo(options: SmoothScrollToOptions): Promise; /** * Scroll to element by reference or selector */ scrollToElement(target: SmoothScrollElement, options?: any): Promise; } interface ScrollbarDragging { verticalDragging?: boolean; horizontalDragging?: boolean; } interface ScrollbarHovered { verticalHovered?: boolean; horizontalHovered?: boolean; } export {};