import { Subject, Observable } from 'rxjs'; import * as i0 from '@angular/core'; import { ElementRef, InjectionToken, Provider } from '@angular/core'; import { _XAxis, _YAxis } from '@angular/cdk/scrolling'; declare const SMOOTH_SCROLL_OPTIONS: InjectionToken; declare function provideSmoothScrollOptions(options: SmoothScrollOptions): Provider[]; /** * Interface for an element that can be scrolled smoothly. */ type SmoothScrollElement = Element | ElementRef | string; /** * Interface for options provided for smooth scrolling. */ type SmoothScrollToOptions = Partial & Pick<_YAxis, keyof _YAxis>> & SmoothScrollOptions; /** * Interface for options provided for smooth scrolling to an element. */ type SmoothScrollToElementOptions = SmoothScrollToOptions & { center?: boolean; }; interface SmoothScrollStep { scrollable: Element; startTime: number; startX: number; startY: number; x: number; y: number; duration: number; easing: (k: number) => number; currentX?: number; currentY?: number; } interface SmoothScrollOptions { duration?: number; easing?: BezierEasingOptions; } interface BezierEasingOptions { x1: number; y1: number; x2: number; y2: number; } declare class SmoothScrollManager { private document; private zone; private readonly _defaultOptions; private onGoingScrolls; /** * Timing method */ private get now(); /** * changes scroll position inside an element */ private scrollElement; /** * Handles a given parameter of type HTMLElement, ElementRef or selector */ private getElement; /** * Initializes a destroyer stream, re-initializes it if the element is already being scrolled */ private getScrollDestroyerRef; /** * A function called recursively that, given a context, steps through scrolling */ private step; /** * Checks if smooth scroll has reached, cleans up the smooth scroll stream */ private isReached; /** * Scroll recursively until coordinates are reached * @param context * @param destroyed */ scrolling(context: SmoothScrollStep, destroyed: Subject): Observable; /** * Deletes the destroyer function, runs if the smooth scroll has finished or interrupted */ private onScrollReached; /** * Terminates an ongoing smooth scroll */ private interrupted; private applyScrollToOptions; /** * Scrolls to the specified offsets. This is a normalized version of the browser's native scrollTo * method, since browsers are not consistent about what scrollLeft means in RTL. For this method * left and right always refer to the left and right side of the scrolling container irrespective * of the layout direction. start and end refer to left and right in an LTR context and vice-versa * in an RTL context. * @param scrollable element * @param customOptions specified the offsets to scroll to. */ scrollTo(scrollable: SmoothScrollElement, customOptions: SmoothScrollToOptions): Promise; /** * Scroll to element by reference or selector */ scrollToElement(scrollable: SmoothScrollElement, target: SmoothScrollElement, customOptions?: SmoothScrollToElementOptions): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class SmoothScroll { private readonly smoothScroll; private readonly element; scrollTo(options: SmoothScrollToOptions): Promise; scrollToElement(target: SmoothScrollElement, options: SmoothScrollToElementOptions): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } export { SMOOTH_SCROLL_OPTIONS, SmoothScroll, SmoothScrollManager, provideSmoothScrollOptions }; export type { BezierEasingOptions, SmoothScrollElement, SmoothScrollOptions, SmoothScrollStep, SmoothScrollToElementOptions, SmoothScrollToOptions };