loro-crdt
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -5,2 +5,15 @@ # Changelog | ||
### [0.4.2](https://github.com/loro-dev/loro/compare/v0.4.1...v0.4.2) (2023-11-16) | ||
### Features | ||
* get sub container directly when getting value ([#175](https://github.com/loro-dev/loro/issues/175)) ([1ff1505](https://github.com/loro-dev/loro/commit/1ff1505933198be8f3b7aefc32e1698007e21c25)) | ||
* **wasm:** add event id ([e54d2ac](https://github.com/loro-dev/loro/commit/e54d2ac21b02ad6b161336b0b9a99a0a85ca5a02)) | ||
### Bug Fixes | ||
* loro-wasm typo ([#171](https://github.com/loro-dev/loro/issues/171)) ([c4b9cb4](https://github.com/loro-dev/loro/commit/c4b9cb4b2b77c3c83b99b51153cd8dd19a948dc0)) | ||
### 0.4.1 (2023-11-12) | ||
@@ -7,0 +20,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { ContainerID, PrelimList, PrelimMap, PrelimText, Delta, TreeID } from 'loro-wasm'; | ||
import { LoroTree, ContainerID, LoroList, LoroMap, LoroText, PrelimList, PrelimMap, PrelimText, Delta, TreeID } from 'loro-wasm'; | ||
export * from 'loro-wasm'; | ||
@@ -11,2 +11,3 @@ export { Loro } from 'loro-wasm'; | ||
} | Uint8Array | Value[]; | ||
type Container = LoroList | LoroMap | LoroText | LoroTree; | ||
type Prelim = PrelimList | PrelimMap | PrelimText; | ||
@@ -29,2 +30,6 @@ /** | ||
interface LoroEvent { | ||
/** | ||
* The unique ID of the event. | ||
*/ | ||
id: bigint; | ||
local: boolean; | ||
@@ -87,3 +92,3 @@ origin?: string; | ||
insertContainer(pos: number, container: string): never; | ||
get(index: number): Value; | ||
get(index: number): undefined | Value | Container; | ||
getTyped<Key extends keyof T & number>(loro: Loro, index: Key): T[Key]; | ||
@@ -101,3 +106,3 @@ insertTyped<Key extends keyof T & number>(pos: Key, value: T[Key]): void; | ||
setContainer(key: string, container_type: string): never; | ||
get(key: string): Value; | ||
get(key: string): undefined | Value | Container; | ||
getTyped<Key extends keyof T & string>(txn: Loro, key: Key): T[Key]; | ||
@@ -116,2 +121,2 @@ set(key: string, value: Value | Prelim): void; | ||
export { Diff, ListDiff, LoroEvent, MapDiff, Path, Prelim, TextDiff, TreeDiff, Value, isContainerId }; | ||
export { Container, Diff, ListDiff, LoroEvent, MapDiff, Path, Prelim, TextDiff, TreeDiff, Value, isContainerId }; |
{ | ||
"name": "loro-crdt", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Loro CRDTs is a high-performance CRDT framework that makes your app state synchronized, collaborative and maintainable effortlessly.", | ||
@@ -18,5 +18,5 @@ "keywords": [ | ||
"homepage": "https://loro.dev", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"dependencies": { | ||
"loro-wasm": "0.4.1" | ||
"loro-wasm": "0.4.2" | ||
}, | ||
@@ -23,0 +23,0 @@ "devDependencies": { |
export * from "loro-wasm"; | ||
import { Delta } from "loro-wasm"; | ||
import { PrelimText,PrelimList,PrelimMap } from "loro-wasm"; | ||
import { ContainerID, Loro, LoroList, LoroMap, LoroText , LoroTree, TreeID} from "loro-wasm"; | ||
import { PrelimText, PrelimList, PrelimMap } from "loro-wasm"; | ||
import { | ||
ContainerID, | ||
Loro, | ||
LoroList, | ||
LoroMap, | ||
LoroText, | ||
LoroTree, | ||
TreeID, | ||
} from "loro-wasm"; | ||
@@ -48,3 +56,3 @@ Loro.prototype.getTypedMap = function (...args) { | ||
export type Container = LoroList | LoroMap | LoroText | LoroTree; | ||
export type Prelim = PrelimList | PrelimMap | PrelimText; | ||
@@ -54,3 +62,3 @@ | ||
* Represents a path to identify the exact location of an event's target. | ||
* The path is composed of numbers (e.g., indices of a list container) and strings | ||
* The path is composed of numbers (e.g., indices of a list container) and strings | ||
* (e.g., keys of a map container), indicating the absolute position of the event's source | ||
@@ -70,2 +78,6 @@ * within a loro document. | ||
export interface LoroEvent { | ||
/** | ||
* The unique ID of the event. | ||
*/ | ||
id: bigint; | ||
local: boolean; | ||
@@ -103,4 +115,6 @@ origin?: string; | ||
type: "tree"; | ||
diff: {target: TreeID, action: "create"|"delete" } | {target: TreeID; action:"move"; parent: TreeID}; | ||
} | ||
diff: | ||
| { target: TreeID; action: "create" | "delete" } | ||
| { target: TreeID; action: "move"; parent: TreeID }; | ||
}; | ||
@@ -142,3 +156,3 @@ export type Diff = ListDiff | TextDiff | MapDiff | TreeDiff; | ||
get(index: number): Value; | ||
get(index: number): undefined | Value | Container; | ||
getTyped<Key extends keyof T & number>(loro: Loro, index: Key): T[Key]; | ||
@@ -158,3 +172,3 @@ insertTyped<Key extends keyof T & number>(pos: Key, value: T[Key]): void; | ||
get(key: string): Value; | ||
get(key: string): undefined | Value | Container; | ||
getTyped<Key extends keyof T & string>(txn: Loro, key: Key): T[Key]; | ||
@@ -161,0 +175,0 @@ set(key: string, value: Value | Prelim): void; |
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
98252
13
496
+ Addedloro-wasm@0.4.2(transitive)
- Removedloro-wasm@0.4.1(transitive)
Updatedloro-wasm@0.4.2