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.
*/
var IgcGridSelectedKeysChangedEventArgs = /** @class */ /*@__PURE__*/ (function () {
    function IgcGridSelectedKeysChangedEventArgs() {
        this._currentKeys = null;
        this._addedKeys = null;
        this._removedKeys = null;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    IgcGridSelectedKeysChangedEventArgs.prototype.createImplementation = function () {
        return new GridSelectedKeysChangedEventArgs_internal();
    };
    Object.defineProperty(IgcGridSelectedKeysChangedEventArgs.prototype, "i", {
        /**
         * @hidden
         */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgcGridSelectedKeysChangedEventArgs.prototype.onImplementationCreated = function () {
    };
    IgcGridSelectedKeysChangedEventArgs.prototype._provideImplementation = function (i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    };
    Object.defineProperty(IgcGridSelectedKeysChangedEventArgs.prototype, "currentKeys", {
        /**
         * All keys in the selection.
        */
        get: function () {
            if (this._currentKeys === null) {
                var coll = new IgcGridSelectedKeysCollection();
                var innerColl = this.i.currentKeys;
                if (!innerColl) {
                    innerColl = new GridSelectedKeysCollection_internal();
                }
                this._currentKeys = coll._fromInner(innerColl);
                this.i.currentKeys = innerColl;
            }
            return this._currentKeys;
        },
        set: function (v) {
            if (this._currentKeys !== null) {
                this._currentKeys._setSyncTarget(null);
                this._currentKeys = null;
            }
            var coll = new IgcGridSelectedKeysCollection();
            this._currentKeys = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(PrimaryKeyValue.$type);
            var innerColl = this.i.currentKeys;
            if (!innerColl) {
                innerColl = new GridSelectedKeysCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._currentKeys._setSyncTarget(syncColl);
            this.i.currentKeys = innerColl;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridSelectedKeysChangedEventArgs.prototype, "addedKeys", {
        /**
         * The keys added to the selection.
        */
        get: function () {
            if (this._addedKeys === null) {
                var coll = new IgcGridSelectedKeysCollection();
                var innerColl = this.i.addedKeys;
                if (!innerColl) {
                    innerColl = new GridSelectedKeysCollection_internal();
                }
                this._addedKeys = coll._fromInner(innerColl);
                this.i.addedKeys = innerColl;
            }
            return this._addedKeys;
        },
        set: function (v) {
            if (this._addedKeys !== null) {
                this._addedKeys._setSyncTarget(null);
                this._addedKeys = null;
            }
            var coll = new IgcGridSelectedKeysCollection();
            this._addedKeys = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(PrimaryKeyValue.$type);
            var innerColl = this.i.addedKeys;
            if (!innerColl) {
                innerColl = new GridSelectedKeysCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._addedKeys._setSyncTarget(syncColl);
            this.i.addedKeys = innerColl;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridSelectedKeysChangedEventArgs.prototype, "removedKeys", {
        /**
         * The keys removed from the selection.
        */
        get: function () {
            if (this._removedKeys === null) {
                var coll = new IgcGridSelectedKeysCollection();
                var innerColl = this.i.removedKeys;
                if (!innerColl) {
                    innerColl = new GridSelectedKeysCollection_internal();
                }
                this._removedKeys = coll._fromInner(innerColl);
                this.i.removedKeys = innerColl;
            }
            return this._removedKeys;
        },
        set: function (v) {
            if (this._removedKeys !== null) {
                this._removedKeys._setSyncTarget(null);
                this._removedKeys = null;
            }
            var coll = new IgcGridSelectedKeysCollection();
            this._removedKeys = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(PrimaryKeyValue.$type);
            var innerColl = this.i.removedKeys;
            if (!innerColl) {
                innerColl = new GridSelectedKeysCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._removedKeys._setSyncTarget(syncColl);
            this.i.removedKeys = innerColl;
        },
        enumerable: true,
        configurable: true
    });
    return IgcGridSelectedKeysChangedEventArgs;
}());
export { IgcGridSelectedKeysChangedEventArgs };
//# sourceMappingURL=igc-grid-selected-keys-changed-event-args.js.map
