Currently Index class is very inconvenient to use and mixes several different indexes in one: text, block, key in data, key in tunes, key in document properties.
It might be more convenient if we split those indexes into child classes of an abstract Index class. Something like:
abstract class Index {
static text(documentId, block, key, textRange) {
return new TextIndex(...);
}
static data(documentId, block, key);
....
serialize() {
....
}
}
class TextIndex extends Index {
constructor(documentId, block, key, textRange) { ... };
}
Also now composite index is handled differently and always have to be considered when working with text selection. It would be more convenient if we always treat text index as segmented, but it would have just one segment if it's not cross-input
Currently Index class is very inconvenient to use and mixes several different indexes in one: text, block, key in data, key in tunes, key in document properties.
It might be more convenient if we split those indexes into child classes of an abstract Index class. Something like:
Also now composite index is handled differently and always have to be considered when working with text selection. It would be more convenient if we always treat text index as segmented, but it would have just one segment if it's not cross-input