"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * Interface to sass_*_list.
 * This won't be exposed as public but only being used to marshall between JS array.
 *
 * @internal
 */
class SassImportEntryList {
    constructor(cwrapImporter, size) {
        this.cwrapImporter = cwrapImporter;
        this.size = size;
        this.sassImportEntryListPtr = this.cwrapImporter.make_import_list(size);
    }
    get entry() {
        return [...Array(this.size).keys()]
            .map(idx => this.cwrapImporter.import_get_list_entry(this.sassImportEntryListPtr, idx))
            .map(x => this.importEntries.find(v => v.sassImportEntryPtr === x))
            .filter(x => !!x);
    }
    set entry(values) {
        //Keep references to JS context values
        this.importEntries = values;
        values.forEach((value, idx) => this.cwrapImporter.import_set_list_entry(this.sassImportEntryListPtr, idx, value.sassImportEntryPtr));
    }
}
exports.SassImportEntryList = SassImportEntryList;
//# sourceMappingURL=sassImportEntryList.js.map