Represents a Pixels die. Most of its methods require the instance to be connected to the Pixel device. Call the () method to initiate a connection.

Call addEventListener to get notified for rolls, connection and disconnection events and more.

Call addPropertyListener to get notified on property changes.

Hierarchy (view full)

Implements

Constructors

  • Instantiates a Pixel.

    Parameters

    • session: PixelSession

      The session used to communicate with the Pixel.

    • Optionalinfo: Partial<Pick<Readonly<{
          batteryLevel: number;
          colorway:
              | "custom"
              | "clear"
              | "unknown"
              | "onyxBlack"
              | "hematiteGrey"
              | "midnightGalaxy"
              | "auroraSky"
              | "whiteAurora";
          currentFace: number;
          currentFaceIndex: number;
          dieType:
              | "unknown"
              | "d4"
              | "d6"
              | "d8"
              | "d10"
              | "d00"
              | "d12"
              | "d20"
              | "d6pipped"
              | "d6fudge";
          firmwareDate: Date;
          isCharging: boolean;
          ledCount: number;
          name: string;
          pixelId: number;
          rollState:
              | "unknown"
              | "handling"
              | "rolling"
              | "crooked"
              | "rolled"
              | "onFace";
          rssi: number;
          systemId: string;
      }>,
          | "pixelId"
          | "ledCount"
          | "colorway"
          | "dieType"
          | "firmwareDate">>

    Returns Pixel

Properties

_msgEvEmitter: EventEmitter = ...
_serializer: MessageSerializer<
    | "blink"
    | "none"
    | "playAnimation"
    | "whoAreYou"
    | "bulkSetup"
    | "bulkSetupAck"
    | "bulkData"
    | "bulkDataAck"
    | "transferSettings"
    | "transferSettingsAck"
    | "transferSettingsFinished"
    | "debugLog"
    | "requestSettings"
    | "blinkAck"
    | "requestBatteryLevel"
    | "batteryLevel"
    | "requestRssi"
    | "rssi"
    | "notifyUser"
    | "notifyUserAck"
    | "storeValue"
    | "storeValueAck"
    | "programDefaultParameters"
    | "programDefaultParametersFinished"
    | "setName"
    | "setNameAck"
    | "powerOperation"
    | "exitValidation"
    | "requestTemperature"
    | "temperature"
    | "testBulkSend"
    | "testBulkReceive"
    | "attractMode"
    | "printA2DReadings"
    | "printAnimationControllerState"
    | "rollState"
    | "iAmADie"
    | "telemetry"
    | "transferAnimationSet"
    | "transferAnimationSetAck"
    | "transferAnimationSetFinished"
    | "transferTestAnimationSet"
    | "transferTestAnimationSetAck"
    | "transferTestAnimationSetFinished"
    | "playAnimationEvent"
    | "stopAnimation"
    | "remoteAction"
    | "requestRollState"
    | "requestAnimationSet"
    | "requestTelemetry"
    | "programDefaultAnimationSet"
    | "programDefaultAnimationSetFinished"
    | "requestDefaultAnimationSetColor"
    | "defaultAnimationSetColor"
    | "calibrate"
    | "calibrateFace"
    | "testHardware"
    | "setTopLevelState"
    | "setDesignAndColor"
    | "setDesignAndColorAck"
    | "setCurrentBehavior"
    | "setCurrentBehaviorAck"
    | "transferInstantAnimationSet"
    | "transferInstantAnimationSetAck"
    | "transferInstantAnimationSetFinished"
    | "playInstantAnimation"
    | "stopAllAnimations"
    | "setBatteryControllerMode"
    | "_unused"
    | "discharge"
    | "blinkId"
    | "blinkIdAck"
    | "transferTest"
    | "transferTestAck"
    | "transferTestFinished"
    | "clearSettings"
    | "clearSettingsAck"
    | "setAllLEDsToColor"
    | "printNormals"
    | "lightUpFace"
    | "setLEDToColor">
isNotifier = true
type = "die"

Device type is Pixels die.

MutablePropsList: readonly (
    | "name"
    | "batteryLevel"
    | "rssi"
    | "pixelId"
    | "ledCount"
    | "systemId"
    | "colorway"
    | "dieType"
    | "firmwareDate"
    | "isCharging"
    | "rollState"
    | "currentFace"
    | "currentFaceIndex")[] = ...

Accessors

  • get batteryLevel(): number
  • Gets the Pixel battery level (percentage).

    Returns number

    This value is automatically updated when the die is connected.

  • get colorway():
        | "custom"
        | "clear"
        | "unknown"
        | "onyxBlack"
        | "hematiteGrey"
        | "midnightGalaxy"
        | "auroraSky"
        | "whiteAurora"
  • Gets the color of the Pixel.

    Returns
        | "custom"
        | "clear"
        | "unknown"
        | "onyxBlack"
        | "hematiteGrey"
        | "midnightGalaxy"
        | "auroraSky"
        | "whiteAurora"

  • get currentFace(): number
  • Gets the die face value that is currently facing up.

    Returns number

    Fudge die returns +1, 0 and -1. This value is automatically updated when the die is connected.

  • get currentFaceIndex(): number
  • Gets the 0-based index of the die face that is currently facing up.

    Returns number

    This value is automatically updated when the die is connected.

    PixelInfo.currentFaceIndex for more details.

  • get dieType():
        | "unknown"
        | "d4"
        | "d6"
        | "d8"
        | "d10"
        | "d00"
        | "d12"
        | "d20"
        | "d6pipped"
        | "d6fudge"
  • Gets the die type of the Pixel.

    Returns
        | "unknown"
        | "d4"
        | "d6"
        | "d8"
        | "d10"
        | "d00"
        | "d12"
        | "d20"
        | "d6pipped"
        | "d6fudge"

  • get isCharging(): boolean
  • Gets whether the Pixel battery is charging or not. Returns 'true' if fully charged but still on charger.

    Returns boolean

    This value is automatically updated when the die is connected.

  • get profileHash(): number
  • Gets the on-die profile hash value. This can be used as an identifier for the current profile.

    Returns number

  • get rollState():
        | "unknown"
        | "handling"
        | "rolling"
        | "crooked"
        | "rolled"
        | "onFace"
  • Gets the Pixel roll state.

    Returns
        | "unknown"
        | "handling"
        | "rolling"
        | "crooked"
        | "rolled"
        | "onFace"

    This value is automatically updated when the die is connected.

