import { delegateCombine, delegateRemove } from "igniteui-react-core/ES2015/type";
import { AxisRangeChangedEventArgs } from "./igr-axis-range-changed-event-args";
import { IgrCategoryAxisBase } from "./igr-category-axis-base";
import { ensureBool } from "igniteui-react-core/ES2015/componentUtil";
/**
 * Represents an category-based horizontal X axis that uses a DateTime scale.
*/
export class IgrTimeAxisBase extends IgrCategoryAxisBase {
    constructor(props) {
        super(props);
        this._actualRangeChanged = null;
        this._actualRangeChanged_wrapped = null;
    }
    get i() {
        return this._implementation;
    }
    /**
     * Gets or sets the DateTime mapping property for the axis.
    */
    get dateTimeMemberPath() {
        return this.i.dateTimeMemberPath;
    }
    set dateTimeMemberPath(v) {
        this.i.dateTimeMemberPath = v;
    }
    /**
     * Gets or sets whether the data assigned to the date time axis should be considered pre-sorted by date/time.
    */
    get isDataPreSorted() {
        return this.i.kv;
    }
    set isDataPreSorted(v) {
        this.i.kv = ensureBool(v);
    }
    /**
     * Gets the coerced minimum value.
    */
    get actualMinimumValue() {
        return this.i.actualMinimumValue;
    }
    /**
     * Gets the coerced maximum value.
    */
    get actualMaximumValue() {
        return this.i.actualMaximumValue;
    }
    /**
     * Gets or sets the axis MinimumValue.
    */
    get minimumValue() {
        return this.i.minimumValue;
    }
    set minimumValue(v) {
        this.i.minimumValue = v;
    }
    /**
     * Gets or sets the axis MaximumValue.
    */
    get maximumValue() {
        return this.i.maximumValue;
    }
    set maximumValue(v) {
        this.i.maximumValue = v;
    }
    /**
     * Checks if the axis is of date time axis type
    */
    get isDateTime() {
        return this.i.b5;
    }
    /**
     * Checks if axis requires sorting of items
    */
    get isSorting() {
        return this.i.cc;
    }
    /**
     * Gets the index of the data item with the value nearest the given value.
    
    * @param unscaledValue  * The value to find a value close to.
    */
    getIndexClosestToUnscaledValue(unscaledValue) {
        let iv = this.i.i$f(unscaledValue);
        return (iv);
    }
    /**
     * Updates the axis when the data has been changed.
    
    */
    notifyDataChanged() {
        this.i.i$i();
    }
    get actualRangeChanged() {
        return this._actualRangeChanged;
    }
    set actualRangeChanged(ev) {
        if (this._actualRangeChanged !== null) {
            this.i.actualRangeChanged = delegateRemove(this.i.actualRangeChanged, this._actualRangeChanged_wrapped);
            this._actualRangeChanged_wrapped = null;
            this._actualRangeChanged = null;
        }
        this._actualRangeChanged = ev;
        this._actualRangeChanged_wrapped = (o, e) => {
            let outerArgs = new AxisRangeChangedEventArgs();
            outerArgs._provideImplementation(e);
            this._actualRangeChanged(this, outerArgs);
        };
        this.i.actualRangeChanged = delegateCombine(this.i.actualRangeChanged, this._actualRangeChanged_wrapped);
    }
}
