"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;
/* eslint-disable deprecation/deprecation */
/** Contains a map of Items.
 * @public
 * @deprecated in 4.15.0. Map for deprecated {@link ItemDefBase} class instances. Use `Map` to store your objects.
 */
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
 * @deprecated in 4.15.0. List of deprecated {@link ItemDefBase} class instances. Use `Array` to store your objects.
 */
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