Skip to main content

Interface: Tag<E>#

Representation of a single tag.

Type parameters#

Name
E

Hierarchy#

Properties#

_dataType#

Optional Readonly _dataType: E

Type of the Events which may be returned by the contained tags. Note that this does reflect only locally declared type knowledge; historic events delivered by the Actyx system may not match these types, and this is not automatically detected. It is therefore good practice to carefully review changes to the declared type so that they remain backwards compatible.

Inherited from: void


rawTag#

Readonly rawTag: string

Methods#

and#

and<E1>(tag: Tags<E1>): Tags<Extract<E1, E>>

Add more tags to this requirement. E.g Tag<FooEvent>('foo').and(Tag<BarEvent>('bar')) will require both foo and bar.

Type parameters:#

Name
E1

Parameters:#

NameType
tagTags<E1>

Returns: Tags<Extract<E1, E>>

Inherited from: void

and(tag: string): Tags<E>

Add an additional untyped tag to this requirement. Since there is no associated type, the overall type cannot be constrained further.

Parameters:#

NameType
tagstring

Returns: Tags<E>

Inherited from: void


local#

local(): Tags<E>

The same requirement, but matching only Events emitted by the very node the code is run on. E.g. Tags('my-tag').local() selects all locally emitted events tagged with 'my-tag'.

Returns: Tags<E>

Inherited from: void


or#

or<E1>(tag: Where<E1>): Where<E | E1>

Add an alternative set we may also match. E.g. tag0.or(tag1.and(tag2)).or(tag1.and(tag3)) will match: Events with tag0; Events with both tag1 and tag2; Events with both tag1 and tag3.

Type parameters:#

Name
E1

Parameters:#

NameType
tagWhere<E1>

Returns: Where<E | E1>

Inherited from: void


toString#

toString(): string

Convert to an Actyx Event Service query string.

Returns: string

Inherited from: void


withId#

withId(name: string): Tags<E>

This very tag, suffixed with an id. E.g. Tag<RobotEvent>('robot').withId('robot500') expresses robot events belonging to a specific robot. The suffix will be separated from the base name by a colon :.

Parameters:#

NameType
namestring

Returns: Tags<E>