@snippetify/book-reader-component
Version:
Book Reader Component
17 lines (16 loc) • 518 B
JavaScript
import { Selection } from "./selection";
export class Decorator extends Selection {
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;
}
}
Decorator.NOTE_TYPE = 'note';
Decorator.BOOKMARK_TYPE = 'bookmark';
Decorator.HIGHLIGHT_TYPE = 'highlight';
Decorator.SEARCH_RESULT_TYPE = 'search-result';