feat: add models package

This commit is contained in:
Karol Sójko
2022-07-05 20:47:11 +02:00
parent 60d1554ff7
commit b614c71e79
199 changed files with 8772 additions and 22 deletions

View File

@@ -0,0 +1,13 @@
import { UuidMap } from '@standardnotes/utils'
export interface CollectionInterface {
/** Maintains an index where the direct map for each item id is an array
* of item ids that the item references. This is essentially equivalent to
* item.content.references, but keeps state even when the item is deleted.
* So if tag A references Note B, referenceMap.directMap[A.uuid] == [B.uuid].
* The inverse map for each item is an array of item ids where the items reference the
* key item. So if tag A references Note B, referenceMap.inverseMap[B.uuid] == [A.uuid].
* This allows callers to determine for a given item, who references it?
* It would be prohibitive to look this up on demand */
readonly referenceMap: UuidMap
}