loro-crdt
Advanced tools
Comparing version 0.11.1 to 0.12.0
# Changelog | ||
## 0.12.0 | ||
### Minor Changes | ||
- Add getParent and getOrCreate | ||
### Patch Changes | ||
- Updated dependencies | ||
- loro-wasm@0.12.0 | ||
## 0.11.1 | ||
@@ -4,0 +15,0 @@ |
@@ -141,2 +141,7 @@ import { Value, Container, TreeID, OpId, ContainerID, Delta, LoroText, LoroMap, LoroTree, LoroList } from 'loro-wasm'; | ||
interface LoroMap<T extends Record<string, any> = Record<string, any>> { | ||
getOrCreateContainer(key: string, container_type: "Map"): LoroMap; | ||
getOrCreateContainer(key: string, container_type: "List"): LoroList; | ||
getOrCreateContainer(key: string, container_type: "Text"): LoroText; | ||
getOrCreateContainer(key: string, container_type: "Tree"): LoroTree; | ||
getOrCreateContainer(key: string, container_type: string): never; | ||
setContainer(key: string, container_type: "Map"): LoroMap; | ||
@@ -143,0 +148,0 @@ setContainer(key: string, container_type: "List"): LoroList; |
{ | ||
"name": "loro-crdt", | ||
"version": "0.11.1", | ||
"version": "0.12.0", | ||
"description": "Loro CRDTs is a high-performance CRDT framework that makes your app state synchronized, collaborative and maintainable effortlessly.", | ||
@@ -20,3 +20,3 @@ "keywords": [ | ||
"dependencies": { | ||
"loro-wasm": "0.11.1" | ||
"loro-wasm": "0.12.0" | ||
}, | ||
@@ -23,0 +23,0 @@ "devDependencies": { |
export * from "loro-wasm"; | ||
import { Container, Delta, LoroText, LoroTree,LoroTreeNode, OpId, Value, ContainerID, Loro, LoroList, LoroMap, TreeID } from "loro-wasm"; | ||
import { | ||
Container, | ||
Delta, | ||
LoroText, | ||
LoroTree, | ||
LoroTreeNode, | ||
OpId, | ||
Value, | ||
ContainerID, | ||
Loro, | ||
LoroList, | ||
LoroMap, | ||
TreeID, | ||
} from "loro-wasm"; | ||
Loro.prototype.getTypedMap = function (...args) { | ||
@@ -39,6 +51,6 @@ return this.getMap(...args); | ||
* The path is composed of numbers (e.g., indices of a list container) strings | ||
* (e.g., keys of a map container) and TreeID (the node of a tree container), | ||
* (e.g., keys of a map container) and TreeID (the node of a tree container), | ||
* indicating the absolute position of the event's source within a loro document. | ||
*/ | ||
export type Path = (number | string | TreeID )[]; | ||
export type Path = (number | string | TreeID)[]; | ||
@@ -99,5 +111,6 @@ /** | ||
export type TreeDiffItem = { target: TreeID; action: "create"; parent: TreeID | undefined } | ||
| { target: TreeID; action: "delete" } | ||
| { target: TreeID; action: "move"; parent: TreeID | undefined }; | ||
export type TreeDiffItem = | ||
| { target: TreeID; action: "create"; parent: TreeID | undefined } | ||
| { target: TreeID; action: "delete" } | ||
| { target: TreeID; action: "move"; parent: TreeID | undefined }; | ||
@@ -217,2 +230,8 @@ export type TreeDiff = { | ||
interface LoroMap<T extends Record<string, any> = Record<string, any>> { | ||
getOrCreateContainer(key: string, container_type: "Map"): LoroMap; | ||
getOrCreateContainer(key: string, container_type: "List"): LoroList; | ||
getOrCreateContainer(key: string, container_type: "Text"): LoroText; | ||
getOrCreateContainer(key: string, container_type: "Tree"): LoroTree; | ||
getOrCreateContainer(key: string, container_type: string): never; | ||
setContainer(key: string, container_type: "Map"): LoroMap; | ||
@@ -247,3 +266,3 @@ setContainer(key: string, container_type: "List"): LoroList; | ||
interface LoroTreeNode{ | ||
interface LoroTreeNode { | ||
readonly data: LoroMap; | ||
@@ -250,0 +269,0 @@ createNode(): LoroTreeNode; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115389
680
+ Addedloro-wasm@0.12.0(transitive)
- Removedloro-wasm@0.11.1(transitive)
Updatedloro-wasm@0.12.0