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 ​
Name | Type |
---|---|
pluginName | string |
functions | Object |
Returns ​
void
Defined in ​
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 ​
Name | Type |
---|---|
callback | Function |
Returns ​
void
Defined in ​
getPlugins ​
Usage
Athena.systems.plugins.getPlugins(): string
[]
Returns a list of all plugin names that are currently being loaded.
Static
Returns ​
string
[]
Defined in ​
init ​
Usage
Athena.systems.plugins.init(): void
Loads all plugins.
Returns ​
void
Defined in ​
isDoneLoading ​
Usage
Athena.systems.plugins.isDoneLoading(): Promise
<void
>
Verifies if all plugins are done loading.
Returns ​
Promise
<void
>
Defined in ​
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 ​
Name | Type |
---|---|
name | string |
callback | Function |
Returns ​
void
Defined in ​
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 ​
Name | Type |
---|---|
K | extends ExtractStringKeys <ServerPluginAPI > |
Parameters ​
Name | Type |
---|---|
apiName | K |
Returns ​
Promise
<ServerPluginAPI
[K
]>