[6a3a178] | 1 | /**
|
---|
| 2 | * @license
|
---|
| 3 | * Copyright Google LLC All Rights Reserved.
|
---|
| 4 | *
|
---|
| 5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
| 6 | * found in the LICENSE file at https://angular.io/license
|
---|
| 7 | */
|
---|
| 8 | import { Directionality } from '@angular/cdk/bidi';
|
---|
| 9 | import { ElementRef, NgZone, OnDestroy, OnInit } from '@angular/core';
|
---|
| 10 | import { Observable } from 'rxjs';
|
---|
| 11 | import { ScrollDispatcher } from './scroll-dispatcher';
|
---|
| 12 | import * as ɵngcc0 from '@angular/core';
|
---|
| 13 | export declare type _Without<T> = {
|
---|
| 14 | [P in keyof T]?: never;
|
---|
| 15 | };
|
---|
| 16 | export declare type _XOR<T, U> = (_Without<T> & U) | (_Without<U> & T);
|
---|
| 17 | export declare type _Top = {
|
---|
| 18 | top?: number;
|
---|
| 19 | };
|
---|
| 20 | export declare type _Bottom = {
|
---|
| 21 | bottom?: number;
|
---|
| 22 | };
|
---|
| 23 | export declare type _Left = {
|
---|
| 24 | left?: number;
|
---|
| 25 | };
|
---|
| 26 | export declare type _Right = {
|
---|
| 27 | right?: number;
|
---|
| 28 | };
|
---|
| 29 | export declare type _Start = {
|
---|
| 30 | start?: number;
|
---|
| 31 | };
|
---|
| 32 | export declare type _End = {
|
---|
| 33 | end?: number;
|
---|
| 34 | };
|
---|
| 35 | export declare type _XAxis = _XOR<_XOR<_Left, _Right>, _XOR<_Start, _End>>;
|
---|
| 36 | export declare type _YAxis = _XOR<_Top, _Bottom>;
|
---|
| 37 | /**
|
---|
| 38 | * An extended version of ScrollToOptions that allows expressing scroll offsets relative to the
|
---|
| 39 | * top, bottom, left, right, start, or end of the viewport rather than just the top and left.
|
---|
| 40 | * Please note: the top and bottom properties are mutually exclusive, as are the left, right,
|
---|
| 41 | * start, and end properties.
|
---|
| 42 | */
|
---|
| 43 | export declare type ExtendedScrollToOptions = _XAxis & _YAxis & ScrollOptions;
|
---|
| 44 | /**
|
---|
| 45 | * Sends an event when the directive's element is scrolled. Registers itself with the
|
---|
| 46 | * ScrollDispatcher service to include itself as part of its collection of scrolling events that it
|
---|
| 47 | * can be listened to through the service.
|
---|
| 48 | */
|
---|
| 49 | export declare class CdkScrollable implements OnInit, OnDestroy {
|
---|
| 50 | protected elementRef: ElementRef<HTMLElement>;
|
---|
| 51 | protected scrollDispatcher: ScrollDispatcher;
|
---|
| 52 | protected ngZone: NgZone;
|
---|
| 53 | protected dir?: Directionality | undefined;
|
---|
| 54 | private readonly _destroyed;
|
---|
| 55 | private _elementScrolled;
|
---|
| 56 | constructor(elementRef: ElementRef<HTMLElement>, scrollDispatcher: ScrollDispatcher, ngZone: NgZone, dir?: Directionality | undefined);
|
---|
| 57 | ngOnInit(): void;
|
---|
| 58 | ngOnDestroy(): void;
|
---|
| 59 | /** Returns observable that emits when a scroll event is fired on the host element. */
|
---|
| 60 | elementScrolled(): Observable<Event>;
|
---|
| 61 | /** Gets the ElementRef for the viewport. */
|
---|
| 62 | getElementRef(): ElementRef<HTMLElement>;
|
---|
| 63 | /**
|
---|
| 64 | * Scrolls to the specified offsets. This is a normalized version of the browser's native scrollTo
|
---|
| 65 | * method, since browsers are not consistent about what scrollLeft means in RTL. For this method
|
---|
| 66 | * left and right always refer to the left and right side of the scrolling container irrespective
|
---|
| 67 | * of the layout direction. start and end refer to left and right in an LTR context and vice-versa
|
---|
| 68 | * in an RTL context.
|
---|
| 69 | * @param options specified the offsets to scroll to.
|
---|
| 70 | */
|
---|
| 71 | scrollTo(options: ExtendedScrollToOptions): void;
|
---|
| 72 | private _applyScrollToOptions;
|
---|
| 73 | /**
|
---|
| 74 | * Measures the scroll offset relative to the specified edge of the viewport. This method can be
|
---|
| 75 | * used instead of directly checking scrollLeft or scrollTop, since browsers are not consistent
|
---|
| 76 | * about what scrollLeft means in RTL. The values returned by this method are normalized such that
|
---|
| 77 | * left and right always refer to the left and right side of the scrolling container irrespective
|
---|
| 78 | * of the layout direction. start and end refer to left and right in an LTR context and vice-versa
|
---|
| 79 | * in an RTL context.
|
---|
| 80 | * @param from The edge to measure from.
|
---|
| 81 | */
|
---|
| 82 | measureScrollOffset(from: 'top' | 'left' | 'right' | 'bottom' | 'start' | 'end'): number;
|
---|
| 83 | static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<CdkScrollable, [null, null, null, { optional: true; }]>;
|
---|
| 84 | static ɵdir: ɵngcc0.ɵɵDirectiveDeclaration<CdkScrollable, "[cdk-scrollable], [cdkScrollable]", never, {}, {}, never>;
|
---|
| 85 | }
|
---|
| 86 |
|
---|
| 87 | //# sourceMappingURL=scrollable.d.ts.map |
---|