import { __extends } from "tslib";
import { IgCollection } from "igniteui-angular-core";
import { markType } from "igniteui-angular-core";
import { SyncableObservableCollection$2 } from "igniteui-angular-core";
import { TimeAxisInterval as TimeAxisInterval_internal } from './TimeAxisInterval';
import { IgxTimeAxisIntervalComponent as IgxTimeAxisIntervalComponent } from './igx-time-axis-interval-component';
var IgxTimeAxisIntervalCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxTimeAxisIntervalCollection, _super);
    function IgxTimeAxisIntervalCollection(list) {
        var _this = _super.call(this) || this;
        if (!IgxTimeAxisIntervalComponent.$type) {
            IgxTimeAxisIntervalComponent.$type = markType(IgxTimeAxisIntervalComponent, "IgxTimeAxisIntervalComponent");
        }
        if (list) {
            for (var i = 0; i < list.length; i++) {
                _this.add(list[i]);
            }
        }
        return _this;
    }
    IgxTimeAxisIntervalCollection.prototype._createInnerColl = function () {
        if (!IgxTimeAxisIntervalComponent.$type) {
            IgxTimeAxisIntervalComponent.$type = markType(IgxTimeAxisIntervalComponent, "IgxTimeAxisIntervalComponent");
        }
        var coll = new SyncableObservableCollection$2(IgxTimeAxisIntervalComponent.$type, TimeAxisInterval_internal.$type, 0);
        coll.compare = function (ext, int) {
            var comp = ext;
            if (comp._implementation) {
                comp = comp._implementation;
            }
            if (comp.equals) {
                return comp.equals(int);
            }
            return comp === int;
        };
        coll.createTo = function (ext) {
            return ext._implementation;
        };
        coll.createFrom = function (int) {
            var ext = int.externalObject;
            if (!ext) {
                ext = new IgxTimeAxisIntervalComponent();
                if (ext) {
                    ext._implementation = int;
                }
            }
            return ext;
        };
        return coll;
    };
    return IgxTimeAxisIntervalCollection;
}(IgCollection));
export { IgxTimeAxisIntervalCollection };
