Message API/docs/components/annotation/api

API References

Technical reference for annotation and drawing tool control.

Message Structure

The `toolControl` message is the primary interface for managing active tools.

interface ToolControlMessage {
  type: 'toolControl';
  payload: 
    | { group: 'drawing' | 'annotation'; action: string; enabled?: boolean }
    | { command: 'clear' };
}
Message Structure

Interfaces & Types

Reference the available tool identifiers for annotation and drawing payloads.

Annotation Tool IDs

Text and markup tool identifiers.

const annotationIds = [
  'TEXT',
  'CALLOUT',
  'NOTE',
  'ERASE',
  'PAINT_HIGHLIGHTER',
  'PAINT_FREEHAND',
  'PAINT_TEXT_HIGHLIGHTING',
  'PAINT_POLYLINE',
];

Drawing Tool IDs

Shapes and arrows identifiers.

const drawingIds = [
  'SHAPE_RECTANGLE',
  'SHAPE_RECTANGLE_ROUNDED',
  'SHAPE_ELLIPSE',
  'SHAPE_CLOUD',
  'SHAPE_POLYGON',
  'ARROW_SINGLE_END',
  'ARROW_FILLED_SINGLE_END',
  'ARROW_BOTH_ENDS',
  'ARROW_FILLED_BOTH_ENDS',
];