Skip to content

Commit

Permalink
feat: add direct call to annotationModule updateAnnotation within r…
Browse files Browse the repository at this point in the history
…eader instance
  • Loading branch information
Andrea Pruccoli committed Mar 25, 2024
1 parent b8c8b05 commit c28a77b
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 c28a77b

Please sign in to comment.