API reference
@salmonui/editors/image-editor
45 exported symbols: 1 function, 24 interfaces, 14 types and 6 constants. Each name links its page with the signature, docs and members.
import { … } from '@salmonui/editors/image-editor';Functions
ImageEditorImageEditor: crop, rotate, straighten, flip, resize, zoom and pan, finetune and filter presets, frames, shape / text / freehand / image annotations, redaction,…
Interfaces
ImageEditorActionsactionsRef: imperative operations.ImageEditorAdjustmentsFinetune values; 0 is neutral except opacity (100).ImageEditorBeforeEventBefore-callback payload; preventDefault() cancels the operation.ImageEditorBeforeExportEventImageEditorBoxAnnotationImageEditorChangeEventSecond argument of the change callbacks (frozen).ImageEditorCropA crop in oriented-image pixels.ImageEditorCustomItemImageEditorEditCompleteEventImageEditorEditStateThe undoable edit: everything history records.ImageEditorEventAfter-callback payload: the value before and after the operation.ImageEditorExportOptionsImageEditorFlipImageEditorFrameA frame drawn over the output edges.ImageEditorHistoryStateImageEditorImageAnnotationImage annotation.ImageEditorLocaleTextUser-visible strings.ImageEditorPointsAnnotationline and arrow use two points; path and freehand any number. Points are [x0, y0, x1, y1, ...].ImageEditorPropsImageEditorRedactAnnotationRedaction: burned into the pixels below it on render and export.ImageEditorShapeStyleStroke and fill of the shape kinds.ImageEditorTextAnnotationText annotation. x, y are the top-left corner of the first line.ImageEditorToolbarItemClickEventImageEditorTransformGeometry of the edit. Every field is optional; omitted means neutral.
Types
ImageEditorAnnotationArray order is z-order: the last annotation is drawn on top.ImageEditorAnnotationKindImageEditorCropRatioCrop ratio presets. A number is width / height.ImageEditorCropShapeImageEditorFilterFilter presets.ImageEditorFrameTypeImageEditorInputSourceInput that caused a change.ImageEditorOperationOperations reported by the before / after callbacks and onEditComplete.ImageEditorPartImageEditorQuickItemIdQuick-access items for a selected annotation or the crop.ImageEditorSourceWhat src accepts. A string is a URL or a data URL.ImageEditorToolTools of the editor; select moves and resizes annotations, pan drags the zoomed view.ImageEditorToolbarItemA toolbar entry: a built-in id, '|' for a separator, or a custom item.ImageEditorToolbarItemIdBuilt-in toolbar items.
Constants
IMAGE_EDITOR_DEFAULT_CROP_RATIOSIMAGE_EDITOR_DEFAULT_LOCALE_TEXTIMAGE_EDITOR_DEFAULT_QUICK_TOOLBARIMAGE_EDITOR_DEFAULT_TOOLBARIMAGE_EDITOR_FILTERSIMAGE_EDITOR_FILTER_PRESETSPreset definitions (CSS filter functions, applied before the finetune values).