@linalgo/annotate-core
TypeScript icon, indicating that this package has built-in type declarations

0.0.17 • Public • Published

annotate-core

Installation

npm i @linalgo/annotate-core

How to use

import { Annotator } from './annotators/annotator';

document.addEventListener('selectionchange', function () {
  let selection = window.getSelection();
  range = selection.getRangeAt(0);
});

function highlight(range: Range) {
  const annotation = annotator.createAnnotation(range, 'test', 'test', document.URL, 'test');
  annotator.showAnnotation(annotation);
  console.log(JSON.stringify(annotation));
}

let range: Range;
const annotator = new Annotator(document, 'mark');
let btn = document.getElementById('button');
btn.addEventListener('click', (e: Event) => highlight(range));

/@linalgo/annotate-core/

    Package Sidebar

    Install

    npm i @linalgo/annotate-core

    Weekly Downloads

    1

    Version

    0.0.17

    License

    SEE LICENSE IN LICENSE

    Unpacked Size

    2.29 MB

    Total Files

    36

    Last publish

    Collaborators

    • nikhiln
    • gunjan.kothari
    • webcat
    • estelled
    • zermelozf