/**
 * plugins.ts — Plugin system for @nice2dev/ui-graphics editors.
 *
 * Allows third-party extensions to register custom tools, filters,
 * export formats, and UI panels for any editor.
 */
export type EditorType = "pixel" | "vector" | "photo" | "animation" | "game";
export interface PluginTool {
    id: string;
    label: string;
    icon?: string;
    cursor?: string;
    onActivate?: () => void;
    onDeactivate?: () => void;
    onPointerDown?: (x: number, y: number, ctx: CanvasRenderingContext2D) => void;
    onPointerMove?: (x: number, y: number, ctx: CanvasRenderingContext2D) => void;
    onPointerUp?: (x: number, y: number, ctx: CanvasRenderingContext2D) => void;
}
export interface PluginFilter {
    id: string;
    label: string;
    category?: string;
    apply: (imageData: ImageData) => ImageData;
}
export interface PluginExporter {
    id: string;
    label: string;
    extension: string;
    mimeType: string;
    export: (data: unknown) => Blob | Promise<Blob>;
}
export interface PluginPanel {
    id: string;
    label: string;
    position: "left" | "right" | "bottom";
    render: (props: {
        editor: unknown;
    }) => React.ReactNode;
}
export interface PluginMenuAction {
    id: string;
    label: string;
    menu: "file" | "edit" | "view" | "tools" | "help";
    shortcut?: string;
    execute: () => void;
}
export interface EditorPlugin {
    id: string;
    name: string;
    version: string;
    description?: string;
    /** Which editors this plugin applies to. Empty = all. */
    editors?: EditorType[];
    tools?: PluginTool[];
    filters?: PluginFilter[];
    exporters?: PluginExporter[];
    panels?: PluginPanel[];
    menuActions?: PluginMenuAction[];
    /** Called when plugin is loaded. */
    onInit?: () => void;
    /** Called when plugin is unloaded. */
    onDestroy?: () => void;
}
import React from "react";
type PluginEventHandler = (plugin: EditorPlugin) => void;
declare class PluginRegistryImpl {
    private plugins;
    private listeners;
    /** Register a plugin. Calls onInit if defined. */
    register(plugin: EditorPlugin): void;
    /** Unregister a plugin. Calls onDestroy if defined. */
    unregister(pluginId: string): void;
    /** Get a registered plugin by ID. */
    get(pluginId: string): EditorPlugin | undefined;
    /** Get all registered plugins. */
    getAll(): EditorPlugin[];
    /** Get plugins for a specific editor type. */
    getForEditor(editor: EditorType): EditorPlugin[];
    /** Get all tools from plugins for a specific editor. */
    getTools(editor: EditorType): PluginTool[];
    /** Get all filters from plugins for a specific editor. */
    getFilters(editor: EditorType): PluginFilter[];
    /** Get all exporters from plugins for a specific editor. */
    getExporters(editor: EditorType): PluginExporter[];
    /** Get all panels from plugins for a specific editor. */
    getPanels(editor: EditorType): PluginPanel[];
    /** Get all menu actions from plugins for a specific editor. */
    getMenuActions(editor: EditorType): PluginMenuAction[];
    /** Subscribe to registry events. */
    on(event: string, handler: PluginEventHandler): () => void;
    private emit;
    /** Clear all plugins. */
    clear(): void;
}
/** Global plugin registry singleton. */
export declare const PluginRegistry: PluginRegistryImpl;
/** React hook that returns plugins for a specific editor, re-renders on changes. */
export declare function usePlugins(editor: EditorType): {
    plugins: EditorPlugin[];
    tools: PluginTool[];
    filters: PluginFilter[];
    exporters: PluginExporter[];
    panels: PluginPanel[];
    menuActions: PluginMenuAction[];
};
export declare const NicePluginProvider: React.FC<{
    plugins?: EditorPlugin[];
    children: React.ReactNode;
}>;
export declare function usePluginRegistry(): PluginRegistryImpl;
export {};
