import{ Link }from"../components/hal/hal";import{ Widget }from"./configuration";exportinterfaceSimpleChannelMapping{
source:string;
destination:string;}exportinterfaceChannelMapping{
channel:string;}exportinterfaceInputChannelMappingextendsChannelMapping{type:"input";
source:string;}exportinterfaceOutputChannelMappingextendsChannelMapping{type:"output";
destination:string;}exportinterfaceWidgetConfig<T={[key:string]:any}>{
id:string;
component:string;
configuration:T;
hostClass?:string;
hostClassModifiers?:string[];
elementClass?:string;
elementClassModifiers?:string[];
pageTitle?:string;
infoTitle?:string;
infoText?:string;
infoWidth?:string;
infoHeight?:string;
infoToolTip?:string;
wikiLink?:string;
overlayScrollbarActive?:boolean;
channels?:[SimpleChannelMapping];
inputs?:[InputChannelMapping];
outputs?:[OutputChannelMapping];
header?: WidgetConfig;
animationDelay?:number;
animationEnabled?:boolean;
actions?:{
alignment?:string;
elements: WidgetConfig[];};
footer?: WidgetConfig;
_embedded?:{[key:string]: WidgetConfig;};
_links?:{[key:string]: Link | Link[];};}exportfunctiongetOrDefault(value, defaultValue){if(value !== undefined){return value;}return defaultValue;}exportfunctionthrowIfUndefined(value){if(value === undefined){console.error("Value is not allowed to be undefined. Please check your configuration");}return value;}/**
* Throws an error if given property is undefined. Use this function over throwIfUndefined since it gives better output
* @param paramName the name of the parameter
* @param value the object to extract the value from
*/exportfunctionthrowErrorIfUndefined(paramName, configuration){const value = configuration[paramName];if(value === undefined){console.error(`Configuration property ${paramName} is required but was not found in`,
configuration
);}return value;}