Interface: TypedDataBusHost<R, I>
Defined in: src/sdk/data/DataBus.ts:69
Experimental
A provider of subscribable DataItems that also supports publishing changes to the same data items. Each data item is accessed using a combination of a string label and a numeric index. The data item labels available from the provider are defined by its record type parameter.
Extends
TypedDataBusClient<R,I>
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
R extends Record<string, any> | - | The record describing the data items available from the host. The name of each property in the record defines one label that can be used to access a data item, and the type of the property defines the value type of data items accessed using the label (under any index). |
I extends number | number | The indexes for which data items are available from the host. |
Methods
defineEquality()
defineEquality<
L>(label,equalityFunc):void
Defined in: src/sdk/data/DataBus.ts:81
Experimental
Defines equality semantics for data item values published to a given label. The specified equality semantics will be used to determine whether to notify subscribers when an update to the data item is published (subscribers are notified if and only if either the new data item value or status is not equal to the old data item value or status, respectively).
Type Parameters
| Type Parameter |
|---|
L extends string |
Parameters
| Parameter | Type | Description |
|---|---|---|
label | L | The label for which to define data item value equality semantics. |
equalityFunc | (a, b) => boolean | undefined | A function that implements the desired equality semantics by returning whether two data item values are equal. If not defined, then default equality semantics will be used, which state that two values a and b are equal if and only if the strict equality operator (===) evaluates to true for a and b, or both a and b are the numeric value NaN. |
Returns
void
getSubscribable()
getSubscribable<
L>(label,index):Subscribable<Readonly<DataItem<R[L]>>>
Defined in: src/sdk/data/DataBus.ts:38
Experimental
Gets a subscribable for a data item.
Type Parameters
| Type Parameter | Description |
|---|---|
L extends string | The label of the data item to get. |
Parameters
| Parameter | Type | Description |
|---|---|---|
label | L | The label of the data item to get. |
index | I | The index of the data item to get. |
Returns
Subscribable<Readonly<DataItem<R[L]>>>
A subscribable for the requested data item.
Inherited from
TypedDataBusClient.getSubscribable
publish()
Call Signature
publish<
L>(label,index,value):void
Defined in: src/sdk/data/DataBus.ts:91
Experimental
Publishes a value update to this data bus. The updated data item will retain its current status. If the data
item's current status is EmptyValue, then the value update will be ignored.
Type Parameters
| Type Parameter | Description |
|---|---|
L extends string | The label of the data item to publish to. |
Parameters
| Parameter | Type | Description |
|---|---|---|
label | L | The label of the data item to publish to. |
index | I | The index of the data item to publish to. |
value | R[L] | The value to publish. |
Returns
void
Call Signature
publish<
L>(label,index,value,status):void
Defined in: src/sdk/data/DataBus.ts:100
Experimental
Publishes a no-value update to this data bus.
Type Parameters
| Type Parameter | Description |
|---|---|
L extends string | The label of the data item to publish to. |
Parameters
| Parameter | Type | Description |
|---|---|---|
label | L | The label of the data item to publish to. |
index | I | The index of the data item to publish to. |
value | undefined | The value to publish, which must be undefined. |
status | EmptyValue | A status to publish along with the value, which must be EmptyValue. |
Returns
void
Call Signature
publish<
L>(label,index,value,status):void
Defined in: src/sdk/data/DataBus.ts:109
Experimental
Publishes a value and status update to this data bus.
Type Parameters
| Type Parameter | Description |
|---|---|
L extends string | The label of the data item to publish to. |
Parameters
| Parameter | Type | Description |
|---|---|---|
label | L | The label of the data item to publish to. |
index | I | The index of the data item to publish to. |
value | R[L] | The value to publish. |
status | Normal | Failed | NoComputedValue | Testing | The status to publish. |
Returns
void
Call Signature
publish<
L,S>(label,index,value,status):void
Defined in: src/sdk/data/DataBus.ts:119
Experimental
Publishes a value and status update to this data bus.
Type Parameters
| Type Parameter | Description |
|---|---|
L extends string | The label of the data item to publish to. |
S extends DataItemStatus | The status to publish. |
Parameters
| Parameter | Type | Description |
|---|---|---|
label | L | The label of the data item to publish to. |
index | I | The index of the data item to publish to. |
value | S extends EmptyValue ? undefined : R[L] | The value to publish. |
status | S | The status to publish. |
Returns
void