import { HighlightingState_$type } from "./HighlightingState";
import { IgxSeriesComponent } from "./igx-series-component";
import { HighlightingInfo as HighlightingInfo_internal } from "./HighlightingInfo";
import { ensureEnum, ensureBool } from "igniteui-angular-core";
/**
 * Contains contextual information about a highlighting.
*/
export class IgxHighlightingInfo {
    constructor() {
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    createImplementation() {
        return new HighlightingInfo_internal();
    }
    /**
     * @hidden
     */
    get i() {
        return this._implementation;
    }
    onImplementationCreated() {
    }
    _provideImplementation(i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    /**
     * The index of the first highlighted item.
    *
    * You can use `StartIndex` to get or set the first highlighted item for the series.
    *
    * ```html
    * <igx-column-series
    *         #series
    *         [xAxis]="xAxis"
    *         [yAxis]="yAxis"
    *         valueMemberPath="value"
    *         isHighlightingEnabled="true" isCustomCategoryStyleAllowed="true" (assigningCategoryStyle)="assigningSeries($event)"   >
    * </igx-column-series>
    * ```
    */
    get startIndex() {
        return this.i.h;
    }
    set startIndex(v) {
        this.i.h = +v;
    }
    /**
     * The index of the last highlighted item.
    *
    * You can use the `EndIndex` to get or set the last highlighted item for the series.
    *
    * ```html
    * <igx-column-series
    *         #series
    *         [xAxis]="xAxis"
    *         [yAxis]="yAxis"
    *         valueMemberPath="value"
    *         isHighlightingEnabled="true" isCustomCategoryStyleAllowed="true"  (assigningCategoryStyle)="assigningSeries($event)"   >
    *       </igx-column-series>
    * ```
    */
    get endIndex() {
        return this.i.g;
    }
    set endIndex(v) {
        this.i.g = +v;
    }
    /**
     * The state of the highlighting.
    *
    * You can use the `State` to get or set the transitioning state of the highlighting, between In, Out, or Static.
    */
    get state() {
        return this.i.a;
    }
    set state(v) {
        this.i.a = ensureEnum(HighlightingState_$type, v);
    }
    /**
     * A number between 0 and 1 representing the progress of the highlighting.
    *
    * You can use the `Progress` property to set a number between 0 and 1 representing the progress of the highlighting.
    *
    * ```html
    * <igx-column-series
    *         #series
    *         [xAxis]="xAxis"
    *         [yAxis]="yAxis"
    *         valueMemberPath="value"
    *         isHighlightingEnabled="true" isCustomCategoryStyleAllowed="true"  (assigningCategoryStyle)="assigningSeries($event)"   >
    *       </igx-column-series>
    * ```
    */
    get progress() {
        return this.i.f;
    }
    set progress(v) {
        this.i.f = +v;
    }
    /**
     * True if this HighlightingInfo represents a marker highlighting.
    *
    * You can set the `IsMarker` to True if the HighlightingInfo represents a marker highlighting. Otherwise set to false.
    *
    * ```html
    * <igx-column-series
    *         #series
    *         [xAxis]="xAxis"
    *         [yAxis]="yAxis"
    *         valueMemberPath="value"
    *         isHighlightingEnabled="true" isCustomCategoryStyleAllowed="true"  (assigningCategoryStyle)="assigningSeries($event)"   >
    *       </igx-column-series>
    * ```
    */
    get isMarker() {
        return this.i.e;
    }
    set isMarker(v) {
        this.i.e = ensureBool(v);
    }
    /**
     * True if this HighlightingInfo represents a full selection of the data.
    */
    get isFullRange() {
        return this.i.d;
    }
    set isFullRange(v) {
        this.i.d = ensureBool(v);
    }
    get isExclusive() {
        return this.i.c;
    }
    set isExclusive(v) {
        this.i.c = ensureBool(v);
    }
    /**
     * The series in context.
    *
    * You can use the `Series` property to get the series in context.
    *
    * ```html
    * <igx-column-series
    *         #series
    *         [xAxis]="xAxis"
    *         [yAxis]="yAxis"
    *         valueMemberPath="value"
    *         isHighlightingEnabled="true" isCustomCategoryStyleAllowed="true"  (assigningCategoryStyle)="assigningSeries($event)"   >
    *       </igx-column-series>
    * ```
    */
    get series() {
        const r = this.i.b;
        if (r == null) {
            return null;
        }
        if (!r.externalObject) {
            let e = IgxSeriesComponent._createFromInternal(r);
            if (e) {
                e._implementation = r;
            }
            r.externalObject = e;
        }
        return r.externalObject;
    }
    set series(v) {
        v == null ? this.i.b = null : this.i.b = v.i;
    }
    findByName(name) {
        if (this.findEphemera) {
            if (name && name.indexOf("@@e:") == 0) {
                return this.findEphemera(name);
            }
        }
        if (this.series && this.series.name && this.series.name == name) {
            return this.series;
        }
        return null;
    }
}
