export interface ActivateContext {
  pluginId: string;
  logger: PluginLogger;
  subscriptions: CommandDisposable[];
  commands?: CommandRegistry;
  storage?: PluginStorage;
}

export interface IdeAPluginModule {
  activate(ctx: ActivateContext): void | Promise<void>;
  deactivate?(): void | Promise<void>;
}

export interface PluginLogger {
  debug(message: string, ...args: unknown[]): void;
  info(message: string, ...args: unknown[]): void;
  warn(message: string, ...args: unknown[]): void;
  error(message: string, ...args: unknown[]): void;
}

export type CommandHandler = (...args: unknown[]) => unknown | Promise<unknown>;

export interface CommandRegistry {
  registerCommand(commandId: string, handler: CommandHandler): CommandDisposable;
}

export interface CommandDisposable {
  dispose(): void;
}

export interface PluginStorage {
  get<T = unknown>(key: string): Promise<T | undefined>;
  set<T = unknown>(key: string, value: T): Promise<void>;
  delete(key: string): Promise<void>;
}

