import { IgcGridSelectedCellsCollection } from "./igc-grid-selected-cells-collection";
import { GridSelectedCellsChangedEventArgs as GridSelectedCellsChangedEventArgs_internal } from "./GridSelectedCellsChangedEventArgs";
import { GridSelectedCellsCollection as GridSelectedCellsCollection_internal } from "./GridSelectedCellsCollection";
import { CellKey } from "./CellKey";
import { SyncableObservableCollection$1 } from "igniteui-webcomponents-core";
/**
 * Information about the change to the selected cells in the grid.
*/
export class IgcGridSelectedCellsChangedEventArgs {
    constructor() {
        this._currentCells = null;
        this._addedCells = null;
        this._removedCells = null;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    createImplementation() {
        return new GridSelectedCellsChangedEventArgs_internal();
    }
    /**
     * @hidden
     */
    get i() {
        return this._implementation;
    }
    onImplementationCreated() {
    }
    _provideImplementation(i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    /**
     * The current cells in the selection.
    */
    get currentCells() {
        if (this._currentCells === null) {
            let coll = new IgcGridSelectedCellsCollection();
            let innerColl = this.i.currentCells;
            if (!innerColl) {
                innerColl = new GridSelectedCellsCollection_internal();
            }
            this._currentCells = coll._fromInner(innerColl);
            this.i.currentCells = innerColl;
        }
        return this._currentCells;
    }
    set currentCells(v) {
        if (this._currentCells !== null) {
            this._currentCells._setSyncTarget(null);
            this._currentCells = null;
        }
        let coll = new IgcGridSelectedCellsCollection();
        this._currentCells = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(CellKey.$type);
        let innerColl = this.i.currentCells;
        if (!innerColl) {
            innerColl = new GridSelectedCellsCollection_internal();
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._currentCells._setSyncTarget(syncColl);
        this.i.currentCells = innerColl;
    }
    /**
     * The cells added to the selection.
    */
    get addedCells() {
        if (this._addedCells === null) {
            let coll = new IgcGridSelectedCellsCollection();
            let innerColl = this.i.addedCells;
            if (!innerColl) {
                innerColl = new GridSelectedCellsCollection_internal();
            }
            this._addedCells = coll._fromInner(innerColl);
            this.i.addedCells = innerColl;
        }
        return this._addedCells;
    }
    set addedCells(v) {
        if (this._addedCells !== null) {
            this._addedCells._setSyncTarget(null);
            this._addedCells = null;
        }
        let coll = new IgcGridSelectedCellsCollection();
        this._addedCells = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(CellKey.$type);
        let innerColl = this.i.addedCells;
        if (!innerColl) {
            innerColl = new GridSelectedCellsCollection_internal();
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._addedCells._setSyncTarget(syncColl);
        this.i.addedCells = innerColl;
    }
    /**
     * The cells removed from the selection.
    */
    get removedCells() {
        if (this._removedCells === null) {
            let coll = new IgcGridSelectedCellsCollection();
            let innerColl = this.i.removedCells;
            if (!innerColl) {
                innerColl = new GridSelectedCellsCollection_internal();
            }
            this._removedCells = coll._fromInner(innerColl);
            this.i.removedCells = innerColl;
        }
        return this._removedCells;
    }
    set removedCells(v) {
        if (this._removedCells !== null) {
            this._removedCells._setSyncTarget(null);
            this._removedCells = null;
        }
        let coll = new IgcGridSelectedCellsCollection();
        this._removedCells = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(CellKey.$type);
        let innerColl = this.i.removedCells;
        if (!innerColl) {
            innerColl = new GridSelectedCellsCollection_internal();
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._removedCells._setSyncTarget(syncColl);
        this.i.removedCells = innerColl;
    }
}
//# sourceMappingURL=igc-grid-selected-cells-changed-event-args.js.map
