import { IgcColumnSortDescription } from "./igc-column-sort-description";
import { ColumnSortDescriptionCollection as ColumnSortDescriptionCollection_internal } from "./ColumnSortDescriptionCollection";
/**
 * Represents a collection of sort elements that are applied to a data source or provider.
*/
export class IgcColumnSortDescriptionCollection {
    createImplementation() {
        return new ColumnSortDescriptionCollection_internal();
    }
    get i() {
        return this._implementation;
    }
    onImplementationCreated() {
    }
    constructor() {
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    _provideImplementation(i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    item(index, value) {
        let int = null;
        if (value !== undefined) {
            int = this.i.set(index, value == null ? null : value.i);
        }
        else {
            int = this.i.get(index);
        }
        let ext = null;
        if (int != null) {
            ext = int.externalObject;
            if (!ext) {
                ext = new IgcColumnSortDescription();
                ext._implementation = int;
                int.externalObject = ext;
            }
        }
        return ext;
    }
    get count() {
        return this.i.size();
    }
    toArray() {
        let arr = [];
        for (let i = 0; i < this.count; i++) {
            arr[i] = this.item(i);
        }
        return arr;
    }
    *[Symbol.iterator]() {
        for (let i = 0; i < this.count; i++) {
            let item = this.item(i);
            if (item.externalObject) {
                item = item.externalObject;
            }
            yield item;
        }
    }
    findByName(name) {
        return null;
    }
    add(item) {
        let iv = this.i.g((item == null ? null : item.i));
        return (iv);
    }
    insert(index, item) {
        this.i.n(index, (item == null ? null : item.i));
    }
    clear() {
        this.i.m();
    }
    indexOf(item) {
        let iv = this.i.j((item == null ? null : item.i));
        return (iv);
    }
    remove(item) {
        let iv = this.i.h((item == null ? null : item.i));
        return (iv);
    }
    removeAt(index) {
        let iv = this.i.d(index);
        return (iv == null ? null : iv.externalObject);
    }
}
//# sourceMappingURL=igc-column-sort-description-collection.js.map
