Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

loro-wasm

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loro-wasm - npm Package Compare versions

Comparing version 0.12.0 to 0.13.0

38

bundler/loro_wasm_bg.wasm.d.ts

@@ -45,2 +45,4 @@ /* tslint:disable */

export function loro_vvToFrontiers(a: number, b: number, c: number): void;
export function __wbg_lorotext_free(a: number): void;
export function lorotext_new(): number;
export function lorotext_kind(a: number): number;

@@ -53,5 +55,10 @@ export function lorotext_insert(a: number, b: number, c: number, d: number, e: number): void;

export function lorotext_toDelta(a: number): number;
export function lorotext_id(a: number): number;
export function lorotext_length(a: number): number;
export function lorotext_subscribe(a: number, b: number, c: number, d: number): void;
export function lorotext_applyDelta(a: number, b: number, c: number): void;
export function lorotext_parent(a: number): number;
export function lorotext_getAttached(a: number): number;
export function __wbg_loromap_free(a: number): void;
export function loromap_new(): number;
export function loromap_kind(a: number): number;

@@ -61,11 +68,16 @@ export function loromap_set(a: number, b: number, c: number, d: number, e: number): void;

export function loromap_get(a: number, b: number, c: number): number;
export function loromap_getOrCreateContainer(a: number, b: number, c: number, d: number, e: number, f: number): void;
export function loromap_getOrCreateContainer(a: number, b: number, c: number, d: number, e: number): void;
export function loromap_keys(a: number, b: number): void;
export function loromap_values(a: number, b: number): void;
export function loromap_entries(a: number, b: number): void;
export function loromap_id(a: number): number;
export function loromap_toJson(a: number): number;
export function loromap_setContainer(a: number, b: number, c: number, d: number, e: number, f: number): void;
export function loromap_setContainer(a: number, b: number, c: number, d: number, e: number): void;
export function loromap_subscribe(a: number, b: number, c: number, d: number): void;
export function loromap_size(a: number): number;
export function loromap_parent(a: number): number;
export function loromap_isAttached(a: number): number;
export function loromap_getAttached(a: number): number;
export function __wbg_lorolist_free(a: number): void;
export function lorolist_new(): number;
export function lorolist_kind(a: number): number;

@@ -78,3 +90,3 @@ export function lorolist_insert(a: number, b: number, c: number, d: number): void;

export function lorolist_toJson(a: number): number;
export function lorolist_insertContainer(a: number, b: number, c: number, d: number, e: number): void;
export function lorolist_insertContainer(a: number, b: number, c: number, d: number): void;
export function lorolist_subscribe(a: number, b: number, c: number, d: number): void;

@@ -84,2 +96,5 @@ export function lorolist_unsubscribe(a: number, b: number, c: number, d: number): void;

export function lorolist_parent(a: number): number;
export function lorolist_isAttached(a: number): number;
export function lorolist_getAttached(a: number): number;
export function __wbg_lorotree_free(a: number): void;
export function __wbg_lorotreenode_free(a: number): void;

@@ -93,2 +108,3 @@ export function lorotreenode_id(a: number): number;

export function lorotreenode_children(a: number): number;
export function lorotree_new(): number;
export function lorotree_kind(a: number): number;

@@ -99,6 +115,11 @@ export function lorotree_createNode(a: number, b: number, c: number): void;

export function lorotree_getNodeByID(a: number, b: number): number;
export function lorotree_id(a: number): number;
export function lorotree_has(a: number, b: number): number;
export function lorotree_value(a: number): number;
export function lorotree_toJson(a: number): number;
export function lorotree_nodes(a: number, b: number): void;
export function lorotree_subscribe(a: number, b: number, c: number, d: number): void;
export function lorotree_parent(a: number): number;
export function lorotree_isAttached(a: number): number;
export function lorotree_getAttached(a: number): number;
export function __wbg_versionvector_free(a: number): void;

@@ -112,15 +133,6 @@ export function versionvector_new(a: number, b: number): void;

