Hierarchy

  • BaseDevice
    • Device

Constructors

  • Parameters

    • id: string
    • name: string
    • organizationId: string
    • Optional tags: ITags

    Returns Device

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 Device

  • Parameters

    • cancelled: boolean

    Returns void

  • Parameters

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

    Returns Promise<void>

  • Parameters

    • channelName: string
    • Optional rtcConfig: RTCDataChannelInit

    Returns Promise<DataChannel>

  • Parameters

    Returns Promise<null | string>

  • 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" | "intervention-request" | "teleop-session-record" | "port-forwarding-session-record" | "command-request" | "command-response" | "command-delivery" | "comment" | "system")[]
    • timeFrame: AggregateLevel
    • range: number
    • time: number
    • Optional query: IEventQuery

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

  • Asynchronously retrieves the device's agent version string

    Throws

    Throws an error if the device info cannot be fetched

    Returns Promise<undefined | null | string>

    A promise that resolves to the agent version

  • Parameters

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

  • Parameters

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

  • Asynchronously retrieves the configuration document for a device.

    Throws

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

    Parameters

    • getDesiredConfigurationVersion: boolean = false

      Whether to retrieve the desired configuration version

    Returns Promise<ConfigurationDocument>

    A promise that resolves to the configuration document

  • Parameters

    • fileId: string

    Returns Promise<string[]>

  • Returns undefined | number

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

  • Parameters

    • rtcClient: RtcClient

    Returns Promise<string>

  • Returns Promise<IRtcPeer>

  • Parameters

    • peerId: string
    • message: any

    Returns void

  • 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 Device

  • 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 Device

  • 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 Device

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

    Parameters

    • Optional event: string | symbol

    Returns Device

  • 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 Device

  • 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.

      Throws

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

      Parameters

      Returns Promise<void>

    Generated using TypeDoc