import { IgrSeries } from "./igr-series";
import { FinalValueSelectionMode_$type } from "./FinalValueSelectionMode";
import { IgrAnnotationLayer } from "./igr-annotation-layer";
import { FinalValueLayer } from "./FinalValueLayer";
import { 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 IgrFinalValueLayer extends IgrAnnotationLayer {
    createImplementation() {
        return new FinalValueLayer();
    }
    /**
                                 * @hidden
                                 */
    get i() {
        return this._implementation;
    }
    constructor(props) {
        super(props);
    }
    /**
     * Gets whether the series is final value annotation layer.
    */
    get isAnnotationFinalValue() {
        return this.i.eo;
    }
    /**
     * 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.aad;
    }
    set targetSeriesName(v) {
        this.i.aad = 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 how to select the final value to annotate.
    */
    get finalValueSelectionMode() {
        return this.i.zq;
    }
    set finalValueSelectionMode(v) {
        this.i.zq = ensureEnum(FinalValueSelectionMode_$type, v);
    }
    /**
     * Gets or sets the color to use for the axis annotation text. Leave unset for an automatic value.
    */
    get axisAnnotationTextColor() {
        return brushToString(this.i.aax);
    }
    set axisAnnotationTextColor(v) {
        this.i.aax = stringToBrush(v);
    }
    /**
     * Gets or sets the color to use for the axis annotation backing. Leave unset for an automatic value.
    */
    get axisAnnotationBackground() {
        return brushToString(this.i.aav);
    }
    set axisAnnotationBackground(v) {
        this.i.aav = stringToBrush(v);
    }
    /**
     * Gets or sets the corner radius to use for the axis annotation backing. Leave unset for an automatic value.
    */
    get axisAnnotationBackgroundCornerRadius() {
        return this.i.zv;
    }
    set axisAnnotationBackgroundCornerRadius(v) {
        this.i.zv = +v;
    }
    /**
     * Gets or sets the precision to use displaying values for interpolated crosshair positions.
    */
    get axisAnnotationInterpolatedValuePrecision() {
        return this.i.z1;
    }
    set axisAnnotationInterpolatedValuePrecision(v) {
        this.i.z1 = +v;
    }
    /**
     * Gets or sets the color to use for the axis annotation outline. Leave unset for an automatic value.
    */
    get axisAnnotationOutline() {
        return brushToString(this.i.aaw);
    }
    set axisAnnotationOutline(v) {
        this.i.aaw = stringToBrush(v);
    }
    /**
     * Gets or sets the left padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
    */
    get axisAnnotationPaddingLeft() {
        return this.i.zx;
    }
    set axisAnnotationPaddingLeft(v) {
        this.i.zx = +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 axisAnnotationPaddingTop() {
        return this.i.zz;
    }
    set axisAnnotationPaddingTop(v) {
        this.i.zz = +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 axisAnnotationPaddingRight() {
        return this.i.zy;
    }
    set axisAnnotationPaddingRight(v) {
        this.i.zy = +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 axisAnnotationPaddingBottom() {
        return this.i.zw;
    }
    set axisAnnotationPaddingBottom(v) {
        this.i.zw = +v;
    }
    /**
     * Gets or sets the stroke thickness for the axis annotation backing. Leave unset for an automatic value.
    */
    get axisAnnotationStrokeThickness() {
        return this.i.z0;
    }
    set axisAnnotationStrokeThickness(v) {
        this.i.z0 = +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;
        }
        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);
        }
        this._inStyling = false;
    }
}
