import { ObservableArray } from '@nativescript/core';
import { RadRadialGauge, RadialScale, ScaleStyle, RadialBarIndicator, BarIndicatorStyle, RadialNeedle, TitleStyle, SubtitleStyle, NeedleStyle } from '..';
const RadGaugePlugin = {
    install(Vue) {
        Vue.registerElement('RadRadialGauge', () => RadRadialGauge);
        Vue.registerElement('RadialScale', () => RadialScale);
        Vue.registerElement('ScaleStyle', () => ScaleStyle);
        Vue.registerElement('RadialBarIndicator', () => RadialBarIndicator);
        Vue.registerElement('BarIndicatorStyle', () => BarIndicatorStyle);
        Vue.registerElement('RadialNeedle', () => RadialNeedle);
        Vue.registerElement('TitleStyle', () => TitleStyle);
        Vue.registerElement('SubtitleStyle', () => SubtitleStyle);
        Vue.registerElement('NeedleStyle', () => NeedleStyle);
        Vue.directive('tkRadialGaugeScales', {
            inserted: function (el) {
                let scale = el._nativeView;
                let gauge = el.parentNode._nativeView;
                if (gauge.scales) {
                    gauge.scales.push(scale);
                }
                else {
                    gauge.scales = new ObservableArray([scale]);
                }
            }
        });
        Vue.directive('tkRadialScaleIndicators', {
            inserted: function (el) {
                let barIndicator = el._nativeView;
                let scale = el.parentNode._nativeView;
                if (scale.indicators) {
                    scale.indicators.push(barIndicator);
                }
                else {
                    scale.indicators = new ObservableArray([barIndicator]);
                }
            }
        });
        Vue.directive('tkRadialBarIndicatorStyle', {
            inserted: function (el) {
                el.parentNode._nativeView.indicatorStyle = el._nativeView;
            }
        });
        Vue.directive('tkRadialGaugeTitleStyle', {
            inserted: function (el) {
                el.parentNode._nativeView.titleStyle = el._nativeView;
            }
        });
        Vue.directive('tkRadialGaugeSubtitleStyle', {
            inserted: function (el) {
                el.parentNode._nativeView.subtitleStyle = el._nativeView;
            }
        });
        Vue.directive('tkRadialNeedleStyle', {
            inserted: function (el) {
                el.parentNode._nativeView.needleStyle = el._nativeView;
            }
        });
        Vue.directive('tkRadialScaleStyle', {
            inserted: function (el) {
                el.parentNode._nativeView.scaleStyle = el._nativeView;
            }
        });
    }
};
export default RadGaugePlugin;
//# sourceMappingURL=index.js.map