import { AnnotationType } from 'polar-shared/src/metadata/AnnotationType' ; import { ITextHighlight } from "polar-shared/src/metadata/ITextHighlight" ; import { IAreaHighlight } from "polar-shared/src/metadata/IAreaHighlight" ; import { IComment } from 'polar-shared/src/metadata/IComment' ; import { IFlashcard } from 'polar-shared/src/metadata/IFlashcard' ; export class AnnotationTypes { public static fromString ( val ) { return AnnotationType [ val as keyof typeof AnnotationType ] ; } public static toDataAttribute ( annotationType ) { return annotationType . toLowerCase ( ) . replace ( "_" , "-" ) ; } public static isTextHighlight ( annotation , type ) { return type === AnnotationType . TEXT_HIGHLIGHT ; } public static isAreaHighlight ( annotation , type ) { return type === AnnotationType . AREA_HIGHLIGHT ; } public static isComment ( annotation , type ) { return type === AnnotationType . COMMENT ; } public static isFlashcard ( annotation , type ) { return type === AnnotationType . FLASHCARD ; } }