Skip to content

Install annot-core

@ingcreators/annot-core is the SVG annotation format + storage types layer. Install it directly when you’re building a new host (another editor, a Vim plugin, an extension for a different browser) and want to consume the format without a renderer.

Terminal window
npm install @ingcreators/annot-core

The root export is DOM-free by construction — you can import from it inside a Node script, a Cloudflare Worker, or a Web Worker without pulling in document / window.

import {
type ElementTree,
type ImageRecord,
type StorageProvider,
parseAnnotationSvg,
serializeAnnotationSvg,
DATA_ANNOT_VERSION,
} from "@ingcreators/annot-core";
  • Format primitivesparseAnnotationSvg / serializeAnnotationSvg + the data-annot-version attribute constants
  • Storage typesImageRecord, FolderRecord, StorageProvider
  • ElementTree — canonical screen-capture model + serializers
    • traversal helpers (@ingcreators/annot-core/element-tree)
  • Pure utilities — id generation, dasharray helpers, ZIP building, default colour constants
import {
rectForBoundingBox,
arrowBetween,
textAt,
} from "@ingcreators/annot-core/editor";

The /editor subpath holds jsdom-friendly element-takers — no real-browser dependencies, but they manipulate Element instances. Safe to use in tests that boot happy-dom or jsdom.

If you want a working annotated PNG out of an ImageRecord, install @ingcreators/annot-annotator. Core is the format + types layer; the renderer ships separately so you can pick a target (browser canvas, Node resvg-js, your own implementation).