@likecoin/epub-ts
    Preparing search index...

    Class Annotations

    Handles managing adding & removing Annotations

    Index

    Constructors

    Properties

    _annotations: Record<string, Annotation>
    _annotationsBySectionIndex: Record<number, string[]>
    highlights: Annotation[]
    marks: Annotation[]
    rendition: Rendition
    underlines: Annotation[]

    Methods

    • Add an annotation to store

      Parameters

      • type: string

        Type of annotation to add: "highlight", "underline", "mark"

      • cfiRange: string

        EpubCFI range to attach annotation to

      • Optionaldata: Record<string, any>

        Data to assign to annotation

      • Optionalcb: EventListener

        Callback after annotation is added

      • OptionalclassName: string

        CSS class to assign to annotation

      • Optionalstyles: Record<string, string>

        CSS styles to assign to annotation

      Returns Annotation

      annotation

    • iterate over annotations in the store

      Parameters

      • fn: (annotation: Annotation, key: string) => void

      Returns void

    • [Not Implemented] Hide annotations @TODO: needs implementation in View

      Returns void

    • Add a highlight to the store

      Parameters

      • cfiRange: string

        EpubCFI range to attach annotation to

      • Optionaldata: Record<string, any>

        Data to assign to annotation

      • Optionalcb: EventListener

        Callback after annotation is clicked

      • OptionalclassName: string

        CSS class to assign to annotation

      • Optionalstyles: Record<string, string>

        CSS styles to assign to annotation

      Returns Annotation

    • Add a mark to the store

      Parameters

      • cfiRange: string

        EpubCFI range to attach annotation to

      • Optionaldata: Record<string, any>

        Data to assign to annotation

      • Optionalcb: EventListener

        Callback after annotation is clicked

      Returns Annotation

    • Remove an annotation from store

      Parameters

      • cfiRange: string

        EpubCFI range the annotation is attached to

      • Optionaltype: string

        Type of annotation to add: "highlight", "underline", "mark"

      Returns void

    • [Not Implemented] Show annotations @TODO: needs implementation in View

      Returns void

    • Add a underline to the store

      Parameters

      • cfiRange: string

        EpubCFI range to attach annotation to

      • Optionaldata: Record<string, any>

        Data to assign to annotation

      • Optionalcb: EventListener

        Callback after annotation is clicked

      • OptionalclassName: string

        CSS class to assign to annotation

      • Optionalstyles: Record<string, string>

        CSS styles to assign to annotation

      Returns Annotation