import { delegateCombine, delegateRemove } from "igniteui-react-core/ES2015/type";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { AssigningCategoryStyleEventArgs } from "./igr-assigning-category-style-event-args";
import { AssigningCategoryMarkerStyleEventArgs } from "./igr-assigning-category-marker-style-event-args";
import { IgrMarkerSeries } from "./igr-marker-series";
import { ensureBool, ensureEnum, toPoint } from "igniteui-react-core/ES2015/componentUtil";
/**
 * Represents the base class for IgxDataChartComponent category series.
*/
export class IgrCategorySeries extends IgrMarkerSeries {
    constructor(props) {
        super(props);
        this._assigningCategoryStyle = null;
        this._assigningCategoryStyle_wrapped = null;
        this._assigningCategoryMarkerStyle = null;
        this._assigningCategoryMarkerStyle_wrapped = null;
    }
    get i() {
        return this._implementation;
    }
    /**
     * Gets whether or not this series is Category series
    */
    get isCategory() {
        return this.i.ck;
    }
    /**
     * Gets or sets whether this category series should allow custom style overrides of its individual visuals.
    */
    get isCustomCategoryStyleAllowed() {
        return this.i.nl;
    }
    set isCustomCategoryStyleAllowed(v) {
        this.i.nl = ensureBool(v);
    }
    /**
     * Gets or sets whether this category series should allow custom style overrides of its individual marker visuals.
    */
    get isCustomCategoryMarkerStyleAllowed() {
        return this.i.nk;
    }
    set isCustomCategoryMarkerStyleAllowed(v) {
        this.i.nk = ensureBool(v);
    }
    /**
     * Sets or Gets whether to increase marker fidelity for extreme data shapes that have lots of Y variation over short X intervals.
    */
    get useHighMarkerFidelity() {
        return this.i.nq;
    }
    set useHighMarkerFidelity(v) {
        this.i.nq = ensureBool(v);
    }
    /**
     * Gets or sets the method by which to animate the data into the chart when the chart data source is swapped.
     * Note: Transitions are not currently supported for stacked series.
    */
    get transitionInMode() {
        return this.i.m5;
    }
    set transitionInMode(v) {
        this.i.m5 = ensureEnum(CategoryTransitionInMode_$type, v);
    }
    /**
     * Gets or sets whether the series should transition into the plot area when a new data source is assigned.
     * Note: Transitions are not currently supported for stacked series.
    */
    get isTransitionInEnabled() {
        return this.i.nm;
    }
    set isTransitionInEnabled(v) {
        this.i.nm = ensureBool(v);
    }
    /**
     * Returns the offset value for this series if grouped on a category axis.
    
    */
    getOffsetValue() {
        let iv = this.i.getOffsetValue();
        return (iv);
    }
    /**
     * Returns the width of the category grouping this series is in.
    
    */
    getCategoryWidth() {
        let iv = this.i.getCategoryWidth();
        return (iv);
    }
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    getItem(world) {
        let iv = this.i.fj(toPoint(world));
        return (iv);
    }
    /**
     * Gets the index of the item based on world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    getItemIndex(world) {
        let iv = this.i.e2(toPoint(world));
        return (iv);
    }
    /**
     * Gets the precise item index, if possible, based on the closeness to the previous or next whole integer. If the series cannot provide this information, GetExactItemIndex will return the same integer value as GetItemIndex.
    
    * @param world  * The world position for which to return the index.
    */
    getExactItemIndex(world) {
        let iv = this.i.d6(toPoint(world));
        return (iv);
    }
    /**
     * Event raised when Assigning Category Style
    */
    get assigningCategoryStyle() {
        return this._assigningCategoryStyle;
    }
    set assigningCategoryStyle(ev) {
        if (this._assigningCategoryStyle !== null) {
            this.i.assigningCategoryStyle = delegateRemove(this.i.assigningCategoryStyle, this._assigningCategoryStyle_wrapped);
            this._assigningCategoryStyle_wrapped = null;
            this._assigningCategoryStyle = null;
        }
        this._assigningCategoryStyle = ev;
        this._assigningCategoryStyle_wrapped = (o, e) => {
            let outerArgs = new AssigningCategoryStyleEventArgs();
            outerArgs._provideImplementation(e);
            this._assigningCategoryStyle(this, outerArgs);
        };
        this.i.assigningCategoryStyle = delegateCombine(this.i.assigningCategoryStyle, this._assigningCategoryStyle_wrapped);
    }
    /**
     * Event raised when Assigning Category Marker Style
    */
    get assigningCategoryMarkerStyle() {
        return this._assigningCategoryMarkerStyle;
    }
    set assigningCategoryMarkerStyle(ev) {
        if (this._assigningCategoryMarkerStyle !== null) {
            this.i.assigningCategoryMarkerStyle = delegateRemove(this.i.assigningCategoryMarkerStyle, this._assigningCategoryMarkerStyle_wrapped);
            this._assigningCategoryMarkerStyle_wrapped = null;
            this._assigningCategoryMarkerStyle = null;
        }
        this._assigningCategoryMarkerStyle = ev;
        this._assigningCategoryMarkerStyle_wrapped = (o, e) => {
            let outerArgs = new AssigningCategoryMarkerStyleEventArgs();
            outerArgs._provideImplementation(e);
            this._assigningCategoryMarkerStyle(this, outerArgs);
        };
        this.i.assigningCategoryMarkerStyle = delegateCombine(this.i.assigningCategoryMarkerStyle, this._assigningCategoryMarkerStyle_wrapped);
    }
}
