import { StructStore, ID, Transaction // eslint-disable-line } from '../internals.js' import * as encoding from 'lib0/encoding.js' // eslint-disable-line import * as error from 'lib0/error.js' export class AbstractStruct { /** * @param {ID} id * @param {number} length */ constructor (id, length) { this.id = id this.length = length } /** * @type {boolean} */ get deleted () { throw error.methodUnimplemented() } /** * Merge this struct with the item to the right. * This method is already assuming that `this.id.clock + this.length === this.id.clock`. * Also this method does *not* remove right from StructStore! * @param {AbstractStruct} right * @return {boolean} wether this merged with right */ mergeWith (right) { return false } /** * @param {encoding.Encoder} encoder The encoder to write data to. * @param {number} offset * @param {number} encodingRef */ write (encoder, offset, encodingRef) { throw error.methodUnimplemented() } /** * @param {Transaction} transaction * @param {number} offset */ integrate (transaction, offset) { throw error.methodUnimplemented() } }