Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DeviceConstants

Hierarchy

  • DeviceConstants

Index

Constructors

constructor

  • new DeviceConstants(deviceID: number, key: string | number, delimiter?: string): DeviceConstants
  • Construct a DeviceConstant object seated at the root or sub node in the tree of constants. Traverse directly to a sub node by specifying the full path using delimiters (default "/") between element names

    Parameters

    • deviceID: number

      ID of device to query

    • key: string | number

      Root node or full path to Jabra Constant

    • Default value delimiter: string = "/"

      Optional - delimiter used if full path was specified

    Returns DeviceConstants

    DeviceConstant object

Methods

asArray

  • Get list node as Array

    Returns DeviceConstants[] | undefined

    Array of DeviceConstants if current node points at a list. Returns undefined if not a list.

asBoolean

  • asBoolean(): boolean | undefined
  • Get boolean value

    Returns boolean | undefined

    Value at node if it is a boolean. Returns undefined if not a boolean.

asNumber

  • asNumber(): number | undefined
  • Get number value

    Returns number | undefined

    Value at node if it is a number. Returns undefined if not a number.

asString

  • asString(): string | undefined
  • Get string value

    Returns string | undefined

    Value at node if it is a string. Returns undefined if not a string.

get

  • get(id: number | string, delimiter?: string): DeviceConstants | undefined
  • Traverse sub node(s) (structs or lists) Traverse nested structs in single call using delimiter (default "/") between element names

    Parameters

    • id: number | string

      Element name (struct) or index (list element)

    • Default value delimiter: string = "/"

      Optional - delimiter used if multiple sub nodes were specified

    Returns DeviceConstants | undefined

getValue

  • Get value

    Returns number | string | boolean | DeviceConstants[] | undefined

    Value at node if it is a number, string or boolean. Returns an array of constants if node points at a list. Returns undefined if neither.

isValid

  • isValid(): boolean
  • Does this node point to an existing value?

    Returns boolean

    True if this node exists

toString

  • toString(): string
  • Get string representation of current value at node

    Returns string

    Value at node if it is a number, string or boolean, as a string. Alternatively returns "array" or "struct" to indicate sub node type or "undefined" if node is invalid.

This API Reference is provided by Jabra Developer Zone.