import { DataLegendSeriesValueType_$type } from "./DataLegendSeriesValueType";
import { DataLegendSeriesValueInfo as DataLegendSeriesValueInfo_internal } from "./DataLegendSeriesValueInfo";
import { brushToString, stringToBrush, ensureBool, ensureEnum } from "./componentUtil";
/**
 * Represent info about series values
*/
export class IgrDataLegendSeriesValueInfo {
    createImplementation() {
        return new DataLegendSeriesValueInfo_internal();
    }
    /**
     * @hidden
     */
    get i() {
        return this._implementation;
    }
    onImplementationCreated() {
    }
    constructor() {
        this.mounted = false;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
        if (this._initializeAdapters) {
            this._initializeAdapters();
        }
    }
    _provideImplementation(i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
        if (this._initializeAdapters) {
            this._initializeAdapters();
        }
    }
    /**
     * Gets value of series
    */
    get value() {
        return this.i.l;
    }
    set value(v) {
        this.i.l = +v;
    }
    /**
     * Gets or sets prefix for negative value
    */
    get valueNegativePrefix() {
        return this.i.u;
    }
    set valueNegativePrefix(v) {
        this.i.u = v;
    }
    /**
     * Gets or sets suffix for negative value
    */
    get valueNegativeSuffix() {
        return this.i.v;
    }
    set valueNegativeSuffix(v) {
        this.i.v = v;
    }
    /**
     * Gets or sets prefix for positive value
    */
    get valuePositivePrefix() {
        return this.i.w;
    }
    set valuePositivePrefix(v) {
        this.i.w = v;
    }
    /**
     * Gets or sets suffix for positive value
    */
    get valuePositiveSuffix() {
        return this.i.x;
    }
    set valuePositiveSuffix(v) {
        this.i.x = v;
    }
    /**
     * Gets value color used by the series
    */
    get formatWithSeriesColor() {
        return brushToString(this.i.y);
    }
    set formatWithSeriesColor(v) {
        this.i.y = stringToBrush(v);
    }
    /**
     * Gets or sets minimum digits used for displaying faction of the value
    */
    get formatMinFractions() {
        return this.i.n;
    }
    set formatMinFractions(v) {
        this.i.n = +v;
    }
    /**
     * Gets or sets maximum digits used for displaying faction of the value
    */
    get formatMaxFractions() {
        return this.i.m;
    }
    set formatMaxFractions(v) {
        this.i.m = +v;
    }
    /**
     * Gets or sets whether or not use conditional color
    */
    get formatUsePositiveColor() {
        return this.i.j;
    }
    set formatUsePositiveColor(v) {
        this.i.j = ensureBool(v);
    }
    /**
     * Gets or sets whether or not use conditional color
    */
    get formatUseNegativeColor() {
        return this.i.i;
    }
    set formatUseNegativeColor(v) {
        this.i.i = ensureBool(v);
    }
    /**
     * Gets or sets whether or not allow displaying value as currency
    */
    get formatAllowCurrency() {
        return this.i.e;
    }
    set formatAllowCurrency(v) {
        this.i.e = ensureBool(v);
    }
    /**
     * Gets or sets whether or not allow displaying value as percentage
    */
    get formatAllowPercent() {
        return this.i.h;
    }
    set formatAllowPercent(v) {
        this.i.h = ensureBool(v);
    }
    /**
     * Gets or sets whether or not allow displaying value as decimal
    */
    get formatAllowDecimal() {
        return this.i.f;
    }
    set formatAllowDecimal(v) {
        this.i.f = ensureBool(v);
    }
    /**
     * Gets or sets whether or not allow displaying value as integer
    */
    get formatAllowInteger() {
        return this.i.g;
    }
    set formatAllowInteger(v) {
        this.i.g = ensureBool(v);
    }
    /**
     * Gets or sets whether or not allow displaying value with abbreviation
    */
    get formatAllowAbbreviation() {
        return this.i.d;
    }
    set formatAllowAbbreviation(v) {
        this.i.d = ensureBool(v);
    }
    /**
     * Gets or sets type of value
    */
    get valueType() {
        return this.i.a;
    }
    set valueType(v) {
        this.i.a = ensureEnum(DataLegendSeriesValueType_$type, v);
    }
    /**
     * Gets the index of series
    */
    get index() {
        return this.i.o;
    }
    set index(v) {
        this.i.o = +v;
    }
    /**
     * Gets or sets whether this value is excluded/hidden by default in Data Legend
    */
    get isExcludeByDefault() {
        return this.i.k;
    }
    set isExcludeByDefault(v) {
        this.i.k = ensureBool(v);
    }
    /**
     * Gets or sets whether the unit text is allowed by the series, e.g. "Hz"
    */
    get allowUnits() {
        return this.i.c;
    }
    set allowUnits(v) {
        this.i.c = ensureBool(v);
    }
    /**
     * Gets or sets whether the label text is allowed by the series, e.g. "H:"
    */
    get allowLabels() {
        return this.i.b;
    }
    set allowLabels(v) {
        this.i.b = ensureBool(v);
    }
    /**
     * Gets or sets member path for the series value, e.g. "HighPrice"
    */
    get memberPath() {
        return this.i.q;
    }
    set memberPath(v) {
        this.i.q = v;
    }
    /**
     * Gets or sets member path for the series value, e.g. "High"
    */
    get memberLabel() {
        return this.i.p;
    }
    set memberLabel(v) {
        this.i.p = v;
    }
    /**
     * Gets or sets label for the series value, e.g. "H:"
    */
    get memberSymbol() {
        return this.i.r;
    }
    set memberSymbol(v) {
        this.i.r = v;
    }
    /**
     * Gets or sets unit text for the value, e.g. "Hz"
    */
    get memberUnit() {
        return this.i.s;
    }
    set memberUnit(v) {
        this.i.s = v;
    }
    findByName(name) {
        if (this.findEphemera) {
            if (name && name.indexOf("@@e:") == 0) {
                return this.findEphemera(name);
            }
        }
        return null;
    }
    /**
     * Converts this object to a string
    
    */
    toString() {
        let iv = this.i.t();
        return (iv);
    }
}
