import { FinancialCalculationSupportingCalculations as FinancialCalculationSupportingCalculations_internal } from "./FinancialCalculationSupportingCalculations";
/**
 * Represents a contract between the financial series and the calculation strategies
 * detailing the supporting calculation strategies that the financial series will
 * provide in order for the indicator calculations to be performed.
*/
var IgxFinancialCalculationSupportingCalculations = /** @class */ /*@__PURE__*/ (function () {
    function IgxFinancialCalculationSupportingCalculations() {
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    IgxFinancialCalculationSupportingCalculations.prototype.createImplementation = function () {
        return new FinancialCalculationSupportingCalculations_internal();
    };
    Object.defineProperty(IgxFinancialCalculationSupportingCalculations.prototype, "i", {
        /**
         * @hidden
         */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    IgxFinancialCalculationSupportingCalculations.prototype.onImplementationCreated = function () {
    };
    IgxFinancialCalculationSupportingCalculations.prototype._provideImplementation = function (i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    };
    Object.defineProperty(IgxFinancialCalculationSupportingCalculations.prototype, "eMA", {
        /**
         * The strategy provided to calculate an exponential moving average for a collection.
        */
        get: function () {
            var r = this.i.a;
            if (r == null) {
                return null;
            }
            return r.externalObject;
        },
        set: function (v) {
            v == null ? this.i.a = null : this.i.a = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxFinancialCalculationSupportingCalculations.prototype, "sMA", {
        /**
         * The strategy provided to calculate a simple moving average for a collection.
        */
        get: function () {
            var r = this.i.c;
            if (r == null) {
                return null;
            }
            return r.externalObject;
        },
        set: function (v) {
            v == null ? this.i.c = null : this.i.c = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxFinancialCalculationSupportingCalculations.prototype, "sTDEV", {
        /**
         * The strategy provided to calculate a standard deviation for a collection.
        */
        get: function () {
            var r = this.i.d;
            if (r == null) {
                return null;
            }
            return r.externalObject;
        },
        set: function (v) {
            v == null ? this.i.d = null : this.i.d = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxFinancialCalculationSupportingCalculations.prototype, "movingSum", {
        /**
         * The strategy provided to calculate a moving sum for a collection.
        */
        get: function () {
            var r = this.i.b;
            if (r == null) {
                return null;
            }
            return r.externalObject;
        },
        set: function (v) {
            v == null ? this.i.b = null : this.i.b = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxFinancialCalculationSupportingCalculations.prototype, "shortVolumeOscillatorAverage", {
        /**
         * The strategy provided to calculate the short period moving average for volume oscillator indicators.
        */
        get: function () {
            var r = this.i.h;
            if (r == null) {
                return null;
            }
            return r.externalObject;
        },
        set: function (v) {
            v == null ? this.i.h = null : this.i.h = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxFinancialCalculationSupportingCalculations.prototype, "longVolumeOscillatorAverage", {
        /**
         * The strategy provided to calculate the long period moving average for volume oscillator indicators.
        */
        get: function () {
            var r = this.i.f;
            if (r == null) {
                return null;
            }
            return r.externalObject;
        },
        set: function (v) {
            v == null ? this.i.f = null : this.i.f = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxFinancialCalculationSupportingCalculations.prototype, "shortPriceOscillatorAverage", {
        /**
         * The strategy provided to calculate the short period moving average for price oscillator indicators.
        */
        get: function () {
            var r = this.i.g;
            if (r == null) {
                return null;
            }
            return r.externalObject;
        },
        set: function (v) {
            v == null ? this.i.g = null : this.i.g = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxFinancialCalculationSupportingCalculations.prototype, "longPriceOscillatorAverage", {
        /**
         * The strategy provided to calculate the long period moving average for price oscillator indicators.
        */
        get: function () {
            var r = this.i.e;
            if (r == null) {
                return null;
            }
            return r.externalObject;
        },
        set: function (v) {
            v == null ? this.i.e = null : this.i.e = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxFinancialCalculationSupportingCalculations.prototype, "makeSafe", {
        /**
         * The strategy provided to make doubles safe for plotting, by default will just make zero if the value
         * is invalid.
        */
        get: function () {
            return this.i.i;
        },
        set: function (v) {
            this.i.i = v;
        },
        enumerable: false,
        configurable: true
    });
    IgxFinancialCalculationSupportingCalculations.prototype.findByName = function (name) {
        if (this.findEphemera) {
            if (name && name.indexOf("@@e:") == 0) {
                return this.findEphemera(name);
            }
        }
        if (this.eMA && this.eMA.name && this.eMA.name == name) {
            return this.eMA;
        }
        if (this.sMA && this.sMA.name && this.sMA.name == name) {
            return this.sMA;
        }
        if (this.sTDEV && this.sTDEV.name && this.sTDEV.name == name) {
            return this.sTDEV;
        }
        if (this.movingSum && this.movingSum.name && this.movingSum.name == name) {
            return this.movingSum;
        }
        if (this.shortVolumeOscillatorAverage && this.shortVolumeOscillatorAverage.name && this.shortVolumeOscillatorAverage.name == name) {
            return this.shortVolumeOscillatorAverage;
        }
        if (this.longVolumeOscillatorAverage && this.longVolumeOscillatorAverage.name && this.longVolumeOscillatorAverage.name == name) {
            return this.longVolumeOscillatorAverage;
        }
        if (this.shortPriceOscillatorAverage && this.shortPriceOscillatorAverage.name && this.shortPriceOscillatorAverage.name == name) {
            return this.shortPriceOscillatorAverage;
        }
        if (this.longPriceOscillatorAverage && this.longPriceOscillatorAverage.name && this.longPriceOscillatorAverage.name == name) {
            return this.longPriceOscillatorAverage;
        }
        return null;
    };
    return IgxFinancialCalculationSupportingCalculations;
}());
export { IgxFinancialCalculationSupportingCalculations };