export function versionvector_compare(a: number, b: number, c: number): void;
export function lorotext_isAttached(a: number): number;
export function lorotext_unsubscribe(a: number, b: number, c: number, d: number): void;
export function loromap_unsubscribe(a: number, b: number, c: number, d: number): void;
export function lorotree_unsubscribe(a: number, b: number, c: number, d: number): void;
export function lorotext_parent(a: number): number;
export function loromap_parent(a: number): number;
export function lorotree_parent(a: number): number;
export function __wbg_lorotext_free(a: number): void;
export function __wbg_loromap_free(a: number): void;
export function __wbg_lorotree_free(a: number): void;
export function lorotree_toJson(a: number): number;
export function lorotext_id(a: number): number;
export function loromap_id(a: number): number;
export function lorotree_id(a: number): number;
export function __wbindgen_malloc(a: number, b: number): number;

@@ -127,0 +139,0 @@ export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;

@@ -532,5 +532,5 @@ /* tslint:disable */

* list.insert(0, "Hello");
* const text = list.insertContainer(0, "Text");
* const text = list.insertContainer(0, new LoroText());
* text.insert(0, "Hello");
* const map = list.insertContainer(1, "Map");
* const map = list.insertContainer(1, new LoroMap());
* map.set("foo", "bar");

@@ -682,2 +682,9 @@ * /*

/**
* Create a new detached LoroList.
*
* The edits on a detached container will not be persisted.
* To attach the container to the document, please insert it into an attached container.
*/
constructor();
/**
* "List"

@@ -752,3 +759,3 @@ * @returns {any}

* list.insert(2, true);
* list.insertContainer(3, "Text");
* list.insertContainer(3, new LoroText());
* console.log(list.value); // [100, "foo", true, LoroText];

@@ -770,3 +777,3 @@ * ```

* list.insert(0, 100);
* const text = list.insertContainer(1, "Text");
* const text = list.insertContainer(1, new LoroText());
* text.insert(0, "Hello");

@@ -788,3 +795,3 @@ * console.log(list.getDeepValue()); // [100, "Hello"];

* list.insert(0, 100);
* const text = list.insertContainer(1, "Text");
* const text = list.insertContainer(1, new LoroText());
* text.insert(0, "Hello");

@@ -794,6 +801,6 @@ * console.log(list.getDeepValue()); // [100, "Hello"];

* @param {number} index
* @param {string} container
* @returns {any}
* @param {Container} child
* @returns {Container}
*/
insertContainer(index: number, container: string): any;
insertContainer(index: number, child: Container): Container;
/**

@@ -847,2 +854,16 @@ * Subscribe to the changes of the list.

/**
* Whether the container is attached to a docuemnt.
*
* If it's detached, the operations on the container will not be persisted.
* @returns {boolean}
*/
isAttached(): boolean;
/**
* Get the attached container associated with this.
*
* Returns an attached `Container` that equals to this or created by this, otherwise `undefined`.
* @returns {LoroList | undefined}
*/
getAttached(): LoroList | undefined;
/**
* Get the id of this container.

@@ -874,2 +895,9 @@ */

/**
* Create a new detached LoroMap.
*
* The edits on a detached container will not be persisted.
* To attach the container to the document, please insert it into an attached container.
*/
constructor();
/**
* "Map"

@@ -943,6 +971,6 @@ * @returns {any}

* @param {string} key
* @param {string} container_type
* @returns {Container | undefined}
* @param {Container} child
* @returns {Container}
*/
getOrCreateContainer(key: string, container_type: string): Container | undefined;
getOrCreateContainer(key: string, child: Container): Container;
/**

@@ -1009,3 +1037,3 @@ * Get the keys of the map.

* map.set("foo", "bar");
* const text = map.setContainer("text", "Text");
* const text = map.setContainer("text", new LoroText());
* text.insert(0, "Hello");

@@ -1027,10 +1055,10 @@ * console.log(map.getDeepValue()); // {"foo": "bar", "text": "Hello"}

* map.set("foo", "bar");
* const text = map.setContainer("text", "Text");
* const list = map.setContainer("list", "List");
* const text = map.setContainer("text", new LoroText());
* const list = map.setContainer("list", new LoroText());
* ```
* @param {string} key
* @param {string} container_type
* @returns {any}
* @param {Container} child
* @returns {Container}
*/
setContainer(key: string, container_type: string): any;
setContainer(key: string, child: Container): Container;
/**

@@ -1086,2 +1114,16 @@ * Subscribe to the changes of the map.

/**
* Whether the container is attached to a docuemnt.
*
* If it's detached, the operations on the container will not be persisted.
* @returns {boolean}
*/
isAttached(): boolean;
/**
* Get the attached container associated with this.
*
* Returns an attached `Container` that equals to this or created by this, otherwise `undefined`.
* @returns {LoroMap | undefined}
*/
getAttached(): LoroMap | undefined;
/**
* The container id of this handler.

@@ -1111,2 +1153,9 @@ */

