Class JDEvent

A Jacdac event client.

Hierarchy

JDOM

eventStats: Record<string, number> = {}

Gets a counter of event emit calls.

newListenerStats: Record<string, number> = undefined

Gets a counter map from events to new listener counts

nodeId: number = ...

Gets an internal unique node identifier, mostly used for debugging.

service: JDService

Parent service

  • get changeId(): number
  • Gets a counter for the CHANGE event.

    Returns number

  • get friendlyName(): string
  • Gets the event friendly name.

    Returns string

  • get nodeData(): Record<string, unknown>
  • Gets a databag to store custom information

    Returns Record<string, unknown>

  • get nodeKind(): string
  • Returns the EVENT_NODE_NAME identifier

    Returns string

  • get notImplemented(): boolean
  • Indicates if the member is not implemented on the server side

    Returns boolean

  • get qualifiedName(): string
  • Gets the qualitified event name, if specified.

    Returns string

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    Parameters

    • eventName: string
    • Rest ...args: unknown[]

    Returns boolean

  • Gets the list stack trace where an event was registered. Only enabled if Flags.debug is true.

    Parameters

    • eventName: string

      name of the event

    Returns string[]

    stack traces where a listener was added

  • Subscribes to an event and returns the unsubscription handler

    Type Parameters

    • T

    Parameters

    • eventName: string | string[]
    • next: ((value) => void)
        • (value): void
        • Parameters

          • value: T

          Returns void

    Returns (() => void)

      • (): void
      • Subscribes to an event and returns the unsubscription handler

        Returns void

        Category

        JDOM

Data

  • get count(): number
  • Gets a counter of occurences for this event.

    Returns number

  • get data(): Uint8Array
  • Gets the raw data attached to the last event packet

    Returns Uint8Array

  • get lastDataTimestamp(): number
  • Gets the timestamp of the last packet with data received for this event.

    Returns number

Other

Service Clients

Specification

code: number

Identifier of the event.

  • get specification(): PacketInfo
  • Gets the event specification if known.

    Returns PacketInfo

Generated using TypeDoc