import { SerializedObject } from './SerializedObject' ; import { ReadingProgress } from 'polar-shared/src/metadata/ReadingProgress' ; import { IPageMeta } from "polar-shared/src/metadata/IPageMeta" ; import { IPageInfo } from "polar-shared/src/metadata/IPageInfo" ; import { IPagemark } from "polar-shared/src/metadata/IPagemark" ; import { INote } from "polar-shared/src/metadata/INote" ; import { IComment } from "polar-shared/src/metadata/IComment" ; import { IQuestion } from "polar-shared/src/metadata/IQuestion" ; import { IFlashcard } from "polar-shared/src/metadata/IFlashcard" ; import { ITextHighlight } from "polar-shared/src/metadata/ITextHighlight" ; import { IAreaHighlight } from "polar-shared/src/metadata/IAreaHighlight" ; import { IScreenshot } from "polar-shared/src/metadata/IScreenshot" ; import { IThumbnail } from "polar-shared/src/metadata/IThumbnail" ; export class PageMeta extends SerializedObject implements IPageMeta { public readonly pageInfo : IPageInfo ; public readonly pagemarks : { [ id ] : IPagemark ; } = { } ; public readonly notes : { [ id ] : INote ; } = { } ; public readonly comments : { [ id ] : IComment ; } = { } ; public readonly questions : { [ id ] : IQuestion ; } = { } ; public readonly flashcards : { [ id ] : IFlashcard ; } = { } ; public readonly textHighlights : { [ id ] : ITextHighlight ; } = { } ; public readonly areaHighlights : { [ id ] : IAreaHighlight ; } = { } ; public readonly screenshots : { [ id ] : IScreenshot ; } = { } ; public readonly thumbnails : { [ id ] : IThumbnail ; } = { } ; public readonly readingProgress : { [ id ] : ReadingProgress ; } = { } ; constructor ( val ) { super ( val ) ; this . pageInfo = val . pageInfo ; this . init ( val ) ; } public setup ( ) { super . setup ( ) ; if ( ! this . pagemarks ) { ( < any > this ) . pagemarks = { } ; } if ( ! this . textHighlights ) { ( < any > this ) . textHighlights = { } ; } if ( ! this . areaHighlights ) { ( < any > this ) . areaHighlights = { } ; } if ( ! this . screenshots ) { ( < any > this ) . screenshots = { } ; } if ( ! this . thumbnails ) { ( < any > this ) . thumbnails = { } ; } } public validate ( ) { super . validate ( ) ; } }