import * as tslib_1 from "tslib";
import { EventEmitter, Output, Component, Input, ChangeDetectionStrategy } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core/ES2015/type";
import { PropertyUpdatedEventArgs } from "igniteui-angular-core/ES2015/igx-property-updated-event-args";
import { BrushScale } from "./BrushScale";
import { toBrushCollection, fromBrushCollection, brushToString } from "igniteui-angular-core/ES2015/componentUtil";
/**
 * Represents a base class for brush scales.
*/
export const IgxBrushScaleComponent_PROVIDERS = [];
let IgxBrushScaleComponent = class IgxBrushScaleComponent {
    constructor() {
        this._propertyUpdated = null;
        this._zoneRunner = null;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    createImplementation() {
        return new BrushScale();
    }
    ngOnInit() {
    }
    get i() {
        return this._implementation;
    }
    onImplementationCreated() {
    }
    /**
     * Gets the brushes collection used by this scale.
    */
    get brushes() {
        return fromBrushCollection(this.i.brushes);
    }
    set brushes(v) {
        this.i.brushes = toBrushCollection(v);
    }
    /**
     * Gets the status of the scale
    */
    get isReady() {
        return this.i.isReady;
    }
    /**
     * Checks if this item is a BrushScale
    */
    get isBrushScale() {
        return this.i.isBrushScale;
    }
    /**
     * Registers a series with the scale. Under normal circumstances you should not need to call this manually.
    
    * @param series  * The series to register with the scale.
    */
    registerSeries(series) {
        this.i.registerSeries((series == null ? null : series.i));
    }
    /**
     * Unregisters a series with the scale. Under normal circumstances you should not need to call this manually.
    
    * @param series  * The series to unregister from the scale.
    */
    unregisterSeries(series) {
        this.i.unregisterSeries((series == null ? null : series.i));
    }
    /**
     * Gets a brush from the brushes collection by index.
    
    */
    getBrush(index) {
        let iv = this.i.getBrush(index);
        return brushToString(iv);
    }
    /**
     * Event raised when a property (including "effective" and non-dependency property) value changes.
    */
    get propertyUpdated() {
        if (this._propertyUpdated == null) {
            this._propertyUpdated = new EventEmitter();
            this.i.propertyUpdated = delegateCombine(this.i.propertyUpdated, (o, e) => {
                this._runInZone(() => {
                    let outerArgs = new PropertyUpdatedEventArgs();
                    outerArgs._provideImplementation(e);
                    if (this.beforePropertyUpdated) {
                        this.beforePropertyUpdated(this, outerArgs);
                    }
                    this._propertyUpdated.emit({
                        sender: this,
                        args: outerArgs
                    });
                });
            });
        }
        return this._propertyUpdated;
    }
    _runInZone(act) {
        if (this._zoneRunner != null) {
            this._zoneRunner(act);
        }
        else {
            act();
        }
    }
};
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Array),
    tslib_1.__metadata("design:paramtypes", [Array])
], IgxBrushScaleComponent.prototype, "brushes", null);
tslib_1.__decorate([
    Output(),
    tslib_1.__metadata("design:type", EventEmitter),
    tslib_1.__metadata("design:paramtypes", [])
], IgxBrushScaleComponent.prototype, "propertyUpdated", null);
IgxBrushScaleComponent = tslib_1.__decorate([
    Component({
        selector: 'igx-brush-scale',
        template: ``,
        providers: [],
        changeDetection: ChangeDetectionStrategy.OnPush
    }),
    tslib_1.__metadata("design:paramtypes", [])
], IgxBrushScaleComponent);
export { IgxBrushScaleComponent };
//# sourceMappingURL=igx-brush-scale-component.js.map