Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VariableStore

This class is responsible for managing BetterTouchTool variables. It has similar usage to the ES6 Map object, but due to implementation specifics every method retunrs a promise.

Hierarchy

  • VariableStore

Index

Constructors

Methods

Constructors

constructor

Methods

del

  • del(key: string, persistent?: boolean): Promise<void>
  • "Deletes" specified variable. Depending on its type, it'll either be set to '' or -1

    Parameters

    • key: string

      a variable name that you want to delete

    • Optional persistent: boolean

      whether persistent or regular variable should be deleted

    Returns Promise<void>

get

  • get(key: string, mode?: "string" | "number"): Promise<number | string>
  • Retrieves BTT variable

    Parameters

    • key: string

      a variable name to retrieve

    • Optional mode: "string" | "number"

      string or number. Providing this parameter makes this method more efficient

    Returns Promise<number | string>

set

  • set(key: string, value: string | number, isPersistent?: boolean): Promise<CallResult>
  • Sets the variable name to specific value

    Parameters

    • key: string

      a name of the variable that is supposed to be saved

    • value: string | number

      new value of the variable

    • Optional isPersistent: boolean

      whether the variable should persist after BTT reboot

    Returns Promise<CallResult>