mirror of
https://github.com/YuzuZensai/Termix.git
synced 2026-11-12 17:11:48 +00:00
14 lines
366 B
TypeScript
14 lines
366 B
TypeScript
import type { PluginContext } from "@termix/plugin-sdk/backend";
|
|||
|
|
|
||
|
|
let current: PluginContext | null = null;
|
||
|
|
|
||
|
|
/** Set in activate, cleared on deactivate. */
|
||
|
|
export function setPluginCtx(ctx: PluginContext | null): void {
|
||
|
|
current = ctx;
|
||
|
|
}
|
||
|
|
|
||
|
|
export function pluginCtx(): PluginContext {
|
||
|
|
if (!current) throw new Error("The plugin is not active");
|
||
|
|
return current;
|
||
|
|
}
|