Hierarchy

  • BaseDevice
    • Device

Constructors

Properties

connectionMonitorInterval: undefined | Timer
id: string
name: string
organizationId: string
realtimeListeners: RealtimeListener[] = []
remoteDevicePeerId: null | string = null
rtcClient: undefined | RtcClient
tags?: ITags
createDevice: ((device) => Promise<IDevice>) = createDevice

Type declaration

    • (device): Promise<IDevice>
    • Parameters

      • device: IDevice

      Returns Promise<IDevice>

disableDevice: ((id) => Promise<IDevice[]>) = disableDevice

Type declaration

    • (id): Promise<IDevice[]>
    • Parameters

      • id: string

      Returns Promise<IDevice[]>

getDevicesData: (() => Promise<IDevice[]>) = getDevicesData

Type declaration

    • (): Promise<IDevice[]>
    • Returns Promise<IDevice[]>

patchDevice: ((id, device) => Promise<IDevice>) = patchDevice

Type declaration

    • (id, device): Promise<IDevice>
    • Parameters

      • id: string
      • device: Partial<IDevice>

      Returns Promise<IDevice>

prefixed: string | boolean
queryDevicesData: ((query) => Promise<IDevice[]>) = queryDevicesData

Type declaration

    • (query): Promise<IDevice[]>
    • Parameters

      Returns Promise<IDevice[]>

Methods

  • Type Parameters

    • T extends string | symbol

    Parameters

    • event: T
    • fn: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns this

  • Parameters

    • streamName: string
    • newFormat: "wav" | "opus"

    Returns Promise<void>

  • Parameters

    • streamName: string

    Returns Promise<void>

  • Calls each of the listeners registered for a given event.

    Type Parameters

    • T extends string | symbol

    Parameters

    • event: T
    • Rest ...args: any[]

    Returns boolean

  • Parameters

    • streamName: string

    Returns Promise<void>

  • Return an array listing the events for which the emitter has registered listeners.

    Returns (string | symbol)[]

  • Parameters

    • eventTypes: ("custom" | "annotation" | "triggered-event" | "datapoint-event" | "device-online" | "device-offline" | "intervention-request" | "teleop-session-record" | "port-forwarding-session-record" | "command-request" | "command-response" | "command-delivery" | "intervention-response" | "comment" | "system" | "task-summary" | "stateful")[]
    • timeFrame: AggregateLevel
    • range: number
    • time: number
    • Optional query: IEventQuery

    Returns Promise<{
        date: string;
        events: IEvent[];
    }[]>

  • Asynchronously retrieves the device's agent version string

    Returns Promise<undefined | null | string>

    A promise that resolves to the agent version

    Throws

    Throws an error if the device info cannot be fetched

  • Parameters

    Returns Promise<{
        annotations: {
            [key: string]: number;
        };
        date: string;
    }[]>

  • Asynchronously retrieves the configuration document for a device.

    Parameters

    • getDesiredConfigurationVersion: boolean = false

      Whether to retrieve the desired configuration version

    Returns Promise<ConfigurationDocument>

    A promise that resolves to the configuration document

    Throws

    Throws an error if the device has no configuration or has never been turned on

  • Returns "connected" | "connecting" | "disconnected"

  • Parameters

    • streamNameOrStreamNames: string | string[]
    • start: Date
    • end: Date
    • Optional tags: {}
      • Optional limit: number
      • Optional offset: number
      • Optional latestOnly: boolean

      Returns Promise<TelemetryResult[]>

    • Return the number of listeners listening to a given event.

      Parameters

      • event: string | symbol

      Returns number

    • Return the listeners registered for a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T

      Returns ((...args) => void)[]

    • Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • Optional fn: ((...args) => void)
          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      • Optional context: any
      • Optional once: boolean

      Returns this

    • Add a listener for a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • fn: ((...args) => void)
          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      • Optional context: any

      Returns this

    • Add a one-time listener for a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • fn: ((...args) => void)
          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      • Optional context: any

      Returns this

    • Remove all listeners, or those of the specified event.

      Parameters

      • Optional event: string | symbol

      Returns this

    • Remove the listeners of a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • Optional fn: ((...args) => void)
          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      • Optional context: any
      • Optional once: boolean

      Returns this

    • Parameters

      • name: string
      • Optional data: string
      • Optional time: Date
      • Optional metadata: {}

        Returns Promise<Response>

      • Starts a real-time connection with the remote device using WebRTC.

        Parameters

        Returns Promise<void>

        Throws

        Error If the connection could not be established or if a connection already exists.

      Generated using TypeDoc