import { IgcGridSelectedKeysCollection } from "./igc-grid-selected-keys-collection";
import { GridSelectedKeysChangedEventArgs as GridSelectedKeysChangedEventArgs_internal } from "./GridSelectedKeysChangedEventArgs";
import { GridSelectedKeysCollection as GridSelectedKeysCollection_internal } from "./GridSelectedKeysCollection";
import { PrimaryKeyValue } from "./PrimaryKeyValue";
import { SyncableObservableCollection$1 } from "igniteui-webcomponents-core";
/**
 * Information about the change to the selected keys in the grid.
*/
export class IgcGridSelectedKeysChangedEventArgs {
    constructor() {
        this._currentKeys = null;
        this._addedKeys = null;
        this._removedKeys = null;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    createImplementation() {
        return new GridSelectedKeysChangedEventArgs_internal();
    }
    /**
     * @hidden
     */
    get i() {
        return this._implementation;
    }
    onImplementationCreated() {
    }
    _provideImplementation(i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    /**
     * All keys in the selection.
    */
    get currentKeys() {
        if (this._currentKeys === null) {
            let coll = new IgcGridSelectedKeysCollection();
            let innerColl = this.i.currentKeys;
            if (!innerColl) {
                innerColl = new GridSelectedKeysCollection_internal();
            }
            this._currentKeys = coll._fromInner(innerColl);
            this.i.currentKeys = innerColl;
        }
        return this._currentKeys;
    }
    set currentKeys(v) {
        if (this._currentKeys !== null) {
            this._currentKeys._setSyncTarget(null);
            this._currentKeys = null;
        }
        let coll = new IgcGridSelectedKeysCollection();
        this._currentKeys = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(PrimaryKeyValue.$type);
        let innerColl = this.i.currentKeys;
        if (!innerColl) {
            innerColl = new GridSelectedKeysCollection_internal();
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._currentKeys._setSyncTarget(syncColl);
        this.i.currentKeys = innerColl;
    }
    /**
     * The keys added to the selection.
    */
    get addedKeys() {
        if (this._addedKeys === null) {
            let coll = new IgcGridSelectedKeysCollection();
            let innerColl = this.i.addedKeys;
            if (!innerColl) {
                innerColl = new GridSelectedKeysCollection_internal();
            }
            this._addedKeys = coll._fromInner(innerColl);
            this.i.addedKeys = innerColl;
        }
        return this._addedKeys;
    }
    set addedKeys(v) {
        if (this._addedKeys !== null) {
            this._addedKeys._setSyncTarget(null);
            this._addedKeys = null;
        }
        let coll = new IgcGridSelectedKeysCollection();
        this._addedKeys = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(PrimaryKeyValue.$type);
        let innerColl = this.i.addedKeys;
        if (!innerColl) {
            innerColl = new GridSelectedKeysCollection_internal();
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._addedKeys._setSyncTarget(syncColl);
        this.i.addedKeys = innerColl;
    }
    /**
     * The keys removed from the selection.
    */
    get removedKeys() {
        if (this._removedKeys === null) {
            let coll = new IgcGridSelectedKeysCollection();
            let innerColl = this.i.removedKeys;
            if (!innerColl) {
                innerColl = new GridSelectedKeysCollection_internal();
            }
            this._removedKeys = coll._fromInner(innerColl);
            this.i.removedKeys = innerColl;
        }
        return this._removedKeys;
    }
    set removedKeys(v) {
        if (this._removedKeys !== null) {
            this._removedKeys._setSyncTarget(null);
            this._removedKeys = null;
        }
        let coll = new IgcGridSelectedKeysCollection();
        this._removedKeys = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(PrimaryKeyValue.$type);
        let innerColl = this.i.removedKeys;
        if (!innerColl) {
            innerColl = new GridSelectedKeysCollection_internal();
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._removedKeys._setSyncTarget(syncColl);
        this.i.removedKeys = innerColl;
    }
}
//# sourceMappingURL=igc-grid-selected-keys-changed-event-args.js.map
