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";
export class IgcPropertyEditorDescriptionObject {
    constructor() {
        this._properties = null;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    createImplementation() {
        return new PropertyEditorDescriptionObject_internal();
    }
    /**
     * @hidden
     */
    get i() {
        return this._implementation;
    }
    onImplementationCreated() {
    }
    _provideImplementation(i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    get descriptionType() {
        return this.i.b;
    }
    set descriptionType(v) {
        this.i.b = v;
    }
    get properties() {
        if (this._properties === null) {
            let coll = new IgcPropertyEditorPropertyDescriptionCollection();
            let innerColl = this.i.a;
            if (!innerColl) {
                innerColl = new PropertyEditorPropertyDescriptionCollection_internal();
            }
            this._properties = coll._fromInner(innerColl);
            this.i.a = innerColl;
        }
        return this._properties;
    }
    set properties(v) {
        if (this._properties !== null) {
            this._properties._setSyncTarget(null);
            this._properties = null;
        }
        let coll = new IgcPropertyEditorPropertyDescriptionCollection();
        this._properties = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(PropertyEditorPropertyDescription.$type);
        let innerColl = this.i.a;
        if (!innerColl) {
            innerColl = new PropertyEditorPropertyDescriptionCollection_internal();
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._properties._setSyncTarget(syncColl);
        this.i.a = innerColl;
    }
    findByName(name) {
        if (this.properties != null && this.properties.findByName && this.properties.findByName(name)) {
            return this.properties.findByName(name);
        }
        return null;
    }
}
//# sourceMappingURL=igc-property-editor-description-object.js.map
