"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ArrayCarousel = void 0;
const IndexCarousel_1 = require("./IndexCarousel.js");
class ArrayCarousel {
    _array;
    indexCarousel;
    constructor(array) {
        if (!Array.isArray(array)) {
            throw new Error('ArrayCarousel: "array" argument must be array');
        }
        this._array = array;
        this.indexCarousel = new IndexCarousel_1.IndexCarousel(array.length);
    }
    get array() {
        return this._array;
    }
    get currentIndex() {
        return this.indexCarousel.current;
    }
    set currentIndex(value) {
        this.indexCarousel.current = value;
    }
    get currentItem() {
        return this.array[this.currentIndex];
    }
    next() {
        this.indexCarousel.next();
        return this;
    }
    prev() {
        this.indexCarousel.prev();
        return this;
    }
}
exports.ArrayCarousel = ArrayCarousel;
//# sourceMappingURL=ArrayCarousel.js.map
