import * as tslib_1 from "tslib";
import { delegateCombine, delegateRemove } from "igniteui-react-core/ES5/type";
import { IgrNumericYAxis } from "./igr-numeric-y-axis";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { AssigningCategoryStyleEventArgs } from "./igr-assigning-category-style-event-args";
import { FinancialEventArgs } from "./igr-financial-event-args";
import { IgrSeries } from "./igr-series";
import { ensureBool, brushToString, stringToBrush, ensureEnum, toPoint, fromPoint } from "igniteui-react-core/ES5/componentUtil";
/**
 * Represents the base class for all financial indicator and overlay series.
*/
var IgrFinancialSeries = /** @class */ (function (_super) {
    tslib_1.__extends(IgrFinancialSeries, _super);
    function IgrFinancialSeries(props) {
        var _this = _super.call(this, props) || this;
        _this._assigningCategoryStyle = null;
        _this._assigningCategoryStyle_wrapped = null;
        _this._typical = null;
        _this._typical_wrapped = null;
        _this._typicalBasedOn = null;
        _this._typicalBasedOn_wrapped = null;
        return _this;
    }
    Object.defineProperty(IgrFinancialSeries.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "isFinancial", {
        /**
         * Gets whether the current series is a financial type series.
        */
        get: function () {
            return this.i.cq;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "negativeBrush", {
        /**
         * Gets or sets the brush to use for negative portions of the series.
        */
        get: function () {
            return brushToString(this.i.o0);
        },
        set: function (v) {
            this.i.o0 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "xAxis", {
        /**
         * Gets or sets the effective x-axis for the current FinancialSeries object.
        */
        get: function () {
            if (this.i.lw == null) {
                return null;
            }
            return this.i.lw.externalObject;
        },
        set: function (v) {
            v == null ? this.i.lw = null : this.i.lw = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "yAxis", {
        /**
         * Gets or sets the effective y-axis for the current FinancialSeries object.
        */
        get: function () {
            if (this.i.mg == null) {
                return null;
            }
            if (!this.i.mg.externalObject) {
                var e = new IgrNumericYAxis(null);
                e._implementation = this.i.mg;
                this.i.mg.externalObject = e;
            }
            return this.i.mg.externalObject;
        },
        set: function (v) {
            v == null ? this.i.mg = null : this.i.mg = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "openMemberPath", {
        /**
         * Gets or sets the open mapping property for the current series object.
        */
        get: function () {
            return this.i.oa;
        },
        set: function (v) {
            this.i.oa = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "highMemberPath", {
        /**
         * Gets or sets the high mapping property for the current series object.
        */
        get: function () {
            return this.i.n1;
        },
        set: function (v) {
            this.i.n1 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "lowMemberPath", {
        /**
         * Gets or sets the low mapping property for the current series object.
        */
        get: function () {
            return this.i.n6;
        },
        set: function (v) {
            this.i.n6 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "closeMemberPath", {
        /**
         * Gets or sets the close mapping property for the current series object.
        */
        get: function () {
            return this.i.ny;
        },
        set: function (v) {
            this.i.ny = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "volumeMemberPath", {
        /**
         * Gets or sets the volume mapping property for the current series object.
        */
        get: function () {
            return this.i.oe;
        },
        set: function (v) {
            this.i.oe = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "isCustomCategoryStyleAllowed", {
        /**
         * Gets or sets whether this category series should allow custom style overrides of its individual visuals.
        */
        get: function () {
            return this.i.m0;
        },
        set: function (v) {
            this.i.m0 = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "transitionInMode", {
        /**
         * Gets or sets the method by which to animate the data into the chart when the chart data source is swapped.
         * Note: Transitions are not currently supported for stacked series.
        */
        get: function () {
            return this.i.l6;
        },
        set: function (v) {
            this.i.l6 = ensureEnum(CategoryTransitionInMode_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "isTransitionInEnabled", {
        /**
         * Gets or sets whether the series should transition into the plot area when a new data source is assigned.
         * Note: Transitions are not currently supported for stacked series.
        */
        get: function () {
            return this.i.m1;
        },
        set: function (v) {
            this.i.m1 = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "isNegativeColorSupported", {
        get: function () {
            return this.i.cy;
        },
        enumerable: true,
        configurable: true
    });
    IgrFinancialSeries.prototype.getPreviousOrExactIndex = function (world, skipUnknowns) {
        var iv = this.i.e8(toPoint(world), skipUnknowns);
        return (iv);
    };
    IgrFinancialSeries.prototype.getNextOrExactIndex = function (world, skipUnknowns) {
        var iv = this.i.e6(toPoint(world), skipUnknowns);
        return (iv);
    };
    /**
     * Returns the offset value for this series if grouped on a category axis.
    
    */
    IgrFinancialSeries.prototype.getOffsetValue = function () {
        var iv = this.i.getOffsetValue();
        return (iv);
    };
    /**
     * Returns the width of the category grouping this series is in.
    
    */
    IgrFinancialSeries.prototype.getCategoryWidth = function () {
        var iv = this.i.getCategoryWidth();
        return (iv);
    };
    IgrFinancialSeries.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.k9(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    IgrFinancialSeries.prototype.getSeriesValue = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.eh(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    };
    IgrFinancialSeries.prototype.getSeriesHighValue = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.ed(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    };
    IgrFinancialSeries.prototype.getSeriesLowValue = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.ef(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    };
    IgrFinancialSeries.prototype.getSeriesCloseValue = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.nm(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    };
    IgrFinancialSeries.prototype.getSeriesOpenValue = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.nn(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    };
    IgrFinancialSeries.prototype.getSeriesVolumeValue = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.no(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    };
    IgrFinancialSeries.prototype.getSeriesHighValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.k5(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    IgrFinancialSeries.prototype.getSeriesLowValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.k7(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    IgrFinancialSeries.prototype.getSeriesOpenValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.o2(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    IgrFinancialSeries.prototype.getSeriesCloseValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.o1(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    IgrFinancialSeries.prototype.getSeriesVolumeValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.o3(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    /**
     * Determine if object can be used as YAxis
    
    * @param axis  * The object to check
    */
    IgrFinancialSeries.prototype.canUseAsYAxis = function (axis) {
        var iv = this.i.mw(axis);
        return (iv);
    };
    /**
     * Determine if object can be used as XAxis
    
    * @param axis  * The object to check
    */
    IgrFinancialSeries.prototype.canUseAsXAxis = function (axis) {
        var iv = this.i.mv(axis);
        return (iv);
    };
    /**
     * Gets the precise item index, if possible, based on the closeness to the previous or next whole integer. If the series cannot provide this information, GetExactItemIndex will return the same integer value as GetItemIndex.
    
    * @param world  * The world position for which to return the index.
    */
    IgrFinancialSeries.prototype.getExactItemIndex = function (world) {
        var iv = this.i.d6(toPoint(world));
        return (iv);
    };
    /**
     * Gets the index of the item that resides at the provided world coordinates.
    
    * @param world  * The world coordinates of the requested item.
    */
    IgrFinancialSeries.prototype.getItemIndex = function (world) {
        var iv = this.i.e2(toPoint(world));
        return (iv);
    };
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    IgrFinancialSeries.prototype.getItem = function (world) {
        var iv = this.i.fj(toPoint(world));
        return (iv);
    };
    IgrFinancialSeries.prototype.setNegativeColors = function (negativeBrush, negativeOutline) {
        this.i.i6(stringToBrush(negativeBrush), stringToBrush(negativeOutline));
    };
    Object.defineProperty(IgrFinancialSeries.prototype, "assigningCategoryStyle", {
        /**
         * Event raised when Assigning Category Style
        */
        get: function () {
            return this._assigningCategoryStyle;
        },
        set: function (ev) {
            var _this = this;
            if (this._assigningCategoryStyle !== null) {
                this.i.assigningCategoryStyle = delegateRemove(this.i.assigningCategoryStyle, this._assigningCategoryStyle_wrapped);
                this._assigningCategoryStyle_wrapped = null;
                this._assigningCategoryStyle = null;
            }
            this._assigningCategoryStyle = ev;
            this._assigningCategoryStyle_wrapped = function (o, e) {
                var outerArgs = new AssigningCategoryStyleEventArgs();
                outerArgs._provideImplementation(e);
                _this._assigningCategoryStyle(_this, outerArgs);
            };
            this.i.assigningCategoryStyle = delegateCombine(this.i.assigningCategoryStyle, this._assigningCategoryStyle_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "typical", {
        /**
         * Handle this event in order to perform a custom typical price calculation.
        */
        get: function () {
            return this._typical;
        },
        set: function (ev) {
            var _this = this;
            if (this._typical !== null) {
                this.i.typical = delegateRemove(this.i.typical, this._typical_wrapped);
                this._typical_wrapped = null;
                this._typical = null;
            }
            this._typical = ev;
            this._typical_wrapped = function (o, e) {
                var outerArgs = new FinancialEventArgs();
                outerArgs._provideImplementation(e);
                _this._typical(_this, outerArgs);
            };
            this.i.typical = delegateCombine(this.i.typical, this._typical_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialSeries.prototype, "typicalBasedOn", {
        /**
         * Handle this event in order to specify which columns the Typical price calculation is based on.
        */
        get: function () {
            return this._typicalBasedOn;
        },
        set: function (ev) {
            var _this = this;
            if (this._typicalBasedOn !== null) {
                this.i.typicalBasedOn = delegateRemove(this.i.typicalBasedOn, this._typicalBasedOn_wrapped);
                this._typicalBasedOn_wrapped = null;
                this._typicalBasedOn = null;
            }
            this._typicalBasedOn = ev;
            this._typicalBasedOn_wrapped = function (o, e) {
                var outerArgs = new FinancialEventArgs();
                outerArgs._provideImplementation(e);
                _this._typicalBasedOn(_this, outerArgs);
            };
            this.i.typicalBasedOn = delegateCombine(this.i.typicalBasedOn, this._typicalBasedOn_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    return IgrFinancialSeries;
}(IgrSeries));
export { IgrFinancialSeries };
