[]
| Name | Type |
|---|---|
S |
unknown |
T |
unknown |
Db<S, T>
↳ MemoryDb
• new MemoryDb<S, T>()
| Name | Type |
|---|---|
S |
unknown |
T |
unknown |
▸ close(): Promise<void>
Closes the database connection.
Promise<void>
▸ commitOp(id, op, document): Promise<boolean>
Commits an operation to the database.
| Name | Type |
|---|---|
id |
string |
op |
IOp<T> |
document |
IDocument |
Promise<boolean>
▸ commitSnapshot(roomId, snapshot): Promise<boolean>
Commits a snapshot to the database.
| Name | Type |
|---|---|
roomId |
string |
snapshot |
ICommitSnapshot<S> |
Promise<boolean>
▸ getCommittedOpVersion(id, to, op): Promise<null | number>
Retrieves the committed version of an operation if it exists.
| Name | Type |
|---|---|
id |
string |
to |
number |
op |
IOp<object> |
Promise<null | number>
▸ getDocument(roomId): Promise<null | IDocument>
Retrieves document information by ID.
| Name | Type |
|---|---|
roomId |
string |
Promise<null | IDocument>
▸ getFragment(roomId, fragmentId): Promise<null | { data: null | S ; version: number }>
Retrieves a specific fragment of a document by ID.
| Name | Type |
|---|---|
roomId |
string |
fragmentId |
string |
Promise<null | { data: null | S ; version: number }>
▸ getOps(roomId, fromVersion, toVersion?): Promise<IOp<T>[]>
Retrieves operations between two versions (inclusive of 'from', exclusive of 'to').
| Name | Type |
|---|---|
roomId |
string |
fromVersion |
number |
toVersion? |
number |
Promise<IOp<T>[]>
▸ getSnapshot(roomId): Promise<null | ISnapshot<S>>
Retrieves the snapshot of a document by ID.
| Name | Type |
|---|---|
roomId |
string |
Promise<null | ISnapshot<S>>