draft of YWeakLink type

This commit is contained in:
Bartosz Sypytkowski
2023-10-06 11:30:31 +02:00
parent 9a7b659919
commit f3de5b0add
13 changed files with 1620 additions and 144 deletions
+8 -1
View File
@@ -2,7 +2,7 @@
import {
GC,
splitItem,
Transaction, ID, Item, DSDecoderV2 // eslint-disable-line
Transaction, ID, Item, DSDecoderV2, YWeakLink // eslint-disable-line
} from '../internals.js'
import * as math from 'lib0/math'
@@ -14,6 +14,13 @@ export class StructStore {
* @type {Map<number,Array<GC|Item>>}
*/
this.clients = new Map()
/**
* If this item was referenced by other weak links, here we keep the references
* to these weak refs.
*
* @type {Map<Item, Set<YWeakLink<any>>>}
*/
this.linkedBy = new Map()
/**
* @type {null | { missing: Map<number, number>, update: Uint8Array }}
*/