import { EventBus } from '../core/EventBus';
import type { PluginDefinition, PluginContext, PluginManifest, ExtensionPoint, PluginStorage } from './PluginSDK';
export type TestStatus = 'passed' | 'failed' | 'skipped';
export interface TestResult {
    name: string;
    status: TestStatus;
    duration: number;
    error?: string;
}
export interface TestSuiteResult {
    pluginId: string;
    suiteName: string;
    results: TestResult[];
    passed: number;
    failed: number;
    skipped: number;
    totalDuration: number;
}
export interface PluginTestCase {
    name: string;
    skip?: boolean;
    fn: (ctx: TestPluginContext) => void | Promise<void>;
}
export declare class TestPluginStorage implements PluginStorage {
    private data;
    get<T>(key: string): T | undefined;
    set<T>(key: string, value: T): void;
    remove(key: string): void;
    clear(): void;
    keys(): string[];
    /** Snapshot current storage state for assertions. */
    snapshot(): Record<string, unknown>;
    get size(): number;
}
export declare class TestPluginContext implements PluginContext {
    readonly manifest: PluginManifest;
    readonly events: EventBus;
    readonly storage: TestPluginStorage;
    readonly logs: string[];
    readonly warnings: string[];
    readonly registeredExtensions: Map<ExtensionPoint, unknown[]>;
    constructor(manifest: PluginManifest);
    log: (message: string) => void;
    warn: (message: string) => void;
    registerExtension: <T>(point: ExtensionPoint, entry: T) => void;
    unregisterExtension: <T>(point: ExtensionPoint, entry: T) => void;
    /** Get all extensions registered for a given point. */
    getExtensions<T>(point: ExtensionPoint): T[];
    /** Count extensions for a given point. */
    extensionCount(point: ExtensionPoint): number;
    /** Check if any extension was registered for a given point. */
    hasExtension(point: ExtensionPoint): boolean;
    /** Get storage snapshot for assertion/comparison. */
    storageSnapshot(): Record<string, unknown>;
    /** Reset context to fresh state (between tests). */
    reset(): void;
}
export declare class PluginAssertionError extends Error {
    constructor(message: string);
}
export declare const pluginAssert: {
    /** Assert value is truthy. */
    ok(value: unknown, message?: string): void;
    /** Assert strict equality. */
    equal<T>(actual: T, expected: T, message?: string): void;
    /** Assert not equal. */
    notEqual<T>(actual: T, notExpected: T, message?: string): void;
    /** Assert deep equality (JSON comparison). */
    deepEqual(actual: unknown, expected: unknown, message?: string): void;
    /** Assert that a function throws. */
    throws(fn: () => unknown, message?: string): void;
    /** Assert async function throws. */
    throwsAsync(fn: () => Promise<unknown>, message?: string): Promise<void>;
    /** Assert array contains element. */
    contains<T>(arr: readonly T[], item: T, message?: string): void;
    /** Assert string includes substring. */
    includes(str: string, substr: string, message?: string): void;
    /** Assert extension was registered. */
    hasExtension(ctx: TestPluginContext, point: ExtensionPoint, message?: string): void;
    /** Assert extension count. */
    extensionCount(ctx: TestPluginContext, point: ExtensionPoint, expected: number, message?: string): void;
    /** Assert log message was emitted. */
    logged(ctx: TestPluginContext, substr: string, message?: string): void;
    /** Assert warning was emitted. */
    warned(ctx: TestPluginContext, substr: string, message?: string): void;
};
export declare class PluginTestRunner {
    private tests;
    private _beforeEach;
    private _afterEach;
    /** Add a test case. */
    test(name: string, fn: (ctx: TestPluginContext) => void | Promise<void>): this;
    /** Add a skipped test case. */
    skip(name: string, fn: (ctx: TestPluginContext) => void | Promise<void>): this;
    /** Run something before each test. */
    beforeEach(fn: (ctx: TestPluginContext) => void | Promise<void>): this;
    /** Run something after each test. */
    afterEach(fn: (ctx: TestPluginContext) => void | Promise<void>): this;
    /** Run all tests against a plugin. */
    run(plugin: PluginDefinition, suiteName?: string): Promise<TestSuiteResult>;
}
/** Create a default manifest for testing. */
export declare function createTestManifest(overrides?: Partial<PluginManifest>): PluginManifest;
/** Quick lifecycle test — activate, verify, deactivate. */
export declare function testPluginLifecycle(plugin: PluginDefinition): Promise<TestSuiteResult>;
/** Format test results as a readable string. */
export declare function formatTestResults(suite: TestSuiteResult): string;