/**
* Create a new detached LoroText.
*
* The edits on a detached container will not be persisted.
* To attach the container to the document, please insert it into an attached container.
*/
constructor();
/**
* "Text"

@@ -1270,2 +1319,16 @@ * @returns {any}

/**
* Whether the container is attached to a docuemnt.
*
* If it's detached, the operations on the container will not be persisted.
* @returns {boolean}
*/
isAttached(): boolean;
/**
* Get the attached container associated with this.
*
* Returns an attached `Container` that equals to this or created by this, otherwise `undefined`.
* @returns {LoroText | undefined}
*/
getAttached(): LoroText | undefined;
/**
* Get the container id of the text.

@@ -1285,2 +1348,9 @@ */

/**
* Create a new detached LoroTree.
*
* The edits on a detached container will not be persisted.
* To attach the container to the document, please insert it into an attached container.
*/
constructor();
/**
* "Tree"

@@ -1463,2 +1533,16 @@ * @returns {any}

/**
* Whether the container is attached to a docuemnt.
*
* If it's detached, the operations on the container will not be persisted.
* @returns {boolean}
*/
isAttached(): boolean;
/**
* Get the attached container associated with this.
*
* Returns an attached `Container` that equals to this or created by this, otherwise `undefined`.
* @returns {LoroTree | undefined}
*/
getAttached(): LoroTree | undefined;
/**
* Get the id of the container.

@@ -1465,0 +1549,0 @@ */

# Changelog
## 0.13.0
### Minor Changes
- BREAKING CHANGE: `detached` mode for Containers #300
Now creating sub-containers is much easier.
A container can be either attached to a document or detached. When it's detached, its history/state is not persisted. You can attach a container to a document by inserting it into an existing attached container. Once a container is attached, its state, along with all of its descendants's states, will be recreated in the document. After attaching, the container and its descendants will each have their corresponding "attached" version of themselves.
When a detached container x is attached to a document, you can use `x.getAttached()` to obtain the corresponding attached container.
When we use const text = new LoroList(), it's not attached to a doc. But we can insert it into a doc by map.insertContainer(”t”, text), where the map is attached. But if we want the operations on the text to be recorded to the doc, we now need to get its attached version. So we can use “let attachedText = text.getAttached()”
## 0.12.0

@@ -4,0 +18,0 @@

@@ -45,2 +45,4 @@ /* tslint:disable */

export function loro_vvToFrontiers(a: number, b: number, c: number): void;
export function __wbg_lorotext_free(a: number): void;
export function lorotext_new(): number;
export function lorotext_kind(a: number): number;

@@ -53,5 +55,10 @@ export function lorotext_insert(a: number, b: number, c: number, d: number, e: number): void;

export function lorotext_toDelta(a: number): number;
export function lorotext_id(a: number): number;
export function lorotext_length(a: number): number;
export function lorotext_subscribe(a: number, b: number, c: number, d: number): void;
export function lorotext_applyDelta(a: number, b: number, c: number): void;
export function lorotext_parent(a: number): number;
export function lorotext_getAttached(a: number): number;
export function __wbg_loromap_free(a: number): void;
export function loromap_new(): number;
export function loromap_kind(a: number): number;

@@ -61,11 +68,16 @@ export function loromap_set(a: number, b: number, c: number, d: number, e: number): void;

export function loromap_get(a: number, b: number, c: number): number;
export function loromap_getOrCreateContainer(a: number, b: number, c: number, d: number, e: number, f: number): void;
export function loromap_getOrCreateContainer(a: number, b: number, c: number, d: number, e: number): void;
export function loromap_keys(a: number, b: number): void;
export function loromap_values(a: number, b: number): void;
export function loromap_entries(a: number, b: number): void;
export function loromap_id(a: number): number;
export function loromap_toJson(a: number): number;
export function loromap_setContainer(a: number, b: number, c: number, d: number, e: number, f: number): void;
export function loromap_setContainer(a: number, b: number, c: number, d: number, e: number): void;
export function loromap_subscribe(a: number, b: number, c: number, d: number): void;
export function loromap_size(a: number): number;
export function loromap_parent(a: number): number;
export function loromap_isAttached(a: number): number;
export function loromap_getAttached(a: number): number;
export function __wbg_lorolist_free(a: number): void;
export function lorolist_new(): number;
export function lorolist_kind(a: number): number;

