API reference: @salmonui/editors/image-editor
ImageEditorActionsinterface
import type { ImageEditorActions } from '@salmonui/editors/image-editor';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.
| Name | Signature | Description |
|---|---|---|
toBlob | toBlob(options?: ImageEditorExportOptions): Promise<Blob | null>; | The edited image at output size; |
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 |
select | select(id: string | null): void; | Selects an annotation by id ( |
setTool | setTool(tool: ImageEditorTool): void; | |
getSize | getSize(): {
width: number;
height: number;
} | null; | Output size of the current edit, or |
focus | focus(): void; | Focuses the canvas. |