View as Markdown

API reference: @salmonui/editors/image-editor

ImageEditorPointsAnnotationinterface

import type { ImageEditorPointsAnnotation } from '@salmonui/editors/image-editor';
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, ...].

ImageEditorPointsAnnotation members (9, 6 inherited)
NameSignatureDescription
kindreadonly kind: 'line' | 'arrow' | 'path' | 'freehand';
pointsreadonly points: readonly number[];
closedoptionalreadonly closed?: boolean | undefined;

path only: joins the last point to the first (and fills with fill).

idinheritedid: string;

Stable id; selection, history and callbacks use it.

rotationoptionalinheritedrotation?: number;

Clockwise degrees around the annotation's center. Default 0.

opacityoptionalinheritedopacity?: number;

0 to 1. Default 1.

strokeoptionalinheritedstroke?: string;

CSS color; 'transparent' or omitted draws no stroke for filled shapes. Default '#e5484d'.

filloptionalinheritedfill?: string;

CSS color; omitted draws no fill.

strokeWidthoptionalinheritedstrokeWidth?: number;

Default 4.