src/a11y/initEventHandlers.js
function reorderAnnotationsByType(documentId, pageNumber, type) {
  PDFJSAnnotate.getStoreAdapter().getAnnotations(documentId, pageNumber)
    .then((annotations) => {
      return annotations.annotations.filter((a) => {
        return a.type === type;
      });
    })
    .then((annotations) => {
      annotations.forEach((a) => {
        removeAnnotation(documentId, a.uuid);
      });

      return annotations;
    })
    .then(renderScreenReaderHints);
}
function reorderAnnotationsByType(documentId, pageNumber, type) {
  PDFJSAnnotate.getStoreAdapter().getAnnotations(documentId, pageNumber)
    .then((annotations) => {
      return annotations.annotations.filter((a) => {
        return a.type === type;
      });
    })
    .then((annotations) => {
      annotations.forEach((a) => {
        removeAnnotation(documentId, a.uuid);
      });

      return annotations;
    })
    .then(renderScreenReaderHints);
}
function reorderAnnotationsByType ( documentId , pageNumber , type ) { PDFJSAnnotate . getStoreAdapter ( ) . getAnnotations ( documentId , pageNumber ) . then ( ( annotations ) => { return annotations . annotations . filter ( ( a ) => { return a . type === type ; } ) ; } ) . then ( ( annotations ) => { annotations . forEach ( ( a ) => { removeAnnotation ( documentId , a . uuid ) ; } ) ; return annotations ; } ) . then ( renderScreenReaderHints ) ; }
Reorder the annotation numbers by annotation type

@param {String} documentId The ID of the document
@param {Number} pageNumber The page number of the annotations
@param {Strig} type The annotation type
Reorder the annotation numbers by annotation type