import { CalloutAnnotationCollection } from "./igr-callout-annotation-collection";
import { CalloutCollisionMode_$type } from "./CalloutCollisionMode";
import { IgrAnnotationLayer } from "./igr-annotation-layer";
import { CalloutLayer } from "./CalloutLayer";
import { CalloutAnnotationCollection as CalloutAnnotationCollection_internal } from "./CalloutAnnotationCollection";
import { CalloutAnnotation } from "./CalloutAnnotation";
import { SyncableObservableCollection$1 } from "igniteui-react-core/ES2015/SyncableObservableCollection$1";
import { ensureBool, brushToString, stringToBrush, ensureEnum } from "igniteui-react-core/ES2015/componentUtil";
/**
 * Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor.
*/
export class IgrCalloutLayer extends IgrAnnotationLayer {
    constructor(props) {
        super(props);
        this._callouts = null;
    }
    createImplementation() {
        return new CalloutLayer();
    }
    get i() {
        return this._implementation;
    }
    /**
     * Gets the current SeriesViewer object's child Series.
    */
    get callouts() {
        if (this._callouts === null) {
            let coll = new CalloutAnnotationCollection();
            let innerColl = this.i.callouts;
            let wasNull = false;
            if (!innerColl) {
                wasNull = true;
                innerColl = new CalloutAnnotationCollection_internal();
            }
            this._callouts = coll._fromInner(innerColl);
        }
        return this._callouts;
    }
    set callouts(v) {
        if (this._callouts !== null) {
            this._callouts._setSyncTarget(null);
            this._callouts = null;
        }
        let coll = new CalloutAnnotationCollection();
        this._callouts = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(CalloutAnnotation.$type);
        let innerColl = this.i.callouts;
        let wasNull = false;
        if (!innerColl) {
            wasNull = true;
            innerColl = new CalloutAnnotationCollection_internal();
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._callouts._setSyncTarget(syncColl);
    }
    /**
     * Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
    */
    get targetSeries() {
        if (this.i.mu == null) {
            return null;
        }
        return this.i.mu.externalObject;
    }
    set targetSeries(v) {
        v == null ? this.i.mu = null : this.i.mu = v.i;
    }
    /**
     * Gets or sets how to select the final value to annotate.
    */
    get isAutoCalloutBehaviorEnabled() {
        return this.i.m2;
    }
    set isAutoCalloutBehaviorEnabled(v) {
        this.i.m2 = ensureBool(v);
    }
    /**
     * Gets or sets the color to use for the axis annotation text. Leave unset for an automatic value.
    */
    get calloutTextColor() {
        return brushToString(this.i.ob);
    }
    set calloutTextColor(v) {
        this.i.ob = stringToBrush(v);
    }
    /**
     * Gets or sets the color to use for the axis annotation backing. Leave unset for an automatic value.
    */
    get calloutBackground() {
        return brushToString(this.i.n9);
    }
    set calloutBackground(v) {
        this.i.n9 = stringToBrush(v);
    }
    /**
     * Gets or sets the precision to use displaying values for interpolated crosshair positions.
    */
    get calloutInterpolatedValuePrecision() {
        return this.i.ne;
    }
    set calloutInterpolatedValuePrecision(v) {
        this.i.ne = +v;
    }
    /**
     * Gets or sets the color to use for the axis annotation outline. Leave unset for an automatic value.
    */
    get calloutOutline() {
        return brushToString(this.i.oa);
    }
    set calloutOutline(v) {
        this.i.oa = stringToBrush(v);
    }
    /**
     * Gets or sets the padding for the axis annotation backing. Leave unset for an automatic value.
    */
    get calloutPadding() {
        return this.i.na;
    }
    set calloutPadding(v) {
        this.i.na = +v;
    }
    /**
     * Gets or sets the padding for the axis annotation backing. Leave unset for an automatic value.
    */
    get calloutCollisionMode() {
        return this.i.ms;
    }
    set calloutCollisionMode(v) {
        this.i.ms = ensureEnum(CalloutCollisionMode_$type, v);
    }
    /**
     * Gets or sets the padding to add to the callout positioning. Leave unset for an automatic value.
    */
    get calloutPositionPadding() {
        return this.i.nb;
    }
    set calloutPositionPadding(v) {
        this.i.nb = +v;
    }
    /**
     * Gets or sets the stroke thickness for the axis annotation backing. Leave unset for an automatic value.
    */
    get calloutStrokeThickness() {
        return this.i.nc;
    }
    set calloutStrokeThickness(v) {
        this.i.nc = +v;
    }
}
