export class MockIntersectionObserver {
    root;
    rootMargin;
    thresholds;
    viewPort;
    entries;
    callback;
    constructor(callback, options) {
        this.viewPort = options?.root ? options.root : window;
        this.entries = [];
        this.root = null;
        this.rootMargin = '0px';
        this.thresholds = [1];
        this.callback = callback;
        this.viewPort.addEventListener('scroll', this.intersect);
    }
    intersect = () => {
        this.entries.map((entry) => {
            entry.isIntersecting = this.isInViewPort(entry.target);
        });
        this.callback(this.entries, this);
    };
    isInViewPort(target) {
        return target.id !== 'toc-0';
    }
    observe(target) {
        this.entries.push({ isIntersecting: false, target });
    }
    unobserve(target) {
        this.entries = this.entries.filter((ob) => ob.target !== target);
    }
    disconnect() {
        this.viewPort.removeEventListener('scroll', this.intersect);
        this.entries = [];
    }
    takeRecords() {
        return this.entries;
    }
}
//# sourceMappingURL=mock-intersection-observer.js.map