import type { JsonValue, LiveSandboxedPluginApiV1, NativePluginApiV1, NativePluginComponentsApi, NativePluginMarkdownMountOptions, NativePluginNoteEditorMountOptions, NativePluginSearchViewMountOptions, PluginJobRunContext, PluginJobRunStatusDto, PluginNetworkRequestDto, PluginNetworkResponseDto, PluginRuntime, SandboxedPagePluginApiV1, Sha256Digest } from "@thortiq/plugin-api";
type FixtureApi<R extends PluginRuntime> = R extends "native" ? NativePluginApiV1 : R extends "sandboxed-page" ? SandboxedPagePluginApiV1 : LiveSandboxedPluginApiV1;
export interface FixtureNoteInput {
    readonly id: string;
    readonly title: string;
    readonly path?: string;
    readonly body?: string;
    readonly properties?: Readonly<Record<string, JsonValue>>;
}
export interface FixtureAssetInput {
    readonly path: string;
    readonly text?: string;
    readonly bytes?: Uint8Array;
    readonly mediaType?: string | null;
    readonly updatedAt?: string;
}
export interface FixtureComponentFactories {
    readonly searchView?: (container: HTMLElement, options: NativePluginSearchViewMountOptions) => ReturnType<NativePluginComponentsApi["searchView"]["mount"]>;
    readonly noteEditor?: (container: HTMLElement, options: NativePluginNoteEditorMountOptions) => ReturnType<NativePluginComponentsApi["noteEditor"]["mount"]>;
    readonly markdown?: (container: HTMLElement, options: NativePluginMarkdownMountOptions) => ReturnType<NativePluginComponentsApi["markdown"]["mount"]>;
}
export interface FixtureHostOptions<R extends PluginRuntime> {
    readonly runtime: R;
    readonly plugin?: {
        readonly id?: string;
        readonly name?: string;
        readonly version?: string;
        readonly digest?: Sha256Digest | null;
    };
    readonly notes?: readonly FixtureNoteInput[];
    readonly assets?: readonly FixtureAssetInput[];
    readonly settings?: Readonly<Record<string, JsonValue>>;
    readonly localStorage?: Readonly<Record<string, JsonValue>>;
    readonly syncedStorage?: Readonly<Record<string, JsonValue>>;
    readonly secrets?: readonly string[];
    readonly features?: Readonly<Record<string, boolean>>;
    readonly network?: (request: PluginNetworkRequestDto) => Promise<PluginNetworkResponseDto> | PluginNetworkResponseDto;
    readonly components?: FixtureComponentFactories;
}
export interface FixtureCalls {
    readonly network: PluginNetworkRequestDto[];
    readonly componentMounts: Array<{
        readonly kind: "searchView" | "noteEditor" | "markdown";
        readonly options: unknown;
    }>;
    readonly opened: Array<{
        readonly kind: "note" | "asset" | "view";
        readonly value: string;
    }>;
}
export interface FixturePluginHost<R extends PluginRuntime> {
    readonly api: FixtureApi<R>;
    readonly calls: FixtureCalls;
    readonly disposed: boolean;
    invokeCommand(id: string, input?: JsonValue | null): Promise<void>;
    runJob(id: string, reason?: PluginJobRunContext["reason"]): Promise<PluginJobRunStatusDto | null>;
    emitSettings(keys: readonly string[]): void;
    emitAsset(path: string): void;
    dispose(): Promise<void>;
}
export declare class FixturePluginError extends Error {
    readonly code: string;
    readonly retryable: boolean;
    constructor(code: string, message: string, retryable?: boolean);
}
export declare function createFixtureHost<R extends PluginRuntime>(options: FixtureHostOptions<R>): FixturePluginHost<R>;
export declare function createFixtureApi<R extends PluginRuntime>(options: FixtureHostOptions<R>): FixtureApi<R>;
export type { FixtureApi };
