import { IgcPropertyEditorPropertyDescriptionCollection } from "./igc-property-editor-property-description-collection";
import { PropertyEditorDescriptionObject as PropertyEditorDescriptionObject_internal } from "./PropertyEditorDescriptionObject";
import { PropertyEditorPropertyDescriptionCollection as PropertyEditorPropertyDescriptionCollection_internal } from "./PropertyEditorPropertyDescriptionCollection";
import { PropertyEditorPropertyDescription } from "./PropertyEditorPropertyDescription";
import { SyncableObservableCollection$1 } from "igniteui-webcomponents-core";
var IgcPropertyEditorDescriptionObject = /** @class */ /*@__PURE__*/ (function () {
    function IgcPropertyEditorDescriptionObject() {
        this._properties = null;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    IgcPropertyEditorDescriptionObject.prototype.createImplementation = function () {
        return new PropertyEditorDescriptionObject_internal();
    };
    Object.defineProperty(IgcPropertyEditorDescriptionObject.prototype, "i", {
        /**
         * @hidden
         */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgcPropertyEditorDescriptionObject.prototype.onImplementationCreated = function () {
    };
    IgcPropertyEditorDescriptionObject.prototype._provideImplementation = function (i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    };
    Object.defineProperty(IgcPropertyEditorDescriptionObject.prototype, "descriptionType", {
        get: function () {
            return this.i.b;
        },
        set: function (v) {
            this.i.b = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcPropertyEditorDescriptionObject.prototype, "properties", {
        get: function () {
            if (this._properties === null) {
                var coll = new IgcPropertyEditorPropertyDescriptionCollection();
                var innerColl = this.i.a;
                if (!innerColl) {
                    innerColl = new PropertyEditorPropertyDescriptionCollection_internal();
                }
                this._properties = coll._fromInner(innerColl);
                this.i.a = innerColl;
            }
            return this._properties;
        },
        set: function (v) {
            if (this._properties !== null) {
                this._properties._setSyncTarget(null);
                this._properties = null;
            }
            var coll = new IgcPropertyEditorPropertyDescriptionCollection();
            this._properties = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(PropertyEditorPropertyDescription.$type);
            var innerColl = this.i.a;
            if (!innerColl) {
                innerColl = new PropertyEditorPropertyDescriptionCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._properties._setSyncTarget(syncColl);
            this.i.a = innerColl;
        },
        enumerable: true,
        configurable: true
    });
    IgcPropertyEditorDescriptionObject.prototype.findByName = function (name) {
        if (this.properties != null && this.properties.findByName && this.properties.findByName(name)) {
            return this.properties.findByName(name);
        }
        return null;
    };
    return IgcPropertyEditorDescriptionObject;
}());
export { IgcPropertyEditorDescriptionObject };
//# sourceMappingURL=igc-property-editor-description-object.js.map
