Skip to main content

Types

The @modbros/dashboard-sdk provides a couple of types. Most of those are shared between the typescript code and the json schemas for the json configuration files.

ValueColor

This is the value of a field with the type color.

FieldTypeDescription
hexstring?The hex representation of the color
alphanumber?The alpha of the color for opacity

ValueFile

This is the value of a field with the type file.

FieldTypeDescription
filenamestring?The filename
srcstring?Relative image url without the host
localSrcstring?Image url with the localhost of MoBro included

ValueMetricConfig

This is how a field with the type metric stores the selection in the background.

FieldTypeDescription
idstring?The id of the metric
pluginstring?The id of the plugin the metric belongs to
categoriesstring[]?The ids of the categories that were selected to get to the metric in the select
optionsValueMetricOptionsThe options for the metric, like conversions

ValueMetricOptions

These are the options for a ValueMetricConfig.

FieldTypeDescription
conversionUnitstringThe abbreviation of the unit the metric should be converted to

ValueOptions

These are the options for a field with the type select. It's an array of objects with the following fields.

FieldTypeDescription
labelstringThe human readable option label
valuestringThe value of the option

ItemPosition

This is the absolute position in pixels of a widget (dashboard item).

FieldTypeDescription
xnumberThe absolute position in pixels on the x axis.
ynumberThe absolute position in pixels on the y axis.

ItemSize

This is the size in pixels of a widget (dashboard item).

FieldTypeDescription
widthnumberThe width of the widget in pixels.
heightnumberThe height of the widget in pixels.

Settings

This represents a couple of settings that are defined in MoBro.

FieldTypeDescription
languagestringThe selected language in the app
themestringThe selected theme in the app
timezonestringThe selected timezone in the app

MetricValueType

type MetricValueType = number | string | null

MetricTypeValueType

type MetricTypeValueType =
| 'Custom'
| 'String'
| 'Numeric'
| 'Duration'
| 'DateTime'
| 'DateOnly'
| 'TimeOnly'
| 'Resource'

MetricUnit

FieldTypeDescription
labelstringThe nice name of the metric unit
abbreviationstringThe abbreviation of the metric unit
descriptionstringThe description of the metric unit
fromBaseFormulastringThe formula to convert to this unit from the base unit
toBaseFormulastringThe formula to convert this unit to the base unit

MetricType

FieldTypeDescription
idstringThe id of the metric type
labelstringThe nice name of the metric type
descriptionstringThe metric type description
valueTypeMetricTypeValueTypeThe value type of metrics of this type
baseUnitMetricUnitThe base unit of metrics of this type
unitsMetricUnit[]Other possible units for metrics of this type

Metric

FieldTypeDescription
idstringThe id of the metric
labelstringThe nice name of the metric
descriptionstringThe metric description

MetricValue

FieldTypeDescription
idstringThe id of the metric
valueUpdatedstringThe ISO time the value was updated
valueChangedstringThe ISO time the value was changed
valueMetricValueTypeThe value

ChannelValue

The value of a metric channel. This includes the current metric value and some metadata about the channel.

FieldTypeDescription
metricMetricThe metric of this channel value
typeMetricTypeThe metric type of this channel value
unitMetricUnitThe metric unit this channel value was converted to
valueMetricValueThe metric value of this channel value