# DrawAction

An event that may change the drawing.

This is a type alias exported by `@mapcairn/core`, checked against version 0.2.0.

## Signature

```ts
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[];
};
```

## See also

- [`DrawKind`](https://docs.mapcairn.com/api/core/DrawKind.md)
- [`LatLng`](https://docs.mapcairn.com/api/core/LatLng.md)
- [`DrawShapeInput`](https://docs.mapcairn.com/api/core/DrawShapeInput.md)

Source: [packages/core/src/draw/reducer.ts:122](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/draw/reducer.ts#L122)
