UNPKG

1.31 kBTypeScriptView Raw
1import { ElementRef } from '@angular/core';
2export type ContainerRef = Window | ElementRef | any;
3export interface IInfiniteScrollEvent {
4 currentScrollPosition: number;
5}
6export interface IPositionElements {
7 windowElement: ContainerRef;
8 axis: any;
9}
10export interface IPositionStats {
11 height: number;
12 scrolled: number;
13 totalToScroll: number;
14 isWindow?: boolean;
15}
16export interface IScrollerDistance {
17 down?: number;
18 up?: number;
19}
20export interface IScrollState {
21 lastTotalToScroll: number;
22 totalToScroll: number;
23 triggered: IScrollerDistance;
24 lastScrollPosition: number;
25}
26export interface IResolver {
27 container: ContainerRef;
28 isWindow: boolean;
29 axis: any;
30}
31export interface IScrollRegisterConfig {
32 container: ContainerRef;
33 throttle: number;
34}
35export interface IScroller {
36 fromRoot: boolean;
37 horizontal: boolean;
38 disable: boolean;
39 throttle: number;
40 scrollWindow: boolean;
41 element: ElementRef;
42 scrollContainer: string | ElementRef;
43 alwaysCallback: boolean;
44 downDistance: number;
45 upDistance: number;
46}
47export interface IScrollParams {
48 scrollDown: boolean;
49 fire: boolean;
50 stats: IPositionStats;
51}
52export interface IInfiniteScrollAction {
53 type: string;
54 payload: IInfiniteScrollEvent;
55}