"use strict";
/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Item
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ItemList = exports.ItemMap = void 0;
/** Contains a map of Items.
 * @public
 */
class ItemMap extends Map {
    constructor(items) {
        super();
        if (items && typeof items === "object")
            this.addItems(items);
    }
    addItem(item) {
        this.set(item.id, item);
    }
    addItems(items) {
        items.forEach((item) => {
            this.set(item.id, item);
        });
    }
}
exports.ItemMap = ItemMap;
/** Contains a list of Items.
 * @public
 */
class ItemList extends Array {
    constructor(items) {
        super();
        if (items && typeof items === "object")
            this.addItems(items);
    }
    addItem(item) {
        this.push(item);
    }
    addItems(items) {
        items.forEach((item) => {
            this.push(item);
        });
    }
    get items() {
        return this;
    }
}
exports.ItemList = ItemList;
//# sourceMappingURL=ItemMap.js.map