import { ValueLayerValueMode_$type } from "./ValueLayerValueMode";
import { IgrSeries } from "./igr-series";
import { IgrAxis } from "./igr-axis";
import { IgrAnnotationLayer } from "./igr-annotation-layer";
import { ValueLayer } from "./ValueLayer";
import { ensureBool, ensureEnum, brushToString, stringToBrush } from "igniteui-react-core";
/**
 * Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor.
*/
export class IgrValueLayer extends IgrAnnotationLayer {
    createImplementation() {
        return new ValueLayer();
    }
    /**
                                 * @hidden
                                 */
    get i() {
        return this._implementation;
    }
    constructor(props) {
        super(props);
    }
    /**
     * Gets whether the series is an crosshair annotation layer.
    */
    get isAnnotationValueLayer() {
        return this.i.er;
    }
    /**
     * Gets or sets the value mode for the overlay.
    */
    get valueMode() {
        return this.i.zt;
    }
    set valueMode(v) {
        this.i.zt = ensureEnum(ValueLayerValueMode_$type, v);
    }
    /**
     * Gets or sets the color to use for the horizontal line. Leave null for an automatic value.
    */
    get horizontalLineStroke() {
        return brushToString(this.i.ach);
    }
    set horizontalLineStroke(v) {
        this.i.ach = stringToBrush(v);
    }
    /**
     * Gets or sets the color to use for vertical line. Leave null for an automatic value.
    */
    get verticalLineStroke() {
        return brushToString(this.i.aci);
    }
    set verticalLineStroke(v) {
        this.i.aci = stringToBrush(v);
    }
    /**
     * Gets or sets the name of the series to target this annotation to. If null, this annotation targets all series simultaneously.
    */
    get targetSeriesName() {
        return this.i.aam;
    }
    set targetSeriesName(v) {
        this.i.aam = v;
    }
    /**
     * Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
    */
    get targetSeries() {
        const r = this.i.zr;
        if (r == null) {
            return null;
        }
        if (!r.externalObject) {
            let e = IgrSeries._createFromInternal(r);
            if (e) {
                e._implementation = r;
            }
            r.externalObject = e;
        }
        return r.externalObject;
    }
    set targetSeries(v) {
        if (v != null && this._stylingContainer && v._styling)
            v._styling(this._stylingContainer, this, this);
        v == null ? this.i.zr = null : this.i.zr = v.i;
    }
    /**
     * Gets or sets the name of the axis to target this annotation to. If null, this annotation targets all axis simultaneously.
    */
    get targetAxisName() {
        return this.i.aaj;
    }
    set targetAxisName(v) {
        this.i.aaj = v;
    }
    /**
     * Gets or sets the axis to target this annotation to. If null, this annotation targets all value axis simultaneously.
    */
    get targetAxis() {
        const r = this.i.zo;
        if (r == null) {
            return null;
        }
        if (!r.externalObject) {
            let e = IgrAxis._createFromInternal(r);
            if (e) {
                e._implementation = r;
            }
            r.externalObject = e;
        }
        return r.externalObject;
    }
    set targetAxis(v) {
        if (v != null && this._stylingContainer && v._styling)
            v._styling(this._stylingContainer, this, this);
        v == null ? this.i.zo = null : this.i.zo = v.i;
    }
    /**
     * Gets or sets whether to use value interpolation when drawing a line through the best value for the cursor position.
    */
    get useInterpolation() {
        return this.i.zy;
    }
    set useInterpolation(v) {
        this.i.zy = ensureBool(v);
    }
    /**
     * Gets or sets whether to draw annotations over the axes where the crosshair meets with them.
    */
    get isAxisAnnotationEnabled() {
        return this.i.zv;
    }
    set isAxisAnnotationEnabled(v) {
        this.i.zv = ensureBool(v);
    }
    /**
     * Sets or gets a function which takes an object that produces a formatted label for the x axis annotation.
    */
    get xAxisAnnotationFormatLabel() {
        return this.i.zp;
    }
    set xAxisAnnotationFormatLabel(v) {
        this.i.zp = v;
    }
    /**
     * Sets or gets a function which takes an object that produces a formatted label for the y axis annotation.
    */
    get yAxisAnnotationFormatLabel() {
        return this.i.zq;
    }
    set yAxisAnnotationFormatLabel(v) {
        this.i.zq = v;
    }
    /**
     * Gets or sets the color to use for the x axis annotation text. Leave unset for an automatic value.
    */
    get xAxisAnnotationTextColor() {
        return brushToString(this.i.acl);
    }
    set xAxisAnnotationTextColor(v) {
        this.i.acl = stringToBrush(v);
    }
    /**
     * Gets or sets the color to use for the x axis annotation backing. Leave unset for an automatic value.
    */
    get xAxisAnnotationBackground() {
        return brushToString(this.i.acj);
    }
    set xAxisAnnotationBackground(v) {
        this.i.acj = stringToBrush(v);
    }
    /**
     * Gets or sets the corner radius to use for the x axis annotation backing. Leave unset for an automatic value.
    */
    get xAxisAnnotationBackgroundCornerRadius() {
        return this.i.z1;
    }
    set xAxisAnnotationBackgroundCornerRadius(v) {
        this.i.z1 = +v;
    }
    /**
     * Gets or sets the precision to use displaying values for interpolated crosshair positions.
    */
    get xAxisAnnotationInterpolatedValuePrecision() {
        return this.i.aad;
    }
    set xAxisAnnotationInterpolatedValuePrecision(v) {
        this.i.aad = +v;
    }
    /**
     * Gets or sets the color to use for the x axis annotation outline. Leave unset for an automatic value.
    */
    get xAxisAnnotationOutline() {
        return brushToString(this.i.ack);
    }
    set xAxisAnnotationOutline(v) {
        this.i.ack = stringToBrush(v);
    }
    /**
     * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
    */
    get xAxisAnnotationPaddingLeft() {
        return this.i.z3;
    }
    set xAxisAnnotationPaddingLeft(v) {
        this.i.z3 = +v;
    }
    /**
     * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
    */
    get xAxisAnnotationPaddingTop() {
        return this.i.z5;
    }
    set xAxisAnnotationPaddingTop(v) {
        this.i.z5 = +v;
    }
    /**
     * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
    */
    get xAxisAnnotationPaddingRight() {
        return this.i.z4;
    }
    set xAxisAnnotationPaddingRight(v) {
        this.i.z4 = +v;
    }
    /**
     * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
    */
    get xAxisAnnotationPaddingBottom() {
        return this.i.z2;
    }
    set xAxisAnnotationPaddingBottom(v) {
        this.i.z2 = +v;
    }
    /**
     * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
    */
    get yAxisAnnotationPaddingLeft() {
        return this.i.z9;
    }
    set yAxisAnnotationPaddingLeft(v) {
        this.i.z9 = +v;
    }
    /**
     * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
    */
    get yAxisAnnotationPaddingTop() {
        return this.i.aab;
    }
    set yAxisAnnotationPaddingTop(v) {
        this.i.aab = +v;
    }
    /**
     * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
    */
    get yAxisAnnotationPaddingRight() {
        return this.i.aaa;
    }
    set yAxisAnnotationPaddingRight(v) {
        this.i.aaa = +v;
    }
    /**
     * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
    */
    get yAxisAnnotationPaddingBottom() {
        return this.i.z8;
    }
    set yAxisAnnotationPaddingBottom(v) {
        this.i.z8 = +v;
    }
    /**
     * Gets or sets the stroke thickness for the x axis annotation backing. Leave unset for an automatic value.
    */
    get xAxisAnnotationStrokeThickness() {
        return this.i.z6;
    }
    set xAxisAnnotationStrokeThickness(v) {
        this.i.z6 = +v;
    }
    /**
     * Gets or sets the color to use for the y axis annotation text. Leave unset for an automatic value.
    */
    get yAxisAnnotationTextColor() {
        return brushToString(this.i.aco);
    }
    set yAxisAnnotationTextColor(v) {
        this.i.aco = stringToBrush(v);
    }
    /**
     * Gets or sets the color to use for the y axis annotation backing. Leave unset for an automatic value.
    */
    get yAxisAnnotationBackground() {
        return brushToString(this.i.acm);
    }
    set yAxisAnnotationBackground(v) {
        this.i.acm = stringToBrush(v);
    }
    /**
     * Gets or sets the corner radius to use for the y axis annotation backing. Leave unset for an automatic value.
    */
    get yAxisAnnotationBackgroundCornerRadius() {
        return this.i.z7;
    }
    set yAxisAnnotationBackgroundCornerRadius(v) {
        this.i.z7 = +v;
    }
    /**
     * Gets or sets the precision to use displaying values for interpolated crosshair positions.
    */
    get yAxisAnnotationInterpolatedValuePrecision() {
        return this.i.aae;
    }
    set yAxisAnnotationInterpolatedValuePrecision(v) {
        this.i.aae = +v;
    }
    /**
     * Gets or sets the color to use for the y axis annotation outline. Leave unset for an automatic value.
    */
    get yAxisAnnotationOutline() {
        return brushToString(this.i.acn);
    }
    set yAxisAnnotationOutline(v) {
        this.i.acn = stringToBrush(v);
    }
    /**
     * Gets or sets the stroke thickness for the y axis annotation backing. Leave unset for an automatic value.
    */
    get yAxisAnnotationStrokeThickness() {
        return this.i.aac;
    }
    set yAxisAnnotationStrokeThickness(v) {
        this.i.aac = +v;
    }
    /**
     * Gets or sets whether to skip unknown values when searching for series values.
    */
    get skipUnknownValues() {
        return this.i.zx;
    }
    set skipUnknownValues(v) {
        this.i.zx = ensureBool(v);
    }
    findByName(name) {
        var baseResult = super.findByName(name);
        if (baseResult) {
            return baseResult;
        }
        if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) {
            return this.targetSeries;
        }
        if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) {
            return this.targetAxis;
        }
        return null;
    }
    _styling(container, component, parent) {
        super._styling(container, component, parent);
        this._inStyling = true;
        if (this.targetSeries && this.targetSeries._styling) {
            this.targetSeries._styling(container, component, this);
        }
        if (this.targetAxis && this.targetAxis._styling) {
            this.targetAxis._styling(container, component, this);
        }
        this._inStyling = false;
    }
}
