# @salmonui/editors/image-editor API reference

> 45 exported symbols of @salmonui/editors/image-editor: 1 function, 24 interfaces, 14 types and 6 constants.

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

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

## Functions

### ImageEditor

Kind: function

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditor

```ts
function ImageEditor(props: ImageEditorProps): ReactElement;
```

ImageEditor: crop, rotate, straighten, flip, resize, zoom and pan, finetune
and filter presets, frames, shape / text / freehand / image annotations,
redaction, undo and redo, and export through `actionsRef`.
`.salmon-image-editor` with `data-status` and `data-tool`; `ref` is the
canvas (`role="img"`).

## Interfaces

### ImageEditorActions

Kind: interface

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

```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. |

### ImageEditorAdjustments

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorAdjustments

```ts
interface ImageEditorAdjustments {
    readonly brightness?: number | undefined;
    readonly contrast?: number | undefined;
    readonly hue?: number | undefined;
    readonly saturation?: number | undefined;
    readonly exposure?: number | undefined;
    readonly opacity?: number | undefined;
    readonly blur?: number | undefined;
}
```

Finetune values; 0 is neutral except `opacity` (100).

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `brightness` | `readonly brightness?: number \| undefined;` | optional | -100 to 100. |
| `contrast` | `readonly contrast?: number \| undefined;` | optional | -100 to 100. |
| `hue` | `readonly hue?: number \| undefined;` | optional | Hue rotation in degrees, -180 to 180. |
| `saturation` | `readonly saturation?: number \| undefined;` | optional | -100 to 100. |
| `exposure` | `readonly exposure?: number \| undefined;` | optional | -100 to 100 (an exponential brightness: +100 doubles, -100 halves). |
| `opacity` | `readonly opacity?: number \| undefined;` | optional | 0 to 100. Default 100. |
| `blur` | `readonly blur?: number \| undefined;` | optional | Blur radius in source pixels, 0 to 20. |

### ImageEditorBeforeEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorBeforeEvent

```ts
interface ImageEditorBeforeEvent<T> extends ImageEditorEvent<T> {
    readonly defaultPrevented: boolean;
    preventDefault(): void;
}
```

Before-callback payload; `preventDefault()` cancels the operation.

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `defaultPrevented` | `readonly defaultPrevented: boolean;` |  |  |
| `preventDefault` | `preventDefault(): void;` |  |  |
| `operation` | `operation: ImageEditorOperation;` | inherited |  |
| `previous` | `previous: T;` | inherited |  |
| `value` | `value: T;` | inherited |  |
| `source` | `source: ImageEditorInputSource;` | inherited |  |
| `action` | `action?: "add" \| "clone" \| "delete" \| "reorder" \| "update";` | optional, inherited | Annotation operations: what happened. |

### ImageEditorBeforeExportEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorBeforeExportEvent

```ts
interface ImageEditorBeforeExportEvent {
    readonly type: string;
    readonly quality: number | undefined;
    readonly width: number;
    readonly height: number;
    readonly defaultPrevented: boolean;
    preventDefault(): void;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: string;` |  |  |
| `quality` | `readonly quality: number \| undefined;` |  |  |
| `width` | `readonly width: number;` |  |  |
| `height` | `readonly height: number;` |  |  |
| `defaultPrevented` | `readonly defaultPrevented: boolean;` |  |  |
| `preventDefault` | `preventDefault(): void;` |  |  |

### ImageEditorBoxAnnotation

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorBoxAnnotation

```ts
interface ImageEditorBoxAnnotation extends AnnotationCommon, ImageEditorShapeStyle {
    readonly kind: 'rectangle' | 'ellipse';
    readonly x: number;
    readonly y: number;
    readonly width: number;
    readonly height: number;
    readonly radius?: number | undefined;
}
```

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `readonly kind: 'rectangle' \| 'ellipse';` |  |  |
| `x` | `readonly x: number;` |  |  |
| `y` | `readonly y: number;` |  |  |
| `width` | `readonly width: number;` |  |  |
| `height` | `readonly height: number;` |  |  |
| `radius` | `readonly radius?: number \| undefined;` | optional | Corner radius of a rectangle. |
| `id` | `id: string;` | inherited | Stable id; selection, history and callbacks use it. |
| `rotation` | `rotation?: number;` | optional, inherited | Clockwise degrees around the annotation's center. Default 0. |
| `opacity` | `opacity?: number;` | optional, inherited | 0 to 1. Default 1. |
| `stroke` | `stroke?: string;` | optional, inherited | CSS color; `'transparent'` or omitted draws no stroke for filled shapes. Default `'#e5484d'`. |
| `fill` | `fill?: string;` | optional, inherited | CSS color; omitted draws no fill. |
| `strokeWidth` | `strokeWidth?: number;` | optional, inherited | Default 4. |

### ImageEditorChangeEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorChangeEvent

```ts
interface ImageEditorChangeEvent {
    readonly source: ImageEditorInputSource;
    readonly reason: ImageEditorOperation | 'add' | 'update' | 'delete' | 'clone' | 'reorder';
}
```

Second argument of the change callbacks (frozen).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `source` | `readonly source: ImageEditorInputSource;` |  |  |
| `reason` | `readonly reason: ImageEditorOperation \| 'add' \| 'update' \| 'delete' \| 'clone' \| 'reorder';` |  |  |

### ImageEditorCrop

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorCrop

```ts
interface ImageEditorCrop {
    readonly x: number;
    readonly y: number;
    readonly width: number;
    readonly height: number;
    readonly shape?: ImageEditorCropShape | undefined;
}
```

A crop in oriented-image pixels.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `x` | `readonly x: number;` |  |  |
| `y` | `readonly y: number;` |  |  |
| `width` | `readonly width: number;` |  |  |
| `height` | `readonly height: number;` |  |  |
| `shape` | `readonly shape?: ImageEditorCropShape \| undefined;` | optional | `'circle'` keeps the inscribed ellipse; the corners export transparent. Default `'rect'`. |

### ImageEditorCustomItem

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorCustomItem

```ts
interface ImageEditorCustomItem {
    readonly id: string;
    readonly label: string;
    readonly icon?: ReactNode;
    readonly disabled?: boolean | undefined;
    readonly onClick?: ((actions: ImageEditorActions) => void) | undefined;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  |  |
| `label` | `readonly label: string;` |  | Accessible name and tooltip. |
| `icon` | `readonly icon?: ReactNode;` | optional | Decorative icon; without one the label is shown. |
| `disabled` | `readonly disabled?: boolean \| undefined;` | optional |  |
| `onClick` | `readonly onClick?: ((actions: ImageEditorActions) => void) \| undefined;` | optional |  |

### ImageEditorEditCompleteEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorEditCompleteEvent

```ts
interface ImageEditorEditCompleteEvent {
    readonly operation: ImageEditorOperation;
    readonly source: ImageEditorInputSource;
    readonly state: ImageEditorEditState;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `operation` | `readonly operation: ImageEditorOperation;` |  |  |
| `source` | `readonly source: ImageEditorInputSource;` |  |  |
| `state` | `readonly state: ImageEditorEditState;` |  |  |

### ImageEditorEditState

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorEditState

```ts
interface ImageEditorEditState {
    readonly transform: ImageEditorTransform;
    readonly adjustments: ImageEditorAdjustments;
    readonly filter: ImageEditorFilter;
    readonly frame: ImageEditorFrame;
    readonly annotations: readonly ImageEditorAnnotation[];
}
```

The undoable edit: everything history records.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `transform` | `readonly transform: ImageEditorTransform;` |  |  |
| `adjustments` | `readonly adjustments: ImageEditorAdjustments;` |  |  |
| `filter` | `readonly filter: ImageEditorFilter;` |  |  |
| `frame` | `readonly frame: ImageEditorFrame;` |  |  |
| `annotations` | `readonly annotations: readonly ImageEditorAnnotation[];` |  |  |

### ImageEditorEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorEvent

```ts
interface ImageEditorEvent<T> {
    readonly operation: ImageEditorOperation;
    readonly previous: T;
    readonly value: T;
    readonly source: ImageEditorInputSource;
    readonly action?: 'add' | 'update' | 'delete' | 'clone' | 'reorder' | undefined;
}
```

After-callback payload: the value before and after the operation.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `operation` | `readonly operation: ImageEditorOperation;` |  |  |
| `previous` | `readonly previous: T;` |  |  |
| `value` | `readonly value: T;` |  |  |
| `source` | `readonly source: ImageEditorInputSource;` |  |  |
| `action` | `readonly action?: 'add' \| 'update' \| 'delete' \| 'clone' \| 'reorder' \| undefined;` | optional | Annotation operations: what happened. |

### ImageEditorExportOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorExportOptions

```ts
interface ImageEditorExportOptions {
    readonly type?: string | undefined;
    readonly quality?: number | undefined;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type?: string \| undefined;` | optional | Default `'image/png'`. |
| `quality` | `readonly quality?: number \| undefined;` | optional | 0 to 1 for lossy types. |

### ImageEditorFlip

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorFlip

```ts
interface ImageEditorFlip {
    readonly horizontal?: boolean | undefined;
    readonly vertical?: boolean | undefined;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `horizontal` | `readonly horizontal?: boolean \| undefined;` | optional |  |
| `vertical` | `readonly vertical?: boolean \| undefined;` | optional |  |

### ImageEditorFrame

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorFrame

```ts
interface ImageEditorFrame {
    readonly type: ImageEditorFrameType;
    readonly color?: string | undefined;
    readonly gradientColor?: string | undefined;
    readonly size?: number | undefined;
    readonly inset?: number | undefined;
    readonly radius?: number | undefined;
}
```

A frame drawn over the output edges.

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: ImageEditorFrameType;` |  |  |
| `color` | `readonly color?: string \| undefined;` | optional | Default `'#ffffff'`. |
| `gradientColor` | `readonly gradientColor?: string \| undefined;` | optional | A second color: the frame fills with a linear gradient from `color` to it. |
| `size` | `readonly size?: number \| undefined;` | optional | Band or line width in output pixels. Default 5 % of the shorter side. |
| `inset` | `readonly inset?: number \| undefined;` | optional | Distance of the `line`, `inset` and `hook` strokes from the edge. Default `size`. |
| `radius` | `readonly radius?: number \| undefined;` | optional | Corner radius of the opening (`mat`, `bevel`, `inset`) or of the line. Default 0. |

### ImageEditorHistoryState

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorHistoryState

```ts
interface ImageEditorHistoryState {
    readonly canUndo: boolean;
    readonly canRedo: boolean;
    readonly undoCount: number;
    readonly redoCount: number;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `canUndo` | `readonly canUndo: boolean;` |  |  |
| `canRedo` | `readonly canRedo: boolean;` |  |  |
| `undoCount` | `readonly undoCount: number;` |  |  |
| `redoCount` | `readonly redoCount: number;` |  |  |

### ImageEditorImageAnnotation

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorImageAnnotation

```ts
interface ImageEditorImageAnnotation extends AnnotationCommon {
    readonly kind: 'image';
    readonly x: number;
    readonly y: number;
    readonly width: number;
    readonly height: number;
    readonly src: string;
}
```

Image annotation.

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `readonly kind: 'image';` |  |  |
| `x` | `readonly x: number;` |  |  |
| `y` | `readonly y: number;` |  |  |
| `width` | `readonly width: number;` |  |  |
| `height` | `readonly height: number;` |  |  |
| `src` | `readonly src: string;` |  | URL or data URL. |
| `id` | `id: string;` | inherited | Stable id; selection, history and callbacks use it. |
| `rotation` | `rotation?: number;` | optional, inherited | Clockwise degrees around the annotation's center. Default 0. |
| `opacity` | `opacity?: number;` | optional, inherited | 0 to 1. Default 1. |

### ImageEditorLocaleText

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorLocaleText

```ts
interface ImageEditorLocaleText {
    readonly toolbar: string;
    readonly canvas: string;
    readonly empty: string;
    readonly loading: string;
    readonly loadError: string;
    readonly keyboardHint: string;
    readonly quickToolbar: string;
    readonly open: string;
    readonly undo: string;
    readonly redo: string;
    readonly reset: string;
    readonly zoomIn: string;
    readonly zoomOut: string;
    readonly pan: string;
    readonly select: string;
    readonly crop: string;
    readonly rotateLeft: string;
    readonly rotateRight: string;
    readonly flipHorizontal: string;
    readonly flipVertical: string;
    readonly straighten: string;
    readonly resize: string;
    readonly adjust: string;
    readonly filter: string;
    readonly frame: string;
    readonly rectangle: string;
    readonly ellipse: string;
    readonly line: string;
    readonly arrow: string;
    readonly path: string;
    readonly text: string;
    readonly freehand: string;
    readonly image: string;
    readonly redact: string;
    readonly save: string;
    readonly edit: string;
    readonly clone: string;
    readonly delete: string;
    readonly bringForward: string;
    readonly sendBackward: string;
    readonly bringToFront: string;
    readonly sendToBack: string;
    readonly applyCrop: string;
    readonly cancelCrop: string;
    readonly apply: string;
    readonly width: string;
    readonly height: string;
    readonly keepAspectRatio: string;
    readonly brightness: string;
    readonly contrast: string;
    readonly hue: string;
    readonly saturation: string;
    readonly exposure: string;
    readonly opacity: string;
    readonly blur: string;
    readonly ratioFree: string;
    readonly ratioSquare: string;
    readonly ratioCircle: string;
    readonly filterDefault: string;
    readonly filterChrome: string;
    readonly filterCold: string;
    readonly filterWarm: string;
    readonly filterGrayscale: string;
    readonly filterSepia: string;
    readonly filterInvert: string;
    readonly frameNone: string;
    readonly frameMat: string;
    readonly frameBevel: string;
    readonly frameLine: string;
    readonly frameInset: string;
    readonly frameHook: string;
    readonly frameColor: string;
    readonly frameSize: string;
    readonly strokeColor: string;
    readonly fillColor: string;
    readonly strokeWidth: string;
    readonly fontSize: string;
    readonly redactBlur: string;
    readonly redactPixelate: string;
    readonly strength: string;
    readonly textEditor: string;
    readonly announce: (operation: ImageEditorOperation, detail?: string) => string;
}
```

User-visible strings.

Members (82):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `toolbar` | `readonly toolbar: string;` |  |  |
| `canvas` | `readonly canvas: string;` |  |  |
| `empty` | `readonly empty: string;` |  |  |
| `loading` | `readonly loading: string;` |  |  |
| `loadError` | `readonly loadError: string;` |  |  |
| `keyboardHint` | `readonly keyboardHint: string;` |  |  |
| `quickToolbar` | `readonly quickToolbar: string;` |  |  |
| `open` | `readonly open: string;` |  |  |
| `undo` | `readonly undo: string;` |  |  |
| `redo` | `readonly redo: string;` |  |  |
| `reset` | `readonly reset: string;` |  |  |
| `zoomIn` | `readonly zoomIn: string;` |  |  |
| `zoomOut` | `readonly zoomOut: string;` |  |  |
| `pan` | `readonly pan: string;` |  |  |
| `select` | `readonly select: string;` |  |  |
| `crop` | `readonly crop: string;` |  |  |
| `rotateLeft` | `readonly rotateLeft: string;` |  |  |
| `rotateRight` | `readonly rotateRight: string;` |  |  |
| `flipHorizontal` | `readonly flipHorizontal: string;` |  |  |
| `flipVertical` | `readonly flipVertical: string;` |  |  |
| `straighten` | `readonly straighten: string;` |  |  |
| `resize` | `readonly resize: string;` |  |  |
| `adjust` | `readonly adjust: string;` |  |  |
| `filter` | `readonly filter: string;` |  |  |
| `frame` | `readonly frame: string;` |  |  |
| `rectangle` | `readonly rectangle: string;` |  |  |
| `ellipse` | `readonly ellipse: string;` |  |  |
| `line` | `readonly line: string;` |  |  |
| `arrow` | `readonly arrow: string;` |  |  |
| `path` | `readonly path: string;` |  |  |
| `text` | `readonly text: string;` |  |  |
| `freehand` | `readonly freehand: string;` |  |  |
| `image` | `readonly image: string;` |  |  |
| `redact` | `readonly redact: string;` |  |  |
| `save` | `readonly save: string;` |  |  |
| `edit` | `readonly edit: string;` |  |  |
| `clone` | `readonly clone: string;` |  |  |
| `delete` | `readonly delete: string;` |  |  |
| `bringForward` | `readonly bringForward: string;` |  |  |
| `sendBackward` | `readonly sendBackward: string;` |  |  |
| `bringToFront` | `readonly bringToFront: string;` |  |  |
| `sendToBack` | `readonly sendToBack: string;` |  |  |
| `applyCrop` | `readonly applyCrop: string;` |  |  |
| `cancelCrop` | `readonly cancelCrop: string;` |  |  |
| `apply` | `readonly apply: string;` |  |  |
| `width` | `readonly width: string;` |  |  |
| `height` | `readonly height: string;` |  |  |
| `keepAspectRatio` | `readonly keepAspectRatio: string;` |  |  |
| `brightness` | `readonly brightness: string;` |  |  |
| `contrast` | `readonly contrast: string;` |  |  |
| `hue` | `readonly hue: string;` |  |  |
| `saturation` | `readonly saturation: string;` |  |  |
| `exposure` | `readonly exposure: string;` |  |  |
| `opacity` | `readonly opacity: string;` |  |  |
| `blur` | `readonly blur: string;` |  |  |
| `ratioFree` | `readonly ratioFree: string;` |  |  |
| `ratioSquare` | `readonly ratioSquare: string;` |  |  |
| `ratioCircle` | `readonly ratioCircle: string;` |  |  |
| `filterDefault` | `readonly filterDefault: string;` |  |  |
| `filterChrome` | `readonly filterChrome: string;` |  |  |
| `filterCold` | `readonly filterCold: string;` |  |  |
| `filterWarm` | `readonly filterWarm: string;` |  |  |
| `filterGrayscale` | `readonly filterGrayscale: string;` |  |  |
| `filterSepia` | `readonly filterSepia: string;` |  |  |
| `filterInvert` | `readonly filterInvert: string;` |  |  |
| `frameNone` | `readonly frameNone: string;` |  |  |
| `frameMat` | `readonly frameMat: string;` |  |  |
| `frameBevel` | `readonly frameBevel: string;` |  |  |
| `frameLine` | `readonly frameLine: string;` |  |  |
| `frameInset` | `readonly frameInset: string;` |  |  |
| `frameHook` | `readonly frameHook: string;` |  |  |
| `frameColor` | `readonly frameColor: string;` |  |  |
| `frameSize` | `readonly frameSize: string;` |  |  |
| `strokeColor` | `readonly strokeColor: string;` |  |  |
| `fillColor` | `readonly fillColor: string;` |  |  |
| `strokeWidth` | `readonly strokeWidth: string;` |  |  |
| `fontSize` | `readonly fontSize: string;` |  |  |
| `redactBlur` | `readonly redactBlur: string;` |  |  |
| `redactPixelate` | `readonly redactPixelate: string;` |  |  |
| `strength` | `readonly strength: string;` |  |  |
| `textEditor` | `readonly textEditor: string;` |  |  |
| `announce` | `readonly announce: (operation: ImageEditorOperation, detail?: string) => string;` |  | Live-region text for a committed operation. |

### ImageEditorPointsAnnotation

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorPointsAnnotation

```ts
interface ImageEditorPointsAnnotation extends AnnotationCommon, ImageEditorShapeStyle {
    readonly kind: 'line' | 'arrow' | 'path' | 'freehand';
    readonly points: readonly number[];
    readonly closed?: boolean | undefined;
}
```

`line` and `arrow` use two points; `path` and `freehand` any number. Points are `[x0, y0, x1, y1, ...]`.

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `readonly kind: 'line' \| 'arrow' \| 'path' \| 'freehand';` |  |  |
| `points` | `readonly points: readonly number[];` |  |  |
| `closed` | `readonly closed?: boolean \| undefined;` | optional | `path` only: joins the last point to the first (and fills with `fill`). |
| `id` | `id: string;` | inherited | Stable id; selection, history and callbacks use it. |
| `rotation` | `rotation?: number;` | optional, inherited | Clockwise degrees around the annotation's center. Default 0. |
| `opacity` | `opacity?: number;` | optional, inherited | 0 to 1. Default 1. |
| `stroke` | `stroke?: string;` | optional, inherited | CSS color; `'transparent'` or omitted draws no stroke for filled shapes. Default `'#e5484d'`. |
| `fill` | `fill?: string;` | optional, inherited | CSS color; omitted draws no fill. |
| `strokeWidth` | `strokeWidth?: number;` | optional, inherited | Default 4. |

### ImageEditorProps

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorProps

```ts
interface ImageEditorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onLoad' | 'onSelect' | 'defaultValue' | 'onChange' | 'children'> {
    readonly src?: ImageEditorSource | null | undefined;
    readonly crossOrigin?: '' | 'anonymous' | 'use-credentials' | null | undefined;
    readonly onLoad?: ((info: {
        readonly width: number;
        readonly height: number;
    }) => void) | undefined;
    readonly onLoadError?: ((error: unknown) => void) | undefined;
    readonly accept?: string | undefined;
    readonly transform?: ImageEditorTransform | undefined;
    readonly defaultTransform?: ImageEditorTransform | undefined;
    readonly onTransformChange?: ((transform: ImageEditorTransform, event: ImageEditorChangeEvent) => void) | undefined;
    readonly adjustments?: ImageEditorAdjustments | undefined;
    readonly defaultAdjustments?: ImageEditorAdjustments | undefined;
    readonly onAdjustmentsChange?: ((adjustments: ImageEditorAdjustments, event: ImageEditorChangeEvent) => void) | undefined;
    readonly filter?: ImageEditorFilter | undefined;
    readonly defaultFilter?: ImageEditorFilter | undefined;
    readonly onFilterChange?: ((filter: ImageEditorFilter, event: ImageEditorChangeEvent) => void) | undefined;
    readonly frame?: ImageEditorFrame | undefined;
    readonly defaultFrame?: ImageEditorFrame | undefined;
    readonly onFrameChange?: ((frame: ImageEditorFrame, event: ImageEditorChangeEvent) => void) | undefined;
    readonly annotations?: readonly ImageEditorAnnotation[] | undefined;
    readonly defaultAnnotations?: readonly ImageEditorAnnotation[] | undefined;
    readonly onAnnotationsChange?: ((annotations: readonly ImageEditorAnnotation[], event: ImageEditorChangeEvent) => void) | undefined;
    readonly tool?: ImageEditorTool | undefined;
    readonly defaultTool?: ImageEditorTool | undefined;
    readonly onToolChange?: ((tool: ImageEditorTool, event: ImageEditorChangeEvent) => void) | undefined;
    readonly cropRatios?: readonly ImageEditorCropRatio[] | undefined;
    readonly minZoom?: number | undefined;
    readonly maxZoom?: number | undefined;
    readonly undoLimit?: number | undefined;
    readonly imageSmoothing?: boolean | undefined;
    readonly annotationDefaults?: Partial<ImageEditorShapeStyle & {
        fontFamily: string;
        fontSize: number;
        color: string;
    }> | undefined;
    readonly toolbar?: readonly ImageEditorToolbarItem[] | false | undefined;
    readonly renderToolbar?: ((toolbar: ReactNode, actions: ImageEditorActions) => ReactNode) | undefined;
    readonly onToolbarItemClick?: ((event: ImageEditorToolbarItemClickEvent) => void) | undefined;
    readonly quickAccessToolbar?: readonly ImageEditorQuickItemId[] | false | undefined;
    readonly onHistoryChange?: ((history: ImageEditorHistoryState) => void) | undefined;
    readonly onEditComplete?: ((event: ImageEditorEditCompleteEvent) => void) | undefined;
    readonly onBeforeExport?: ((event: ImageEditorBeforeExportEvent) => void) | undefined;
    readonly onSave?: ((blob: Blob) => void) | undefined;
    readonly onBeforeCrop?: ((event: ImageEditorBeforeEvent<ImageEditorCrop | null>) => void) | undefined;
    readonly onCrop?: ((event: ImageEditorEvent<ImageEditorCrop | null>) => void) | undefined;
    readonly onBeforeRotate?: ((event: ImageEditorBeforeEvent<{
        readonly rotation: number;
        readonly straighten: number;
    }>) => void) | undefined;
    readonly onRotate?: ((event: ImageEditorEvent<{
        readonly rotation: number;
        readonly straighten: number;
    }>) => void) | undefined;
    readonly onBeforeFlip?: ((event: ImageEditorBeforeEvent<ImageEditorFlip>) => void) | undefined;
    readonly onFlip?: ((event: ImageEditorEvent<ImageEditorFlip>) => void) | undefined;
    readonly onBeforeResize?: ((event: ImageEditorBeforeEvent<{
        readonly width: number;
        readonly height: number;
    } | null>) => void) | undefined;
    readonly onResize?: ((event: ImageEditorEvent<{
        readonly width: number;
        readonly height: number;
    } | null>) => void) | undefined;
    readonly onBeforeZoom?: ((event: ImageEditorBeforeEvent<number>) => void) | undefined;
    readonly onZoom?: ((event: ImageEditorEvent<number>) => void) | undefined;
    readonly onBeforePan?: ((event: ImageEditorBeforeEvent<{
        readonly x: number;
        readonly y: number;
    }>) => void) | undefined;
    readonly onPan?: ((event: ImageEditorEvent<{
        readonly x: number;
        readonly y: number;
    }>) => void) | undefined;
    readonly onBeforeAnnotationChange?: ((event: ImageEditorBeforeEvent<readonly ImageEditorAnnotation[]>) => void) | undefined;
    readonly onAnnotationChange?: ((event: ImageEditorEvent<readonly ImageEditorAnnotation[]>) => void) | undefined;
    readonly onBeforeFilter?: ((event: ImageEditorBeforeEvent<ImageEditorFilter>) => void) | undefined;
    readonly onFilter?: ((event: ImageEditorEvent<ImageEditorFilter>) => void) | undefined;
    readonly onBeforeAdjust?: ((event: ImageEditorBeforeEvent<ImageEditorAdjustments>) => void) | undefined;
    readonly onAdjust?: ((event: ImageEditorEvent<ImageEditorAdjustments>) => void) | undefined;
    readonly onBeforeFrame?: ((event: ImageEditorBeforeEvent<ImageEditorFrame>) => void) | undefined;
    readonly onFrame?: ((event: ImageEditorEvent<ImageEditorFrame>) => void) | undefined;
    readonly onBeforeSelect?: ((event: ImageEditorBeforeEvent<string | null>) => void) | undefined;
    readonly onSelect?: ((event: ImageEditorEvent<string | null>) => void) | undefined;
    readonly localeText?: Partial<ImageEditorLocaleText> | undefined;
    readonly classNames?: Partial<Record<ImageEditorPart, string>> | undefined;
    readonly styles?: Partial<Record<ImageEditorPart, CSSProperties>> | undefined;
    readonly actionsRef?: RefObject<ImageEditorActions | null> | undefined;
    readonly ref?: Ref<HTMLCanvasElement> | undefined;
}
```

Members (64):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `src` | `readonly src?: ImageEditorSource \| null \| undefined;` | optional | The image. |
| `crossOrigin` | `readonly crossOrigin?: '' \| 'anonymous' \| 'use-credentials' \| null \| undefined;` | optional | `crossOrigin` of a URL source. Default `'anonymous'` (export needs an untainted canvas). |
| `onLoad` | `readonly onLoad?: ((info: {     readonly width: number;     readonly height: number; }) => void) \| undefined;` | optional |  |
| `onLoadError` | `readonly onLoadError?: ((error: unknown) => void) \| undefined;` | optional |  |
| `accept` | `readonly accept?: string \| undefined;` | optional | `accept` of the `'open'` item's file input. Default `'image/*'`. |
| `transform` | `readonly transform?: ImageEditorTransform \| undefined;` | optional |  |
| `defaultTransform` | `readonly defaultTransform?: ImageEditorTransform \| undefined;` | optional |  |
| `onTransformChange` | `readonly onTransformChange?: ((transform: ImageEditorTransform, event: ImageEditorChangeEvent) => void) \| undefined;` | optional |  |
| `adjustments` | `readonly adjustments?: ImageEditorAdjustments \| undefined;` | optional |  |
| `defaultAdjustments` | `readonly defaultAdjustments?: ImageEditorAdjustments \| undefined;` | optional |  |
| `onAdjustmentsChange` | `readonly onAdjustmentsChange?: ((adjustments: ImageEditorAdjustments, event: ImageEditorChangeEvent) => void) \| undefined;` | optional |  |
| `filter` | `readonly filter?: ImageEditorFilter \| undefined;` | optional |  |
| `defaultFilter` | `readonly defaultFilter?: ImageEditorFilter \| undefined;` | optional |  |
| `onFilterChange` | `readonly onFilterChange?: ((filter: ImageEditorFilter, event: ImageEditorChangeEvent) => void) \| undefined;` | optional |  |
| `frame` | `readonly frame?: ImageEditorFrame \| undefined;` | optional |  |
| `defaultFrame` | `readonly defaultFrame?: ImageEditorFrame \| undefined;` | optional |  |
| `onFrameChange` | `readonly onFrameChange?: ((frame: ImageEditorFrame, event: ImageEditorChangeEvent) => void) \| undefined;` | optional |  |
| `annotations` | `readonly annotations?: readonly ImageEditorAnnotation[] \| undefined;` | optional |  |
| `defaultAnnotations` | `readonly defaultAnnotations?: readonly ImageEditorAnnotation[] \| undefined;` | optional |  |
| `onAnnotationsChange` | `readonly onAnnotationsChange?: ((annotations: readonly ImageEditorAnnotation[], event: ImageEditorChangeEvent) => void) \| undefined;` | optional |  |
| `tool` | `readonly tool?: ImageEditorTool \| undefined;` | optional |  |
| `defaultTool` | `readonly defaultTool?: ImageEditorTool \| undefined;` | optional |  |
| `onToolChange` | `readonly onToolChange?: ((tool: ImageEditorTool, event: ImageEditorChangeEvent) => void) \| undefined;` | optional |  |
| `cropRatios` | `readonly cropRatios?: readonly ImageEditorCropRatio[] \| undefined;` | optional | Crop presets in the crop panel. Default `['free', 'square', 'circle', '3:2', '4:3', '16:9']`. |
| `minZoom` | `readonly minZoom?: number \| undefined;` | optional | Default 1. |
| `maxZoom` | `readonly maxZoom?: number \| undefined;` | optional | Default 10. |
| `undoLimit` | `readonly undoLimit?: number \| undefined;` | optional | Maximum undo steps. Default 50. |
| `imageSmoothing` | `readonly imageSmoothing?: boolean \| undefined;` | optional | Maps to `ctx.imageSmoothingEnabled` on the view and the export. Default `true`. |
| `annotationDefaults` | `readonly annotationDefaults?: Partial<ImageEditorShapeStyle & {     fontFamily: string;     fontSize: number;     color: string; }> \| undefined;` | optional | Style of new annotations (stroke, fill, width, font). |
| `toolbar` | `readonly toolbar?: readonly ImageEditorToolbarItem[] \| false \| undefined;` | optional | Toolbar items. Default `IMAGE_EDITOR_DEFAULT_TOOLBAR`; `false` hides the toolbar. |
| `renderToolbar` | `readonly renderToolbar?: ((toolbar: ReactNode, actions: ImageEditorActions) => ReactNode) \| undefined;` | optional | Replaces the toolbar: receives the default toolbar element and the actions. |
| `onToolbarItemClick` | `readonly onToolbarItemClick?: ((event: ImageEditorToolbarItemClickEvent) => void) \| undefined;` | optional |  |
| `quickAccessToolbar` | `readonly quickAccessToolbar?: readonly ImageEditorQuickItemId[] \| false \| undefined;` | optional | Quick-access items; `false` hides the quick-access toolbar. |
| `onHistoryChange` | `readonly onHistoryChange?: ((history: ImageEditorHistoryState) => void) \| undefined;` | optional |  |
| `onEditComplete` | `readonly onEditComplete?: ((event: ImageEditorEditCompleteEvent) => void) \| undefined;` | optional |  |
| `onBeforeExport` | `readonly onBeforeExport?: ((event: ImageEditorBeforeExportEvent) => void) \| undefined;` | optional |  |
| `onSave` | `readonly onSave?: ((blob: Blob) => void) \| undefined;` | optional | The `'save'` toolbar item exports a PNG and passes it here (the download is the application's). |
| `onBeforeCrop` | `readonly onBeforeCrop?: ((event: ImageEditorBeforeEvent<ImageEditorCrop \| null>) => void) \| undefined;` | optional |  |
| `onCrop` | `readonly onCrop?: ((event: ImageEditorEvent<ImageEditorCrop \| null>) => void) \| undefined;` | optional |  |
| `onBeforeRotate` | `readonly onBeforeRotate?: ((event: ImageEditorBeforeEvent<{     readonly rotation: number;     readonly straighten: number; }>) => void) \| undefined;` | optional |  |
| `onRotate` | `readonly onRotate?: ((event: ImageEditorEvent<{     readonly rotation: number;     readonly straighten: number; }>) => void) \| undefined;` | optional |  |
| `onBeforeFlip` | `readonly onBeforeFlip?: ((event: ImageEditorBeforeEvent<ImageEditorFlip>) => void) \| undefined;` | optional |  |
| `onFlip` | `readonly onFlip?: ((event: ImageEditorEvent<ImageEditorFlip>) => void) \| undefined;` | optional |  |
| `onBeforeResize` | `readonly onBeforeResize?: ((event: ImageEditorBeforeEvent<{     readonly width: number;     readonly height: number; } \| null>) => void) \| undefined;` | optional |  |
| `onResize` | `readonly onResize?: ((event: ImageEditorEvent<{     readonly width: number;     readonly height: number; } \| null>) => void) \| undefined;` | optional |  |
| `onBeforeZoom` | `readonly onBeforeZoom?: ((event: ImageEditorBeforeEvent<number>) => void) \| undefined;` | optional |  |
| `onZoom` | `readonly onZoom?: ((event: ImageEditorEvent<number>) => void) \| undefined;` | optional |  |
| `onBeforePan` | `readonly onBeforePan?: ((event: ImageEditorBeforeEvent<{     readonly x: number;     readonly y: number; }>) => void) \| undefined;` | optional |  |
| `onPan` | `readonly onPan?: ((event: ImageEditorEvent<{     readonly x: number;     readonly y: number; }>) => void) \| undefined;` | optional |  |
| `onBeforeAnnotationChange` | `readonly onBeforeAnnotationChange?: ((event: ImageEditorBeforeEvent<readonly ImageEditorAnnotation[]>) => void) \| undefined;` | optional |  |
| `onAnnotationChange` | `readonly onAnnotationChange?: ((event: ImageEditorEvent<readonly ImageEditorAnnotation[]>) => void) \| undefined;` | optional |  |
| `onBeforeFilter` | `readonly onBeforeFilter?: ((event: ImageEditorBeforeEvent<ImageEditorFilter>) => void) \| undefined;` | optional |  |
| `onFilter` | `readonly onFilter?: ((event: ImageEditorEvent<ImageEditorFilter>) => void) \| undefined;` | optional |  |
| `onBeforeAdjust` | `readonly onBeforeAdjust?: ((event: ImageEditorBeforeEvent<ImageEditorAdjustments>) => void) \| undefined;` | optional |  |
| `onAdjust` | `readonly onAdjust?: ((event: ImageEditorEvent<ImageEditorAdjustments>) => void) \| undefined;` | optional |  |
| `onBeforeFrame` | `readonly onBeforeFrame?: ((event: ImageEditorBeforeEvent<ImageEditorFrame>) => void) \| undefined;` | optional |  |
| `onFrame` | `readonly onFrame?: ((event: ImageEditorEvent<ImageEditorFrame>) => void) \| undefined;` | optional |  |
| `onBeforeSelect` | `readonly onBeforeSelect?: ((event: ImageEditorBeforeEvent<string \| null>) => void) \| undefined;` | optional |  |
| `onSelect` | `readonly onSelect?: ((event: ImageEditorEvent<string \| null>) => void) \| undefined;` | optional |  |
| `localeText` | `readonly localeText?: Partial<ImageEditorLocaleText> \| undefined;` | optional |  |
| `classNames` | `readonly classNames?: Partial<Record<ImageEditorPart, string>> \| undefined;` | optional |  |
| `styles` | `readonly styles?: Partial<Record<ImageEditorPart, CSSProperties>> \| undefined;` | optional |  |
| `actionsRef` | `readonly actionsRef?: RefObject<ImageEditorActions \| null> \| undefined;` | optional | Imperative operations (export, history, zoom). |
| `ref` | `readonly ref?: Ref<HTMLCanvasElement> \| undefined;` | optional | The canvas (the primary focusable element). |

### ImageEditorRedactAnnotation

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorRedactAnnotation

```ts
interface ImageEditorRedactAnnotation extends AnnotationCommon {
    readonly kind: 'redact';
    readonly x: number;
    readonly y: number;
    readonly width: number;
    readonly height: number;
    readonly mode?: 'blur' | 'pixelate' | undefined;
    readonly strength?: number | undefined;
}
```

Redaction: burned into the pixels below it on render and export.

Members (10):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `readonly kind: 'redact';` |  |  |
| `x` | `readonly x: number;` |  |  |
| `y` | `readonly y: number;` |  |  |
| `width` | `readonly width: number;` |  |  |
| `height` | `readonly height: number;` |  |  |
| `mode` | `readonly mode?: 'blur' \| 'pixelate' \| undefined;` | optional | Default `'blur'`. |
| `strength` | `readonly strength?: number \| undefined;` | optional | Blur radius or pixel block size in oriented-image pixels. Default 12. |
| `id` | `id: string;` | inherited | Stable id; selection, history and callbacks use it. |
| `rotation` | `rotation?: number;` | optional, inherited | Clockwise degrees around the annotation's center. Default 0. |
| `opacity` | `opacity?: number;` | optional, inherited | 0 to 1. Default 1. |

### ImageEditorShapeStyle

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorShapeStyle

```ts
interface ImageEditorShapeStyle {
    readonly stroke?: string | undefined;
    readonly fill?: string | undefined;
    readonly strokeWidth?: number | undefined;
}
```

Stroke and fill of the shape kinds.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `stroke` | `readonly stroke?: string \| undefined;` | optional | CSS color; `'transparent'` or omitted draws no stroke for filled shapes. Default `'#e5484d'`. |
| `fill` | `readonly fill?: string \| undefined;` | optional | CSS color; omitted draws no fill. |
| `strokeWidth` | `readonly strokeWidth?: number \| undefined;` | optional | Default 4. |

### ImageEditorTextAnnotation

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorTextAnnotation

```ts
interface ImageEditorTextAnnotation extends AnnotationCommon {
    readonly kind: 'text';
    readonly x: number;
    readonly y: number;
    readonly text: string;
    readonly fontFamily?: string | undefined;
    readonly fontSize?: number | undefined;
    readonly color?: string | undefined;
    readonly bold?: boolean | undefined;
    readonly italic?: boolean | undefined;
}
```

Text annotation. `x`, `y` are the top-left corner of the first line.

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `readonly kind: 'text';` |  |  |
| `x` | `readonly x: number;` |  |  |
| `y` | `readonly y: number;` |  |  |
| `text` | `readonly text: string;` |  |  |
| `fontFamily` | `readonly fontFamily?: string \| undefined;` | optional | Default `'sans-serif'`. |
| `fontSize` | `readonly fontSize?: number \| undefined;` | optional | In oriented-image pixels. Default 32. |
| `color` | `readonly color?: string \| undefined;` | optional | Default `'#e5484d'`. |
| `bold` | `readonly bold?: boolean \| undefined;` | optional |  |
| `italic` | `readonly italic?: boolean \| undefined;` | optional |  |
| `id` | `id: string;` | inherited | Stable id; selection, history and callbacks use it. |
| `rotation` | `rotation?: number;` | optional, inherited | Clockwise degrees around the annotation's center. Default 0. |
| `opacity` | `opacity?: number;` | optional, inherited | 0 to 1. Default 1. |

### ImageEditorToolbarItemClickEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorToolbarItemClickEvent

```ts
interface ImageEditorToolbarItemClickEvent {
    readonly id: string;
    readonly source: ImageEditorInputSource;
    readonly defaultPrevented: boolean;
    preventDefault(): void;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  |  |
| `source` | `readonly source: ImageEditorInputSource;` |  |  |
| `defaultPrevented` | `readonly defaultPrevented: boolean;` |  |  |
| `preventDefault` | `preventDefault(): void;` |  | Skips the item's built-in action. |

### ImageEditorTransform

Kind: interface

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorTransform

```ts
interface ImageEditorTransform {
    readonly crop?: ImageEditorCrop | null | undefined;
    readonly rotation?: number | undefined;
    readonly straighten?: number | undefined;
    readonly flip?: ImageEditorFlip | undefined;
    readonly resize?: {
        readonly width: number;
        readonly height: number;
    } | null | undefined;
    readonly zoom?: number | undefined;
}
```

Geometry of the edit. Every field is optional; omitted means neutral.

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `crop` | `readonly crop?: ImageEditorCrop \| null \| undefined;` | optional | `null` or omitted: the whole oriented image. |
| `rotation` | `readonly rotation?: number \| undefined;` | optional | Clockwise degrees in 90-degree steps (normalized to 0, 90, 180, 270). |
| `straighten` | `readonly straighten?: number \| undefined;` | optional | Straighten angle in degrees, -45 to 45; the image scales up so no empty corner shows. |
| `flip` | `readonly flip?: ImageEditorFlip \| undefined;` | optional |  |
| `resize` | `readonly resize?: {     readonly width: number;     readonly height: number; } \| null \| undefined;` | optional | Output size in pixels; `null` or omitted keeps the crop size. |
| `zoom` | `readonly zoom?: number \| undefined;` | optional | Committed view zoom; 1 fits the image into the canvas. Not an edit (no history entry). |

## Types

### ImageEditorAnnotation

Kind: type

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorAnnotation

```ts
type ImageEditorAnnotation = ImageEditorBoxAnnotation | ImageEditorPointsAnnotation | ImageEditorTextAnnotation | ImageEditorImageAnnotation | ImageEditorRedactAnnotation;
```

Array order is z-order: the last annotation is drawn on top.

### ImageEditorAnnotationKind

Kind: type

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorAnnotationKind

```ts
type ImageEditorAnnotationKind = 'rectangle' | 'ellipse' | 'line' | 'arrow' | 'path' | 'text' | 'freehand' | 'image' | 'redact';
```

### ImageEditorCropRatio

Kind: type

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorCropRatio

```ts
type ImageEditorCropRatio = 'free' | 'square' | 'circle' | '3:2' | '4:3' | '16:9' | {
    readonly label: string;
    readonly ratio: number;
};
```

Crop ratio presets. A number is width / height.

### ImageEditorCropShape

Kind: type

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorCropShape

```ts
type ImageEditorCropShape = 'rect' | 'circle';
```

### ImageEditorFilter

Kind: type

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorFilter

```ts
type ImageEditorFilter = 'default' | 'chrome' | 'cold' | 'warm' | 'grayscale' | 'sepia' | 'invert';
```

Filter presets.

### ImageEditorFrameType

Kind: type

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorFrameType

```ts
type ImageEditorFrameType = 'none' | 'mat' | 'bevel' | 'line' | 'inset' | 'hook';
```

### ImageEditorInputSource

Kind: type

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorInputSource

```ts
type ImageEditorInputSource = 'pointer' | 'keyboard' | 'touch' | 'api';
```

Input that caused a change.

### ImageEditorOperation

Kind: type

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorOperation

```ts
type ImageEditorOperation = 'crop' | 'rotate' | 'flip' | 'resize' | 'zoom' | 'pan' | 'annotation' | 'filter' | 'adjustment' | 'frame' | 'selection' | 'undo' | 'redo' | 'reset' | 'open';
```

Operations reported by the before / after callbacks and `onEditComplete`.

### ImageEditorPart

Kind: type

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorPart

```ts
type ImageEditorPart = 'toolbar' | 'panel' | 'stage' | 'canvas' | 'quickToolbar';
```

### ImageEditorQuickItemId

Kind: type

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorQuickItemId

```ts
type ImageEditorQuickItemId = 'edit' | 'clone' | 'delete' | 'bringForward' | 'sendBackward' | 'bringToFront' | 'sendToBack' | 'applyCrop' | 'cancelCrop';
```

Quick-access items for a selected annotation or the crop.

### ImageEditorSource

Kind: type

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorSource

```ts
type ImageEditorSource = string | Blob | ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement;
```

What `src` accepts. A string is a URL or a data URL.

### ImageEditorTool

Kind: type

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorTool

```ts
type ImageEditorTool = 'select' | 'pan' | 'crop' | 'straighten' | 'resize' | 'adjust' | 'filter' | 'frame' | ImageEditorAnnotationKind;
```

Tools of the editor; `select` moves and resizes annotations, `pan` drags the zoomed view.

### ImageEditorToolbarItem

Kind: type

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorToolbarItem

```ts
type ImageEditorToolbarItem = ImageEditorToolbarItemId | '|' | ImageEditorCustomItem;
```

A toolbar entry: a built-in id, `'|'` for a separator, or a custom item.

### ImageEditorToolbarItemId

Kind: type

Page: https://salmonui.dev/docs/reference/editors/image-editor/ImageEditorToolbarItemId

```ts
type ImageEditorToolbarItemId = 'open' | 'undo' | 'redo' | 'reset' | 'zoomIn' | 'zoomOut' | 'pan' | 'select' | 'crop' | 'rotateLeft' | 'rotateRight' | 'flipHorizontal' | 'flipVertical' | 'straighten' | 'resize' | 'adjust' | 'filter' | 'frame' | ImageEditorAnnotationKind | 'save';
```

Built-in toolbar items.

## Constants

### IMAGE_EDITOR_DEFAULT_CROP_RATIOS

Kind: const

Page: https://salmonui.dev/docs/reference/editors/image-editor/IMAGE_EDITOR_DEFAULT_CROP_RATIOS

```ts
const IMAGE_EDITOR_DEFAULT_CROP_RATIOS: readonly ImageEditorCropRatio[];
```

### IMAGE_EDITOR_DEFAULT_LOCALE_TEXT

Kind: const

Page: https://salmonui.dev/docs/reference/editors/image-editor/IMAGE_EDITOR_DEFAULT_LOCALE_TEXT

```ts
const IMAGE_EDITOR_DEFAULT_LOCALE_TEXT: ImageEditorLocaleText;
```

### IMAGE_EDITOR_DEFAULT_QUICK_TOOLBAR

Kind: const

Page: https://salmonui.dev/docs/reference/editors/image-editor/IMAGE_EDITOR_DEFAULT_QUICK_TOOLBAR

```ts
const IMAGE_EDITOR_DEFAULT_QUICK_TOOLBAR: readonly ImageEditorQuickItemId[];
```

### IMAGE_EDITOR_DEFAULT_TOOLBAR

Kind: const

Page: https://salmonui.dev/docs/reference/editors/image-editor/IMAGE_EDITOR_DEFAULT_TOOLBAR

```ts
const IMAGE_EDITOR_DEFAULT_TOOLBAR: readonly ImageEditorToolbarItem[];
```

### IMAGE_EDITOR_FILTERS

Kind: const

Page: https://salmonui.dev/docs/reference/editors/image-editor/IMAGE_EDITOR_FILTERS

```ts
const IMAGE_EDITOR_FILTERS: readonly ImageEditorFilter[];
```

### IMAGE_EDITOR_FILTER_PRESETS

Kind: const

Page: https://salmonui.dev/docs/reference/editors/image-editor/IMAGE_EDITOR_FILTER_PRESETS

```ts
const FILTER_PRESETS: Readonly<Record<ImageEditorFilter, readonly FilterOp[]>>;
```

Preset definitions (CSS filter functions, applied before the finetune values).
