# Relevant Types & Data structures
## WidgetConfigInterface
The `WidgetConfigInterface` TypeScript type defines a configuration object for widgets, with optional properties to customize various aspects of the widget’s data sources, items, dimensions, history fetching options, and styling. Here's a detailed breakdown of each part of this type:
### Properties
- **_sources**:
- Type: `SourceIdentifierInterface[]`
- Description: An optional array of source identifiers, defining the data sources that the widget will use. Each element in the array should adhere to the `SourceIdentifierInterface`.
- **_items**:
- Type: `DataItemIdentifierInterface[]`
- Description: An optional array of data item identifiers, specifying individual data items the widget will display or use. Each element in the array should adhere to the `DataItemIdentifierInterface`.
- **_dimensions**:
- Type: `DataItemDimensionIdentifierInterface[]`
- Description: An optional array of dimension identifiers, representing different dimensions or aspects of the data items. Each element should conform to the `DataItemDimensionIdentifierInterface`.
- **_history**:
- Type: `DataFetchingOptionsInterface`
- Description: An optional object containing options for fetching historical data. This should adhere to the `DataFetchingOptionsInterface`, providing configurations such as aggregation settings and live data fetching options.
- **_style**:
- Type: `{ borderless?: boolean; padding?: number }`
- Description: An optional style object to customize the widget’s appearance.
- `borderless`: An optional boolean indicating whether the widget should be displayed without borders.
- `padding`: An optional number specifying the padding around the widget's content.
- **other options**
- Other config parameters may be provided to customize the widgets indivual behavior. These parameters are widget dependent. A good starting point is to configure a widget in the dashboard an check the network tab of your developer console to see how its configuration looks like.
## SourceIdentifierInterface
String referencing the tag of a data source
## DataItemIdentifierInterface
2-Tupel of strings consisting of a source identifier and an item identifier
`[string, string]`
## DataItemDimensionIdentifierInterface
3-Tupel of 2 strings and a number consisting of a source identifier, an item identifier and an number indicating the item's dimension
`[string, string, number]`
## DataFetchingOptionsInterface
The interface defines a comprehensive set of options for configuring data fetching in a widget. It includes various parameters to handle live data, historical data, aggregation, resolution, filtering, and more. Here's a detailed explanation of each property within the interface:
| **Parameter** | **Type** | **Description** |
|--------------------------------|-----------------------------------------|---------------------------------------------------------------------------------|
| `live` | `boolean` | Specifies whether live data should be fetched. If `true`, the data will be updated in real-time. |
| `historyType` | `"relative" \| "absolute" \| "aggregate"` | Defines the type of historical data to be fetched. Options are `"relative"`, `"absolute"`, and `"aggregate"`. |
| `historyRelativeSnap` | `boolean` | Indicates whether to snap the relative history to specific intervals. |
| `historyRelativeOffset` | `number` | Specifies an offset for the relative history in milliseconds. |
| `start` | `UnixTimestampMilliseconds` | The start timestamp for fetching historical data, in milliseconds since the Unix epoch. |
| `end` | `UnixTimestampMilliseconds` | The end timestamp for fetching historical data, in milliseconds since the Unix epoch. |
| `value` | `number` | Specifies a value used for data fetching, context-dependent. |
| `unit` | `DateUnitInterface` | Defines the unit of time for the `value`, e.g., seconds, minutes, hours. |
| `futureValue` | `number` | Similar to `value`, but for future data points. |
| `futureUnit` | `DateUnitInterface` | Defines the unit of time for `futureValue`. |
| `unitDisableSnapping` | `boolean` | Disables snapping of units to predefined intervals. |
| `limit` | `number` | Limits the number of data points to fetch. |
| `includeLowerBound` | `boolean` | Includes the lower bound in the data fetching range. |
| `includeUpperBound` | `boolean` | Includes the upper bound in the data fetching range. |
| `resolution` | `boolean` | Enables or disables data resolution, which is the process of refining data granularity. |
| `resolutionMode` | `"minmax" \| "drop"` | Defines the mode of resolution. Options are `"minmax"` or `"drop"`. |
| `resolutionMaxValues` | `number` | Sets the maximum number of values after resolution. |
| `aggregation` | `boolean` | Enables or disables data aggregation. |
| `aggregationPots` | `AggregationPotInterface[]` | Specifies the aggregation pots, which are containers or groupings for aggregated data. |
| `aggregationSplits` | `number` | The number of splits for aggregation. |
| `aggregationDateUnit` | `"second" \| "minute" \| "hour" \| "day" \| "week" \| "month" \| "year"` | Defines the unit of time for aggregation. |
| `aggregationSteps` | `DateUnitInterface` | Specifies the steps for aggregation. |
| `aggregationGroup` | `DateUnitGroupedInterface` | Defines how data should be grouped for aggregation. |
| `aggregationOperation` | `AggregationOperationInterface` | Specifies the operation used for aggregation, such as sum, average, etc. |
| `aggregationPipe` | `AggregationPipeInterface` | Defines the pipeline for processing aggregated data. |
| `filter` | `Record<string, DataFetchingFilterInterface \| undefined>` | A record of filters applied to the data fetching process, where the key is a string and the value is a `DataFetchingFilterInterface` or `undefined`. |