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
.
Field | Type | Description |
---|---|---|
hex | string? | The hex representation of the color |
alpha | number? | The alpha of the color for opacity |
ValueFile
This is the value of a field with the type file
.
Field | Type | Description |
---|---|---|
filename | string? | The filename |
src | string? | Relative image url without the host |
localSrc | string? | Image url with the localhost of MoBro included |
ValueMetricConfig
This is how a field with the type metric
stores the selection in the background.
Field | Type | Description |
---|---|---|
id | string? | The id of the metric |
plugin | string? | The id of the plugin the metric belongs to |
categories | string[]? | The ids of the categories that were selected to get to the metric in the select |
options | ValueMetricOptions | The options for the metric, like conversions |
ValueMetricOptions
These are the options for a ValueMetricConfig
.
Field | Type | Description |
---|---|---|
conversionUnit | string | The 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.
Field | Type | Description |
---|---|---|
label | string | The human readable option label |
value | string | The value of the option |
ItemPosition
This is the absolute position in pixels of a widget (dashboard item).
Field | Type | Description |
---|---|---|
x | number | The absolute position in pixels on the x axis. |
y | number | The absolute position in pixels on the y axis. |
ItemSize
This is the size in pixels of a widget (dashboard item).
Field | Type | Description |
---|---|---|
width | number | The width of the widget in pixels. |
height | number | The height of the widget in pixels. |
Settings
This represents a couple of settings that are defined in MoBro.
Field | Type | Description |
---|---|---|
language | string | The selected language in the app |
theme | string | The selected theme in the app |
timezone | string | The selected timezone in the app |
MetricValueType
type MetricValueType = number | string | null
MetricTypeValueType
type MetricTypeValueType =
| 'Custom'
| 'String'
| 'Numeric'
| 'Duration'
| 'DateTime'
| 'DateOnly'
| 'TimeOnly'
| 'Resource'
MetricUnit
Field | Type | Description |
---|---|---|
label | string | The nice name of the metric unit |
abbreviation | string | The abbreviation of the metric unit |
description | string | The description of the metric unit |
fromBaseFormula | string | The formula to convert to this unit from the base unit |
toBaseFormula | string | The formula to convert this unit to the base unit |
MetricType
Field | Type | Description |
---|---|---|
id | string | The id of the metric type |
label | string | The nice name of the metric type |
description | string | The metric type description |
valueType | MetricTypeValueType | The value type of metrics of this type |
baseUnit | MetricUnit | The base unit of metrics of this type |
units | MetricUnit[] | Other possible units for metrics of this type |
Metric
Field | Type | Description |
---|---|---|
id | string | The id of the metric |
label | string | The nice name of the metric |
description | string | The metric description |
MetricValue
Field | Type | Description |
---|---|---|
id | string | The id of the metric |
valueUpdated | string | The ISO time the value was updated |
valueChanged | string | The ISO time the value was changed |
value | MetricValueType | The value |
ChannelValue
The value of a metric channel. This includes the current metric value and some metadata about the channel.
Field | Type | Description |
---|---|---|
metric | Metric | The metric of this channel value |
type | MetricType | The metric type of this channel value |
unit | MetricUnit | The metric unit this channel value was converted to |
value | MetricValue | The metric value of this channel value |