UNPKG

1.83 kBTypeScriptView Raw
1import { Observable, Subject } from 'rxjs';
2import * as i0 from "@angular/core";
3/**
4 * Scroll position type
5 */
6export interface NbScrollPosition {
7 /**
8 * x - left
9 * @type {number}
10 */
11 x: number;
12 /**
13 * y - top
14 * @type {number}
15 */
16 y: number;
17}
18/**
19 * Layout scroll service. Provides information about current scroll position,
20 * as well as methods to update position of the scroll.
21 *
22 * The reason we added this service is that in Nebular there are two scroll modes:
23 * - the default mode when scroll is on body
24 * - and the `withScroll` mode, when scroll is removed from the body and moved to an element inside of the
25 * `nb-layout` component
26 */
27export declare class NbLayoutScrollService {
28 private scrollPositionReq$;
29 private manualScroll$;
30 private scroll$;
31 private scrollable$;
32 /**
33 * Returns scroll position
34 *
35 * @returns {Observable<NbScrollPosition>}
36 */
37 getPosition(): Observable<NbScrollPosition>;
38 /**
39 * Sets scroll position
40 *
41 * @param {number} x
42 * @param {number} y
43 */
44 scrollTo(x?: number, y?: number): void;
45 /**
46 * Returns a stream of scroll events
47 *
48 * @returns {Observable<any>}
49 */
50 onScroll(): Observable<any>;
51 /**
52 * @private
53 * @returns Observable<NbScrollPosition>.
54 */
55 onManualScroll(): Observable<NbScrollPosition>;
56 /**
57 * @private
58 * @returns {Subject<any>}
59 */
60 onGetPosition(): Subject<any>;
61 onScrollableChange(): Observable<boolean>;
62 /**
63 * @private
64 * @param {any} event
65 */
66 fireScrollChange(event: any): void;
67 scrollable(scrollable: boolean): void;
68 static ɵfac: i0.ɵɵFactoryDeclaration<NbLayoutScrollService, never>;
69 static ɵprov: i0.ɵɵInjectableDeclaration<NbLayoutScrollService>;
70}