N

plugins

namespace plugins

Functions

F

disable(id: string): void

Disables a plugin and stops it.

F

enable(id: string): void | Promise<void>

Enables a plugin and starts it.

F

get(id: string): AddonHandle | undefined

Reads one installed plugin by id.

Lists every installed plugin.

F

install(url: string, digest?: string): Promise<AddonHandle | undefined>

Installs a plugin from its manifest URL.

F

isEnabled(id: string): boolean

Reports whether a plugin is enabled.

F

reload(id: string, bundle: string, manifest: PushedManifest, bytecode?: string): Promise<ReloadResult>

Swaps a plugin's bundle in place, keeping its enabled state.

F

start(id: string): void | Promise<void>

Starts a plugin without changing its enabled state.

F

stop(id: string): void | Promise<void>

Stops a running plugin without changing its enabled state.

F

toggle(id: string): void

Enables a disabled plugin, or disables an enabled one.

F

uninstall(id: string): Promise<void>

Stops and removes an installed plugin.

F

selfTest(id: string): Promise<PluginSelfTestResult | undefined>

Runs a running plugin's self-test, as the device matrix does after restarting it.

Returns

Its report, or undefined when it is not running or has no self-test; rejects with what the self-test threw.

F

update(id: string): Promise<boolean>

Checks for updates, then applies this plugin's pending update.

Returns

Whether the plugin now runs a newer version.

Types

The outcome of an addon reload: success, or failure carrying the recorded error.

Variables

V

addons: ReadonlyMap<PropertyKey, AddonHandle>

Every installed plugin, keyed by id.

V

errors: ReadonlyMap<PropertyKey, Error>

The error each plugin that failed to load or start threw, keyed by id.

V

startDurations: ReadonlyMap<string, number>

How long each plugin's last start took, in milliseconds, keyed by id.