@citeproc-rs/wasm
Advanced tools
Comparing version 0.0.0-canary-b724318 to 0.0.0-canary-ce08631
@@ -43,3 +43,3 @@ /* tslint:disable */ | ||
export type Cluster = { | ||
id: number; | ||
id: string; | ||
cites: Cite[]; | ||
@@ -49,3 +49,3 @@ }; | ||
export type ClusterPosition = { | ||
id: number; | ||
id: string; | ||
/** Leaving off this field means this cluster is in-text. */ | ||
@@ -69,3 +69,3 @@ note?: number; | ||
export type UpdateSummary<Output = string> = { | ||
clusters: [number, Output][]; | ||
clusters: [string, Output][]; | ||
bibliography?: BibliographyUpdate; | ||
@@ -180,11 +180,16 @@ }; | ||
/** | ||
* Returns a random cluster id, with an extra guarantee that it isn't already in use. | ||
* @returns {string} | ||
*/ | ||
randomClusterId(): string; | ||
/** | ||
* Inserts or replaces a cluster with a matching `id`. | ||
* @param {any} cluster_id | ||
* @param {any} cluster | ||
*/ | ||
insertCluster(cluster_id: any): void; | ||
insertCluster(cluster: any): void; | ||
/** | ||
* Removes a cluster with a matching `id` | ||
* @param {number} cluster_id | ||
* @param {string} cluster_id | ||
*/ | ||
removeCluster(cluster_id: number): void; | ||
removeCluster(cluster_id: string): void; | ||
/** | ||
@@ -202,6 +207,6 @@ * Resets all the clusters in the processor to a new list. | ||
* still useful for initialization. | ||
* @param {number} id | ||
* @param {string} id | ||
* @returns {any} | ||
*/ | ||
builtCluster(id: number): any; | ||
builtCluster(id: string): any; | ||
/** | ||
@@ -230,25 +235,2 @@ * Previews a formatted citation cluster, in a particular position. | ||
/** | ||
* Replaces cluster numberings in one go. | ||
* | ||
* * `mappings` is an `Array<[ ClusterId, ClusterNumber ]>` where `ClusterNumber` | ||
* is, e.g. `{ note: 1 }`, `{ note: [3, 1] }` or `{ inText: 5 }` in the same way a | ||
* Cluster must contain one of those three numberings. | ||
* | ||
* Not every ClusterId must appear in the array, just the ones you wish to renumber. | ||
* | ||
* The library consumer is responsible for ensuring that clusters are well-ordered. Clusters | ||
* are sorted for determining cite positions (ibid, subsequent, etc). If a footnote is | ||
* deleted, you will likely need to shift all cluster numbers after it back by one. | ||
* | ||
* The second note numbering, `{note: [3, 1]}`, is for having multiple clusters in a single | ||
* footnote. This is possible in many editors. The second number acts as a second sorting | ||
* key. | ||
* | ||
* The third note numbering, `{ inText: 5 }`, is for ordering in-text references that appear | ||
* within the body of a document. These will be sorted but won't cause | ||
* `first-reference-note-number` to become available. | ||
* @param {any[]} mappings | ||
*/ | ||
renumberClusters(mappings: any[]): void; | ||
/** | ||
* Specifies which clusters are actually considered to be in the document, and sets their | ||
@@ -255,0 +237,0 @@ * order. You may insert as many clusters as you like, but the ones provided here are the only |
@@ -6,2 +6,18 @@ let imports = {}; | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
cachedTextDecoder.decode(); | ||
let cachegetUint8Memory0 = null; | ||
function getUint8Memory0() { | ||
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) { | ||
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
} | ||
return cachegetUint8Memory0; | ||
} | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
const heap = new Array(32).fill(undefined); | ||
@@ -11,2 +27,13 @@ | ||
let heap_next = heap.length; | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
function getObject(idx) { return heap[idx]; } | ||
@@ -41,29 +68,2 @@ | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
cachedTextDecoder.decode(); | ||
let cachegetUint8Memory0 = null; | ||
function getUint8Memory0() { | ||
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) { | ||
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
} | ||
return cachegetUint8Memory0; | ||
} | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
let heap_next = heap.length; | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
function dropObject(idx) { | ||
@@ -109,4 +109,4 @@ if (idx < 36) return; | ||
} | ||
function __wbg_adapter_18(arg0, arg1, arg2) { | ||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf77188239a1f71cd(arg0, arg1, addHeapObject(arg2)); | ||
function __wbg_adapter_20(arg0, arg1, arg2) { | ||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hca4f7551db7d6c55(arg0, arg1, addHeapObject(arg2)); | ||
} | ||
@@ -142,6 +142,9 @@ | ||
} | ||
function __wbg_adapter_64(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h19f62226ce422262(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
function __wbg_adapter_66(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h11c2c306e07dc854(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
} | ||
function getArrayU8FromWasm0(ptr, len) { | ||
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); | ||
} | ||
/** | ||
@@ -253,14 +256,33 @@ */ | ||
/** | ||
* Returns a random cluster id, with an extra guarantee that it isn't already in use. | ||
* @returns {string} | ||
*/ | ||
randomClusterId() { | ||
try { | ||
const retptr = wasm.__wbindgen_export_4.value - 16; | ||
wasm.__wbindgen_export_4.value = retptr; | ||
wasm.driver_randomClusterId(retptr, this.ptr); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
return getStringFromWasm0(r0, r1); | ||
} finally { | ||
wasm.__wbindgen_export_4.value += 16; | ||
wasm.__wbindgen_free(r0, r1); | ||
} | ||
} | ||
/** | ||
* Inserts or replaces a cluster with a matching `id`. | ||
* @param {any} cluster_id | ||
* @param {any} cluster | ||
*/ | ||
insertCluster(cluster_id) { | ||
wasm.driver_insertCluster(this.ptr, addHeapObject(cluster_id)); | ||
insertCluster(cluster) { | ||
wasm.driver_insertCluster(this.ptr, addHeapObject(cluster)); | ||
} | ||
/** | ||
* Removes a cluster with a matching `id` | ||
* @param {number} cluster_id | ||
* @param {string} cluster_id | ||
*/ | ||
removeCluster(cluster_id) { | ||
wasm.driver_removeCluster(this.ptr, cluster_id); | ||
var ptr0 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
wasm.driver_removeCluster(this.ptr, ptr0, len0); | ||
} | ||
@@ -283,7 +305,9 @@ /** | ||
* still useful for initialization. | ||
* @param {number} id | ||
* @param {string} id | ||
* @returns {any} | ||
*/ | ||
builtCluster(id) { | ||
var ret = wasm.driver_builtCluster(this.ptr, id); | ||
var ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
var ret = wasm.driver_builtCluster(this.ptr, ptr0, len0); | ||
return takeObject(ret); | ||
@@ -329,29 +353,2 @@ } | ||
/** | ||
* Replaces cluster numberings in one go. | ||
* | ||
* * `mappings` is an `Array<[ ClusterId, ClusterNumber ]>` where `ClusterNumber` | ||
* is, e.g. `{ note: 1 }`, `{ note: [3, 1] }` or `{ inText: 5 }` in the same way a | ||
* Cluster must contain one of those three numberings. | ||
* | ||
* Not every ClusterId must appear in the array, just the ones you wish to renumber. | ||
* | ||
* The library consumer is responsible for ensuring that clusters are well-ordered. Clusters | ||
* are sorted for determining cite positions (ibid, subsequent, etc). If a footnote is | ||
* deleted, you will likely need to shift all cluster numbers after it back by one. | ||
* | ||
* The second note numbering, `{note: [3, 1]}`, is for having multiple clusters in a single | ||
* footnote. This is possible in many editors. The second number acts as a second sorting | ||
* key. | ||
* | ||
* The third note numbering, `{ inText: 5 }`, is for ordering in-text references that appear | ||
* within the body of a document. These will be sorted but won't cause | ||
* `first-reference-note-number` to become available. | ||
* @param {any[]} mappings | ||
*/ | ||
renumberClusters(mappings) { | ||
var ptr0 = passArrayJsValueToWasm0(mappings, wasm.__wbindgen_malloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
wasm.driver_renumberClusters(this.ptr, ptr0, len0); | ||
} | ||
/** | ||
* Specifies which clusters are actually considered to be in the document, and sets their | ||
@@ -429,2 +426,7 @@ * order. You may insert as many clusters as you like, but the ones provided here are the only | ||
module.exports.__wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_json_serialize = function(arg0, arg1) { | ||
@@ -439,7 +441,2 @@ const obj = getObject(arg1); | ||
module.exports.__wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_object_drop_ref = function(arg0) { | ||
@@ -449,2 +446,11 @@ takeObject(arg0); | ||
module.exports.__wbg_error_e549f7fed6d655aa = function(arg0) { | ||
console.error(takeObject(arg0)); | ||
}; | ||
module.exports.__wbindgen_object_clone_ref = function(arg0) { | ||
var ret = getObject(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_fetchLocale_8f52b973b0739a6c = function(arg0, arg1, arg2) { | ||
@@ -455,2 +461,12 @@ var ret = getObject(arg0).fetchLocale(getStringFromWasm0(arg1, arg2)); | ||
module.exports.__wbindgen_cb_drop = function(arg0) { | ||
const obj = takeObject(arg0).original; | ||
if (obj.cnt-- == 1) { | ||
obj.a = 0; | ||
return true; | ||
} | ||
var ret = false; | ||
return ret; | ||
}; | ||
module.exports.__wbg_debug_4885c3f7d6f044a3 = function(arg0, arg1) { | ||
@@ -476,21 +492,2 @@ console.debug(getStringFromWasm0(arg0, arg1)); | ||
module.exports.__wbindgen_object_clone_ref = function(arg0) { | ||
var ret = getObject(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_error_e549f7fed6d655aa = function(arg0) { | ||
console.error(takeObject(arg0)); | ||
}; | ||
module.exports.__wbindgen_cb_drop = function(arg0) { | ||
const obj = takeObject(arg0).original; | ||
if (obj.cnt-- == 1) { | ||
obj.a = 0; | ||
return true; | ||
} | ||
var ret = false; | ||
return ret; | ||
}; | ||
module.exports.__wbg_new_59cb74e423758ede = function() { | ||
@@ -517,3 +514,3 @@ var ret = new Error(); | ||
module.exports.__wbg_new_4896ab6bba55e0d9 = function(arg0, arg1) { | ||
module.exports.__wbg_new_1192d65414040ad9 = function(arg0, arg1) { | ||
var ret = new Error(getStringFromWasm0(arg0, arg1)); | ||
@@ -523,3 +520,3 @@ return addHeapObject(ret); | ||
module.exports.__wbg_call_0dad7db75ec90ae7 = handleError(function(arg0, arg1, arg2) { | ||
module.exports.__wbg_call_d713ea0274dfc6d2 = handleError(function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); | ||
@@ -529,3 +526,3 @@ return addHeapObject(ret); | ||
module.exports.__wbg_new_7039bf8b99f049e1 = function(arg0, arg1) { | ||
module.exports.__wbg_new_d0c63652ab4d825c = function(arg0, arg1) { | ||
try { | ||
@@ -537,3 +534,3 @@ var state0 = {a: arg0, b: arg1}; | ||
try { | ||
return __wbg_adapter_64(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_66(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -550,3 +547,3 @@ state0.a = a; | ||
module.exports.__wbg_resolve_4df26938859b92e3 = function(arg0) { | ||
module.exports.__wbg_resolve_2529512c3bb73938 = function(arg0) { | ||
var ret = Promise.resolve(getObject(arg0)); | ||
@@ -556,3 +553,3 @@ return addHeapObject(ret); | ||
module.exports.__wbg_then_ffb6e71f7a6735ad = function(arg0, arg1) { | ||
module.exports.__wbg_then_4a7a614abbbe6d81 = function(arg0, arg1) { | ||
var ret = getObject(arg0).then(getObject(arg1)); | ||
@@ -562,3 +559,3 @@ return addHeapObject(ret); | ||
module.exports.__wbg_then_021fcdc7f0350b58 = function(arg0, arg1, arg2) { | ||
module.exports.__wbg_then_3b7ac098cfda2fa5 = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); | ||
@@ -568,2 +565,45 @@ return addHeapObject(ret); | ||
module.exports.__wbindgen_is_undefined = function(arg0) { | ||
var ret = getObject(arg0) === undefined; | ||
return ret; | ||
}; | ||
module.exports.__wbg_getRandomValues_3ac1b33c90b52596 = function(arg0, arg1, arg2) { | ||
getObject(arg0).getRandomValues(getArrayU8FromWasm0(arg1, arg2)); | ||
}; | ||
module.exports.__wbg_randomFillSync_6f956029658662ec = function(arg0, arg1, arg2) { | ||
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2)); | ||
}; | ||
module.exports.__wbg_self_1c83eb4471d9eb9b = handleError(function() { | ||
var ret = self.self; | ||
return addHeapObject(ret); | ||
}); | ||
module.exports.__wbg_static_accessor_MODULE_abf5ae284bffdf45 = function() { | ||
var ret = module; | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_require_5b2b5b594d809d9f = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_crypto_c12f14e810edcaa2 = function(arg0) { | ||
var ret = getObject(arg0).crypto; | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_msCrypto_679be765111ba775 = function(arg0) { | ||
var ret = getObject(arg0).msCrypto; | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_getRandomValues_05a60bf171bfc2be = function(arg0) { | ||
var ret = getObject(arg0).getRandomValues; | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_string_get = function(arg0, arg1) { | ||
@@ -586,4 +626,4 @@ const obj = getObject(arg1); | ||
module.exports.__wbindgen_closure_wrapper877 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 227, __wbg_adapter_18); | ||
module.exports.__wbindgen_closure_wrapper857 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 196, __wbg_adapter_20); | ||
return addHeapObject(ret); | ||
@@ -590,0 +630,0 @@ }; |
import * as wasm from './citeproc_rs_wasm_bg.wasm'; | ||
const heap = new Array(32).fill(undefined); | ||
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; | ||
heap.push(undefined, null, true, false); | ||
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
function getObject(idx) { return heap[idx]; } | ||
cachedTextDecoder.decode(); | ||
let WASM_VECTOR_LEN = 0; | ||
let cachegetUint8Memory0 = null; | ||
@@ -19,2 +17,25 @@ function getUint8Memory0() { | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
const heap = new Array(32).fill(undefined); | ||
heap.push(undefined, null, true, false); | ||
let heap_next = heap.length; | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
function getObject(idx) { return heap[idx]; } | ||
let WASM_VECTOR_LEN = 0; | ||
const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder; | ||
@@ -83,23 +104,2 @@ | ||
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; | ||
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
cachedTextDecoder.decode(); | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
let heap_next = heap.length; | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
function dropObject(idx) { | ||
@@ -145,4 +145,4 @@ if (idx < 36) return; | ||
} | ||
function __wbg_adapter_18(arg0, arg1, arg2) { | ||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf77188239a1f71cd(arg0, arg1, addHeapObject(arg2)); | ||
function __wbg_adapter_20(arg0, arg1, arg2) { | ||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hca4f7551db7d6c55(arg0, arg1, addHeapObject(arg2)); | ||
} | ||
@@ -178,6 +178,9 @@ | ||
} | ||
function __wbg_adapter_64(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h19f62226ce422262(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
function __wbg_adapter_66(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h11c2c306e07dc854(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
} | ||
function getArrayU8FromWasm0(ptr, len) { | ||
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); | ||
} | ||
/** | ||
@@ -289,14 +292,33 @@ */ | ||
/** | ||
* Returns a random cluster id, with an extra guarantee that it isn't already in use. | ||
* @returns {string} | ||
*/ | ||
randomClusterId() { | ||
try { | ||
const retptr = wasm.__wbindgen_export_4.value - 16; | ||
wasm.__wbindgen_export_4.value = retptr; | ||
wasm.driver_randomClusterId(retptr, this.ptr); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
return getStringFromWasm0(r0, r1); | ||
} finally { | ||
wasm.__wbindgen_export_4.value += 16; | ||
wasm.__wbindgen_free(r0, r1); | ||
} | ||
} | ||
/** | ||
* Inserts or replaces a cluster with a matching `id`. | ||
* @param {any} cluster_id | ||
* @param {any} cluster | ||
*/ | ||
insertCluster(cluster_id) { | ||
wasm.driver_insertCluster(this.ptr, addHeapObject(cluster_id)); | ||
insertCluster(cluster) { | ||
wasm.driver_insertCluster(this.ptr, addHeapObject(cluster)); | ||
} | ||
/** | ||
* Removes a cluster with a matching `id` | ||
* @param {number} cluster_id | ||
* @param {string} cluster_id | ||
*/ | ||
removeCluster(cluster_id) { | ||
wasm.driver_removeCluster(this.ptr, cluster_id); | ||
var ptr0 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
wasm.driver_removeCluster(this.ptr, ptr0, len0); | ||
} | ||
@@ -319,7 +341,9 @@ /** | ||
* still useful for initialization. | ||
* @param {number} id | ||
* @param {string} id | ||
* @returns {any} | ||
*/ | ||
builtCluster(id) { | ||
var ret = wasm.driver_builtCluster(this.ptr, id); | ||
var ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
var ret = wasm.driver_builtCluster(this.ptr, ptr0, len0); | ||
return takeObject(ret); | ||
@@ -365,29 +389,2 @@ } | ||
/** | ||
* Replaces cluster numberings in one go. | ||
* | ||
* * `mappings` is an `Array<[ ClusterId, ClusterNumber ]>` where `ClusterNumber` | ||
* is, e.g. `{ note: 1 }`, `{ note: [3, 1] }` or `{ inText: 5 }` in the same way a | ||
* Cluster must contain one of those three numberings. | ||
* | ||
* Not every ClusterId must appear in the array, just the ones you wish to renumber. | ||
* | ||
* The library consumer is responsible for ensuring that clusters are well-ordered. Clusters | ||
* are sorted for determining cite positions (ibid, subsequent, etc). If a footnote is | ||
* deleted, you will likely need to shift all cluster numbers after it back by one. | ||
* | ||
* The second note numbering, `{note: [3, 1]}`, is for having multiple clusters in a single | ||
* footnote. This is possible in many editors. The second number acts as a second sorting | ||
* key. | ||
* | ||
* The third note numbering, `{ inText: 5 }`, is for ordering in-text references that appear | ||
* within the body of a document. These will be sorted but won't cause | ||
* `first-reference-note-number` to become available. | ||
* @param {any[]} mappings | ||
*/ | ||
renumberClusters(mappings) { | ||
var ptr0 = passArrayJsValueToWasm0(mappings, wasm.__wbindgen_malloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
wasm.driver_renumberClusters(this.ptr, ptr0, len0); | ||
} | ||
/** | ||
* Specifies which clusters are actually considered to be in the document, and sets their | ||
@@ -464,2 +461,7 @@ * order. You may insert as many clusters as you like, but the ones provided here are the only | ||
export const __wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
export const __wbindgen_json_serialize = function(arg0, arg1) { | ||
@@ -474,7 +476,2 @@ const obj = getObject(arg1); | ||
export const __wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
export const __wbindgen_object_drop_ref = function(arg0) { | ||
@@ -484,2 +481,11 @@ takeObject(arg0); | ||
export const __wbg_error_e549f7fed6d655aa = function(arg0) { | ||
console.error(takeObject(arg0)); | ||
}; | ||
export const __wbindgen_object_clone_ref = function(arg0) { | ||
var ret = getObject(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
export const __wbg_fetchLocale_8f52b973b0739a6c = function(arg0, arg1, arg2) { | ||
@@ -490,2 +496,12 @@ var ret = getObject(arg0).fetchLocale(getStringFromWasm0(arg1, arg2)); | ||
export const __wbindgen_cb_drop = function(arg0) { | ||
const obj = takeObject(arg0).original; | ||
if (obj.cnt-- == 1) { | ||
obj.a = 0; | ||
return true; | ||
} | ||
var ret = false; | ||
return ret; | ||
}; | ||
export const __wbg_debug_4885c3f7d6f044a3 = function(arg0, arg1) { | ||
@@ -511,21 +527,2 @@ console.debug(getStringFromWasm0(arg0, arg1)); | ||
export const __wbindgen_object_clone_ref = function(arg0) { | ||
var ret = getObject(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
export const __wbg_error_e549f7fed6d655aa = function(arg0) { | ||
console.error(takeObject(arg0)); | ||
}; | ||
export const __wbindgen_cb_drop = function(arg0) { | ||
const obj = takeObject(arg0).original; | ||
if (obj.cnt-- == 1) { | ||
obj.a = 0; | ||
return true; | ||
} | ||
var ret = false; | ||
return ret; | ||
}; | ||
export const __wbg_new_59cb74e423758ede = function() { | ||
@@ -552,3 +549,3 @@ var ret = new Error(); | ||
export const __wbg_new_4896ab6bba55e0d9 = function(arg0, arg1) { | ||
export const __wbg_new_1192d65414040ad9 = function(arg0, arg1) { | ||
var ret = new Error(getStringFromWasm0(arg0, arg1)); | ||
@@ -558,3 +555,3 @@ return addHeapObject(ret); | ||
export const __wbg_call_0dad7db75ec90ae7 = handleError(function(arg0, arg1, arg2) { | ||
export const __wbg_call_d713ea0274dfc6d2 = handleError(function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); | ||
@@ -564,3 +561,3 @@ return addHeapObject(ret); | ||
export const __wbg_new_7039bf8b99f049e1 = function(arg0, arg1) { | ||
export const __wbg_new_d0c63652ab4d825c = function(arg0, arg1) { | ||
try { | ||
@@ -572,3 +569,3 @@ var state0 = {a: arg0, b: arg1}; | ||
try { | ||
return __wbg_adapter_64(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_66(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -585,3 +582,3 @@ state0.a = a; | ||
export const __wbg_resolve_4df26938859b92e3 = function(arg0) { | ||
export const __wbg_resolve_2529512c3bb73938 = function(arg0) { | ||
var ret = Promise.resolve(getObject(arg0)); | ||
@@ -591,3 +588,3 @@ return addHeapObject(ret); | ||
export const __wbg_then_ffb6e71f7a6735ad = function(arg0, arg1) { | ||
export const __wbg_then_4a7a614abbbe6d81 = function(arg0, arg1) { | ||
var ret = getObject(arg0).then(getObject(arg1)); | ||
@@ -597,3 +594,3 @@ return addHeapObject(ret); | ||
export const __wbg_then_021fcdc7f0350b58 = function(arg0, arg1, arg2) { | ||
export const __wbg_then_3b7ac098cfda2fa5 = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); | ||
@@ -603,2 +600,45 @@ return addHeapObject(ret); | ||
export const __wbindgen_is_undefined = function(arg0) { | ||
var ret = getObject(arg0) === undefined; | ||
return ret; | ||
}; | ||
export const __wbg_getRandomValues_3ac1b33c90b52596 = function(arg0, arg1, arg2) { | ||
getObject(arg0).getRandomValues(getArrayU8FromWasm0(arg1, arg2)); | ||
}; | ||
export const __wbg_randomFillSync_6f956029658662ec = function(arg0, arg1, arg2) { | ||
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2)); | ||
}; | ||
export const __wbg_self_1c83eb4471d9eb9b = handleError(function() { | ||
var ret = self.self; | ||
return addHeapObject(ret); | ||
}); | ||
export const __wbg_static_accessor_MODULE_abf5ae284bffdf45 = function() { | ||
var ret = module; | ||
return addHeapObject(ret); | ||
}; | ||
export const __wbg_require_5b2b5b594d809d9f = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2)); | ||
return addHeapObject(ret); | ||
}; | ||
export const __wbg_crypto_c12f14e810edcaa2 = function(arg0) { | ||
var ret = getObject(arg0).crypto; | ||
return addHeapObject(ret); | ||
}; | ||
export const __wbg_msCrypto_679be765111ba775 = function(arg0) { | ||
var ret = getObject(arg0).msCrypto; | ||
return addHeapObject(ret); | ||
}; | ||
export const __wbg_getRandomValues_05a60bf171bfc2be = function(arg0) { | ||
var ret = getObject(arg0).getRandomValues; | ||
return addHeapObject(ret); | ||
}; | ||
export const __wbindgen_string_get = function(arg0, arg1) { | ||
@@ -621,6 +661,6 @@ const obj = getObject(arg1); | ||
export const __wbindgen_closure_wrapper877 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 227, __wbg_adapter_18); | ||
export const __wbindgen_closure_wrapper857 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 196, __wbg_adapter_20); | ||
return addHeapObject(ret); | ||
}; | ||
@@ -43,3 +43,3 @@ /* tslint:disable */ | ||
export type Cluster = { | ||
id: number; | ||
id: string; | ||
cites: Cite[]; | ||
@@ -49,3 +49,3 @@ }; | ||
export type ClusterPosition = { | ||
id: number; | ||
id: string; | ||
/** Leaving off this field means this cluster is in-text. */ | ||
@@ -69,3 +69,3 @@ note?: number; | ||
export type UpdateSummary<Output = string> = { | ||
clusters: [number, Output][]; | ||
clusters: [string, Output][]; | ||
bibliography?: BibliographyUpdate; | ||
@@ -180,11 +180,16 @@ }; | ||
/** | ||
* Returns a random cluster id, with an extra guarantee that it isn't already in use. | ||
* @returns {string} | ||
*/ | ||
randomClusterId(): string; | ||
/** | ||
* Inserts or replaces a cluster with a matching `id`. | ||
* @param {any} cluster_id | ||
* @param {any} cluster | ||
*/ | ||
insertCluster(cluster_id: any): void; | ||
insertCluster(cluster: any): void; | ||
/** | ||
* Removes a cluster with a matching `id` | ||
* @param {number} cluster_id | ||
* @param {string} cluster_id | ||
*/ | ||
removeCluster(cluster_id: number): void; | ||
removeCluster(cluster_id: string): void; | ||
/** | ||
@@ -202,6 +207,6 @@ * Resets all the clusters in the processor to a new list. | ||
* still useful for initialization. | ||
* @param {number} id | ||
* @param {string} id | ||
* @returns {any} | ||
*/ | ||
builtCluster(id: number): any; | ||
builtCluster(id: string): any; | ||
/** | ||
@@ -230,25 +235,2 @@ * Previews a formatted citation cluster, in a particular position. | ||
/** | ||
* Replaces cluster numberings in one go. | ||
* | ||
* * `mappings` is an `Array<[ ClusterId, ClusterNumber ]>` where `ClusterNumber` | ||
* is, e.g. `{ note: 1 }`, `{ note: [3, 1] }` or `{ inText: 5 }` in the same way a | ||
* Cluster must contain one of those three numberings. | ||
* | ||
* Not every ClusterId must appear in the array, just the ones you wish to renumber. | ||
* | ||
* The library consumer is responsible for ensuring that clusters are well-ordered. Clusters | ||
* are sorted for determining cite positions (ibid, subsequent, etc). If a footnote is | ||
* deleted, you will likely need to shift all cluster numbers after it back by one. | ||
* | ||
* The second note numbering, `{note: [3, 1]}`, is for having multiple clusters in a single | ||
* footnote. This is possible in many editors. The second number acts as a second sorting | ||
* key. | ||
* | ||
* The third note numbering, `{ inText: 5 }`, is for ordering in-text references that appear | ||
* within the body of a document. These will be sorted but won't cause | ||
* `first-reference-note-number` to become available. | ||
* @param {any[]} mappings | ||
*/ | ||
renumberClusters(mappings: any[]): void; | ||
/** | ||
* Specifies which clusters are actually considered to be in the document, and sets their | ||
@@ -255,0 +237,0 @@ * order. You may insert as many clusters as you like, but the ones provided here are the only |
@@ -43,3 +43,3 @@ /* tslint:disable */ | ||
export type Cluster = { | ||
id: number; | ||
id: string; | ||
cites: Cite[]; | ||
@@ -49,3 +49,3 @@ }; | ||
export type ClusterPosition = { | ||
id: number; | ||
id: string; | ||
/** Leaving off this field means this cluster is in-text. */ | ||
@@ -69,3 +69,3 @@ note?: number; | ||
export type UpdateSummary<Output = string> = { | ||
clusters: [number, Output][]; | ||
clusters: [string, Output][]; | ||
bibliography?: BibliographyUpdate; | ||
@@ -180,11 +180,16 @@ }; | ||
/** | ||
* Returns a random cluster id, with an extra guarantee that it isn't already in use. | ||
* @returns {string} | ||
*/ | ||
randomClusterId(): string; | ||
/** | ||
* Inserts or replaces a cluster with a matching `id`. | ||
* @param {any} cluster_id | ||
* @param {any} cluster | ||
*/ | ||
insertCluster(cluster_id: any): void; | ||
insertCluster(cluster: any): void; | ||
/** | ||
* Removes a cluster with a matching `id` | ||
* @param {number} cluster_id | ||
* @param {string} cluster_id | ||
*/ | ||
removeCluster(cluster_id: number): void; | ||
removeCluster(cluster_id: string): void; | ||
/** | ||
@@ -202,6 +207,6 @@ * Resets all the clusters in the processor to a new list. | ||
* still useful for initialization. | ||
* @param {number} id | ||
* @param {string} id | ||
* @returns {any} | ||
*/ | ||
builtCluster(id: number): any; | ||
builtCluster(id: string): any; | ||
/** | ||
@@ -230,25 +235,2 @@ * Previews a formatted citation cluster, in a particular position. | ||
/** | ||
* Replaces cluster numberings in one go. | ||
* | ||
* * `mappings` is an `Array<[ ClusterId, ClusterNumber ]>` where `ClusterNumber` | ||
* is, e.g. `{ note: 1 }`, `{ note: [3, 1] }` or `{ inText: 5 }` in the same way a | ||
* Cluster must contain one of those three numberings. | ||
* | ||
* Not every ClusterId must appear in the array, just the ones you wish to renumber. | ||
* | ||
* The library consumer is responsible for ensuring that clusters are well-ordered. Clusters | ||
* are sorted for determining cite positions (ibid, subsequent, etc). If a footnote is | ||
* deleted, you will likely need to shift all cluster numbers after it back by one. | ||
* | ||
* The second note numbering, `{note: [3, 1]}`, is for having multiple clusters in a single | ||
* footnote. This is possible in many editors. The second number acts as a second sorting | ||
* key. | ||
* | ||
* The third note numbering, `{ inText: 5 }`, is for ordering in-text references that appear | ||
* within the body of a document. These will be sorted but won't cause | ||
* `first-reference-note-number` to become available. | ||
* @param {any[]} mappings | ||
*/ | ||
renumberClusters(mappings: any[]): void; | ||
/** | ||
* Specifies which clusters are actually considered to be in the document, and sets their | ||
@@ -323,10 +305,10 @@ * order. You may insert as many clusters as you like, but the ones provided here are the only | ||
readonly driver_toFetch: (a: number) => number; | ||
readonly driver_randomClusterId: (a: number, b: number) => void; | ||
readonly driver_insertCluster: (a: number, b: number) => void; | ||
readonly driver_removeCluster: (a: number, b: number) => void; | ||
readonly driver_removeCluster: (a: number, b: number, c: number) => void; | ||
readonly driver_initClusters: (a: number, b: number, c: number) => void; | ||
readonly driver_builtCluster: (a: number, b: number) => number; | ||
readonly driver_builtCluster: (a: number, b: number, c: number) => number; | ||
readonly driver_previewCitationCluster: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number; | ||
readonly driver_makeBibliography: (a: number) => number; | ||
readonly driver_bibliographyMeta: (a: number) => number; | ||
readonly driver_renumberClusters: (a: number, b: number, c: number) => void; | ||
readonly driver_setClusterOrder: (a: number, b: number, c: number) => void; | ||
@@ -340,6 +322,6 @@ readonly driver_batchedUpdates: (a: number) => number; | ||
readonly __wbindgen_export_2: WebAssembly.Table; | ||
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf77188239a1f71cd: (a: number, b: number, c: number) => void; | ||
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hca4f7551db7d6c55: (a: number, b: number, c: number) => void; | ||
readonly __wbindgen_free: (a: number, b: number) => void; | ||
readonly __wbindgen_exn_store: (a: number) => void; | ||
readonly wasm_bindgen__convert__closures__invoke2_mut__h19f62226ce422262: (a: number, b: number, c: number, d: number) => void; | ||
readonly wasm_bindgen__convert__closures__invoke2_mut__h11c2c306e07dc854: (a: number, b: number, c: number, d: number) => void; | ||
} | ||
@@ -346,0 +328,0 @@ |
let wasm; | ||
const heap = new Array(32).fill(undefined); | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
heap.push(undefined, null, true, false); | ||
cachedTextDecoder.decode(); | ||
function getObject(idx) { return heap[idx]; } | ||
let WASM_VECTOR_LEN = 0; | ||
let cachegetUint8Memory0 = null; | ||
@@ -20,2 +16,25 @@ function getUint8Memory0() { | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
const heap = new Array(32).fill(undefined); | ||
heap.push(undefined, null, true, false); | ||
let heap_next = heap.length; | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
function getObject(idx) { return heap[idx]; } | ||
let WASM_VECTOR_LEN = 0; | ||
let cachedTextEncoder = new TextEncoder('utf-8'); | ||
@@ -82,21 +101,2 @@ | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
cachedTextDecoder.decode(); | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
let heap_next = heap.length; | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
function dropObject(idx) { | ||
@@ -142,4 +142,4 @@ if (idx < 36) return; | ||
} | ||
function __wbg_adapter_18(arg0, arg1, arg2) { | ||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf77188239a1f71cd(arg0, arg1, addHeapObject(arg2)); | ||
function __wbg_adapter_20(arg0, arg1, arg2) { | ||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hca4f7551db7d6c55(arg0, arg1, addHeapObject(arg2)); | ||
} | ||
@@ -175,6 +175,9 @@ | ||
} | ||
function __wbg_adapter_64(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h19f62226ce422262(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
function __wbg_adapter_66(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h11c2c306e07dc854(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
} | ||
function getArrayU8FromWasm0(ptr, len) { | ||
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); | ||
} | ||
/** | ||
@@ -286,14 +289,33 @@ */ | ||
/** | ||
* Returns a random cluster id, with an extra guarantee that it isn't already in use. | ||
* @returns {string} | ||
*/ | ||
randomClusterId() { | ||
try { | ||
const retptr = wasm.__wbindgen_export_4.value - 16; | ||
wasm.__wbindgen_export_4.value = retptr; | ||
wasm.driver_randomClusterId(retptr, this.ptr); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
return getStringFromWasm0(r0, r1); | ||
} finally { | ||
wasm.__wbindgen_export_4.value += 16; | ||
wasm.__wbindgen_free(r0, r1); | ||
} | ||
} | ||
/** | ||
* Inserts or replaces a cluster with a matching `id`. | ||
* @param {any} cluster_id | ||
* @param {any} cluster | ||
*/ | ||
insertCluster(cluster_id) { | ||
wasm.driver_insertCluster(this.ptr, addHeapObject(cluster_id)); | ||
insertCluster(cluster) { | ||
wasm.driver_insertCluster(this.ptr, addHeapObject(cluster)); | ||
} | ||
/** | ||
* Removes a cluster with a matching `id` | ||
* @param {number} cluster_id | ||
* @param {string} cluster_id | ||
*/ | ||
removeCluster(cluster_id) { | ||
wasm.driver_removeCluster(this.ptr, cluster_id); | ||
var ptr0 = passStringToWasm0(cluster_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
wasm.driver_removeCluster(this.ptr, ptr0, len0); | ||
} | ||
@@ -316,7 +338,9 @@ /** | ||
* still useful for initialization. | ||
* @param {number} id | ||
* @param {string} id | ||
* @returns {any} | ||
*/ | ||
builtCluster(id) { | ||
var ret = wasm.driver_builtCluster(this.ptr, id); | ||
var ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
var ret = wasm.driver_builtCluster(this.ptr, ptr0, len0); | ||
return takeObject(ret); | ||
@@ -362,29 +386,2 @@ } | ||
/** | ||
* Replaces cluster numberings in one go. | ||
* | ||
* * `mappings` is an `Array<[ ClusterId, ClusterNumber ]>` where `ClusterNumber` | ||
* is, e.g. `{ note: 1 }`, `{ note: [3, 1] }` or `{ inText: 5 }` in the same way a | ||
* Cluster must contain one of those three numberings. | ||
* | ||
* Not every ClusterId must appear in the array, just the ones you wish to renumber. | ||
* | ||
* The library consumer is responsible for ensuring that clusters are well-ordered. Clusters | ||
* are sorted for determining cite positions (ibid, subsequent, etc). If a footnote is | ||
* deleted, you will likely need to shift all cluster numbers after it back by one. | ||
* | ||
* The second note numbering, `{note: [3, 1]}`, is for having multiple clusters in a single | ||
* footnote. This is possible in many editors. The second number acts as a second sorting | ||
* key. | ||
* | ||
* The third note numbering, `{ inText: 5 }`, is for ordering in-text references that appear | ||
* within the body of a document. These will be sorted but won't cause | ||
* `first-reference-note-number` to become available. | ||
* @param {any[]} mappings | ||
*/ | ||
renumberClusters(mappings) { | ||
var ptr0 = passArrayJsValueToWasm0(mappings, wasm.__wbindgen_malloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
wasm.driver_renumberClusters(this.ptr, ptr0, len0); | ||
} | ||
/** | ||
* Specifies which clusters are actually considered to be in the document, and sets their | ||
@@ -500,2 +497,6 @@ * order. You may insert as many clusters as you like, but the ones provided here are the only | ||
imports.wbg = {}; | ||
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) { | ||
@@ -509,9 +510,12 @@ const obj = getObject(arg1); | ||
}; | ||
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) { | ||
takeObject(arg0); | ||
}; | ||
imports.wbg.__wbg_error_e549f7fed6d655aa = function(arg0) { | ||
console.error(takeObject(arg0)); | ||
}; | ||
imports.wbg.__wbindgen_object_clone_ref = function(arg0) { | ||
var ret = getObject(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_fetchLocale_8f52b973b0739a6c = function(arg0, arg1, arg2) { | ||
@@ -521,2 +525,11 @@ var ret = getObject(arg0).fetchLocale(getStringFromWasm0(arg1, arg2)); | ||
}; | ||
imports.wbg.__wbindgen_cb_drop = function(arg0) { | ||
const obj = takeObject(arg0).original; | ||
if (obj.cnt-- == 1) { | ||
obj.a = 0; | ||
return true; | ||
} | ||
var ret = false; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_debug_4885c3f7d6f044a3 = function(arg0, arg1) { | ||
@@ -537,18 +550,2 @@ console.debug(getStringFromWasm0(arg0, arg1)); | ||
}; | ||
imports.wbg.__wbindgen_object_clone_ref = function(arg0) { | ||
var ret = getObject(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_error_e549f7fed6d655aa = function(arg0) { | ||
console.error(takeObject(arg0)); | ||
}; | ||
imports.wbg.__wbindgen_cb_drop = function(arg0) { | ||
const obj = takeObject(arg0).original; | ||
if (obj.cnt-- == 1) { | ||
obj.a = 0; | ||
return true; | ||
} | ||
var ret = false; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_new_59cb74e423758ede = function() { | ||
@@ -572,11 +569,11 @@ var ret = new Error(); | ||
}; | ||
imports.wbg.__wbg_new_4896ab6bba55e0d9 = function(arg0, arg1) { | ||
imports.wbg.__wbg_new_1192d65414040ad9 = function(arg0, arg1) { | ||
var ret = new Error(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_call_0dad7db75ec90ae7 = handleError(function(arg0, arg1, arg2) { | ||
imports.wbg.__wbg_call_d713ea0274dfc6d2 = handleError(function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); | ||
return addHeapObject(ret); | ||
}); | ||
imports.wbg.__wbg_new_7039bf8b99f049e1 = function(arg0, arg1) { | ||
imports.wbg.__wbg_new_d0c63652ab4d825c = function(arg0, arg1) { | ||
try { | ||
@@ -588,3 +585,3 @@ var state0 = {a: arg0, b: arg1}; | ||
try { | ||
return __wbg_adapter_64(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_66(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -600,14 +597,48 @@ state0.a = a; | ||
}; | ||
imports.wbg.__wbg_resolve_4df26938859b92e3 = function(arg0) { | ||
imports.wbg.__wbg_resolve_2529512c3bb73938 = function(arg0) { | ||
var ret = Promise.resolve(getObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_then_ffb6e71f7a6735ad = function(arg0, arg1) { | ||
imports.wbg.__wbg_then_4a7a614abbbe6d81 = function(arg0, arg1) { | ||
var ret = getObject(arg0).then(getObject(arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_then_021fcdc7f0350b58 = function(arg0, arg1, arg2) { | ||
imports.wbg.__wbg_then_3b7ac098cfda2fa5 = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_is_undefined = function(arg0) { | ||
var ret = getObject(arg0) === undefined; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_getRandomValues_3ac1b33c90b52596 = function(arg0, arg1, arg2) { | ||
getObject(arg0).getRandomValues(getArrayU8FromWasm0(arg1, arg2)); | ||
}; | ||
imports.wbg.__wbg_randomFillSync_6f956029658662ec = function(arg0, arg1, arg2) { | ||
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2)); | ||
}; | ||
imports.wbg.__wbg_self_1c83eb4471d9eb9b = handleError(function() { | ||
var ret = self.self; | ||
return addHeapObject(ret); | ||
}); | ||
imports.wbg.__wbg_static_accessor_MODULE_abf5ae284bffdf45 = function() { | ||
var ret = module; | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_require_5b2b5b594d809d9f = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_crypto_c12f14e810edcaa2 = function(arg0) { | ||
var ret = getObject(arg0).crypto; | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_msCrypto_679be765111ba775 = function(arg0) { | ||
var ret = getObject(arg0).msCrypto; | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_getRandomValues_05a60bf171bfc2be = function(arg0) { | ||
var ret = getObject(arg0).getRandomValues; | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_string_get = function(arg0, arg1) { | ||
@@ -627,4 +658,4 @@ const obj = getObject(arg1); | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper877 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 227, __wbg_adapter_18); | ||
imports.wbg.__wbindgen_closure_wrapper857 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 196, __wbg_adapter_20); | ||
return addHeapObject(ret); | ||
@@ -631,0 +662,0 @@ }; |
@@ -7,3 +7,3 @@ { | ||
"description": "citeproc-rs, compiled to WebAssembly", | ||
"version": "0.0.0-canary-b724318", | ||
"version": "0.0.0-canary-ce08631", | ||
"license": "MPL-2.0", | ||
@@ -18,2 +18,3 @@ "repository": { | ||
"_web/*", | ||
"_no_modules/*", | ||
"README.md" | ||
@@ -20,0 +21,0 @@ ], |
@@ -251,3 +251,3 @@ # `@citeproc-rs/wasm` | ||
A document consists of a series of clusters, each with a series of cites. Each | ||
cluster has an `id`, which is any integer except zero. | ||
cluster has an `id`, which is any old string. | ||
@@ -257,8 +257,10 @@ ```javascript | ||
driver.initClusters([ | ||
{ id: 1, cites: [ {id: "citekey"} ] }, | ||
{ id: 2, cites: [ {id: "citekey", locator: "56", label: "page" } ] }, | ||
{ id: "one", cites: [ {id: "citekey"} ] }, | ||
{ id: "two", cites: [ {id: "citekey", locator: "56", label: "page" } ] }, | ||
]); | ||
// Update or insert any one of them like so | ||
driver.insertCluster({ id: 1, cites: [ { id: "updated_citekey" } ] }); | ||
driver.insertCluster({ id: 3, cites: [ { id: "new_cluster_here" } ] }); | ||
driver.insertCluster({ id: "one", cites: [ { id: "updated_citekey" } ] }); | ||
// (You can use `driver.randomClusterId()` to generate a new one at random.) | ||
let three = driver.randomClusterId(); | ||
driver.insertCluster({ id: three, cites: [ { id: "new_cluster_here" } ] }); | ||
``` | ||
@@ -277,3 +279,3 @@ | ||
```javascript | ||
driver.setClusterOrder([ { id: 1, note: 1 }, { id: 2, note: 4 } ]); | ||
driver.setClusterOrder([ { id: "one", note: 1 }, { id: "two", note: 4 } ]); | ||
``` | ||
@@ -365,3 +367,3 @@ | ||
let cites = [ { id: "citekey", locator: "45" }, { ... } ]; | ||
let positions = [ ... before, { id: 0, note: 34 }, ... after ]; | ||
let positions = [ ... before, { note: 34 }, ... after ]; | ||
let preview = driver.previewCitationCluster(cites, positions, "html"); | ||
@@ -371,3 +373,3 @@ ``` | ||
The positions array is exactly like a call to `setClusterOrder`, except exactly | ||
one of the positions has an id of 0. This could either: | ||
one of the positions omits the id field. This could either: | ||
@@ -374,0 +376,0 @@ - Replace an existing cluster's position, and preview a cluster replacement; or |
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
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
18360003
19
3610
421
6