"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.wrapIntersectionObserver = wrapIntersectionObserver;
exports.wrapUint8Array = wrapUint8Array;
const _1 = require("../Class/$");
const MethodNotImplementedError_1 = require("../exception/MethodNotImplementedError");
function wrapIntersectionObserver(intersectionObserver, system) {
    const observer = new (class IntersectionObserver_ extends _1.$ {
        constructor() {
            super(...arguments);
            this.__ = ['OB'];
        }
        observe(element, callback) {
            intersectionObserver.observe(element);
            return () => {
                intersectionObserver.unobserve(element);
            };
        }
    })(system);
    return observer;
}
function wrapUint8Array(array, system) {
    const _array = new (class Array extends _1.$ {
        constructor() {
            super(...arguments);
            this.__ = ['A'];
        }
        append(a) {
            array[array.length] = a;
            return;
        }
        async put(i, data) {
            array[i] = data;
        }
        async at(i) {
            return array[i];
        }
        async length() {
            return array.length;
        }
        indexOf(a) {
            throw new MethodNotImplementedError_1.MethodNotImplementedError();
        }
        raw() {
            return array;
        }
    })(system);
    return _array;
}
//# sourceMappingURL=IntersectionObserver.js.map