import { __extends } from "tslib";
import { IgCollection } from "igniteui-angular-core";
import { markType } from "igniteui-angular-core";
import { SyncableObservableCollection$2 } from "igniteui-angular-core";
import { CalloutAnnotation as CalloutAnnotation_internal } from './CalloutAnnotation';
import { IgxCalloutAnnotation as IgxCalloutAnnotation } from './igx-callout-annotation';
var IgxCalloutAnnotationCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxCalloutAnnotationCollection, _super);
    function IgxCalloutAnnotationCollection(list) {
        var _this = _super.call(this) || this;
        if (!IgxCalloutAnnotation.$type) {
            IgxCalloutAnnotation.$type = markType(IgxCalloutAnnotation, "IgxCalloutAnnotation");
        }
        if (list) {
            for (var i = 0; i < list.length; i++) {
                _this.add(list[i]);
            }
        }
        return _this;
    }
    IgxCalloutAnnotationCollection.prototype._createInnerColl = function () {
        if (!IgxCalloutAnnotation.$type) {
            IgxCalloutAnnotation.$type = markType(IgxCalloutAnnotation, "IgxCalloutAnnotation");
        }
        var coll = new SyncableObservableCollection$2(IgxCalloutAnnotation.$type, CalloutAnnotation_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 IgxCalloutAnnotation();
                if (ext) {
                    ext._implementation = int;
                }
            }
            return ext;
        };
        return coll;
    };
    return IgxCalloutAnnotationCollection;
}(IgCollection));
export { IgxCalloutAnnotationCollection };
