import { View, Property, ViewBase, booleanConverter, ObservableArray, Color, removeWeakEventListener, addWeakEventListener, Builder } from '@nativescript/core';
import * as gaugesInitializersImpl from './initializers/gauges-initializers';
export var GaugeScaleLayoutMode;
(function (GaugeScaleLayoutMode) {
    GaugeScaleLayoutMode["Outer"] = "Outer";
    GaugeScaleLayoutMode["Inner"] = "Inner";
})(GaugeScaleLayoutMode || (GaugeScaleLayoutMode = {}));
export var GaugeIndicatorCapMode;
(function (GaugeIndicatorCapMode) {
    GaugeIndicatorCapMode["Round"] = "Round";
    GaugeIndicatorCapMode["Edge"] = "Edge";
})(GaugeIndicatorCapMode || (GaugeIndicatorCapMode = {}));
/*
 * Defines the known properties that are collections. This is used by the XML parser.
 */
Builder.knownCollections.add('scales').add('indicators');
///////////////////////////////////////////////////
export class RadGauge extends View {
    constructor() {
        super();
        this.on('bindingContextChange', this.bindingContextChanged, this);
    }
    onScalesPropertyChanged(oldValue, newValue) {
        this._onScalesPropertyChanged(oldValue, newValue);
    }
    onTitlePropertyChanged(oldValue, newValue) {
        this._onTitlePropertyChanged(oldValue, newValue);
    }
    onSubtitlePropertyChanged(oldValue, newValue) {
        this._onSubtitlePropertyChanged(oldValue, newValue);
    }
    onFillColorPropertyChanged(oldValue, newValue) {
        this._onFillColorPropertyChanged(oldValue, newValue);
    }
    bindingContextChanged(data) {
        if (this.scales) {
            for (let i = 0; i < this.scales.length; i++) {
                let scale = this.scales.getItem(i);
                scale.bindingContext = data.value;
                if (scale.indicators) {
                    for (let j = 0; j < scale.indicators.length; j++) {
                        let indicator = scale.indicators.getItem(j);
                        indicator.bindingContext = data.value;
                    }
                }
            }
        }
        if (this.titleStyle) {
            this.titleStyle.bindingContext = data.value;
        }
        if (this.subtitleStyle) {
            this.subtitleStyle.bindingContext = data.value;
        }
    }
    _onScalesPropertyChanged(oldValue, newValue) {
        if (!this.nativeObject) {
            return;
        }
        if (oldValue) {
            for (let i = 0; i < oldValue.length; i++) {
                let scale = oldValue.getItem(i);
                scale.owner = undefined;
            }
            removeWeakEventListener(oldValue, ObservableArray.changeEvent, this.scalesCollectionChanged, this);
        }
        if (newValue) {
            addWeakEventListener(newValue, ObservableArray.changeEvent, this.scalesCollectionChanged, this);
        }
        this.reloadScales();
    }
    scalesCollectionChanged(eventData) {
        if (this && typeof this.reloadScales === 'function') {
            this.reloadScales();
        }
    }
    reloadScales() {
        this.nativeObject.removeAllScales();
        for (let i = 0; i < this.scales.length; i++) {
            let scale = this.scales.getItem(i);
            scale.owner = this;
            this.nativeObject.addScale(scale.nativeObject);
        }
    }
    onTitleStylePropertyChanged(oldValue, newValue) {
        this._onTitleStylePropertyChanged(oldValue, newValue);
    }
    onSubtitleStylePropertyChanged(oldValue, newValue) {
        this._onSubtitleStylePropertyChanged(oldValue, newValue);
    }
    _onTitlePropertyChanged(oldValue, newValue) {
        this.initializer.onTitleChanged(oldValue, newValue, this);
    }
    _onSubtitlePropertyChanged(oldValue, newValue) {
        this.initializer.onSubtitleChanged(oldValue, newValue, this);
    }
    _onFillColorPropertyChanged(oldValue, newValue) { }
    _onTitleStylePropertyChanged(oldValue, newValue) {
        this.initializer.onTitleStyleChanged(oldValue, newValue, this);
    }
    _onSubtitleStylePropertyChanged(oldValue, newValue) {
        this.initializer.onSubtitleStyleChanged(oldValue, newValue, this);
    }
    get nativeObject() {
        return undefined;
    }
    get _nativeView() {
        return undefined;
    }
    get initializer() {
        if (!this._initializer) {
            this._initializer = new gaugesInitializersImpl.RadGaugeValueMapper();
        }
        return this._initializer;
    }
    _addArrayFromBuilder(name, value) {
        if (name === 'scales') {
            this.scales = new ObservableArray(value);
        }
    }
}
RadGauge.scalesProperty = new Property({
    name: 'scales',
    defaultValue: undefined,
    valueChanged: (target, oldValue, newValue) => {
        target.onScalesPropertyChanged(oldValue, newValue);
    }
});
RadGauge.titleProperty = new Property({
    name: 'title',
    defaultValue: undefined,
    valueChanged: (target, oldValue, newValue) => {
        target.onTitlePropertyChanged(oldValue, newValue);
    }
});
RadGauge.subtitleProperty = new Property({
    name: 'subtitle',
    defaultValue: undefined,
    valueChanged: (target, oldValue, newValue) => {
        target.onSubtitlePropertyChanged(oldValue, newValue);
    }
});
RadGauge.fillColorProperty = new Property({
    name: 'fillColor',
    defaultValue: undefined,
    equalityComparer: Color.equals,
    valueConverter: v => new Color(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onFillColorPropertyChanged(oldValue, newValue);
    }
});
RadGauge.titleStyleProperty = new Property({
    name: 'titleStyle',
    defaultValue: undefined,
    valueChanged: (target, oldValue, newValue) => {
        target.onTitleStylePropertyChanged(oldValue, newValue);
    }
});
RadGauge.subtitleStyleProperty = new Property({
    name: 'subtitleStyle',
    defaultValue: undefined,
    valueChanged: (target, oldValue, newValue) => {
        target.onSubtitleStylePropertyChanged(oldValue, newValue);
    }
});
RadGauge.scalesProperty.register(RadGauge);
RadGauge.titleProperty.register(RadGauge);
RadGauge.subtitleProperty.register(RadGauge);
RadGauge.fillColorProperty.register(RadGauge);
RadGauge.titleStyleProperty.register(RadGauge);
RadGauge.subtitleStyleProperty.register(RadGauge);
////////////////////////////////////////////////////
export class RadRadialGauge extends RadGauge {
}
///////////////////////////////////////////////////
export class GaugeScale extends ViewBase {
    constructor() {
        super();
        this.on('bindingContextChange', this.bindingContextChanged, this);
    }
    bindingContextChanged(data) {
        if (this.scaleStyle) {
            this.scaleStyle.bindingContext = data.value;
        }
    }
    onIndicatorsPropertyChanged(oldValue, newValue) {
        this._onIndicatorsPropertyChanged(oldValue, newValue);
    }
    onMinimumPropertyChanged(oldValue, newValue) {
        this._onMinimumPropertyChanged(oldValue, newValue);
    }
    onMaximumPropertyChanged(oldValue, newValue) {
        this._onMaximumPropertyChanged(oldValue, newValue);
    }
    onScaleStylePropertyChanged(oldValue, newValue) {
        this._onScaleStylePropertyChanged(oldValue, newValue);
    }
    _onIndicatorsPropertyChanged(oldValue, newValue) {
        this.initializer.onIndicatorsChange(oldValue, newValue, this);
    }
    _onMinimumPropertyChanged(oldValue, newValue) {
        this.initializer.onMinimumChanged(oldValue, newValue, this);
    }
    _onMaximumPropertyChanged(oldValue, newValue) {
        this.initializer.onMaximumChanged(oldValue, newValue, this);
    }
    _onScaleStylePropertyChanged(oldValue, newValue) {
        this.initializer.onScaleStyleChanged(oldValue, newValue, this);
    }
    _addArrayFromBuilder(name, value) {
        if (name === 'indicators') {
            this.indicators = new ObservableArray(value);
        }
    }
    indicatorsCollectionChanged(eventData) {
        if (this && this.initializer) {
            this.initializer.reloadIndicators(this);
        }
    }
    // @ts-ignore
    get android() {
        return undefined;
    }
    // @ts-ignore
    get ios() {
        return undefined;
    }
    get nativeObject() {
        return undefined;
    }
    get _nativeView() {
        return undefined;
    }
    get initializer() {
        if (!this._initializer) {
            this._initializer = new gaugesInitializersImpl.GaugeScaleValueMapper();
        }
        return this._initializer;
    }
    get owner() {
        return this._owner;
    }
    set owner(value) {
        this._owner = value;
    }
}
GaugeScale.indicatorsProperty = new Property({
    name: 'indicators',
    defaultValue: undefined,
    valueChanged: (target, oldValue, newValue) => {
        target.onIndicatorsPropertyChanged(oldValue, newValue);
    }
});
GaugeScale.minimumProperty = new Property({
    name: 'minimum',
    defaultValue: 0,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onMinimumPropertyChanged(oldValue, newValue);
    }
});
GaugeScale.maximumProperty = new Property({
    name: 'maximum',
    defaultValue: 100,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onMaximumPropertyChanged(oldValue, newValue);
    }
});
GaugeScale.scaleStyleProperty = new Property({
    name: 'scaleStyle',
    defaultValue: undefined,
    valueChanged: (target, oldValue, newValue) => {
        target.onScaleStylePropertyChanged(oldValue, newValue);
    }
});
GaugeScale.indicatorsProperty.register(GaugeScale);
GaugeScale.minimumProperty.register(GaugeScale);
GaugeScale.maximumProperty.register(GaugeScale);
GaugeScale.scaleStyleProperty.register(GaugeScale);
//////////////////////////////////////////////////////////
export class RadialScale extends GaugeScale {
    onStartAnglePropertyChanged(oldValue, newValue) {
        this._onStartAnglePropertyChanged(oldValue, newValue);
    }
    onSweepAnglePropertyChanged(oldValue, newValue) {
        this._onSweepAnglePropertyChanged(oldValue, newValue);
    }
    onRadiusPropertyChanged(oldValue, newValue) {
        this._onRadiusPropertyChanged(oldValue, newValue);
    }
    _onStartAnglePropertyChanged(oldValue, newValue) { }
    _onSweepAnglePropertyChanged(oldValue, newValue) { }
    _onRadiusPropertyChanged(oldValue, newValue) { }
}
RadialScale.startAngleProperty = new Property({
    name: 'startAngle',
    defaultValue: 135,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onStartAnglePropertyChanged(oldValue, newValue);
    }
});
RadialScale.sweepAngleProperty = new Property({
    name: 'sweepAngle',
    defaultValue: 270,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onSweepAnglePropertyChanged(oldValue, newValue);
    }
});
RadialScale.radiusProperty = new Property({
    name: 'radius',
    defaultValue: 1,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onRadiusPropertyChanged(oldValue, newValue);
    }
});
RadialScale.startAngleProperty.register(RadialScale);
RadialScale.sweepAngleProperty.register(RadialScale);
RadialScale.radiusProperty.register(RadialScale);
/////////////////////////////////////////////////////////////
export class GaugeIndicator extends ViewBase {
    get initializer() {
        return undefined;
    }
    onIsAnimatedPropertyChanged(oldValue, newValue) {
        this._onIsAnimatedPropertyChanged(oldValue, newValue);
    }
    onAnimationDurationPropertyChanged(oldValue, newValue) {
        this._onAnimationDurationPropertyChanged(oldValue, newValue);
    }
    _onIsAnimatedPropertyChanged(oldValue, newValue) {
        this.initializer.onIsAnimatedChanged(oldValue, newValue, this);
    }
    _onAnimationDurationPropertyChanged(oldValue, newValue) {
        this.initializer.onAnimationDurationChanged(oldValue, newValue, this);
    }
    // @ts-ignore
    get ios() {
        return undefined;
    }
    // @ts-ignore
    get android() {
        return undefined;
    }
    set owner(value) {
        this._owner = value;
    }
    get nativeObject() {
        return undefined;
    }
    get _nativeView() {
        return undefined;
    }
}
GaugeIndicator.isAnimatedProperty = new Property({
    name: 'isAnimated',
    defaultValue: false,
    valueConverter: booleanConverter,
    valueChanged: (target, oldValue, newValue) => {
        target.onIsAnimatedPropertyChanged(oldValue, newValue);
    }
});
GaugeIndicator.animationDurationProperty = new Property({
    name: 'animationDuration',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onAnimationDurationPropertyChanged(oldValue, newValue);
    }
});
GaugeIndicator.isAnimatedProperty.register(GaugeIndicator);
GaugeIndicator.animationDurationProperty.register(GaugeIndicator);
///////////////////////////////////////////////////////////////
export class RadialNeedle extends GaugeIndicator {
    constructor() {
        super();
        this.on('bindingContextChange', this.bindingContextChanged, this);
    }
    bindingContextChanged(data) {
        if (this.needleStyle) {
            this.needleStyle.bindingContext = data.value;
        }
    }
    onNeedleStylePropertyChanged(oldValue, newValue) {
        this._onNeedleStylePropertyChanged(oldValue, newValue);
    }
    onValuePropertyChanged(oldValue, newValue) {
        this._onValuePropertyChanged(oldValue, newValue);
    }
    _onNeedleStylePropertyChanged(oldValue, newValue) {
        this.initializer.onNeedleStyleChanged(oldValue, newValue, this);
    }
    _onValuePropertyChanged(oldValue, newValue) { }
    get initializer() {
        if (!this._initializer) {
            this._initializer = new gaugesInitializersImpl.NeedleIndicatorValueMapper();
        }
        return this._initializer;
    }
}
RadialNeedle.needleStyleProperty = new Property({
    name: 'needleStyle',
    defaultValue: undefined,
    valueChanged: (target, oldValue, newValue) => {
        target.onNeedleStylePropertyChanged(oldValue, newValue);
    }
});
RadialNeedle.valueProperty = new Property({
    name: 'value',
    defaultValue: 0,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onValuePropertyChanged(oldValue, newValue);
    }
});
RadialNeedle.needleStyleProperty.register(RadialNeedle);
RadialNeedle.valueProperty.register(RadialNeedle);
/////////////////////////////////////////////////////////////
export class BarIndicator extends GaugeIndicator {
    constructor() {
        super();
        this.on('bindingContextChange', this.bindingContextChanged, this);
    }
    bindingContextChanged(data) {
        if (this.indicatorStyle) {
            this.indicatorStyle.bindingContext = data.value;
        }
    }
    onIndicatorStylePropertyChanged(oldValue, newValue) {
        this._onIndicatorStyleChanged(oldValue, newValue);
    }
    onMinimumPropertyChanged(oldValue, newValue) {
        this._onMinimumPropertyChanged(oldValue, newValue);
    }
    onMaximumPropertyChanged(oldValue, newValue) {
        this._onMaximumPropertyChanged(oldValue, newValue);
    }
    onLocationPropertyChanged(oldValue, newValue) {
        this._onLocationPropertyChanged(oldValue, newValue);
    }
    onAnimationStartValueChanged(oldValue, newValue) {
        this._onAnimationStartValueChanged(oldValue, newValue);
    }
    _onIndicatorStyleChanged(oldValue, newValue) {
        this.initializer.onIndicatorStyleChanged(oldValue, newValue, this);
    }
    _onMinimumPropertyChanged(oldValue, newValue) {
        this.initializer.onMinimumValueChanged(oldValue, newValue, this);
    }
    _onMaximumPropertyChanged(oldValue, newValue) {
        this.initializer.onMaximumValueChanged(oldValue, newValue, this);
    }
    _onLocationPropertyChanged(oldValue, newValue) {
        this.initializer.onLocationChanged(oldValue, newValue, this);
    }
    _onAnimationStartValueChanged(oldValue, newValue) { }
    get initializer() {
        if (!this._initializer) {
            this._initializer = new gaugesInitializersImpl.BarIndicatorValueMapper();
        }
        return this._initializer;
    }
}
BarIndicator.indicatorStyleProperty = new Property({
    name: 'indicatorStyle',
    defaultValue: undefined,
    valueChanged: (target, oldValue, newValue) => {
        target.onIndicatorStylePropertyChanged(oldValue, newValue);
    }
});
BarIndicator.minimumProperty = new Property({
    name: 'minimum',
    defaultValue: 0,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onMinimumPropertyChanged(oldValue, newValue);
    }
});
BarIndicator.maximumProperty = new Property({
    name: 'maximum',
    defaultValue: 0,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onMaximumPropertyChanged(oldValue, newValue);
    }
});
BarIndicator.locationProperty = new Property({
    name: 'location',
    defaultValue: 1,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onLocationPropertyChanged(oldValue, newValue);
    }
});
BarIndicator.animationStartValueProperty = new Property({
    name: 'animationStartValue',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onAnimationStartValueChanged(oldValue, newValue);
    }
});
BarIndicator.indicatorStyleProperty.register(BarIndicator);
BarIndicator.minimumProperty.register(BarIndicator);
BarIndicator.maximumProperty.register(BarIndicator);
BarIndicator.locationProperty.register(BarIndicator);
BarIndicator.animationStartValueProperty.register(BarIndicator);
/////////////////////////////////////////////////////////////////
export class RadialBarIndicator extends BarIndicator {
}
////////////////////////// STYLES
export class GaugeStyleBase extends ViewBase {
    onFillColorPropertyChanged(oldValue, newValue) {
        this._onFillColorPropertyChanged(oldValue, newValue);
    }
    onStrokeColorPropertyChanged(oldValue, newValue) {
        this._onStrokeColorPropertyChanged(oldValue, newValue);
    }
    onStrokeWidthPropertyChanged(oldValue, newValue) {
        this._onStrokeWidthPropertyChanged(oldValue, newValue);
    }
    // TODO implement common setting of stroke and fill because of repetitive code;
    _onFillColorPropertyChanged(oldValue, newValue) { }
    _onStrokeColorPropertyChanged(oldValue, newValue) { }
    _onStrokeWidthPropertyChanged(oldValue, newValue) { }
    get owner() {
        return this._owner;
    }
    set owner(value) {
        this._owner = value;
    }
    shouldUpdateNativeObject() {
        if (!this.owner || !this.owner.nativeObject) {
            return false;
        }
        return true;
    }
}
GaugeStyleBase.fillColorProperty = new Property({
    name: 'fillColor',
    defaultValue: undefined,
    equalityComparer: Color.equals,
    valueConverter: v => new Color(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onFillColorPropertyChanged(oldValue, newValue);
    }
});
GaugeStyleBase.strokeColorProperty = new Property({
    name: 'strokeColor',
    defaultValue: undefined,
    equalityComparer: Color.equals,
    valueConverter: v => new Color(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onStrokeColorPropertyChanged(oldValue, newValue);
    }
});
GaugeStyleBase.strokeWidthProperty = new Property({
    name: 'strokeWidth',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onStrokeWidthPropertyChanged(oldValue, newValue);
    }
});
GaugeStyleBase.fillColorProperty.register(GaugeStyleBase);
GaugeStyleBase.strokeColorProperty.register(GaugeStyleBase);
GaugeStyleBase.strokeWidthProperty.register(GaugeStyleBase);
//////////////////////////////////////////////////////////////////
export class TitleStyle extends GaugeStyleBase {
    onTextSizePropertyChanged(oldValue, newValue) {
        this._onTextSizePropertyChanged(oldValue, newValue);
    }
    onTextColorPropertyChanged(oldValue, newValue) {
        this._onTextColorPropertyChanged(oldValue, newValue);
    }
    onHorizontalOffsetPropertyChanged(oldValue, newValue) {
        this._onHorizontalOffsetPropertyChanged(oldValue, newValue);
    }
    onVerticalOffsetPropertyChanged(oldValue, newValue) {
        this._onVerticalOffsetPropertyChanged(oldValue, newValue);
    }
    _onTextSizePropertyChanged(oldValue, newValue) { }
    _onTextColorPropertyChanged(oldValue, newValue) { }
    _onHorizontalOffsetPropertyChanged(oldValue, newValue) { }
    _onVerticalOffsetPropertyChanged(oldValue, newValue) { }
}
TitleStyle.textSizeProperty = new Property({
    name: 'textSize',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onTextSizePropertyChanged(oldValue, newValue);
    }
});
TitleStyle.textColorProperty = new Property({
    name: 'textColor',
    defaultValue: undefined,
    equalityComparer: Color.equals,
    valueConverter: v => new Color(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onTextColorPropertyChanged(oldValue, newValue);
    }
});
TitleStyle.horizontalOffsetProperty = new Property({
    name: 'horizontalOffset',
    defaultValue: 0,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onHorizontalOffsetPropertyChanged(oldValue, newValue);
    }
});
TitleStyle.verticalOffsetProperty = new Property({
    name: 'verticalOffset',
    defaultValue: 0,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onVerticalOffsetPropertyChanged(oldValue, newValue);
    }
});
TitleStyle.textSizeProperty.register(TitleStyle);
TitleStyle.textColorProperty.register(TitleStyle);
TitleStyle.horizontalOffsetProperty.register(TitleStyle);
TitleStyle.verticalOffsetProperty.register(TitleStyle);
/////////////////////////////////////////////////////////////////////
export class SubtitleStyle extends TitleStyle {
}
export class ScaleStyle extends GaugeStyleBase {
    onLineColorPropertyChanged(oldValue, newValue) {
        this._onLineColorPropertyChanged(oldValue, newValue);
    }
    _onLineColorPropertyChanged(oldValue, newValue) { }
    onLineThicknessPropertyChanged(oldValue, newValue) {
        this._onLineThicknessPropertyChanged(oldValue, newValue);
    }
    _onLineThicknessPropertyChanged(oldValue, newValue) { }
    onTicksVisiblePropertyChanged(oldValue, newValue) {
        this._onTicksVisiblePropertyChanged(oldValue, newValue);
    }
    _onTicksVisiblePropertyChanged(oldValue, newValue) { }
    onMajorTicksCountPropertyChanged(oldValue, newValue) {
        this._onMajorTicksCountPropertyChanged(oldValue, newValue);
    }
    _onMajorTicksCountPropertyChanged(oldValue, newValue) { }
    onMinorTicksCountPropertyChanged(oldValue, newValue) {
        this._onMinorTicksCountPropertyChanged(oldValue, newValue);
    }
    _onMinorTicksCountPropertyChanged(oldValue, newValue) { }
    onТicksOffsetPropertyChanged(oldValue, newValue) {
        this._onТicksOffsetPropertyChanged(oldValue, newValue);
    }
    _onТicksOffsetPropertyChanged(oldValue, newValue) { }
    onTicksLayoutModePropertyChanged(oldValue, newValue) {
        this._onTicksLayoutModePropertyChanged(oldValue, newValue);
    }
    _onTicksLayoutModePropertyChanged(oldValue, newValue) { }
    onMajorTicksWidthPropertyChanged(oldValue, newValue) {
        this._onMajorTicksWidthPropertyChanged(oldValue, newValue);
    }
    _onMajorTicksWidthPropertyChanged(oldValue, newValue) { }
    onMinorTicksWidthPropertyChanged(oldValue, newValue) {
        this._onMinorTicksWidthPropertyChanged(oldValue, newValue);
    }
    _onMinorTicksWidthPropertyChanged(oldValue, newValue) { }
    onMajorTicksLengthPropertyChanged(oldValue, newValue) {
        this._onMajorTicksLengthPropertyChanged(oldValue, newValue);
    }
    _onMajorTicksLengthPropertyChanged(oldValue, newValue) { }
    onMinorTicksLengthPropertyChanged(oldValue, newValue) {
        this._onMinorTicksLengthPropertyChanged(oldValue, newValue);
    }
    _onMinorTicksLengthPropertyChanged(oldValue, newValue) { }
    onMajorTicksStrokeColorPropertyChanged(oldValue, newValue) {
        this._onMajorTicksStrokeColorPropertyChanged(oldValue, newValue);
    }
    _onMajorTicksStrokeColorPropertyChanged(oldValue, newValue) { }
    onМinorTicksStrokeColorPropertyChanged(oldValue, newValue) {
        this._onМinorTicksStrokeColorPropertyChanged(oldValue, newValue);
    }
    _onМinorTicksStrokeColorPropertyChanged(oldValue, newValue) { }
    onMajorTicksFillColorPropertyChanged(oldValue, newValue) {
        this._onMajorTicksFillColorPropertyChanged(oldValue, newValue);
    }
    _onMajorTicksFillColorPropertyChanged(oldValue, newValue) { }
    onMinorTicksFillColorPropertyChanged(oldValue, newValue) {
        this._onMinorTicksFillColorPropertyChanged(oldValue, newValue);
    }
    _onMinorTicksFillColorPropertyChanged(oldValue, newValue) { }
    onМajorTicksStrokeWidthPropertyChanged(oldValue, newValue) {
        this._onМajorTicksStrokeWidthPropertyChanged(oldValue, newValue);
    }
    _onМajorTicksStrokeWidthPropertyChanged(oldValue, newValue) { }
    onМinorTicksStrokeWidthPropertyChanged(oldValue, newValue) {
        this._onМinorTicksStrokeWidthPropertyChanged(oldValue, newValue);
    }
    _onМinorTicksStrokeWidthPropertyChanged(oldValue, newValue) { }
    onLabelsVisiblePropertyChanged(oldValue, newValue) {
        this._onLabelsVisiblePropertyChanged(oldValue, newValue);
    }
    _onLabelsVisiblePropertyChanged(oldValue, newValue) { }
    onLabelsCountPropertyChanged(oldValue, newValue) {
        this._onLabelsCountPropertyChanged(oldValue, newValue);
    }
    _onLabelsCountPropertyChanged(oldValue, newValue) { }
    onLabelsLayoutModePropertyChanged(oldValue, newValue) {
        this._onLabelsLayoutModePropertyChanged(oldValue, newValue);
    }
    _onLabelsLayoutModePropertyChanged(oldValue, newValue) { }
    onLabelsOffsetPropertyChanged(oldValue, newValue) {
        this._onLabelsOffsetPropertyChanged(oldValue, newValue);
    }
    _onLabelsOffsetPropertyChanged(oldValue, newValue) { }
    onLabelsSizePropertyChanged(oldValue, newValue) {
        this._onLabelsSizePropertyChanged(oldValue, newValue);
    }
    _onLabelsSizePropertyChanged(oldValue, newValue) { }
    onLabelsColorPropertyChanged(oldValue, newValue) {
        this._onLabelsColorPropertyChanged(oldValue, newValue);
    }
    _onLabelsColorPropertyChanged(oldValue, newValue) { }
}
ScaleStyle.lineColorProperty = new Property({
    name: 'lineColor',
    defaultValue: undefined,
    equalityComparer: Color.equals,
    valueConverter: v => new Color(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onLineColorPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.lineThicknessProperty = new Property({
    name: 'lineThickness',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onLineThicknessPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.ticksVisibleProperty = new Property({
    name: 'ticksVisible',
    defaultValue: true,
    valueConverter: booleanConverter,
    valueChanged: (target, oldValue, newValue) => {
        target.onTicksVisiblePropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.majorTicksCountProperty = new Property({
    name: 'majorTicksCount',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onMajorTicksCountPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.minorTicksCountProperty = new Property({
    name: 'minorTicksCount',
    defaultValue: undefined,
    valueConverter: v => parseInt(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onMinorTicksCountPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.ticksOffsetProperty = new Property({
    name: 'ticksOffset',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onТicksOffsetPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.ticksLayoutModeProperty = new Property({
    name: 'ticksLayoutMode',
    defaultValue: undefined,
    valueConverter: value => GaugeScaleLayoutMode[value],
    valueChanged: (target, oldValue, newValue) => {
        target.onTicksLayoutModePropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.majorTicksWidthProperty = new Property({
    name: 'majorTicksWidth',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onMajorTicksWidthPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.minorTicksWidthProperty = new Property({
    name: 'minorTicksWidth',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onMinorTicksWidthPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.majorTicksLengthProperty = new Property({
    name: 'majorTicksLength',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onMajorTicksLengthPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.minorTicksLengthProperty = new Property({
    name: 'minorTicksLength',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onMinorTicksLengthPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.majorTicksStrokeColorProperty = new Property({
    name: 'majorTicksStrokeColor',
    defaultValue: undefined,
    equalityComparer: Color.equals,
    valueConverter: v => new Color(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onMajorTicksStrokeColorPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.minorTicksStrokeColorProperty = new Property({
    name: 'minorTicksStrokeColor',
    defaultValue: undefined,
    equalityComparer: Color.equals,
    valueConverter: v => new Color(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onМinorTicksStrokeColorPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.majorTicksFillColorProperty = new Property({
    name: 'majorTicksFillColor',
    defaultValue: undefined,
    equalityComparer: Color.equals,
    valueConverter: v => new Color(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onMajorTicksFillColorPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.minorTicksFillColorProperty = new Property({
    name: 'minorTicksFillColor',
    defaultValue: undefined,
    equalityComparer: Color.equals,
    valueConverter: v => new Color(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onMinorTicksFillColorPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.majorTicksStrokeWidthProperty = new Property({
    name: 'majorTicksStrokeWidth',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onМajorTicksStrokeWidthPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.minorTicksStrokeWidthProperty = new Property({
    name: 'minorTicksStrokeWidth',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onМinorTicksStrokeWidthPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.labelsVisibleProperty = new Property({
    name: 'labelsVisible',
    defaultValue: true,
    valueConverter: booleanConverter,
    valueChanged: (target, oldValue, newValue) => {
        target.onLabelsVisiblePropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.labelsCountProperty = new Property({
    name: 'labelsCount',
    defaultValue: undefined,
    valueConverter: v => parseInt(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onLabelsCountPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.labelsLayoutModeProperty = new Property({
    name: 'labelsLayoutMode',
    defaultValue: GaugeScaleLayoutMode.Inner,
    valueConverter: value => GaugeScaleLayoutMode[value],
    valueChanged: (target, oldValue, newValue) => {
        target.onLabelsLayoutModePropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.labelsOffsetProperty = new Property({
    name: 'labelsOffset',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onLabelsOffsetPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.labelsSizeProperty = new Property({
    name: 'labelsSize',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onLabelsSizePropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.labelsColorProperty = new Property({
    name: 'labelsColor',
    defaultValue: undefined,
    equalityComparer: Color.equals,
    valueConverter: v => new Color(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onLabelsColorPropertyChanged(oldValue, newValue);
    }
});
ScaleStyle.lineColorProperty.register(ScaleStyle);
ScaleStyle.lineThicknessProperty.register(ScaleStyle);
ScaleStyle.ticksVisibleProperty.register(ScaleStyle);
ScaleStyle.majorTicksCountProperty.register(ScaleStyle);
ScaleStyle.minorTicksCountProperty.register(ScaleStyle);
ScaleStyle.ticksOffsetProperty.register(ScaleStyle);
ScaleStyle.ticksLayoutModeProperty.register(ScaleStyle);
ScaleStyle.majorTicksWidthProperty.register(ScaleStyle);
ScaleStyle.minorTicksWidthProperty.register(ScaleStyle);
ScaleStyle.majorTicksLengthProperty.register(ScaleStyle);
ScaleStyle.minorTicksLengthProperty.register(ScaleStyle);
ScaleStyle.majorTicksStrokeColorProperty.register(ScaleStyle);
ScaleStyle.minorTicksStrokeColorProperty.register(ScaleStyle);
ScaleStyle.majorTicksFillColorProperty.register(ScaleStyle);
ScaleStyle.minorTicksFillColorProperty.register(ScaleStyle);
ScaleStyle.majorTicksStrokeWidthProperty.register(ScaleStyle);
ScaleStyle.minorTicksStrokeWidthProperty.register(ScaleStyle);
ScaleStyle.labelsVisibleProperty.register(ScaleStyle);
ScaleStyle.labelsCountProperty.register(ScaleStyle);
ScaleStyle.labelsLayoutModeProperty.register(ScaleStyle);
ScaleStyle.labelsOffsetProperty.register(ScaleStyle);
ScaleStyle.labelsSizeProperty.register(ScaleStyle);
ScaleStyle.labelsColorProperty.register(ScaleStyle);
//////////////////////////////////////////////////////
export class IndicatorStyle extends GaugeStyleBase {
}
//////////////////////////////////////////////////
export class NeedleStyle extends IndicatorStyle {
    onLengthPropertyChanged(oldValue, newValue) {
        this._onLengthPropertyChanged(oldValue, newValue);
    }
    _onLengthPropertyChanged(oldValue, newValue) { }
    onBottomWidthPropertyChanged(oldValue, newValue) {
        this._onBottomWidthPropertyChanged(oldValue, newValue);
    }
    _onBottomWidthPropertyChanged(oldValue, newValue) { }
    onTopWidthPropertyChanged(oldValue, newValue) {
        this._onTopWidthPropertyChanged(oldValue, newValue);
    }
    _onTopWidthPropertyChanged(oldValue, newValue) { }
    onCircleRadiusPropertyChanged(oldValue, newValue) {
        this._onCircleRadiusPropertyChanged(oldValue, newValue);
    }
    _onCircleRadiusPropertyChanged(oldValue, newValue) { }
    onCircleInnerRadiusPropertyChanged(oldValue, newValue) {
        this._onCircleInnerRadiusPropertyChanged(oldValue, newValue);
    }
    _onCircleInnerRadiusPropertyChanged(oldValue, newValue) { }
    onOffsetPropertyChanged(oldValue, newValue) {
        this._onOffsetPropertyChanged(oldValue, newValue);
    }
    _onOffsetPropertyChanged(oldValue, newValue) { }
    onCircleFillColorPropertyChanged(oldValue, newValue) {
        this._onCircleFillColorPropertyChanged(oldValue, newValue);
    }
    _onCircleFillColorPropertyChanged(oldValue, newValue) { }
    onCircleStrokeColorPropertyChanged(oldValue, newValue) {
        this._onCircleStrokeColorPropertyChanged(oldValue, newValue);
    }
    _onCircleStrokeColorPropertyChanged(oldValue, newValue) { }
    onCircleStrokeWidthPropertyChanged(oldValue, newValue) {
        this._onCircleStrokeWidthPropertyChanged(oldValue, newValue);
    }
    _onCircleStrokeWidthPropertyChanged(oldValue, newValue) { }
}
NeedleStyle.lengthProperty = new Property({
    name: 'length',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onLengthPropertyChanged(oldValue, newValue);
    }
});
NeedleStyle.bottomWidthProperty = new Property({
    name: 'bottomWidth',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onBottomWidthPropertyChanged(oldValue, newValue);
    }
});
NeedleStyle.topWidthProperty = new Property({
    name: 'topWidth',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onTopWidthPropertyChanged(oldValue, newValue);
    }
});
NeedleStyle.circleRadiusProperty = new Property({
    name: 'circleRadius',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onCircleRadiusPropertyChanged(oldValue, newValue);
    }
});
NeedleStyle.circleInnerRadiusProperty = new Property({
    name: 'circleInnerRadius',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onCircleInnerRadiusPropertyChanged(oldValue, newValue);
    }
});
NeedleStyle.offsetProperty = new Property({
    name: 'offset',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onOffsetPropertyChanged(oldValue, newValue);
    }
});
NeedleStyle.circleFillColorProperty = new Property({
    name: 'circleFillColor',
    defaultValue: undefined,
    equalityComparer: Color.equals,
    valueConverter: v => new Color(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onCircleFillColorPropertyChanged(oldValue, newValue);
    }
});
NeedleStyle.circleStrokeColorProperty = new Property({
    name: 'circleStrokeColor',
    defaultValue: undefined,
    equalityComparer: Color.equals,
    valueConverter: v => new Color(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onCircleStrokeColorPropertyChanged(oldValue, newValue);
    }
});
NeedleStyle.circleStrokeWidthProperty = new Property({
    name: 'circleStrokeWidth',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onCircleStrokeWidthPropertyChanged(oldValue, newValue);
    }
});
NeedleStyle.lengthProperty.register(NeedleStyle);
NeedleStyle.bottomWidthProperty.register(NeedleStyle);
NeedleStyle.topWidthProperty.register(NeedleStyle);
NeedleStyle.circleRadiusProperty.register(NeedleStyle);
NeedleStyle.circleInnerRadiusProperty.register(NeedleStyle);
NeedleStyle.offsetProperty.register(NeedleStyle);
NeedleStyle.circleFillColorProperty.register(NeedleStyle);
NeedleStyle.circleStrokeColorProperty.register(NeedleStyle);
NeedleStyle.circleStrokeWidthProperty.register(NeedleStyle);
//////////////////////////////////////////////////////////////
export class BarIndicatorStyle extends IndicatorStyle {
    onCapPropertyChanged(oldValue, newValue) {
        this._onCapPropertyChanged(oldValue, newValue);
    }
    _onCapPropertyChanged(oldValue, newValue) { }
    onBarWidthPropertyChanged(oldValue, newValue) {
        this._onBarWidthPropertyChanged(oldValue, newValue);
    }
    _onBarWidthPropertyChanged(oldValue, newValue) { }
}
BarIndicatorStyle.capProperty = new Property({
    name: 'cap',
    defaultValue: undefined,
    valueConverter: value => GaugeIndicatorCapMode[value],
    valueChanged: (target, oldValue, newValue) => {
        target.onCapPropertyChanged(oldValue, newValue);
    }
});
BarIndicatorStyle.barWidthProperty = new Property({
    name: 'barWidth',
    defaultValue: undefined,
    valueConverter: v => parseFloat(v),
    valueChanged: (target, oldValue, newValue) => {
        target.onBarWidthPropertyChanged(oldValue, newValue);
    }
});
BarIndicatorStyle.capProperty.register(BarIndicatorStyle);
BarIndicatorStyle.barWidthProperty.register(BarIndicatorStyle);
//# sourceMappingURL=common.js.map