@@ -78,3 +90,3 @@ export function lorolist_insert(a: number, b: number, c: number, d: number): void;

export function lorolist_toJson(a: number): number;
export function lorolist_insertContainer(a: number, b: number, c: number, d: number, e: number): void;
export function lorolist_insertContainer(a: number, b: number, c: number, d: number): void;
export function lorolist_subscribe(a: number, b: number, c: number, d: number): void;

@@ -84,2 +96,5 @@ export function lorolist_unsubscribe(a: number, b: number, c: number, d: number): void;

export function lorolist_parent(a: number): number;
export function lorolist_isAttached(a: number): number;
export function lorolist_getAttached(a: number): number;
export function __wbg_lorotree_free(a: number): void;
export function __wbg_lorotreenode_free(a: number): void;

@@ -93,2 +108,3 @@ export function lorotreenode_id(a: number): number;

export function lorotreenode_children(a: number): number;
export function lorotree_new(): number;
export function lorotree_kind(a: number): number;

@@ -99,6 +115,11 @@ export function lorotree_createNode(a: number, b: number, c: number): void;

export function lorotree_getNodeByID(a: number, b: number): number;
export function lorotree_id(a: number): number;
export function lorotree_has(a: number, b: number): number;
export function lorotree_value(a: number): number;
export function lorotree_toJson(a: number): number;
export function lorotree_nodes(a: number, b: number): void;
export function lorotree_subscribe(a: number, b: number, c: number, d: number): void;
export function lorotree_parent(a: number): number;
export function lorotree_isAttached(a: number): number;
export function lorotree_getAttached(a: number): number;
export function __wbg_versionvector_free(a: number): void;

@@ -112,15 +133,6 @@ export function versionvector_new(a: number, b: number): void;

export function versionvector_compare(a: number, b: number, c: number): void;
export function lorotext_isAttached(a: number): number;
export function lorotext_unsubscribe(a: number, b: number, c: number, d: number): void;
export function loromap_unsubscribe(a: number, b: number, c: number, d: number): void;
export function lorotree_unsubscribe(a: number, b: number, c: number, d: number): void;
export function lorotext_parent(a: number): number;
export function loromap_parent(a: number): number;
export function lorotree_parent(a: number): number;
export function __wbg_lorotext_free(a: number): void;
export function __wbg_loromap_free(a: number): void;
export function __wbg_lorotree_free(a: number): void;
export function lorotree_toJson(a: number): number;
export function lorotext_id(a: number): number;
export function loromap_id(a: number): number;
export function lorotree_id(a: number): number;
export function __wbindgen_malloc(a: number, b: number): number;

@@ -127,0 +139,0 @@ export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;

@@ -532,5 +532,5 @@ /* tslint:disable */

* list.insert(0, "Hello");
* const text = list.insertContainer(0, "Text");
* const text = list.insertContainer(0, new LoroText());
* text.insert(0, "Hello");
* const map = list.insertContainer(1, "Map");
* const map = list.insertContainer(1, new LoroMap());
* map.set("foo", "bar");

@@ -682,2 +682,9 @@ * /*

/**
* Create a new detached LoroList.
*
* The edits on a detached container will not be persisted.
* To attach the container to the document, please insert it into an attached container.
*/
constructor();
/**
* "List"

@@ -752,3 +759,3 @@ * @returns {any}

* list.insert(2, true);
* list.insertContainer(3, "Text");
* list.insertContainer(3, new LoroText());
* console.log(list.value); // [100, "foo", true, LoroText];

@@ -770,3 +777,3 @@ * ```

* list.insert(0, 100);
* const text = list.insertContainer(1, "Text");
* const text = list.insertContainer(1, new LoroText());
* text.insert(0, "Hello");

@@ -788,3 +795,3 @@ * console.log(list.getDeepValue()); // [100, "Hello"];

* list.insert(0, 100);
* const text = list.insertContainer(1, "Text");
* const text = list.insertContainer(1, new LoroText());
* text.insert(0, "Hello");

@@ -794,6 +801,6 @@ * console.log(list.getDeepValue()); // [100, "Hello"];

* @param {number} index
* @param {string} container
* @returns {any}
* @param {Container} child
* @returns {Container}
*/
insertContainer(index: number, container: string): any;
insertContainer(index: number, child: Container): Container;
/**

@@ -847,2 +854,16 @@ * Subscribe to the changes of the list.

/**
* Whether the container is attached to a docuemnt.
*
* If it's detached, the operations on the container will not be persisted.
* @returns {boolean}
*/
isAttached(): boolean;
/**
* Get the attached container associated with this.
*
* Returns an attached `Container` that equals to this or created by this, otherwise `undefined`.
* @returns {LoroList | undefined}
*/
getAttached(): LoroList | undefined;
/**
* Get the id of this container.

@@ -874,2 +895,9 @@ */

