import { IgCollection } from "igniteui-webcomponents-core";
import { markType } from "igniteui-webcomponents-core";
import { SyncableObservableCollection$2 } from "igniteui-webcomponents-core";
import { Column as Column_internal } from './Column';
import { IgcColumnComponent as IgcColumnComponent } from './igc-column-component';
export class IgcGridColumnCollection extends IgCollection {
    constructor(list) {
        super();
        if (!IgcColumnComponent.$type) {
            IgcColumnComponent.$type = markType(IgcColumnComponent, "IgcColumnComponent");
        }
        if (list) {
            for (let i = 0; i < list.length; i++) {
                this.add(list[i]);
            }
        }
    }
    _createInnerColl() {
        if (!IgcColumnComponent.$type) {
            IgcColumnComponent.$type = markType(IgcColumnComponent, "IgcColumnComponent");
        }
        let coll = new SyncableObservableCollection$2(IgcColumnComponent.$type, Column_internal.$type, 0);
        coll.compare = (ext, int) => {
            let comp = ext;
            if (comp._implementation) {
                comp = comp._implementation;
            }
            if (comp.equals) {
                return comp.equals(int);
            }
            return comp === int;
        };
        coll.createTo = (ext) => {
            return ext._implementation;
        };
        coll.createFrom = (int) => {
            let ext = int.externalObject;
            if (!ext) {
                ext = IgcColumnComponent._createFromInternal(int);
                if (ext) {
                    ext._implementation = int;
                }
            }
            return ext;
        };
        return coll;
    }
}
//# sourceMappingURL=igc-grid-column-collection.js.map
