UNPKG

@snippetify/book-reader

Version:
22 lines (17 loc) 595 B
const Selection = require('./Selection') class Decorator extends Selection { static get NOTE_TYPE () { return 'note' } static get BOOKMARK_TYPE () { return 'bookmark' } static get HIGHLIGHT_TYPE () { return 'highlight' } static get SEARCH_RESULT_TYPE () { return 'search-result' } constructor (data) { super(data) this.type = data.type this.uuid = data.uuid this.style = data.style || {} } getSelerialized () { return this.serialized.includes('selection') ? this.serialized.replace('selection', this.type) : this.serialized } } module.exports = Decorator