import * as tslib_1 from "tslib";
import { IgrStrategyBasedIndicator } from './igr-strategy-based-indicator';
import { CustomIndicator } from "./CustomIndicator";
import { FinancialEventArgs } from "./igr-financial-event-args";
import { delegateCombine, delegateRemove } from "igniteui-react-core/ES5/type";
var IgrCustomIndicator = /** @class */ (function (_super) {
    tslib_1.__extends(IgrCustomIndicator, _super);
    function IgrCustomIndicator(props) {
        var _this = _super.call(this, props) || this;
        _this._indicator = null;
        _this._indicator_wrapped = null;
        _this._basedOnColumns = null;
        _this._basedOnColumns_wrapped = null;
        return _this;
    }
    IgrCustomIndicator.prototype.createImplementation = function () {
        return new CustomIndicator();
    };
    Object.defineProperty(IgrCustomIndicator.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCustomIndicator.prototype, "indicator", {
        /**
         * Event raised when the indicator values need to be computed.
        */
        get: function () {
            return this._indicator;
        },
        set: function (ev) {
            var _this = this;
            if (this._indicator !== null) {
                this.i.indicator = delegateRemove(this.i.indicator, this._indicator_wrapped);
                this._indicator_wrapped = null;
                this._indicator = null;
            }
            this._indicator = ev;
            this._indicator_wrapped = function (o, e) {
                var outerArgs = new FinancialEventArgs();
                outerArgs._provideImplementation(e);
                _this._indicator(_this, outerArgs);
            };
            this.i.indicator = delegateCombine(this.i.indicator, this._indicator_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCustomIndicator.prototype, "basedOnColumns", {
        /**
         * Event raised when the basedOnColumns values need to be computed.
        */
        get: function () {
            return this._basedOnColumns;
        },
        set: function (ev) {
            var _this = this;
            if (this._basedOnColumns !== null) {
                this.i.basedOnColumns = delegateRemove(this.i.basedOnColumns, this._basedOnColumns_wrapped);
                this._basedOnColumns_wrapped = null;
                this._basedOnColumns = null;
            }
            this._basedOnColumns = ev;
            this._basedOnColumns_wrapped = function (o, e) {
                var outerArgs = new FinancialEventArgs();
                outerArgs._provideImplementation(e);
                _this._basedOnColumns(_this, outerArgs);
            };
            this.i.basedOnColumns = delegateCombine(this.i.basedOnColumns, this._basedOnColumns_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    return IgrCustomIndicator;
}(IgrStrategyBasedIndicator));
export { IgrCustomIndicator };
