An event associated with a specific topic.

interface TopicEvent {
    getProperties(): Record<string, unknown>;
    getProperty<T = unknown>(name: string): undefined | T;
    getPropertyNames(): string[];
    getTopic(): string;
    getTopicReason(): string;
    matches(filter: string | Pick<Filter, "matchCase">): boolean;
    toString(): string;
}

Methods

  • Gets all properties as a copy.

    Returns Record<string, unknown>

    all properties as plain object.

  • Returns a property.

    Type Parameters

    • T = unknown

    Parameters

    • name: string

      the name of the property to return

    Returns undefined | T

    The value of the property, or undefined if not found.

  • Returns a list of this event's property names.

    Returns string[]

    A non-empty array with one element per property.

  • Returns the topic of this event.

    Returns string

  • Returns the reason of the topic (last part).

    For example if topic is 'ct/map/EXTENT_CHANGE' the reason is 'EXTENT_CHANGE'.

    Returns string

  • Tests this event's properties against the given filter using a case sensitive match.

    Parameters

    • filter: string | Pick<Filter, "matchCase">

      The filter to test.

    Returns boolean

    true if this event's properties match the filter, false otherwise.

  • Returns string

    The string representation of this event.