Skip to content

Commit

Permalink
Merge pull request #839 from MooDySmiles/feature/add-direct-update-an…
Browse files Browse the repository at this point in the history
…notation-method

feat: add direct call to annotationModule `updateAnnotation`
  • Loading branch information
aferditamuriqi authored Mar 26, 2024
2 parents b8c8b05 + c28a77b commit a4463bb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,16 @@ export default class D2Reader {
addAnnotation = async (highlight: Annotation) => {
return (await this.annotationModule?.addAnnotation(highlight)) ?? false;
};
/**
* Update annotation
*
* This should be used only when the add/delete of the annotation note
* is not directly handled in the `addAnnotation`/`addCommentToAnnotation`
* callback defined in the configuration of the D2Reader.load() method
* */
updateAnnotation = async (highlight: Annotation) => {
return (await this.annotationModule?.updateAnnotation(highlight)) ?? false;
};

/** Hide Annotation Layer */
hideAnnotationLayer = () => {
Expand Down

0 comments on commit a4463bb

Please sign in to comment.