import * as i0 from '@angular/core'; import { InjectionToken, InputSignal, InputSignalWithTransform, OutputEmitterRef, Signal, WritableSignal, OnDestroy, ComponentRef, Provider, EnvironmentProviders, ElementRef } from '@angular/core'; import { SmoothScrollManager, SmoothScrollToOptions, SmoothScrollElement, SmoothScrollToElementOptions } from 'ngx-scrollbar/smooth-scroll'; import { Directionality, Direction } from '@angular/cdk/bidi'; type ScrollbarAppearance = 'native' | 'compact'; type ScrollbarOrientation = 'auto' | 'vertical' | 'horizontal'; type ScrollbarVisibility = 'native' | 'hover' | 'visible'; type ScrollbarPosition = 'native' | 'invertY' | 'invertX' | 'invertAll'; declare enum ScrollbarUpdateReason { AfterInit = "AfterInit", Resized = "ResizeObserver" } declare const NG_SCROLLBAR_OPTIONS: InjectionToken; declare const NG_SCROLLBAR_POLYFILL: InjectionToken; interface NgScrollbarOptions { /** * Sets the scroll axis of the viewport. * - 'auto': Scrollbars are displayed for both vertical and horizontal scrolling. * - 'vertical': Scrollbars are displayed for vertical scrolling. * - 'horizontal': Scrollbars are displayed for horizontal scrolling. * Defaults to 'auto'. */ orientation?: ScrollbarOrientation; /** * Determines when to show the scrollbar. * - 'native': Scrollbar is visible when the viewport is scrollable, similar to native scrollbars. * - 'hover': Scrollbars are hidden by default and become visible on scrolling or hovering. * - 'visible': Scrollbars are always visible, even if the viewport is not scrollable. * Defaults to 'native'. */ visibility?: ScrollbarVisibility; /** * Sets the appearance of the scrollbar. * - 'native': Scrollbar space is reserved within the viewport, similar to native scrollbars. * - 'compact': Scrollbars do not reserve any space and are placed over the viewport. * Defaults to 'native'. */ appearance?: ScrollbarAppearance; /** * Sets the position of each scrollbar. * - 'native': Uses the default position as in native scrollbars. * - 'invertY': Inverts the vertical scrollbar position. * - 'invertX': Inverts the horizontal scrollbar position. * - 'invertAll': Inverts the positions of both vertical and horizontal scrollbars. * Defaults to 'native'. */ position?: ScrollbarPosition; /** A class forwarded to the scrollbar track element */ trackClass?: string; /** A class forwarded to the scrollbar thumb element */ thumbClass?: string; /** A class forwarded to the scrollbar button element */ buttonClass?: string; /** Scrolling speed when clicking on scrollbar rail */ trackScrollDuration?: number; /** A flag used to enable/disable the scrollbar pointer events */ disableInteraction?: boolean; /** Debounce interval for detecting changes via ResizeObserver */ sensorThrottleTime?: number; /** Whether ResizeObserver is disabled */ disableSensor?: boolean; /** Show scrollbar buttons */ withButtons?: boolean; /** A flag used to activate hover effect on the offset area around the scrollbar */ hoverOffset?: boolean; } interface ElementDimension { width?: number; height?: number; } type ScrollbarDragging = 'x' | 'y' | 'none'; declare class ScrollbarInputOutputs { /** Global options */ private readonly options; /** * 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 * - `auto` Use both vertical and horizontal scrollbar */ orientation: InputSignal; /** * 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 * - `visible` Scrollbars are always visible even if the viewport is not scrollable */ visibility: InputSignal; /** Show scrollbar buttons */ withButtons: InputSignalWithTransform; /** Disables scrollbar interaction like dragging thumb and jumping by track click */ disableInteraction: InputSignalWithTransform; /** Whether ResizeObserver is disabled */ disableSensor: InputSignalWithTransform; /** Throttle interval for detecting changes via ResizeObserver */ sensorThrottleTime: InputSignalWithTransform; /** A flag used to activate hover effect on the offset area around the scrollbar */ hoverOffset: InputSignalWithTransform; /** Scroll duration when the scroll track is clicked */ trackScrollDuration: InputSignalWithTransform; /** * Sets the appearance of the scrollbar, there are 2 options: * * - `native` (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: InputSignal; /** * 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 */ position: InputSignal; /** A class forwarded to the scrollbar track element */ trackClass: InputSignal; /** A class forwarded to the scrollbar thumb element */ thumbClass: InputSignal; /** A class forwarded to the scrollbar button element */ buttonClass: InputSignal; /** Steam that emits when scrollbar is initialized */ afterInit: OutputEmitterRef; /** Steam that emits when scrollbar is updated */ afterUpdate: OutputEmitterRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Class representing a viewport adapter. * Provides methods and properties to interact with a viewport and its content. */ declare class ViewportAdapter extends ScrollbarInputOutputs { readonly smoothScroll: SmoothScrollManager; readonly dir: Directionality; /** * Indicates if the direction is 'ltr' or 'rtl' */ direction: Signal; /** * Indicates when scrollbar thumb is being dragged */ dragging: WritableSignal; private state; isVerticallyScrollable: Signal; isHorizontallyScrollable: Signal; verticalUsed: Signal; horizontalUsed: Signal; /** Viewport dimension */ viewportDimension: WritableSignal; /** Content dimension */ contentDimension: WritableSignal; /** * Viewport native element */ viewportElement: HTMLElement; /** * The element that wraps the content inside the viewport, * used to measure the content size and observe its changes. */ contentWrapperElement: HTMLElement; initialized: WritableSignal; /** Viewport clientHeight */ get clientHeight(): number; /** Viewport clientWidth */ get clientWidth(): number; /** Viewport scrollTop */ get scrollTop(): number; /** Viewport scrollLeft */ get scrollLeft(): number; /** Content height */ get contentHeight(): number; /** Content width */ get contentWidth(): number; /** The remaining vertical scrollable distance. */ get scrollMaxX(): number; /** The vertical remaining scrollable distance */ get scrollMaxY(): number; /** * Initialize viewport */ init(viewportElement: HTMLElement, contentElement: HTMLElement, spacerElement?: HTMLElement): void; reset(): void; /** * Scrolls the viewport vertically to the specified value. */ scrollYTo(value: number): void; /** * Scrolls the viewport horizontally to the specified value. */ scrollXTo(value: number): void; /** * Smooth scroll functions */ scrollTo(options: SmoothScrollToOptions): Promise; /** * Scroll to an element by reference or selector */ scrollToElement(target: SmoothScrollElement, options?: SmoothScrollToElementOptions): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class ScrollContent { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class Scrollbars { adapter: ViewportAdapter; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ScrollViewport extends NgScrollbarCore implements OnDestroy { private readonly renderer; private readonly appRef; private readonly injector; scrollbarsRef: ComponentRef | undefined; contentWrapperRef: ComponentRef | undefined; /** * The element that wraps the content inside the viewport. */ contentWrapperElement: HTMLElement | undefined; /** * The spacer element used by virtual scroll component. */ spacerElement: HTMLElement | undefined; constructor(); ngOnDestroy(): void; createContentWrapper(hostElement: HTMLElement): void; attachScrollbars(hostElement: HTMLElement): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NgScrollbarCore { private readonly zone; private readonly platform; private readonly sharedResizeObserver; /** Viewport adapter instance */ readonly adapter: ViewportAdapter; /** Viewport native element */ readonly nativeElement: HTMLElement; /** A flag that indicates if the platform is mobile */ readonly isMobile: boolean; protected constructor(); /** * Manual update */ update(reason?: ScrollbarUpdateReason): void; private updateDimensions; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class NgScrollbar extends NgScrollbarCore { private contentWrapper; contentWrapperElement: Signal; constructor(); /** * Smooth scroll functions */ scrollTo(options: SmoothScrollToOptions): Promise; /** * Scroll to an element by reference or selector */ scrollToElement(target: SmoothScrollElement, options?: SmoothScrollToElementOptions): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NgScrollbarExt implements OnDestroy { private readonly appRef; private readonly injector; readonly adapter: ViewportAdapter; readonly nativeElement: HTMLElement; viewportRef: ComponentRef; /** * Selector used to query the viewport element. */ externalViewport: InputSignal; /** * Selector used to query the content wrapper element. */ externalContentWrapper: InputSignal; /** * Selector used to query the spacer element (virtual scroll integration). * In the case of integrating the scrollbar with a virtual scroll component, * a spacer element is typically created to match the real size of the content. * The scrollbar will use the size of this spacer element for calculations instead of the content wrapper size. */ externalSpacer: InputSignal; viewportElement: WritableSignal; viewportError: Signal; contentWrapperElement: WritableSignal; contentWrapperError: Signal; spacerElement: WritableSignal; spacerError: Signal; /** * Skip initializing the viewport and the scrollbar * this is used when the component needs to wait for 3rd party library to render */ skipInit: boolean; constructor(); ngOnDestroy(): void; initialize(viewportElement: HTMLElement, contentWrapperElement: HTMLElement, spacerElement: HTMLElement): void; _destroy(): void; _getElement(selector: string): HTMLElement; /** * Smooth scroll functions */ scrollTo(options: SmoothScrollToOptions): Promise; /** * Scroll to an element by reference or selector */ scrollToElement(target: SmoothScrollElement, options?: SmoothScrollToElementOptions): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } type AsyncViewportOption = '' | 'auto'; declare class NgScrollbarAsyncViewport { private readonly scrollbar; private readonly contentObserver; asyncViewport: InputSignal; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class NgSyncSpacer { private readonly zone; private readonly sharedResizeObserver; private readonly scrollbar; private readonly viewport; /** * A signal used to sync spacer dimension when content dimension changes */ spacerDimension: WritableSignal; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class NgScrollbarModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare function provideScrollbarOptions(options: NgScrollbarOptions): Provider[]; declare function provideScrollbarPolyfill(url: string): EnvironmentProviders; /** * Parameters for creating an extended scrollbar. */ interface ScrollbarParams { host: string | ElementRef | Element; viewport: string; contentWrapper?: string; spacer?: string; } /** * Generic scrollbar reference containing the component instance and a destroy function. */ interface NgScrollbarRef { componentRef: ComponentRef; destroy: () => void; } declare class NgScrollbarAnywhere { private readonly document; private readonly appRef; private readonly environmentInjector; /** * Generic method to create and attach a scrollbar component. * @param host - CSS selector for the host element. * @param component - The scrollbar component to create (either NgScrollbar or NgScrollbarExt). * @param options - Scrollbar options * @returns A reference to the created scrollbar component or null if the host is not found. */ private createScrollbarComponent; /** * Creates a basic scrollbar for a given host element. * @param host - CSS selector for the target element. * @param options - Scrollbar options * @returns A reference to the created scrollbar component. */ createScrollbar(host: string | ElementRef | Element, options?: NgScrollbarOptions): NgScrollbarRef | null; /** * Creates an extended scrollbar with external viewport and optional configurations. * @param params - Configuration options including host, viewport, and optional elements. * @param options - Scrollbar options * @returns A reference to the created extended scrollbar component. */ createScrollbarExt(params: ScrollbarParams, options?: NgScrollbarOptions): NgScrollbarRef | null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class NgScrollbarDocument { private readonly document; private readonly injector; private readonly appRef; attachScrollbar(options?: NgScrollbarOptions): ComponentRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { NG_SCROLLBAR_OPTIONS, NG_SCROLLBAR_POLYFILL, NgScrollbar, NgScrollbarAnywhere, NgScrollbarAsyncViewport, NgScrollbarDocument, NgScrollbarExt, NgScrollbarModule, NgSyncSpacer, ScrollbarInputOutputs, ScrollbarUpdateReason, ViewportAdapter, provideScrollbarOptions, provideScrollbarPolyfill }; export type { NgScrollbarOptions, NgScrollbarRef, ScrollbarAppearance, ScrollbarOrientation, ScrollbarPosition, ScrollbarVisibility };