mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +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;
|
|
}
|