import type { Container } from './container.js'; import type { HookBus } from './hooks.js'; /** * Structural schema compatible with Zod (safeParse), without a runtime dependency. * Any validator with the same shape works. */ export interface ConfigSchema { safeParse(input: unknown): { success: boolean; data?: T; error?: unknown; }; } export interface PluginContext { container: Container; hooks: HookBus; config: TConfig; } export interface BasaltPlugin { /** Unique name, by convention `basalt:` or `app:` */ name: string; /** Names of plugins that must register/boot before this one */ dependsOn?: string[]; /** Validates the plugin's config slice at boot — fail fast */ configSchema?: ConfigSchema; /** Phase 1: register bindings in the container. No I/O side effects. */ register?(context: PluginContext): void | Promise; /** Phase 2: connect, subscribe to hooks, start resources. */ boot?(context: PluginContext): void | Promise; /** Graceful shutdown, in reverse boot order. */ shutdown?(context: PluginContext): void | Promise; } export declare function definePlugin(plugin: BasaltPlugin): BasaltPlugin;