import { DataLegendSeriesGroup_$type } from "./DataLegendSeriesGroup";
import { IgxDataLegendSeriesValueInfo } from "./igx-data-legend-series-value-info";
import { DataLegendSeriesContext as DataLegendSeriesContext_internal } from "./DataLegendSeriesContext";
import { ensureEnum } from "./componentUtil";
/**
 * Represent info about series values
*/
var IgxDataLegendSeriesContext = /** @class */ /*@__PURE__*/ (function () {
    function IgxDataLegendSeriesContext() {
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    IgxDataLegendSeriesContext.prototype.createImplementation = function () {
        return new DataLegendSeriesContext_internal();
    };
    Object.defineProperty(IgxDataLegendSeriesContext.prototype, "i", {
        /**
         * @hidden
         */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    IgxDataLegendSeriesContext.prototype.onImplementationCreated = function () {
    };
    IgxDataLegendSeriesContext.prototype._provideImplementation = function (i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    };
    Object.defineProperty(IgxDataLegendSeriesContext.prototype, "seriesGroup", {
        /**
         * Gets a group of series that the current series belongs to
        */
        get: function () {
            return this.i.b;
        },
        set: function (v) {
            this.i.b = ensureEnum(DataLegendSeriesGroup_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    IgxDataLegendSeriesContext.prototype.findByName = function (name) {
        if (this.findEphemera) {
            if (name && name.indexOf("@@e:") == 0) {
                return this.findEphemera(name);
            }
        }
        return null;
    };
    /**
     * Creates an instance of DataLegendSeriesContext
    
    */
    IgxDataLegendSeriesContext.prototype.getSeriesValueInfo = function (type) {
        var iv = this.i.c((type == null ? null : type));
        var ret = null;
        if (iv && iv.externalObject) {
            ret = iv.externalObject;
        }
        else {
            if (iv) {
                var e = new IgxDataLegendSeriesValueInfo();
                e._implementation = iv;
                iv.externalObject = e;
                ret = e;
            }
        }
        return ret;
    };
    /**
     * Gets value info for the series value type
    
    */
    IgxDataLegendSeriesContext.prototype.getSeriesValue = function (type) {
        var iv = this.i.g((type == null ? null : type));
        return (iv);
    };
    IgxDataLegendSeriesContext.prototype.setSeriesValue = function (type, value) {
        this.i.k((type == null ? null : type), value);
    };
    IgxDataLegendSeriesContext.prototype.setSeriesValueInfo = function (type, valueInfo) {
        this.i.l((type == null ? null : type), (valueInfo == null ? null : valueInfo.i));
    };
    /**
     * Gets all values that a series renders at the current data point
     * For example, Open, High, Low, Close for Financial Series
    
    */
    IgxDataLegendSeriesContext.prototype.getSeriesValues = function () {
        var iv = this.i.a();
        return (iv);
    };
    return IgxDataLegendSeriesContext;
}());
export { IgxDataLegendSeriesContext };
