Skip to content

basalt / core/src / BasaltPlugin

Interface: BasaltPlugin<TConfig> ​

Defined in: core/src/plugin.ts:18

Type Parameters ​

TConfig ​

TConfig = unknown

Properties ​

configSchema? ​

> optional configSchema?: ConfigSchema<TConfig>

Defined in: core/src/plugin.ts:24

Validates the plugin's config slice at boot — fail fast


dependsOn? ​

> optional dependsOn?: string[]

Defined in: core/src/plugin.ts:22

Names of plugins that must register/boot before this one


name ​

> name: string

Defined in: core/src/plugin.ts:20

Unique name, by convention basalt:<package> or app:<name>

Methods ​

boot()? ​

> optional boot(context): void | Promise&lt;void&gt;

Defined in: core/src/plugin.ts:28

Phase 2: connect, subscribe to hooks, start resources.

Parameters ​

context ​

PluginContext&lt;TConfig&gt;

Returns ​

void | Promise&lt;void&gt;


register()? ​

> optional register(context): void | Promise&lt;void&gt;

Defined in: core/src/plugin.ts:26

Phase 1: register bindings in the container. No I/O side effects.

Parameters ​

context ​

PluginContext&lt;TConfig&gt;

Returns ​

void | Promise&lt;void&gt;


shutdown()? ​

> optional shutdown(context): void | Promise&lt;void&gt;

Defined in: core/src/plugin.ts:30

Graceful shutdown, in reverse boot order.

Parameters ​

context ​

PluginContext&lt;TConfig&gt;

Returns ​

void | Promise&lt;void&gt;

Released under the MIT License.