import "./ImageEditor.css"; import type { Plugin, ViewPlugin } from "./types.js"; export type ImageEditorRef = { /** Returns the current edited blob, or null if no edits have been applied since the last source image. */ getCurrentBlob: () => Blob | null; /** * Runs a registered action plugin (e.g. `"rotate-cw"`) against the current image. * Use this instead of calling `plugin.execute()` directly so external toolbars and * keyboard shortcuts share the editor's image state and undo history. * Resolves once the resulting image has been applied. */ executeAction: (pluginId: string) => Promise; /** * Resolves once every queued action has been applied. Await this before `getCurrentBlob()` * to be sure an action started moments earlier is included. */ whenIdle: () => Promise; }; interface Props { imageUrl: string; /** Called when the user clicks the Done button. When omitted, the Done button is not shown. */ onConfirm?: (blob: Blob) => void; /** Called when the user wants to exit without saving. Shows a back button in the top bar. */ onCancel?: () => void; plugins: Plugin[]; /** Optional view plugin (e.g. zoom/pan) that wraps the canvas and contributes top-bar controls. */ viewPlugin?: ViewPlugin; } /** * Full-screen image editor shell. * Does not know about specific tools — behaviour is entirely driven by the `plugins` prop. * Tool plugins contribute an overlay and toolbar; action plugins execute immediately. * Supports undo/redo: each applied transformation is recorded with its EditAction list. */ export declare const ImageEditor: import("react").ForwardRefExoticComponent>; export {};