export class ScrollPosition {
    constructor(params) {
        this.scrollHeight = params.scrollHeight;
        this.clientHeight = params.clientHeight;
        this.scrollTop = params.scrollTop;
    }
    isScrollDown(other) {
        return this.scrollTop >= other.scrollTop;
    }
    // private reachedBottom(prev: ScrollPosition, offset: number = 0) {
    //   const { scrollHeight } = this;
    //
    //   return this.reachedTo(prev, scrollHeight, offset);
    // }
    reachingTo(prev, bottomX, offsetPX = 0) {
        return this.isScrollDown(prev) && this.reachedTo(bottomX, offsetPX);
    }
    reachedTo(bottomX, offsetPX = 0) {
        const { clientHeight, scrollTop } = this;
        return scrollTop + clientHeight + offsetPX > bottomX;
    }
}
//# sourceMappingURL=scrollPosition.js.map