/*---------------------------------------------------------------------------------------------
* 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
 */
/** Contains a map of Items.
 * @public
 */
export 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);
        });
    }
}
/** Contains a list of Items.
 * @public
 */
export 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;
    }
}
//# sourceMappingURL=ItemMap.js.map