diff --git a/src/structs/AbstractItem.js b/src/structs/AbstractItem.js index 0b1f873e..e76b8547 100644 --- a/src/structs/AbstractItem.js +++ b/src/structs/AbstractItem.js @@ -5,7 +5,7 @@ import { writeID, GC, nextID, - AbstractRef, + AbstractStructRef, AbstractStruct, replaceStruct, addStruct, @@ -487,7 +487,7 @@ export class AbstractItem extends AbstractStruct { } } -export class AbstractItemRef extends AbstractRef { +export class AbstractItemRef extends AbstractStructRef { /** * @param {decoding.Decoder} decoder * @param {ID} id diff --git a/src/structs/AbstractStruct.js b/src/structs/AbstractStruct.js index acceb870..6e985464 100644 --- a/src/structs/AbstractStruct.js +++ b/src/structs/AbstractStruct.js @@ -53,7 +53,7 @@ export class AbstractStruct { } } -export class AbstractRef { +export class AbstractStructRef { /** * @param {ID} id */ diff --git a/src/structs/GC.js b/src/structs/GC.js index c96f7b6c..715f01ce 100644 --- a/src/structs/GC.js +++ b/src/structs/GC.js @@ -2,7 +2,7 @@ * @module structs */ import { - AbstractRef, + AbstractStructRef, AbstractStruct, createID, addStruct, @@ -60,7 +60,7 @@ export class GC extends AbstractStruct { } } -export class GCRef extends AbstractRef { +export class GCRef extends AbstractStructRef { /** * @param {decoding.Decoder} decoder * @param {ID} id diff --git a/src/utils/StructStore.js b/src/utils/StructStore.js index 3061d5eb..da28168f 100644 --- a/src/utils/StructStore.js +++ b/src/utils/StructStore.js @@ -1,8 +1,7 @@ -// todo rename AbstractRef to abstractStructRef import { GC, - Transaction, AbstractRef, ID, ItemType, AbstractItem, AbstractStruct // eslint-disable-line + Transaction, AbstractStructRef, ID, ItemType, AbstractItem, AbstractStruct // eslint-disable-line } from '../internals.js' import * as math from 'lib0/math.js' @@ -22,13 +21,13 @@ export class StructStore { * We could shift the array of refs instead, but shift is incredible * slow in Chrome for arrays with more than 100k elements * @see tryResumePendingStructRefs - * @type {Map}>} + * @type {Map}>} */ this.pendingClientsStructRefs = new Map() /** * Stack of pending structs waiting for struct dependencies * Maximum length of stack is structReaders.size - * @type {Array} + * @type {Array} */ this.pendingStack = [] /** diff --git a/src/utils/structEncoding.js b/src/utils/structEncoding.js index 1a800ab0..cd86cb42 100644 --- a/src/utils/structEncoding.js +++ b/src/utils/structEncoding.js @@ -18,7 +18,7 @@ import { readDeleteSet, writeDeleteSet, createDeleteSetFromStructStore, - Transaction, AbstractStruct, AbstractRef, StructStore, ID // eslint-disable-line + Transaction, AbstractStruct, AbstractStructRef, StructStore, ID // eslint-disable-line } from '../internals.js' import * as encoding from 'lib0/encoding.js' @@ -64,11 +64,11 @@ const writeStructs = (encoder, structs, client, clock) => { * @param {decoding.Decoder} decoder * @param {number} numOfStructs * @param {ID} nextID - * @return {Array} + * @return {Array} */ const readStructRefs = (decoder, numOfStructs, nextID) => { /** - * @type {Array} + * @type {Array} */ const refs = [] for (let i = 0; i < numOfStructs; i++) { @@ -109,11 +109,11 @@ export const writeClientsStructs = (encoder, store, _sm) => { /** * @param {decoding.Decoder} decoder The decoder object to read data from. - * @return {Map>} + * @return {Map>} */ export const readClientsStructRefs = decoder => { /** - * @type {Map>} + * @type {Map>} */ const clientRefs = new Map() const numOfStateUpdates = decoding.readVarUint(decoder) @@ -227,9 +227,9 @@ export const tryResumePendingDeleteReaders = (transaction, store) => { } /** - * @param {Map,i:number}>} pendingClientsStructRefs + * @param {Map,i:number}>} pendingClientsStructRefs * @param {number} client - * @param {Array} refs + * @param {Array} refs */ const setPendingClientsStructRefs = (pendingClientsStructRefs, client, refs) => { pendingClientsStructRefs.set(client, { refs, i: 0 }) @@ -243,7 +243,7 @@ export const writeStructsFromTransaction = (encoder, transaction) => writeClient /** * @param {StructStore} store - * @param {Map>} clientsStructsRefs + * @param {Map>} clientsStructsRefs */ const mergeReadStructsIntoPendingReads = (store, clientsStructsRefs) => { const pendingClientsStructRefs = store.pendingClientsStructRefs