import { GetPlanOptions, PlanResult, ActivationsService, BindingService, DeactivationsService, PlanResultCacheService } from '@inversifyjs/core';

interface PluginApi {
    define(name: string | symbol, method: (...args: any[]) => unknown): void;
    onPlan(handler: (options: GetPlanOptions, result: PlanResult) => void): void;
}

interface PluginContext {
    readonly activationService: ActivationsService;
    readonly bindingService: BindingService;
    readonly deactivationService: DeactivationsService;
    readonly planResultCacheService: PlanResultCacheService;
}

declare const isPlugin: unique symbol;
declare abstract class Plugin<TContainer> {
    readonly [isPlugin]: true;
    protected readonly _container: TContainer;
    protected readonly _context: PluginContext;
    constructor(container: TContainer, context: PluginContext);
    abstract load(api: PluginApi): void;
}

export { Plugin, isPlugin };
export type { PluginApi, PluginContext };
