IDynamicDataSource interface

Dynamic Data Sources provide Dynamic Data to consumers. They offer metadata to identify the data sources and API to get the data.

Properties

id

Id of the Dynamic Data Source.

metadata

Metadata of the Dynamic Data Source.

Methods

allowedEventsAsync()

Returns list of allowed events on the dynamic data source. When this api returns a non-empty result, then source must define 'sendData' api.

If this api is not defined or returns an empty map, then no consumer will be able to talk to this source.

getAnnotatedPropertyValue(propertyId)

Given a property id, returns its annotated value. If the source doesn't supply the annotated value, then it falls back to whatever 'getPropertyValue' as the sample value and metadata would be undefined.

getAnnotatedPropertyValueAsync(propertyId)

Given a property id, returns its annotated value. If the source doesn't supply the annotated value, then it falls back to whatever 'getPropertyValue' as the sample value and metadata would be undefined.

getPropertyDefinitions()

Returns all the property definitions for dynamic data. This needs to be overridden by the implementation of the component.

getPropertyDefinitionsAsync()

Returns all the property definitions for dynamic data. This needs to be overridden by the implementation of the component.

getPropertyValue(propertyId)

Given a property id, returns the value of the property. This needs to be overridden by the implementation of the component.

getPropertyValueAsync(propertyId)

Given a property id, returns the value of the property. This needs to be overridden by the implementation of the component.

sendEvent(eventName, data)

If defined, enables the consumer to send data to the associated dynamic data source. Then source can act accordingly.

Invoking this api throws an error when the passed in 'eventName' is not one of the allowed events on the source.

Property Details

id

Id of the Dynamic Data Source.

id: string;

Property Value

string

metadata

Metadata of the Dynamic Data Source.

metadata: IDynamicDataSourceMetadata;

Property Value

Method Details

allowedEventsAsync()

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Returns list of allowed events on the dynamic data source. When this api returns a non-empty result, then source must define 'sendData' api.

If this api is not defined or returns an empty map, then no consumer will be able to talk to this source.

allowedEventsAsync?(): Promise<ReadonlyArray<IDynamicDataEventDefinition>>;

Returns

Promise<ReadonlyArray<IDynamicDataEventDefinition>>

getAnnotatedPropertyValue(propertyId)

Warning

This API is now deprecated.

  • This API is deprecated. Please use the asynchronous version getAsyncAnnotatedPropertyValue

Given a property id, returns its annotated value. If the source doesn't supply the annotated value, then it falls back to whatever 'getPropertyValue' as the sample value and metadata would be undefined.

getAnnotatedPropertyValue(propertyId: string): IDynamicDataAnnotatedPropertyValue;

Parameters

propertyId

string

One of the property ids exposed from the dynamic data source.

Returns

getAnnotatedPropertyValueAsync(propertyId)

Given a property id, returns its annotated value. If the source doesn't supply the annotated value, then it falls back to whatever 'getPropertyValue' as the sample value and metadata would be undefined.

getAnnotatedPropertyValueAsync(propertyId: string): Promise<IDynamicDataAnnotatedPropertyValue>;

Parameters

propertyId

string

Property id for which the value is requested.

Returns

getPropertyDefinitions()

Warning

This API is now deprecated.

  • This API is deprecated. Please use the asynchronous version getPropertyDefinitionsAsync

Returns all the property definitions for dynamic data. This needs to be overridden by the implementation of the component.

getPropertyDefinitions(): ReadonlyArray<IDynamicDataPropertyDefinition>;

Returns

getPropertyDefinitionsAsync()

Returns all the property definitions for dynamic data. This needs to be overridden by the implementation of the component.

getPropertyDefinitionsAsync(): Promise<ReadonlyArray<IDynamicDataPropertyDefinition>>;

Returns

Promise<ReadonlyArray<IDynamicDataPropertyDefinition>>

getPropertyValue(propertyId)

Warning

This API is now deprecated.

  • This API is deprecated. Please use the asynchronous version getAsyncPropertyValue

Given a property id, returns the value of the property. This needs to be overridden by the implementation of the component.

getPropertyValue(propertyId: string): any;

Parameters

propertyId

string

Property id for which the value is requested.

Returns

any

getPropertyValueAsync(propertyId)

Given a property id, returns the value of the property. This needs to be overridden by the implementation of the component.

getPropertyValueAsync(propertyId: string): Promise<any>;

Parameters

propertyId

string

Property id for which the value is requested.

Returns

Promise<any>

sendEvent(eventName, data)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

If defined, enables the consumer to send data to the associated dynamic data source. Then source can act accordingly.

Invoking this api throws an error when the passed in 'eventName' is not one of the allowed events on the source.

sendEvent?(eventName: string, data: any): void;

Parameters

eventName

string

A case-sensitive string representing the name of the event.

data

any

Data to be sent to the dynamic data source.

Returns

void