# ImageEditorActions (@salmonui/editors/image-editor)

> The ImageEditorActions interface of @salmonui/editors/image-editor: actionsRef: imperative operations.

Canonical: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorActions

```ts
import type { ImageEditorActions } from '@salmonui/editors/image-editor';
```

Entry index: https://salmonui.dev/docs/reference/editors/image-editor (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/editors/image-editor.md).

## Reference

Kind: interface

```ts
interface ImageEditorActions {
    toBlob(options?: ImageEditorExportOptions): Promise<Blob | null>;
    toDataURL(options?: ImageEditorExportOptions): Promise<string | null>;
    toImageData(): Promise<ImageData | null>;
    open(source: ImageEditorSource): void;
    undo(): void;
    redo(): void;
    reset(): void;
    zoomTo(zoom: number): void;
    select(id: string | null): void;
    setTool(tool: ImageEditorTool): void;
    getSize(): {
        width: number;
        height: number;
    } | null;
    focus(): void;
}
```

`actionsRef`: imperative operations.

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `toBlob` | `toBlob(options?: ImageEditorExportOptions): Promise<Blob \| null>;` |  | The edited image at output size; `null` when nothing is loaded or `onBeforeExport` cancelled. |
| `toDataURL` | `toDataURL(options?: ImageEditorExportOptions): Promise<string \| null>;` |  |  |
| `toImageData` | `toImageData(): Promise<ImageData \| null>;` |  |  |
| `open` | `open(source: ImageEditorSource): void;` |  | Opens another image; the edit starts over. |
| `undo` | `undo(): void;` |  |  |
| `redo` | `redo(): void;` |  |  |
| `reset` | `reset(): void;` |  |  |
| `zoomTo` | `zoomTo(zoom: number): void;` |  | Proposes a committed zoom (clamped to `minZoom` / `maxZoom`). |
| `select` | `select(id: string \| null): void;` |  | Selects an annotation by id (`null` clears). |
| `setTool` | `setTool(tool: ImageEditorTool): void;` |  |  |
| `getSize` | `getSize(): {     width: number;     height: number; } \| null;` |  | Output size of the current edit, or `null` before load. |
| `focus` | `focus(): void;` |  | Focuses the canvas. |