Methods

  • Sends a message to the Pixel and wait for a specific response.

    Parameters

    • msgOrTypeToSend:
          | "blink"
          | "none"
          | "playAnimation"
          | PixelMessage
          | "whoAreYou"
          | "bulkSetup"
          | "bulkSetupAck"
          | "bulkData"
          | "bulkDataAck"
          | "transferSettings"
          | "transferSettingsAck"
          | "transferSettingsFinished"
          | "debugLog"
          | "requestSettings"
          | "blinkAck"
          | "requestBatteryLevel"
          | "batteryLevel"
          | "requestRssi"
          | "rssi"
          | "notifyUser"
          | "notifyUserAck"
          | "storeValue"
          | "storeValueAck"
          | "programDefaultParameters"
          | "programDefaultParametersFinished"
          | "setName"
          | "setNameAck"
          | "powerOperation"
          | "exitValidation"
          | "requestTemperature"
          | "temperature"
          | "testBulkSend"
          | "testBulkReceive"
          | "attractMode"
          | "printA2DReadings"
          | "printAnimationControllerState"
          | "rollState"
          | "iAmADie"
          | "telemetry"
          | "transferAnimationSet"
          | "transferAnimationSetAck"
          | "transferAnimationSetFinished"
          | "transferTestAnimationSet"
          | "transferTestAnimationSetAck"
          | "transferTestAnimationSetFinished"
          | "playAnimationEvent"
          | "stopAnimation"
          | "remoteAction"
          | "requestRollState"
          | "requestAnimationSet"
          | "requestTelemetry"
          | "programDefaultAnimationSet"
          | "programDefaultAnimationSetFinished"
          | "requestDefaultAnimationSetColor"
          | "defaultAnimationSetColor"
          | "calibrate"
          | "calibrateFace"
          | "testHardware"
          | "setTopLevelState"
          | "setDesignAndColor"
          | "setDesignAndColorAck"
          | "setCurrentBehavior"
          | "setCurrentBehaviorAck"
          | "transferInstantAnimationSet"
          | "transferInstantAnimationSetAck"
          | "transferInstantAnimationSetFinished"
          | "playInstantAnimation"
          | "stopAllAnimations"
          | "setBatteryControllerMode"
          | "_unused"
          | "discharge"
          | "blinkId"
          | "blinkIdAck"
          | "transferTest"
          | "transferTestAck"
          | "transferTestFinished"
          | "clearSettings"
          | "clearSettingsAck"
          | "setAllLEDsToColor"
          | "printNormals"
          | "lightUpFace"
          | "setLEDToColor"

      Message with the data to send or just a message type.

    • responseType:
          | "blink"
          | "none"
          | "playAnimation"
          | "whoAreYou"
          | "bulkSetup"
          | "bulkSetupAck"
          | "bulkData"
          | "bulkDataAck"
          | "transferSettings"
          | "transferSettingsAck"
          | "transferSettingsFinished"
          | "debugLog"
          | "requestSettings"
          | "blinkAck"
          | "requestBatteryLevel"
          | "batteryLevel"
          | "requestRssi"
          | "rssi"
          | "notifyUser"
          | "notifyUserAck"
          | "storeValue"
          | "storeValueAck"
          | "programDefaultParameters"
          | "programDefaultParametersFinished"
          | "setName"
          | "setNameAck"
          | "powerOperation"
          | "exitValidation"
          | "requestTemperature"
          | "temperature"
          | "testBulkSend"
          | "testBulkReceive"
          | "attractMode"
          | "printA2DReadings"
          | "printAnimationControllerState"
          | "rollState"
          | "iAmADie"
          | "telemetry"
          | "transferAnimationSet"
          | "transferAnimationSetAck"
          | "transferAnimationSetFinished"
          | "transferTestAnimationSet"
          | "transferTestAnimationSetAck"
          | "transferTestAnimationSetFinished"
          | "playAnimationEvent"
          | "stopAnimation"
          | "remoteAction"
          | "requestRollState"
          | "requestAnimationSet"
          | "requestTelemetry"
          | "programDefaultAnimationSet"
          | "programDefaultAnimationSetFinished"
          | "requestDefaultAnimationSetColor"
          | "defaultAnimationSetColor"
          | "calibrate"
          | "calibrateFace"
          | "testHardware"
          | "setTopLevelState"
          | "setDesignAndColor"
          | "setDesignAndColorAck"
          | "setCurrentBehavior"
          | "setCurrentBehaviorAck"
          | "transferInstantAnimationSet"
          | "transferInstantAnimationSetAck"
          | "transferInstantAnimationSetFinished"
          | "playInstantAnimation"
          | "stopAllAnimations"
          | "setBatteryControllerMode"
          | "_unused"
          | "discharge"
          | "blinkId"
          | "blinkIdAck"
          | "transferTest"
          | "transferTestAck"
          | "transferTestFinished"
          | "clearSettings"
          | "clearSettingsAck"
          | "setAllLEDsToColor"
          | "printNormals"
          | "lightUpFace"
          | "setLEDToColor"

      Expected response type.

    • timeoutMs: number = Constants.ackMessageTimeout

      Timeout in mill-seconds before aborting waiting for the response.

    Returns Promise<
        | "blink"
        | "none"
        | "playAnimation"
        | PixelMessage
        | "whoAreYou"
        | "bulkSetup"
        | "bulkSetupAck"
        | "bulkData"
        | "bulkDataAck"
        | "transferSettings"
        | "transferSettingsAck"
        | "transferSettingsFinished"
        | "debugLog"
        | "requestSettings"
        | "blinkAck"
        | "requestBatteryLevel"
        | "batteryLevel"
        | "requestRssi"
        | "rssi"
        | "notifyUser"
        | "notifyUserAck"
        | "storeValue"
        | "storeValueAck"
        | "programDefaultParameters"
        | "programDefaultParametersFinished"
        | "setName"
        | "setNameAck"
        | "powerOperation"
        | "exitValidation"
        | "requestTemperature"
        | "temperature"
        | "testBulkSend"
        | "testBulkReceive"
        | "attractMode"
        | "printA2DReadings"
        | "printAnimationControllerState"
        | "rollState"
        | "iAmADie"
        | "telemetry"
        | "transferAnimationSet"
        | "transferAnimationSetAck"
        | "transferAnimationSetFinished"
        | "transferTestAnimationSet"
        | "transferTestAnimationSetAck"
        | "transferTestAnimationSetFinished"
        | "playAnimationEvent"
        | "stopAnimation"
        | "remoteAction"
        | "requestRollState"
        | "requestAnimationSet"
        | "requestTelemetry"
        | "programDefaultAnimationSet"
        | "programDefaultAnimationSetFinished"
        | "requestDefaultAnimationSetColor"
        | "defaultAnimationSetColor"
        | "calibrate"
        | "calibrateFace"
        | "testHardware"
        | "setTopLevelState"
        | "setDesignAndColor"
        | "setDesignAndColorAck"
        | "setCurrentBehavior"
        | "setCurrentBehaviorAck"
        | "transferInstantAnimationSet"
        | "transferInstantAnimationSetAck"
        | "transferInstantAnimationSetFinished"
        | "playInstantAnimation"
        | "stopAllAnimations"
        | "setBatteryControllerMode"
        | "_unused"
        | "discharge"
        | "blinkId"
        | "blinkIdAck"
        | "transferTest"
        | "transferTestAck"
        | "transferTestFinished"
        | "clearSettings"
        | "clearSettingsAck"
        | "setAllLEDsToColor"
        | "printNormals"
        | "lightUpFace"
        | "setLEDToColor">

    A promise resolving to the response in the form of a message type or a message object.

  • Sends a message to the Pixel and wait for a specific response which is returned casted to the expected type.

    Type Parameters

    • T extends PixelMessage

    Parameters

    • msgOrTypeToSend:
          | "blink"
          | "none"
          | "playAnimation"
          | PixelMessage
          | "whoAreYou"
          | "bulkSetup"
          | "bulkSetupAck"
          | "bulkData"
          | "bulkDataAck"
          | "transferSettings"
          | "transferSettingsAck"
          | "transferSettingsFinished"
          | "debugLog"
          | "requestSettings"
          | "blinkAck"
          | "requestBatteryLevel"
          | "batteryLevel"
          | "requestRssi"
          | "rssi"
          | "notifyUser"
          | "notifyUserAck"
          | "storeValue"
          | "storeValueAck"
          | "programDefaultParameters"
          | "programDefaultParametersFinished"
          | "setName"
          | "setNameAck"
          | "powerOperation"
          | "exitValidation"
          | "requestTemperature"
          | "temperature"
          | "testBulkSend"
          | "testBulkReceive"
          | "attractMode"
          | "printA2DReadings"
          | "printAnimationControllerState"
          | "rollState"
          | "iAmADie"
          | "telemetry"
          | "transferAnimationSet"
          | "transferAnimationSetAck"
          | "transferAnimationSetFinished"
          | "transferTestAnimationSet"
          | "transferTestAnimationSetAck"
          | "transferTestAnimationSetFinished"
          | "playAnimationEvent"
          | "stopAnimation"
          | "remoteAction"
          | "requestRollState"
          | "requestAnimationSet"
          | "requestTelemetry"
          | "programDefaultAnimationSet"
          | "programDefaultAnimationSetFinished"
          | "requestDefaultAnimationSetColor"
          | "defaultAnimationSetColor"
          | "calibrate"
          | "calibrateFace"
          | "testHardware"
          | "setTopLevelState"
          | "setDesignAndColor"
          | "setDesignAndColorAck"
          | "setCurrentBehavior"
          | "setCurrentBehaviorAck"
          | "transferInstantAnimationSet"
          | "transferInstantAnimationSetAck"
          | "transferInstantAnimationSetFinished"
          | "playInstantAnimation"
          | "stopAllAnimations"
          | "setBatteryControllerMode"
          | "_unused"
          | "discharge"
          | "blinkId"
          | "blinkIdAck"
          | "transferTest"
          | "transferTestAck"
          | "transferTestFinished"
          | "clearSettings"
          | "clearSettingsAck"
          | "setAllLEDsToColor"
          | "printNormals"
          | "lightUpFace"
          | "setLEDToColor"

      Message with the data to send or just a message type.

    • responseType: (new () => T)

      Expected response class type.

        • new (): T
        • Returns T

    • timeoutMs: number = Constants.ackMessageTimeout

    Returns Promise<T>

    A promise resolving to a message object of the expected type.

  • Sends a message to the Pixel.

    Parameters

    • msgOrType:
          | "blink"
          | "none"
          | "playAnimation"
          | PixelMessage
          | "whoAreYou"
          | "bulkSetup"
          | "bulkSetupAck"
          | "bulkData"
          | "bulkDataAck"
          | "transferSettings"
          | "transferSettingsAck"
          | "transferSettingsFinished"
          | "debugLog"
          | "requestSettings"
          | "blinkAck"
          | "requestBatteryLevel"
          | "batteryLevel"
          | "requestRssi"
          | "rssi"
          | "notifyUser"
          | "notifyUserAck"
          | "storeValue"
          | "storeValueAck"
          | "programDefaultParameters"
          | "programDefaultParametersFinished"
          | "setName"
          | "setNameAck"
          | "powerOperation"
          | "exitValidation"
          | "requestTemperature"
          | "temperature"
          | "testBulkSend"
          | "testBulkReceive"
          | "attractMode"
          | "printA2DReadings"
          | "printAnimationControllerState"
          | "rollState"
          | "iAmADie"
          | "telemetry"
          | "transferAnimationSet"
          | "transferAnimationSetAck"
          | "transferAnimationSetFinished"
          | "transferTestAnimationSet"
          | "transferTestAnimationSetAck"
          | "transferTestAnimationSetFinished"
          | "playAnimationEvent"
          | "stopAnimation"
          | "remoteAction"
          | "requestRollState"
          | "requestAnimationSet"
          | "requestTelemetry"
          | "programDefaultAnimationSet"
          | "programDefaultAnimationSetFinished"
          | "requestDefaultAnimationSetColor"
          | "defaultAnimationSetColor"
          | "calibrate"
          | "calibrateFace"
          | "testHardware"
          | "setTopLevelState"
          | "setDesignAndColor"
          | "setDesignAndColorAck"
          | "setCurrentBehavior"
          | "setCurrentBehaviorAck"
          | "transferInstantAnimationSet"
          | "transferInstantAnimationSetAck"
          | "transferInstantAnimationSetFinished"
          | "playInstantAnimation"
          | "stopAllAnimations"
          | "setBatteryControllerMode"
          | "_unused"
          | "discharge"
          | "blinkId"
          | "blinkIdAck"
          | "transferTest"
          | "transferTestAck"
          | "transferTestFinished"
          | "clearSettings"
          | "clearSettingsAck"
          | "setAllLEDsToColor"
          | "printNormals"
          | "lightUpFace"
          | "setLEDToColor"

      Message with the data to send or just a message type.

    • withoutAck: boolean = false

      Whether to request a confirmation that the message was received.

    Returns Promise<void>

    A promise that resolves once the message has been send.

  • Waits for a message from the Pixel.

    Parameters

    • expectedMsgType:
          | "blink"
          | "none"
          | "playAnimation"
          | "whoAreYou"
          | "bulkSetup"
          | "bulkSetupAck"
          | "bulkData"
          | "bulkDataAck"
          | "transferSettings"
          | "transferSettingsAck"
          | "transferSettingsFinished"
          | "debugLog"
          | "requestSettings"
          | "blinkAck"
          | "requestBatteryLevel"
          | "batteryLevel"
          | "requestRssi"
          | "rssi"
          | "notifyUser"
          | "notifyUserAck"
          | "storeValue"
          | "storeValueAck"
          | "programDefaultParameters"
          | "programDefaultParametersFinished"
          | "setName"
          | "setNameAck"
          | "powerOperation"
          | "exitValidation"
          | "requestTemperature"
          | "temperature"
          | "testBulkSend"
          | "testBulkReceive"
          | "attractMode"
          | "printA2DReadings"
          | "printAnimationControllerState"
          | "rollState"
          | "iAmADie"
          | "telemetry"
          | "transferAnimationSet"
          | "transferAnimationSetAck"
          | "transferAnimationSetFinished"
          | "transferTestAnimationSet"
          | "transferTestAnimationSetAck"
          | "transferTestAnimationSetFinished"
          | "playAnimationEvent"
          | "stopAnimation"
          | "remoteAction"
          | "requestRollState"
          | "requestAnimationSet"
          | "requestTelemetry"
          | "programDefaultAnimationSet"
          | "programDefaultAnimationSetFinished"
          | "requestDefaultAnimationSetColor"
          | "defaultAnimationSetColor"
          | "calibrate"
          | "calibrateFace"
          | "testHardware"
          | "setTopLevelState"
          | "setDesignAndColor"
          | "setDesignAndColorAck"
          | "setCurrentBehavior"
          | "setCurrentBehaviorAck"
          | "transferInstantAnimationSet"
          | "transferInstantAnimationSetAck"
          | "transferInstantAnimationSetFinished"
          | "playInstantAnimation"
          | "stopAllAnimations"
          | "setBatteryControllerMode"
          | "_unused"
          | "discharge"
          | "blinkId"
          | "blinkIdAck"
          | "transferTest"
          | "transferTestAck"
          | "transferTestFinished"
          | "clearSettings"
          | "clearSettingsAck"
          | "setAllLEDsToColor"
          | "printNormals"
          | "lightUpFace"
          | "setLEDToColor"

      Type of the message to expect.

    • timeoutMs: number = Constants.ackMessageTimeout

      Timeout before aborting the wait.

    Returns Promise<
        | "blink"
        | "none"
        | "playAnimation"
        | PixelMessage
        | "whoAreYou"
        | "bulkSetup"
        | "bulkSetupAck"
        | "bulkData"
        | "bulkDataAck"
        | "transferSettings"
        | "transferSettingsAck"
        | "transferSettingsFinished"
        | "debugLog"
        | "requestSettings"
        | "blinkAck"
        | "requestBatteryLevel"
        | "batteryLevel"
        | "requestRssi"
        | "rssi"
        | "notifyUser"
        | "notifyUserAck"
        | "storeValue"
        | "storeValueAck"
        | "programDefaultParameters"
        | "programDefaultParametersFinished"
        | "setName"
        | "setNameAck"
        | "powerOperation"
        | "exitValidation"
        | "requestTemperature"
        | "temperature"
        | "testBulkSend"
        | "testBulkReceive"
        | "attractMode"
        | "printA2DReadings"
        | "printAnimationControllerState"
        | "rollState"
        | "iAmADie"
        | "telemetry"
        | "transferAnimationSet"
        | "transferAnimationSetAck"
        | "transferAnimationSetFinished"
        | "transferTestAnimationSet"
        | "transferTestAnimationSetAck"
        | "transferTestAnimationSetFinished"
        | "playAnimationEvent"
        | "stopAnimation"
        | "remoteAction"
        | "requestRollState"
        | "requestAnimationSet"
        | "requestTelemetry"
        | "programDefaultAnimationSet"
        | "programDefaultAnimationSetFinished"
        | "requestDefaultAnimationSetColor"
        | "defaultAnimationSetColor"
        | "calibrate"
        | "calibrateFace"
        | "testHardware"
        | "setTopLevelState"
        | "setDesignAndColor"
        | "setDesignAndColorAck"
        | "setCurrentBehavior"
        | "setCurrentBehaviorAck"
        | "transferInstantAnimationSet"
        | "transferInstantAnimationSetAck"
        | "transferInstantAnimationSetFinished"
        | "playInstantAnimation"
        | "stopAllAnimations"
        | "setBatteryControllerMode"
        | "_unused"
        | "discharge"
        | "blinkId"
        | "blinkIdAck"
        | "transferTest"
        | "transferTestAck"
        | "transferTestFinished"
        | "clearSettings"
        | "clearSettingsAck"
        | "setAllLEDsToColor"
        | "printNormals"
        | "lightUpFace"
        | "setLEDToColor">

    A promise with the received message of the expected type.

  • Parameters

    • ev: Readonly<{
          lastStatus: PixelStatus;
          reason?:
              | "canceled"
              | "success"
              | "unknown"
              | "host"
              | "timeout"
              | "notSupported"
              | "linkLoss"
              | "bluetoothOff"
              | "peripheral";
          status: PixelStatus;
      }>

    Returns void

  • Registers a listener function that will be called when the specified event is raised. See PixelEventMap for the list of events and their associated data.

    Type Parameters

    • K extends
          | "dataTransfer"
          | "battery"
          | "rollState"
          | "remoteAction"
          | "statusChanged"
          | "messageReceived"
          | "messageSend"
          | "roll"
          | "userMessage"

    Parameters

    • type: K

      A case-sensitive string representing the event type to listen for.

    • listener: EventReceiver<Readonly<{
          battery: Readonly<{
              isCharging: boolean;
              level: number;
          }>;
          dataTransfer: Readonly<{
              totalBytes: number;
              type: "completed" | "preparing" | "starting";
          } | {
              error:
                  | "disconnected"
                  | "unknown"
                  | "timeout"
                  | "outOfMemory";
              type: "failed";
          } | {
              type: "progress";
          } & Readonly<{
              progressPercent: number;
              totalBytes: number;
              transferredBytes: number;
          }>>;
          messageReceived: MessageOrType;
          messageSend: MessageOrType;
          remoteAction: number;
          roll: number;
          rollState: Readonly<{
              face: number;
              faceIndex: number;
              state:
                  | "unknown"
                  | "handling"
                  | "rolling"
                  | "crooked"
                  | "rolled"
                  | "onFace";
          }>;
          statusChanged: Readonly<{
              lastStatus: PixelStatus;
              reason?:
                  | "canceled"
                  | "success"
                  | "unknown"
                  | "host"
                  | "timeout"
                  | "notSupported"
                  | "linkLoss"
                  | "bluetoothOff"
                  | "peripheral";
              status: PixelStatus;
          }>;
          userMessage: Readonly<{
              message: string;
              response: ((okCancel: boolean) => Promise<void>);
              withCancel: boolean;
          }>;
      }>[K]>

      The callback function.

    Returns void

  • Registers a listener function that will be called on receiving raw messages of a given type from the Pixel.

    Parameters

    • msgType:
          | "blink"
          | "none"
          | "playAnimation"
          | "whoAreYou"
          | "bulkSetup"
          | "bulkSetupAck"
          | "bulkData"
          | "bulkDataAck"
          | "transferSettings"
          | "transferSettingsAck"
          | "transferSettingsFinished"
          | "debugLog"
          | "requestSettings"
          | "blinkAck"
          | "requestBatteryLevel"
          | "batteryLevel"
          | "requestRssi"
          | "rssi"
          | "notifyUser"
          | "notifyUserAck"
          | "storeValue"
          | "storeValueAck"
          | "programDefaultParameters"
          | "programDefaultParametersFinished"
          | "setName"
          | "setNameAck"
          | "powerOperation"
          | "exitValidation"
          | "requestTemperature"
          | "temperature"
          | "testBulkSend"
          | "testBulkReceive"
          | "attractMode"
          | "printA2DReadings"
          | "printAnimationControllerState"
          | "rollState"
          | "iAmADie"
          | "telemetry"
          | "transferAnimationSet"
          | "transferAnimationSetAck"
          | "transferAnimationSetFinished"
          | "transferTestAnimationSet"
          | "transferTestAnimationSetAck"
          | "transferTestAnimationSetFinished"
          | "playAnimationEvent"
          | "stopAnimation"
          | "remoteAction"
          | "requestRollState"
          | "requestAnimationSet"
          | "requestTelemetry"
          | "programDefaultAnimationSet"
          | "programDefaultAnimationSetFinished"
          | "requestDefaultAnimationSetColor"
          | "defaultAnimationSetColor"
          | "calibrate"
          | "calibrateFace"
          | "testHardware"
          | "setTopLevelState"
          | "setDesignAndColor"
          | "setDesignAndColorAck"
          | "setCurrentBehavior"
          | "setCurrentBehaviorAck"
          | "transferInstantAnimationSet"
          | "transferInstantAnimationSetAck"
          | "transferInstantAnimationSetFinished"
          | "playInstantAnimation"
          | "stopAllAnimations"
          | "setBatteryControllerMode"
          | "_unused"
          | "discharge"
          | "blinkId"
          | "blinkIdAck"
          | "transferTest"
          | "transferTestAck"
          | "transferTestFinished"
          | "clearSettings"
          | "clearSettingsAck"
          | "setAllLEDsToColor"
          | "printNormals"
          | "lightUpFace"
          | "setLEDToColor"

      The type of message to watch for.

    • listener: ((this: PixelConnect<PixelConnectMutableProps, PixelInfoWithStatus, string>, message:
          | "blink"
          | "none"
          | "playAnimation"
          | PixelMessage
          | "whoAreYou"
          | "bulkSetup"
          | "bulkSetupAck"
          | "bulkData"
          | "bulkDataAck"
          | "transferSettings"
          | "transferSettingsAck"
          | "transferSettingsFinished"
          | "debugLog"
          | "requestSettings"
          | "blinkAck"
          | "requestBatteryLevel"
          | "batteryLevel"
          | "requestRssi"
          | "rssi"
          | "notifyUser"
          | "notifyUserAck"
          | "storeValue"
          | "storeValueAck"
          | "programDefaultParameters"
          | "programDefaultParametersFinished"
          | "setName"
          | "setNameAck"
          | "powerOperation"
          | "exitValidation"
          | "requestTemperature"
          | "temperature"
          | "testBulkSend"
          | "testBulkReceive"
          | "attractMode"
          | "printA2DReadings"
          | "printAnimationControllerState"
          | "rollState"
          | "iAmADie"
          | "telemetry"
          | "transferAnimationSet"
          | "transferAnimationSetAck"
          | "transferAnimationSetFinished"
          | "transferTestAnimationSet"
          | "transferTestAnimationSetAck"
          | "transferTestAnimationSetFinished"
          | "playAnimationEvent"
          | "stopAnimation"
          | "remoteAction"
          | "requestRollState"
          | "requestAnimationSet"
          | "requestTelemetry"
          | "programDefaultAnimationSet"
          | "programDefaultAnimationSetFinished"
          | "requestDefaultAnimationSetColor"
          | "defaultAnimationSetColor"
          | "calibrate"
          | "calibrateFace"
          | "testHardware"
          | "setTopLevelState"
          | "setDesignAndColor"
          | "setDesignAndColorAck"
          | "setCurrentBehavior"
          | "setCurrentBehaviorAck"
          | "transferInstantAnimationSet"
          | "transferInstantAnimationSetAck"
          | "transferInstantAnimationSetFinished"
          | "playInstantAnimation"
          | "stopAllAnimations"
          | "setBatteryControllerMode"
          | "_unused"
          | "discharge"
          | "blinkId"
          | "blinkIdAck"
          | "transferTest"
          | "transferTestAck"
          | "transferTestFinished"
          | "clearSettings"
          | "clearSettingsAck"
          | "setAllLEDsToColor"
          | "printNormals"
          | "lightUpFace"
          | "setLEDToColor") => void)

      The callback function.

        • (this, message): void
        • Parameters

          • this: PixelConnect<PixelConnectMutableProps, PixelInfoWithStatus, string>
          • message:
                | "blink"
                | "none"
                | "playAnimation"
                | PixelMessage
                | "whoAreYou"
                | "bulkSetup"
                | "bulkSetupAck"
                | "bulkData"
                | "bulkDataAck"
                | "transferSettings"
                | "transferSettingsAck"
                | "transferSettingsFinished"
                | "debugLog"
                | "requestSettings"
                | "blinkAck"
                | "requestBatteryLevel"
                | "batteryLevel"
                | "requestRssi"
                | "rssi"
                | "notifyUser"
                | "notifyUserAck"
                | "storeValue"
                | "storeValueAck"
                | "programDefaultParameters"
                | "programDefaultParametersFinished"
                | "setName"
                | "setNameAck"
                | "powerOperation"
                | "exitValidation"
                | "requestTemperature"
                | "temperature"
                | "testBulkSend"
                | "testBulkReceive"
                | "attractMode"
                | "printA2DReadings"
                | "printAnimationControllerState"
                | "rollState"
                | "iAmADie"
                | "telemetry"
                | "transferAnimationSet"
                | "transferAnimationSetAck"
                | "transferAnimationSetFinished"
                | "transferTestAnimationSet"
                | "transferTestAnimationSetAck"
                | "transferTestAnimationSetFinished"
                | "playAnimationEvent"
                | "stopAnimation"
                | "remoteAction"
                | "requestRollState"
                | "requestAnimationSet"
                | "requestTelemetry"
                | "programDefaultAnimationSet"
                | "programDefaultAnimationSetFinished"
                | "requestDefaultAnimationSetColor"
                | "defaultAnimationSetColor"
                | "calibrate"
                | "calibrateFace"
                | "testHardware"
                | "setTopLevelState"
                | "setDesignAndColor"
                | "setDesignAndColorAck"
                | "setCurrentBehavior"
                | "setCurrentBehaviorAck"
                | "transferInstantAnimationSet"
                | "transferInstantAnimationSetAck"
                | "transferInstantAnimationSetFinished"
                | "playInstantAnimation"
                | "stopAllAnimations"
                | "setBatteryControllerMode"
                | "_unused"
                | "discharge"
                | "blinkId"
                | "blinkIdAck"
                | "transferTest"
                | "transferTestAck"
                | "transferTestFinished"
                | "clearSettings"
                | "clearSettingsAck"
                | "setAllLEDsToColor"
                | "printNormals"
                | "lightUpFace"
                | "setLEDToColor"

          Returns void

    Returns void

  • Requests the Pixel to blink and wait for a confirmation.

    Parameters

    • color: Color

      Blink color.

    • Optionalopt: {
          count?: number;
          duration?: number;
          faceMask?: number;
          fade?: number;
          loopCount?: number;
      }
      • Optionalcount?: number

        Number of blinks.

      • Optionalduration?: number

        Total duration of the animation in milliseconds.

      • OptionalfaceMask?: number

        Select which faces to light up.

      • Optionalfade?: number

        Amount of in and out fading, 0: sharp transition, 1: maximum fading.

      • OptionalloopCount?: number

        How many times to loop the animation.

    Returns Promise<void>

    A promise that resolves once the die has confirmed receiving the message.

  • Asynchronously tries to connect to the die. Throws on connection error.

    Parameters

    • timeoutMs: number = 0

      Delay before giving up (may be ignored when having concurrent calls to connect()). It may take longer than the given timeout for the function to return.

    Returns Promise<Pixel>

    A promise that resoles to this instance once the connection process has completed (whether successfully or not).

    Will throw a PixelConnectError if it fails to connect in time.

  • Emit a Pixel event for the specified property. This function should be called by the concrete type whenever the a property's value changes.

    Type Parameters

    • K extends
          | "name"
          | "status"
          | "batteryLevel"
          | "rssi"
          | "pixelId"
          | "ledCount"
          | "systemId"
          | "colorway"
          | "dieType"
          | "firmwareDate"
          | "isCharging"
          | "rollState"
          | "currentFace"
          | "currentFaceIndex"
          | "profileHash"
          | "isTransferring"

    Parameters

    • propertyName: K

      Event name.

    Returns void

  • Plays the instant animation at the given index. See

    Parameters

    • animIndex: number

      The index of the instant animation to play.

    Returns Promise<void>

    A promise that resolves once the message has been send.

    transferInstantAnimations().

  • Plays the (single) LEDs animation included in the given data set.

    Parameters

    • dataSet: Readonly<DataSet>

      The data set containing just one animation to play.

    Returns Promise<void>

    A promise that resolves once the transfer has completed.

  • Unregisters a listener from receiving events identified by the given event name. See PixelEventMap for the list of events and their associated data.

    Type Parameters

    • K extends
          | "dataTransfer"
          | "battery"
          | "rollState"
          | "remoteAction"
          | "statusChanged"
          | "messageReceived"
          | "messageSend"
          | "roll"
          | "userMessage"

    Parameters

    • type: K

      A case-sensitive string representing the event type.

    • listener: EventReceiver<Readonly<{
          battery: Readonly<{
              isCharging: boolean;
              level: number;
          }>;
          dataTransfer: Readonly<{
              totalBytes: number;
              type: "completed" | "preparing" | "starting";
          } | {
              error:
                  | "disconnected"
                  | "unknown"
                  | "timeout"
                  | "outOfMemory";
              type: "failed";
          } | {
              type: "progress";
          } & Readonly<{
              progressPercent: number;
              totalBytes: number;
              transferredBytes: number;
          }>>;
          messageReceived: MessageOrType;
          messageSend: MessageOrType;
          remoteAction: number;
          roll: number;
          rollState: Readonly<{
              face: number;
              faceIndex: number;
              state:
                  | "unknown"
                  | "handling"
                  | "rolling"
                  | "crooked"
                  | "rolled"
                  | "onFace";
          }>;
          statusChanged: Readonly<{
              lastStatus: PixelStatus;
              reason?:
                  | "canceled"
                  | "success"
                  | "unknown"
                  | "host"
                  | "timeout"
                  | "notSupported"
                  | "linkLoss"
                  | "bluetoothOff"
                  | "peripheral";
              status: PixelStatus;
          }>;
          userMessage: Readonly<{
              message: string;
              response: ((okCancel: boolean) => Promise<void>);
              withCancel: boolean;
          }>;
      }>[K]>

      The callback function to unregister.

    Returns void

  • Unregisters a listener from receiving raw messages of a given type.

    Parameters

    • msgType:
          | "blink"
          | "none"
          | "playAnimation"
          | "whoAreYou"
          | "bulkSetup"
          | "bulkSetupAck"
          | "bulkData"
          | "bulkDataAck"
          | "transferSettings"
          | "transferSettingsAck"
          | "transferSettingsFinished"
          | "debugLog"
          | "requestSettings"
          | "blinkAck"
          | "requestBatteryLevel"
          | "batteryLevel"
          | "requestRssi"
          | "rssi"
          | "notifyUser"
          | "notifyUserAck"
          | "storeValue"
          | "storeValueAck"
          | "programDefaultParameters"
          | "programDefaultParametersFinished"
          | "setName"
          | "setNameAck"
          | "powerOperation"
          | "exitValidation"
          | "requestTemperature"
          | "temperature"
          | "testBulkSend"
          | "testBulkReceive"
          | "attractMode"
          | "printA2DReadings"
          | "printAnimationControllerState"
          | "rollState"
          | "iAmADie"
          | "telemetry"
          | "transferAnimationSet"
          | "transferAnimationSetAck"
          | "transferAnimationSetFinished"
          | "transferTestAnimationSet"
          | "transferTestAnimationSetAck"
          | "transferTestAnimationSetFinished"
          | "playAnimationEvent"
          | "stopAnimation"
          | "remoteAction"
          | "requestRollState"
          | "requestAnimationSet"
          | "requestTelemetry"
          | "programDefaultAnimationSet"
          | "programDefaultAnimationSetFinished"
          | "requestDefaultAnimationSetColor"
          | "defaultAnimationSetColor"
          | "calibrate"
          | "calibrateFace"
          | "testHardware"
          | "setTopLevelState"
          | "setDesignAndColor"
          | "setDesignAndColorAck"
          | "setCurrentBehavior"
          | "setCurrentBehaviorAck"
          | "transferInstantAnimationSet"
          | "transferInstantAnimationSetAck"
          | "transferInstantAnimationSetFinished"
          | "playInstantAnimation"
          | "stopAllAnimations"
          | "setBatteryControllerMode"
          | "_unused"
          | "discharge"
          | "blinkId"
          | "blinkIdAck"
          | "transferTest"
          | "transferTestAck"
          | "transferTestFinished"
          | "clearSettings"
          | "clearSettingsAck"
          | "setAllLEDsToColor"
          | "printNormals"
          | "lightUpFace"
          | "setLEDToColor"

      The type of message to watch for.

    • listener: ((this: PixelConnect<PixelConnectMutableProps, PixelInfoWithStatus, string>, msg:
          | "blink"
          | "none"
          | "playAnimation"
          | PixelMessage
          | "whoAreYou"
          | "bulkSetup"
          | "bulkSetupAck"
          | "bulkData"
          | "bulkDataAck"
          | "transferSettings"
          | "transferSettingsAck"
          | "transferSettingsFinished"
          | "debugLog"
          | "requestSettings"
          | "blinkAck"
          | "requestBatteryLevel"
          | "batteryLevel"
          | "requestRssi"
          | "rssi"
          | "notifyUser"
          | "notifyUserAck"
          | "storeValue"
          | "storeValueAck"
          | "programDefaultParameters"
          | "programDefaultParametersFinished"
          | "setName"
          | "setNameAck"
          | "powerOperation"
          | "exitValidation"
          | "requestTemperature"
          | "temperature"
          | "testBulkSend"
          | "testBulkReceive"
          | "attractMode"
          | "printA2DReadings"
          | "printAnimationControllerState"
          | "rollState"
          | "iAmADie"
          | "telemetry"
          | "transferAnimationSet"
          | "transferAnimationSetAck"
          | "transferAnimationSetFinished"
          | "transferTestAnimationSet"
          | "transferTestAnimationSetAck"
          | "transferTestAnimationSetFinished"
          | "playAnimationEvent"
          | "stopAnimation"
          | "remoteAction"
          | "requestRollState"
          | "requestAnimationSet"
          | "requestTelemetry"
          | "programDefaultAnimationSet"
          | "programDefaultAnimationSetFinished"
          | "requestDefaultAnimationSetColor"
          | "defaultAnimationSetColor"
          | "calibrate"
          | "calibrateFace"
          | "testHardware"
          | "setTopLevelState"
          | "setDesignAndColor"
          | "setDesignAndColorAck"
          | "setCurrentBehavior"
          | "setCurrentBehaviorAck"
          | "transferInstantAnimationSet"
          | "transferInstantAnimationSetAck"
          | "transferInstantAnimationSetFinished"
          | "playInstantAnimation"
          | "stopAllAnimations"
          | "setBatteryControllerMode"
          | "_unused"
          | "discharge"
          | "blinkId"
          | "blinkIdAck"
          | "transferTest"
          | "transferTestAck"
          | "transferTestFinished"
          | "clearSettings"
          | "clearSettingsAck"
          | "setAllLEDsToColor"
          | "printNormals"
          | "lightUpFace"
          | "setLEDToColor") => void)

      The callback function to unregister.

        • (this, msg): void
        • Parameters

          • this: PixelConnect<PixelConnectMutableProps, PixelInfoWithStatus, string>
          • msg:
                | "blink"
                | "none"
                | "playAnimation"
                | PixelMessage
                | "whoAreYou"
                | "bulkSetup"
                | "bulkSetupAck"
                | "bulkData"
                | "bulkDataAck"
                | "transferSettings"
                | "transferSettingsAck"
                | "transferSettingsFinished"
                | "debugLog"
                | "requestSettings"
                | "blinkAck"
                | "requestBatteryLevel"
                | "batteryLevel"
                | "requestRssi"
                | "rssi"
                | "notifyUser"
                | "notifyUserAck"
                | "storeValue"
                | "storeValueAck"
                | "programDefaultParameters"
                | "programDefaultParametersFinished"
                | "setName"
                | "setNameAck"
                | "powerOperation"
                | "exitValidation"
                | "requestTemperature"
                | "temperature"
                | "testBulkSend"
                | "testBulkReceive"
                | "attractMode"
                | "printA2DReadings"
                | "printAnimationControllerState"
                | "rollState"
                | "iAmADie"
                | "telemetry"
                | "transferAnimationSet"
                | "transferAnimationSetAck"
                | "transferAnimationSetFinished"
                | "transferTestAnimationSet"
                | "transferTestAnimationSetAck"
                | "transferTestAnimationSetFinished"
                | "playAnimationEvent"
                | "stopAnimation"
                | "remoteAction"
                | "requestRollState"
                | "requestAnimationSet"
                | "requestTelemetry"
                | "programDefaultAnimationSet"
                | "programDefaultAnimationSetFinished"
                | "requestDefaultAnimationSetColor"
                | "defaultAnimationSetColor"
                | "calibrate"
                | "calibrateFace"
                | "testHardware"
                | "setTopLevelState"
                | "setDesignAndColor"
                | "setDesignAndColorAck"
                | "setCurrentBehavior"
                | "setCurrentBehaviorAck"
                | "transferInstantAnimationSet"
                | "transferInstantAnimationSetAck"
                | "transferInstantAnimationSetFinished"
                | "playInstantAnimation"
                | "stopAllAnimations"
                | "setBatteryControllerMode"
                | "_unused"
                | "discharge"
                | "blinkId"
                | "blinkIdAck"
                | "transferTest"
                | "transferTestAck"
                | "transferTestFinished"
                | "clearSettings"
                | "clearSettingsAck"
                | "setAllLEDsToColor"
                | "printNormals"
                | "lightUpFace"
                | "setLEDToColor"

          Returns void

    Returns void

  • Requests the Pixel to change its name.

    Parameters

    • name: string

      New name to assign to the Pixel. Must have at least one character.

    Returns Promise<void>

    A promise that resolves once the die has confirmed being renamed.

  • Requests the Pixel to regularly send its measured RSSI value.

    Parameters

    • activate: boolean

      Whether to turn or turn off this feature.

    • minInterval: number = 5000

      The minimum time interval in milliseconds between two RSSI updates.

    Returns Promise<void>

    A promise that resolves once the message has been send.

  • Sends a message to the Pixel and wait for a specific response.

    Parameters

    • msgOrTypeToSend: MessageOrType

      Message with the data to send or just a message type.

    • responseType:
          | "blink"
          | "none"
          | "playAnimation"
          | "whoAreYou"
          | "bulkSetup"
          | "bulkSetupAck"
          | "bulkData"
          | "bulkDataAck"
          | "transferSettings"
          | "transferSettingsAck"
          | "transferSettingsFinished"
          | "debugLog"
          | "requestSettings"
          | "blinkAck"
          | "requestBatteryLevel"
          | "batteryLevel"
          | "requestRssi"
          | "rssi"
          | "notifyUser"
          | "notifyUserAck"
          | "storeValue"
          | "storeValueAck"
          | "programDefaultParameters"
          | "programDefaultParametersFinished"
          | "setName"
          | "setNameAck"
          | "powerOperation"
          | "exitValidation"
          | "requestTemperature"
          | "temperature"
          | "testBulkSend"
          | "testBulkReceive"
          | "attractMode"
          | "printA2DReadings"
          | "printAnimationControllerState"
          | "rollState"
          | "iAmADie"
          | "telemetry"
          | "transferAnimationSet"
          | "transferAnimationSetAck"
          | "transferAnimationSetFinished"
          | "transferTestAnimationSet"
          | "transferTestAnimationSetAck"
          | "transferTestAnimationSetFinished"
          | "playAnimationEvent"
          | "stopAnimation"
          | "remoteAction"
          | "requestRollState"
          | "requestAnimationSet"
          | "requestTelemetry"
          | "programDefaultAnimationSet"
          | "programDefaultAnimationSetFinished"
          | "requestDefaultAnimationSetColor"
          | "defaultAnimationSetColor"
          | "calibrate"
          | "calibrateFace"
          | "testHardware"
          | "setTopLevelState"
          | "setDesignAndColor"
          | "setDesignAndColorAck"
          | "setCurrentBehavior"
          | "setCurrentBehaviorAck"
          | "transferInstantAnimationSet"
          | "transferInstantAnimationSetAck"
          | "transferInstantAnimationSetFinished"
          | "playInstantAnimation"
          | "stopAllAnimations"
          | "setBatteryControllerMode"
          | "_unused"
          | "discharge"
          | "blinkId"
          | "blinkIdAck"
          | "transferTest"
          | "transferTestAck"
          | "transferTestFinished"
          | "clearSettings"
          | "clearSettingsAck"
          | "setAllLEDsToColor"
          | "printNormals"
          | "lightUpFace"
          | "setLEDToColor"

      Expected response type.

    • timeoutMs: number = Constants.ackMessageTimeout

      Timeout in mill-seconds before aborting waiting for the response.

    Returns Promise<MessageOrType>

    A promise resolving to the response in the form of a message type or a message object.

  • Sends a message to the Pixel and wait for a specific response which is returned casted to the expected type.

    Type Parameters

    • T extends PixelMessage

    Parameters

    • msgOrTypeToSend: MessageOrType

      Message with the data to send or just a message type.

    • responseType: (new () => T)

      Expected response class type.

        • new (): T
        • Returns T

    • timeoutMs: number = Constants.ackMessageTimeout

    Returns Promise<T>

    A promise resolving to a message object of the expected type.

  • Sends a message to the Pixel.

    Parameters

    • msgOrType: MessageOrType

      Message with the data to send or just a message type.

    • withoutAck: boolean = false

      Whether to request a confirmation that the message was received.

    Returns Promise<void>

    A promise that resolves once the message has been send.

  • Uploads the given data set of animations to the Pixel flash memory.

    Parameters

    • dataSet: Readonly<DataSet>

      The data set to upload.

    Returns Promise<void>

    A promise that resolves once the transfer has completed.

  • Uploads the given data set of animations to the Pixel RAM memory. Those animations are lost when the Pixel goes to sleep, is turned off or is restarted.

    Parameters

    • dataSet: Readonly<DataSet>

      The data set to upload.

    Returns Promise<void>

    A promise that resolves once the transfer has completed.

  • Update Pixel info from an external source such as scanning data.

    Parameters

    • info: Partial<Omit<Readonly<{
          batteryLevel: number;
          colorway:
              | "custom"
              | "clear"
              | "unknown"
              | "onyxBlack"
              | "hematiteGrey"
              | "midnightGalaxy"
              | "auroraSky"
              | "whiteAurora";
          currentFace: number;
          currentFaceIndex: number;
          dieType:
              | "unknown"
              | "d4"
              | "d6"
              | "d8"
              | "d10"
              | "d00"
              | "d12"
              | "d20"
              | "d6pipped"
              | "d6fudge";
          firmwareDate: Date;
          isCharging: boolean;
          ledCount: number;
          name: string;
          pixelId: number;
          rollState:
              | "unknown"
              | "handling"
              | "rolling"
              | "crooked"
              | "rolled"
              | "onFace";
          rssi: number;
          systemId: string;
      }>, "systemId" | "currentFace">>

      The updated info.

    Returns void

    The info will be updated only if the die is disconnected. Roll state and face index are updated only if both are provided.