@automerge/automerge-wasm
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -1256,2 +1256,53 @@ let wasm; | ||
/** | ||
* @param {any} obj | ||
* @param {number} index | ||
* @param {Array<any> | undefined} heads | ||
* @returns {string} | ||
*/ | ||
getCursor(obj, index, heads) { | ||
let deferred2_0; | ||
let deferred2_1; | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.automerge_getCursor(retptr, this.__wbg_ptr, addHeapObject(obj), index, isLikeNone(heads) ? 0 : addHeapObject(heads)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
var ptr1 = r0; | ||
var len1 = r1; | ||
if (r3) { | ||
ptr1 = 0; len1 = 0; | ||
throw takeObject(r2); | ||
} | ||
deferred2_0 = ptr1; | ||
deferred2_1 = len1; | ||
return getStringFromWasm0(ptr1, len1); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
wasm.__wbindgen_free(deferred2_0, deferred2_1); | ||
} | ||
} | ||
/** | ||
* @param {any} obj | ||
* @param {any} cursor | ||
* @param {Array<any> | undefined} heads | ||
* @returns {number} | ||
*/ | ||
getCursorPosition(obj, cursor, heads) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.automerge_getCursorPosition(retptr, this.__wbg_ptr, addHeapObject(obj), addHeapObject(cursor), isLikeNone(heads) ? 0 : addHeapObject(heads)); | ||
var r0 = getFloat64Memory0()[retptr / 8 + 0]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
if (r3) { | ||
throw takeObject(r2); | ||
} | ||
return r0; | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
/** | ||
* @param {string | undefined} message | ||
@@ -1258,0 +1309,0 @@ * @param {number | undefined} time |
@@ -1239,2 +1239,53 @@ | ||
/** | ||
* @param {any} obj | ||
* @param {number} index | ||
* @param {Array<any> | undefined} heads | ||
* @returns {string} | ||
*/ | ||
getCursor(obj, index, heads) { | ||
let deferred2_0; | ||
let deferred2_1; | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.automerge_getCursor(retptr, this.__wbg_ptr, addHeapObject(obj), index, isLikeNone(heads) ? 0 : addHeapObject(heads)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
var ptr1 = r0; | ||
var len1 = r1; | ||
if (r3) { | ||
ptr1 = 0; len1 = 0; | ||
throw takeObject(r2); | ||
} | ||
deferred2_0 = ptr1; | ||
deferred2_1 = len1; | ||
return getStringFromWasm0(ptr1, len1); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
wasm.__wbindgen_free(deferred2_0, deferred2_1); | ||
} | ||
} | ||
/** | ||
* @param {any} obj | ||
* @param {any} cursor | ||
* @param {Array<any> | undefined} heads | ||
* @returns {number} | ||
*/ | ||
getCursorPosition(obj, cursor, heads) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.automerge_getCursorPosition(retptr, this.__wbg_ptr, addHeapObject(obj), addHeapObject(cursor), isLikeNone(heads) ? 0 : addHeapObject(heads)); | ||
var r0 = getFloat64Memory0()[retptr / 8 + 0]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
if (r3) { | ||
throw takeObject(r2); | ||
} | ||
return r0; | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
/** | ||
* @param {string | undefined} message | ||
@@ -1241,0 +1292,0 @@ * @param {number | undefined} time |
@@ -26,2 +26,4 @@ export type Actor = string; | ||
export type Cursor = string; | ||
export type FullValueWithId = | ||
@@ -98,3 +100,4 @@ ["str", string, ObjID ] | | ||
export type Patch = PutPatch | DelPatch | SpliceTextPatch | IncPatch | InsertPatch | MarkPatch | UnmarkPatch; | ||
export type PatchValue = string | number | boolean | null | Date | Uint8Array | {} | [] | ||
export type Patch = PutPatch | DelPatch | SpliceTextPatch | IncPatch | InsertPatch | MarkPatch | UnmarkPatch | ConflictPatch; | ||
@@ -104,6 +107,10 @@ export type PutPatch = { | ||
path: Prop[], | ||
value: Value | ||
conflict: boolean | ||
value: PatchValue, | ||
conflict?: boolean | ||
} | ||
export interface MarkSet { | ||
[name : string]: Value; | ||
} | ||
export type MarkPatch = { | ||
@@ -145,2 +152,3 @@ action: 'mark' | ||
value: string, | ||
marks?: MarkSet, | ||
} | ||
@@ -151,5 +159,12 @@ | ||
path: Prop[], | ||
values: Value[], | ||
values: PatchValue[], | ||
marks?: MarkSet, | ||
conflicts?: boolean[] | ||
} | ||
export type ConflictPatch = { | ||
action: 'conflict' | ||
path: Prop[], | ||
} | ||
export type Mark = { | ||
@@ -207,2 +222,6 @@ name: string, | ||
// text cursor | ||
getCursor(obj: ObjID, index: number, heads?: Heads) : Cursor; | ||
getCursorPosition(obj: ObjID, cursor: Cursor, heads?: Heads) : number; | ||
// isolate | ||
@@ -209,0 +228,0 @@ isolate(heads: Heads): void; |
@@ -1251,2 +1251,53 @@ let imports = {}; | ||
/** | ||
* @param {any} obj | ||
* @param {number} index | ||
* @param {Array<any> | undefined} heads | ||
* @returns {string} | ||
*/ | ||
getCursor(obj, index, heads) { | ||
let deferred2_0; | ||
let deferred2_1; | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.automerge_getCursor(retptr, this.__wbg_ptr, addHeapObject(obj), index, isLikeNone(heads) ? 0 : addHeapObject(heads)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
var ptr1 = r0; | ||
var len1 = r1; | ||
if (r3) { | ||
ptr1 = 0; len1 = 0; | ||
throw takeObject(r2); | ||
} | ||
deferred2_0 = ptr1; | ||
deferred2_1 = len1; | ||
return getStringFromWasm0(ptr1, len1); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
wasm.__wbindgen_free(deferred2_0, deferred2_1); | ||
} | ||
} | ||
/** | ||
* @param {any} obj | ||
* @param {any} cursor | ||
* @param {Array<any> | undefined} heads | ||
* @returns {number} | ||
*/ | ||
getCursorPosition(obj, cursor, heads) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.automerge_getCursorPosition(retptr, this.__wbg_ptr, addHeapObject(obj), addHeapObject(cursor), isLikeNone(heads) ? 0 : addHeapObject(heads)); | ||
var r0 = getFloat64Memory0()[retptr / 8 + 0]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
if (r3) { | ||
throw takeObject(r2); | ||
} | ||
return r0; | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
/** | ||
* @param {string | undefined} message | ||
@@ -1253,0 +1304,0 @@ * @param {number | undefined} time |
@@ -11,3 +11,3 @@ { | ||
"repository": "github:automerge/automerge", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"license": "MIT", | ||
@@ -14,0 +14,0 @@ "files": [ |
@@ -1248,2 +1248,53 @@ let wasm; | ||
/** | ||
* @param {any} obj | ||
* @param {number} index | ||
* @param {Array<any> | undefined} heads | ||
* @returns {string} | ||
*/ | ||
getCursor(obj, index, heads) { | ||
let deferred2_0; | ||
let deferred2_1; | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.automerge_getCursor(retptr, this.__wbg_ptr, addHeapObject(obj), index, isLikeNone(heads) ? 0 : addHeapObject(heads)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
var ptr1 = r0; | ||
var len1 = r1; | ||
if (r3) { | ||
ptr1 = 0; len1 = 0; | ||
throw takeObject(r2); | ||
} | ||
deferred2_0 = ptr1; | ||
deferred2_1 = len1; | ||
return getStringFromWasm0(ptr1, len1); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
wasm.__wbindgen_free(deferred2_0, deferred2_1); | ||
} | ||
} | ||
/** | ||
* @param {any} obj | ||
* @param {any} cursor | ||
* @param {Array<any> | undefined} heads | ||
* @returns {number} | ||
*/ | ||
getCursorPosition(obj, cursor, heads) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.automerge_getCursorPosition(retptr, this.__wbg_ptr, addHeapObject(obj), addHeapObject(cursor), isLikeNone(heads) ? 0 : addHeapObject(heads)); | ||
var r0 = getFloat64Memory0()[retptr / 8 + 0]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
if (r3) { | ||
throw takeObject(r2); | ||
} | ||
return r0; | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
/** | ||
* @param {string | undefined} message | ||
@@ -1250,0 +1301,0 @@ * @param {number | undefined} time |
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 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
6574974
7495