/
index.ts
18 lines (15 loc) · 1.25 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { registerElement, registerNativeConfigElement, NativeElementPropType, NativeElementNode, NativeElementPropConfig } from 'svelte-native/dom'
import { NativeViewElementNode } from "svelte-native/dom";
import { RadRadialGauge, RadialScale, RadialNeedle, RadialBarIndicator, ScaleStyle, BarIndicatorStyle } from 'nativescript-ui-gauge';
export default class Gauges {
static register() {
const registerConfigElement = (tag: string, native: new () => any, setsParentProp: string = null, propconfig: NativeElementPropConfig = {}) =>
registerNativeConfigElement(tag, () => native, setsParentProp, propconfig)
registerElement('radRadialGauge', () => new NativeViewElementNode<RadRadialGauge>('radRadialGauge', RadRadialGauge, null, { "scales": NativeElementPropType.ObservableArray } ));
registerConfigElement('radialScale', RadialScale, "scales", { "indicators": NativeElementPropType.ObservableArray })
registerConfigElement('radialNeedle', RadialNeedle, "indicators")
registerConfigElement('radialBarIndicator', RadialBarIndicator, "indicators")
registerConfigElement('scaleStyle', ScaleStyle, "scaleStyle")
registerConfigElement('barIndicatorStyle', BarIndicatorStyle, "indicatorStyle")
}
}