/**
* Create a new detached LoroMap.
*
* The edits on a detached container will not be persisted.
* To attach the container to the document, please insert it into an attached container.
*/
constructor();
/**
* "Map"

@@ -943,6 +971,6 @@ * @returns {any}

* @param {string} key
* @param {string} container_type
* @returns {Container | undefined}
* @param {Container} child
* @returns {Container}
*/
getOrCreateContainer(key: string, container_type: string): Container | undefined;
getOrCreateContainer(key: string, child: Container): Container;
/**

@@ -1009,3 +1037,3 @@ * Get the keys of the map.

* map.set("foo", "bar");
* const text = map.setContainer("text", "Text");
* const text = map.setContainer("text", new LoroText());
* text.insert(0, "Hello");

@@ -1027,10 +1055,10 @@ * console.log(map.getDeepValue()); // {"foo": "bar", "text": "Hello"}

* map.set("foo", "bar");
* const text = map.setContainer("text", "Text");
* const list = map.setContainer("list", "List");
* const text = map.setContainer("text", new LoroText());
* const list = map.setContainer("list", new LoroText());
* ```
* @param {string} key
* @param {string} container_type
* @returns {any}
* @param {Container} child
* @returns {Container}
*/
setContainer(key: string, container_type: string): any;
setContainer(key: string, child: Container): Container;
/**

@@ -1086,2 +1114,16 @@ * Subscribe to the changes of the map.

/**
* Whether the container is attached to a docuemnt.
*
* If it's detached, the operations on the container will not be persisted.
* @returns {boolean}
*/
isAttached(): boolean;
/**
* Get the attached container associated with this.
*
* Returns an attached `Container` that equals to this or created by this, otherwise `undefined`.
* @returns {LoroMap | undefined}
*/
getAttached(): LoroMap | undefined;
/**
* The container id of this handler.

@@ -1111,2 +1153,9 @@ */

/**
* Create a new detached LoroText.
*
* The edits on a detached container will not be persisted.
* To attach the container to the document, please insert it into an attached container.
*/
constructor();
/**
* "Text"

@@ -1270,2 +1319,16 @@ * @returns {any}

/**
* Whether the container is attached to a docuemnt.
*
* If it's detached, the operations on the container will not be persisted.
* @returns {boolean}
*/
isAttached(): boolean;
/**
* Get the attached container associated with this.
*
* Returns an attached `Container` that equals to this or created by this, otherwise `undefined`.
* @returns {LoroText | undefined}
*/
getAttached(): LoroText | undefined;
/**
* Get the container id of the text.

@@ -1285,2 +1348,9 @@ */

/**
* Create a new detached LoroTree.
*
* The edits on a detached container will not be persisted.
* To attach the container to the document, please insert it into an attached container.
*/
constructor();
/**
* "Tree"

@@ -1463,2 +1533,16 @@ * @returns {any}

/**
* Whether the container is attached to a docuemnt.
*
* If it's detached, the operations on the container will not be persisted.
* @returns {boolean}
*/
isAttached(): boolean;
/**
* Get the attached container associated with this.
*
* Returns an attached `Container` that equals to this or created by this, otherwise `undefined`.
* @returns {LoroTree | undefined}
*/
getAttached(): LoroTree | undefined;
/**
* Get the id of the container.

@@ -1465,0 +1549,0 @@ */

{
"name": "loro-wasm",
"version": "0.12.0",
"version": "0.13.0",
"description": "Loro CRDTs is a high-performance CRDT framework that makes your app state synchronized, collaborative and maintainable effortlessly.",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc