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/ES2015/type";
export class IgrCustomIndicator extends IgrStrategyBasedIndicator {
    constructor(props) {
        super(props);
        this._indicator = null;
        this._indicator_wrapped = null;
        this._basedOnColumns = null;
        this._basedOnColumns_wrapped = null;
    }
    createImplementation() {
        return new CustomIndicator();
    }
    get i() {
        return this._implementation;
    }
    /**
     * Event raised when the indicator values need to be computed.
    */
    get indicator() {
        return this._indicator;
    }
    set indicator(ev) {
        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 = (o, e) => {
            let outerArgs = new FinancialEventArgs();
            outerArgs._provideImplementation(e);
            this._indicator(this, outerArgs);
        };
        this.i.indicator = delegateCombine(this.i.indicator, this._indicator_wrapped);
    }
    /**
     * Event raised when the basedOnColumns values need to be computed.
    */
    get basedOnColumns() {
        return this._basedOnColumns;
    }
    set basedOnColumns(ev) {
        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 = (o, e) => {
            let outerArgs = new FinancialEventArgs();
            outerArgs._provideImplementation(e);
            this._basedOnColumns(this, outerArgs);
        };
        this.i.basedOnColumns = delegateCombine(this.i.basedOnColumns, this._basedOnColumns_wrapped);
    }
}
