Tools

Tools class. Basic utility class that provides common functionalities for other classes to extend. It serves as a base class for error handling, printing, and other utility operations.

Constructor

new Tools()

Members

app :App

Reference to the app instance

Type:

plugin :Plugin

Reference to the plugin instance that this Tools class is associated with

Type:

Methods

bindThis(…names) → {void}

Force bind methods to this context.

Since JavaScript's this is dynamic, this method is useful to ensure that the methods always refer to the correct instance of the class.

Typically, you would call this method in the constructor of your plugin class, passing an array of method names or imported functions that you want to bind.

Parameters:
NameTypeAttributesDescription
namesstring | function<repeatable>

Method's names or function references to bind to this context

Returns:
Type: 
void

(async) dispose() → {Promise.<void>}

Dispose internal references.

Returns:
Type: 
Promise.<void>