Skip to content
On this page

Athena.systems.plugins ​

Modules ​

Functions ​

addAPI ​

Usage

Athena.systems.plugins.addAPI(pluginName, functions): void

Injects a 'plugin' API into the runtime.

The runtime injection can be obtained with Athena.systems.plugins.use.

See that function for additional information.

Export

Parameters ​

NameType
pluginNamestring
functionsObject

Returns ​

void

Defined in ​

server/systems/plugins.ts:122


addCallback ​

Usage

Athena.systems.plugins.addCallback(callback): void

After plugins are finished loading; call these callbacks. Useful for using 'Athena API' at the top level of a document.

Parameters ​

NameType
callbackFunction

Returns ​

void

Defined in ​

server/systems/plugins.ts:85


getPlugins ​

Usage

Athena.systems.plugins.getPlugins(): string[]

Returns a list of all plugin names that are currently being loaded.

Static

Returns ​

string[]

Defined in ​

server/systems/plugins.ts:73


init ​

Usage

Athena.systems.plugins.init(): void

Loads all plugins.

Returns ​

void

Defined in ​

server/systems/plugins.ts:46


isDoneLoading ​

Usage

Athena.systems.plugins.isDoneLoading(): Promise<void>

Verifies if all plugins are done loading.

Returns ​

Promise<void>

Defined in ​

server/systems/plugins.ts:98


registerPlugin ​

Usage

Athena.systems.plugins.registerPlugin(name, callback): void

Register a callback for a plugin to begin its initialization period. This ensures that your plugin is ALWAYS loaded last.

Static

Parameters ​

NameType
namestring
callbackFunction

Returns ​

void

Defined in ​

server/systems/plugins.ts:62


useAPI ​

Usage

Athena.systems.plugins.useAPI<K>(apiName): Promise<ServerPluginAPI[K]>

Used to obtain a runtime API and its valid functionality.

This makes it so you can 'import' without knowing the plugin pathways.

As long as you know the 'plugin name' you can import anything.

Export

Type parameters ​

NameType
Kextends ExtractStringKeys<ServerPluginAPI>

Parameters ​

NameType
apiNameK

Returns ​

Promise<ServerPluginAPI[K]>

Defined in ​

server/systems/plugins.ts:143

Created by Stuyk | Est. 2020