Class InstanceBase<TConfig, TSecrets>Abstract

Type Parameters

  • TConfig
  • TSecrets = undefined

Implements

Constructors

Properties

id: string

Accessors

  • get label(): string

    The user chosen name for this instance. This can be changed just before configUpdated is called

    Returns string

Methods

  • Request all feedbacks of the specified types to be checked for changes

    Parameters

    • ...feedbackTypes: string[]

      The feedback types to check

    Returns void

  • Request the specified feedback instances to be checked for changes

    Parameters

    • ...feedbackIds: string[]

      The ids of the feedback instances to check

    Returns void

  • Create a shared udp socket. This can be neccessary for modules where the device/software sends UDP messages to a hardcoded port number. In those cases if you don't use this then it won't be possible to use multiple instances of you module. The api here is a subset of the Socket from the builtin node:dgram, but with Companion hosting the sockets instead of the module.

    Parameters

    • type: "udp4" | "udp6"

      Type of udp to use

    • Optionalcallback: SharedUdpSocketMessageCallback

      Message received callback

    Returns SharedUdpSocket

  • Create a shared udp socket. This can be neccessary for modules where the device/software sends UDP messages to a hardcoded port number. In those cases if you don't use this then it won't be possible to use multiple instances of you module. The api here is a subset of the Socket from the builtin node:dgram, but with Companion hosting the sockets instead of the module.

    Parameters

    • options: SharedUdpSocketOptions
    • Optionalcallback: SharedUdpSocketMessageCallback

      Message received callback

    Returns SharedUdpSocket

  • Clean up the instance before it is destroyed.

    Returns Promise<void>

  • Handle request from Companion to start/stop recording actions

    Parameters

    • isRecording: boolean

      whether recording is now running

    Returns void

  • Main initialization function called once the module is OK to start doing things.

    Parameters

    Returns Promise<void>

  • Send an osc message from the system osc sender

    Parameters

    • host: string

      destination ip address

    • port: number

      destination port number

    • path: string

      message path

    • args: OSCSomeArguments

      mesage arguments

    Returns void

  • Parameters

    • text: string

      The text to parse

    Returns Promise<string>

    The string with variables replaced with their values

    Companion now handles this for you, for actions and feedbacks. If you need this for another purpose, let us know as we intend to remove this

    Parse and replace all the variables in a string Note: You must not use this for feedbacks, as your feedback will not update when the variable changes. There is an alternate version of this supplied to each of the action/feedback callbacks that tracks usages properly and will retrigger the feedback when the variables change.

  • Add an action to the current recording session

    Parameters

    • action: CompanionRecordedAction

      The action to be added to the recording session

    • OptionaluniquenessId: string

      A unique id for the action being recorded. This should be different for each action, but by passing the same as a previous call will replace the previous value.

    Returns void

  • Save an updated configuration object Note: The whole config object and the keys of the secrets object are reported to the webui, so be careful how sensitive data is stored

    Parameters

    • newConfig: undefined | TConfig

      The new config object, or undefined to not update the config

    • newSecrets: undefined | TSecrets

      The new secrets object, or undefined to not update the secrets

    Returns void

  • Call subscribe on all currently known placed actions. It can be useful to trigger this upon establishing a connection, to ensure all data is loaded.

    Parameters

    • ...actionIds: string[]

      The actionIds to call subscribe for. If no values are provided, then all are called.

    Returns void

  • Call subscribe on all currently known placed feedbacks. It can be useful to trigger this upon establishing a connection, to ensure all data is loaded.

    Parameters

    • ...feedbackIds: string[]

      The feedbackIds to call subscribe for. If no values are provided, then all are called.

    Returns void

  • Call unsubscribe on all currently known placed actions. It can be useful to do some cleanup upon a connection closing.

    Parameters

    • ...actionIds: string[]

      The actionIds to call subscribe for. If no values are provided, then all are called.

    Returns void

  • Call unsubscribe on all currently known placed feedbacks. It can be useful to do some cleanup upon a connection closing.

    Parameters

    • ...feedbackIds: string[]

      The feedbackIds to call subscribe for. If no values are provided, then all are called.

    Returns void

  • Update the status of this connection

    Parameters

    • status: InstanceStatus

      The status level

    • Optionalmessage: null | string

      Additional information about the status

      this.updateStatus(InstanceStatus.Ok)
      

    Returns void