UNPKG

2.32 kBTypeScriptView Raw
1import { ComponentInterface, EventEmitter } from '../../stencil-public-runtime';
2export declare class InfiniteScroll implements ComponentInterface {
3 private thrPx;
4 private thrPc;
5 private scrollEl?;
6 private didFire;
7 private isBusy;
8 el: HTMLElement;
9 isLoading: boolean;
10 /**
11 * The threshold distance from the bottom
12 * of the content to call the `infinite` output event when scrolled.
13 * The threshold value can be either a percent, or
14 * in pixels. For example, use the value of `10%` for the `infinite`
15 * output event to get called when the user has scrolled 10%
16 * from the bottom of the page. Use the value `100px` when the
17 * scroll is within 100 pixels from the bottom of the page.
18 */
19 threshold: string;
20 protected thresholdChanged(): void;
21 /**
22 * If `true`, the infinite scroll will be hidden and scroll event listeners
23 * will be removed.
24 *
25 * Set this to true to disable the infinite scroll from actively
26 * trying to receive new data while scrolling. This is useful
27 * when it is known that there is no more data that can be added, and
28 * the infinite scroll is no longer needed.
29 */
30 disabled: boolean;
31 protected disabledChanged(): void;
32 /**
33 * The position of the infinite scroll element.
34 * The value can be either `top` or `bottom`.
35 */
36 position: 'top' | 'bottom';
37 /**
38 * Emitted when the scroll reaches
39 * the threshold distance. From within your infinite handler,
40 * you must call the infinite scroll's `complete()` method when
41 * your async operation has completed.
42 */
43 ionInfinite: EventEmitter<void>;
44 connectedCallback(): Promise<void>;
45 disconnectedCallback(): void;
46 private onScroll;
47 /**
48 * Call `complete()` within the `ionInfinite` output event handler when
49 * your async operation has completed. For example, the `loading`
50 * state is while the app is performing an asynchronous operation,
51 * such as receiving more data from an AJAX request to add more items
52 * to a data list. Once the data has been received and UI updated, you
53 * then call this method to signify that the loading has completed.
54 * This method will change the infinite scroll's state from `loading`
55 * to `enabled`.
56 */
57 complete(): Promise<void>;
58 private canStart;
59 private enableScrollEvents;
60 render(): any;
61}