DrawAction
An event that may change the drawing.
This is a type alias exported by @mapcairn/core, checked against version 0.2.0.
Signature
import type { DrawAction } from "@mapcairn/core";
type DrawAction = {
readonly type: "setMode";
readonly kind: DrawKind;
} | {
readonly type: "addVertex";
readonly at: LatLng;
} | {
readonly type: "insertVertex";
readonly shapeId: string;
readonly index: number;
readonly at: LatLng;
readonly coalesceKey?: string;
} | {
readonly type: "moveVertex";
readonly shapeId: string;
readonly index: number;
readonly to: LatLng;
readonly coalesceKey?: string;
} | {
readonly type: "removeVertex";
readonly shapeId: string;
readonly index: number;
} | {
readonly type: "setRadius";
readonly shapeId: string;
readonly metres: number;
readonly coalesceKey?: string;
} | {
readonly type: "finish";
} | {
readonly type: "cancel";
} | {
readonly type: "select";
readonly shapeId: string;
readonly vertex?: number | null;
} | {
readonly type: "deselect";
} | {
readonly type: "stepVertex";
readonly delta: 1 | -1;
} | {
readonly type: "deleteShape";
readonly shapeId: string;
} | {
readonly type: "clear";
} | {
readonly type: "undo";
} | {
readonly type: "redo";
} | {
readonly type: "load";
readonly shapes: readonly DrawShapeInput[];
} | {
readonly type: "import";
readonly shapes: readonly DrawShapeInput[];
};