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

@citeproc-rs/wasm

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@citeproc-rs/wasm - npm Package Compare versions

Comparing version 0.0.0-canary-36a6745 to 0.0.0-canary-3f5d731

_cjs/citeproc_rs_wasm_bg.wasm.d.ts

48

_cjs/citeproc_rs_wasm.d.ts

@@ -90,3 +90,26 @@ /* tslint:disable */

type BibEntry = {
id: string;
value: string;
};
type BibEntries = BibEntry[];
type FullRender = {
allClusters: { [clusterId: string]: string },
bibEntries: BibEntries,
};
type BibliographyMeta = {
max_offset: number;
entry_spacing: number;
line_spacing: number;
hanging_indent: boolean;
/** the second-field-align value of the CSL style */
secondFieldAlign: null | "flush" | "margin";
/** Format-specific metadata */
formatMeta: any,
};
/**

@@ -113,5 +136,4 @@ */

* @param {string} style_text
* @returns {any}
*/
setStyle(style_text: string): any;
setStyle(style_text: string): void;
/**

@@ -158,5 +180,5 @@ * Completely overwrites the references library.

* 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;
/**

@@ -198,9 +220,9 @@ * Removes a cluster with a matching `id`

/**
* @returns {any}
* @returns {BibEntries}
*/
makeBibliography(): any;
makeBibliography(): BibEntries;
/**
* @returns {any}
* @returns {BibliographyMeta}
*/
bibliographyMeta(): any;
bibliographyMeta(): BibliographyMeta;
/**

@@ -268,5 +290,11 @@ * Replaces cluster numberings in one go.

/**
* Drains the `batchedUpdates` queue manually. Use it to avoid serializing an unneeded
* `UpdateSummary`.
* Returns all the clusters and bibliography entries in the document.
* Also drains the queue, just like batchedUpdates().
* Use this to rehydrate a document or run non-interactively.
* @returns {FullRender}
*/
fullRender(): FullRender;
/**
* Drains the `batchedUpdates` queue manually.
*/
drain(): void;

@@ -273,0 +301,0 @@ /**

@@ -39,16 +39,2 @@ let imports = {};

let heap_next = heap.length;
function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret = getObject(idx);
dropObject(idx);
return ret;
}
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });

@@ -70,2 +56,4 @@

let heap_next = heap.length;
function addHeapObject(obj) {

@@ -80,2 +68,14 @@ if (heap_next === heap.length) heap.push(heap.length + 1);

function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret = getObject(idx);
dropObject(idx);
return ret;
}
function isLikeNone(x) {

@@ -110,3 +110,3 @@ return x === undefined || x === null;

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));
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd125291c94f17248(arg0, arg1, addHeapObject(arg2));
}

@@ -142,4 +142,4 @@

}
function __wbg_adapter_63(arg0, arg1, arg2, arg3) {
wasm.wasm_bindgen__convert__closures__invoke2_mut__h19f62226ce422262(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
function __wbg_adapter_64(arg0, arg1, arg2, arg3) {
wasm.wasm_bindgen__convert__closures__invoke2_mut__h48fd5816c723cd64(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
}

@@ -188,3 +188,2 @@

* @param {string} style_text
* @returns {any}
*/

@@ -194,4 +193,3 @@ setStyle(style_text) {

var len0 = WASM_VECTOR_LEN;
var ret = wasm.driver_setStyle(this.ptr, ptr0, len0);
return takeObject(ret);
wasm.driver_setStyle(this.ptr, ptr0, len0);
}

@@ -258,6 +256,6 @@ /**

* 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));
}

@@ -318,3 +316,3 @@ /**

/**
* @returns {any}
* @returns {BibEntries}
*/

@@ -326,3 +324,3 @@ makeBibliography() {

/**
* @returns {any}
* @returns {BibliographyMeta}
*/

@@ -406,5 +404,14 @@ bibliographyMeta() {

/**
* Drains the `batchedUpdates` queue manually. Use it to avoid serializing an unneeded
* `UpdateSummary`.
* Returns all the clusters and bibliography entries in the document.
* Also drains the queue, just like batchedUpdates().
* Use this to rehydrate a document or run non-interactively.
* @returns {FullRender}
*/
fullRender() {
var ret = wasm.driver_fullRender(this.ptr);
return takeObject(ret);
}
/**
* Drains the `batchedUpdates` queue manually.
*/
drain() {

@@ -434,2 +441,7 @@ wasm.driver_drain(this.ptr);

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) {

@@ -464,7 +476,11 @@ takeObject(arg0);

module.exports.__wbindgen_json_parse = function(arg0, arg1) {
var ret = JSON.parse(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) {

@@ -480,11 +496,2 @@ const obj = takeObject(arg0).original;

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_new_59cb74e423758ede = function() {

@@ -511,3 +518,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));

@@ -517,3 +524,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));

@@ -523,3 +530,3 @@ return addHeapObject(ret);

module.exports.__wbg_new_7039bf8b99f049e1 = function(arg0, arg1) {
module.exports.__wbg_new_d0c63652ab4d825c = function(arg0, arg1) {
try {

@@ -531,3 +538,3 @@ var state0 = {a: arg0, b: arg1};

try {
return __wbg_adapter_63(a, state0.b, arg0, arg1);
return __wbg_adapter_64(a, state0.b, arg0, arg1);
} finally {

@@ -544,3 +551,3 @@ state0.a = a;

module.exports.__wbg_resolve_4df26938859b92e3 = function(arg0) {
module.exports.__wbg_resolve_2529512c3bb73938 = function(arg0) {
var ret = Promise.resolve(getObject(arg0));

@@ -550,3 +557,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));

@@ -556,3 +563,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));

@@ -579,4 +586,4 @@ return addHeapObject(ret);

module.exports.__wbindgen_closure_wrapper835 = function(arg0, arg1, arg2) {
var ret = makeMutClosure(arg0, arg1, 197, __wbg_adapter_18);
module.exports.__wbindgen_closure_wrapper836 = function(arg0, arg1, arg2) {
var ret = makeMutClosure(arg0, arg1, 195, __wbg_adapter_18);
return addHeapObject(ret);

@@ -583,0 +590,0 @@ };

@@ -82,16 +82,2 @@ import * as wasm from './citeproc_rs_wasm_bg.wasm';

let heap_next = heap.length;
function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret = getObject(idx);
dropObject(idx);
return ret;
}
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;

@@ -107,2 +93,4 @@

let heap_next = heap.length;
function addHeapObject(obj) {

@@ -117,2 +105,14 @@ if (heap_next === heap.length) heap.push(heap.length + 1);

function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret = getObject(idx);
dropObject(idx);
return ret;
}
function isLikeNone(x) {

@@ -147,3 +147,3 @@ return x === undefined || x === null;

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));
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd125291c94f17248(arg0, arg1, addHeapObject(arg2));
}

@@ -179,4 +179,4 @@

}
function __wbg_adapter_63(arg0, arg1, arg2, arg3) {
wasm.wasm_bindgen__convert__closures__invoke2_mut__h19f62226ce422262(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
function __wbg_adapter_64(arg0, arg1, arg2, arg3) {
wasm.wasm_bindgen__convert__closures__invoke2_mut__h48fd5816c723cd64(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
}

@@ -225,3 +225,2 @@

* @param {string} style_text
* @returns {any}
*/

@@ -231,4 +230,3 @@ setStyle(style_text) {

var len0 = WASM_VECTOR_LEN;
var ret = wasm.driver_setStyle(this.ptr, ptr0, len0);
return takeObject(ret);
wasm.driver_setStyle(this.ptr, ptr0, len0);
}

@@ -295,6 +293,6 @@ /**

* 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));
}

@@ -355,3 +353,3 @@ /**

/**
* @returns {any}
* @returns {BibEntries}
*/

@@ -363,3 +361,3 @@ makeBibliography() {

/**
* @returns {any}
* @returns {BibliographyMeta}
*/

@@ -443,5 +441,14 @@ bibliographyMeta() {

/**
* Drains the `batchedUpdates` queue manually. Use it to avoid serializing an unneeded
* `UpdateSummary`.
* Returns all the clusters and bibliography entries in the document.
* Also drains the queue, just like batchedUpdates().
* Use this to rehydrate a document or run non-interactively.
* @returns {FullRender}
*/
fullRender() {
var ret = wasm.driver_fullRender(this.ptr);
return takeObject(ret);
}
/**
* Drains the `batchedUpdates` queue manually.
*/
drain() {

@@ -470,2 +477,7 @@ wasm.driver_drain(this.ptr);

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) {

@@ -500,7 +512,11 @@ takeObject(arg0);

export const __wbindgen_json_parse = function(arg0, arg1) {
var ret = JSON.parse(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) {

@@ -516,11 +532,2 @@ const obj = takeObject(arg0).original;

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_new_59cb74e423758ede = function() {

@@ -547,3 +554,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));

@@ -553,3 +560,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));

@@ -559,3 +566,3 @@ return addHeapObject(ret);

export const __wbg_new_7039bf8b99f049e1 = function(arg0, arg1) {
export const __wbg_new_d0c63652ab4d825c = function(arg0, arg1) {
try {

@@ -567,3 +574,3 @@ var state0 = {a: arg0, b: arg1};

try {
return __wbg_adapter_63(a, state0.b, arg0, arg1);
return __wbg_adapter_64(a, state0.b, arg0, arg1);
} finally {

@@ -580,3 +587,3 @@ state0.a = a;

export const __wbg_resolve_4df26938859b92e3 = function(arg0) {
export const __wbg_resolve_2529512c3bb73938 = function(arg0) {
var ret = Promise.resolve(getObject(arg0));

@@ -586,3 +593,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));

@@ -592,3 +599,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));

@@ -615,6 +622,6 @@ return addHeapObject(ret);

export const __wbindgen_closure_wrapper835 = function(arg0, arg1, arg2) {
var ret = makeMutClosure(arg0, arg1, 197, __wbg_adapter_18);
export const __wbindgen_closure_wrapper836 = function(arg0, arg1, arg2) {
var ret = makeMutClosure(arg0, arg1, 195, __wbg_adapter_18);
return addHeapObject(ret);
};

@@ -90,3 +90,26 @@ /* tslint:disable */

type BibEntry = {
id: string;
value: string;
};
type BibEntries = BibEntry[];
type FullRender = {
allClusters: { [clusterId: string]: string },
bibEntries: BibEntries,
};
type BibliographyMeta = {
max_offset: number;
entry_spacing: number;
line_spacing: number;
hanging_indent: boolean;
/** the second-field-align value of the CSL style */
secondFieldAlign: null | "flush" | "margin";
/** Format-specific metadata */
formatMeta: any,
};
/**

@@ -113,5 +136,4 @@ */

* @param {string} style_text
* @returns {any}
*/
setStyle(style_text: string): any;
setStyle(style_text: string): void;
/**

@@ -158,5 +180,5 @@ * Completely overwrites the references library.

* 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;
/**

@@ -198,9 +220,9 @@ * Removes a cluster with a matching `id`

/**
* @returns {any}
* @returns {BibEntries}
*/
makeBibliography(): any;
makeBibliography(): BibEntries;
/**
* @returns {any}
* @returns {BibliographyMeta}
*/
bibliographyMeta(): any;
bibliographyMeta(): BibliographyMeta;
/**

@@ -268,5 +290,11 @@ * Replaces cluster numberings in one go.

/**
* Drains the `batchedUpdates` queue manually. Use it to avoid serializing an unneeded
* `UpdateSummary`.
* Returns all the clusters and bibliography entries in the document.
* Also drains the queue, just like batchedUpdates().
* Use this to rehydrate a document or run non-interactively.
* @returns {FullRender}
*/
fullRender(): FullRender;
/**
* Drains the `batchedUpdates` queue manually.
*/
drain(): void;

@@ -273,0 +301,0 @@ /**

@@ -90,3 +90,26 @@ /* tslint:disable */

type BibEntry = {
id: string;
value: string;
};
type BibEntries = BibEntry[];
type FullRender = {
allClusters: { [clusterId: string]: string },
bibEntries: BibEntries,
};
type BibliographyMeta = {
max_offset: number;
entry_spacing: number;
line_spacing: number;
hanging_indent: boolean;
/** the second-field-align value of the CSL style */
secondFieldAlign: null | "flush" | "margin";
/** Format-specific metadata */
formatMeta: any,
};
/**

@@ -113,5 +136,4 @@ */

* @param {string} style_text
* @returns {any}
*/
setStyle(style_text: string): any;
setStyle(style_text: string): void;
/**

@@ -158,5 +180,5 @@ * Completely overwrites the references library.

* 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;
/**

@@ -198,9 +220,9 @@ * Removes a cluster with a matching `id`

/**
* @returns {any}
* @returns {BibEntries}
*/
makeBibliography(): any;
makeBibliography(): BibEntries;
/**
* @returns {any}
* @returns {BibliographyMeta}
*/
bibliographyMeta(): any;
bibliographyMeta(): BibliographyMeta;
/**

@@ -268,5 +290,11 @@ * Replaces cluster numberings in one go.

/**
* Drains the `batchedUpdates` queue manually. Use it to avoid serializing an unneeded
* `UpdateSummary`.
* Returns all the clusters and bibliography entries in the document.
* Also drains the queue, just like batchedUpdates().
* Use this to rehydrate a document or run non-interactively.
* @returns {FullRender}
*/
fullRender(): FullRender;
/**
* Drains the `batchedUpdates` queue manually.
*/
drain(): void;

@@ -287,3 +315,3 @@ /**

readonly driver_new: (a: number, b: number, c: number, d: number, e: number) => number;
readonly driver_setStyle: (a: number, b: number, c: number) => number;
readonly driver_setStyle: (a: number, b: number, c: number) => void;
readonly driver_resetReferences: (a: number, b: number, c: number) => void;

@@ -305,2 +333,3 @@ readonly driver_insertReferences: (a: number, b: number, c: number) => void;

readonly driver_batchedUpdates: (a: number) => number;
readonly driver_fullRender: (a: number) => number;
readonly driver_drain: (a: number) => void;

@@ -311,6 +340,6 @@ readonly driver_fetchAll: (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__hd125291c94f17248: (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__h48fd5816c723cd64: (a: number, b: number, c: number, d: number) => void;
}

@@ -317,0 +346,0 @@

@@ -81,16 +81,2 @@

let heap_next = heap.length;
function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret = getObject(idx);
dropObject(idx);
return ret;
}
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });

@@ -104,2 +90,4 @@

let heap_next = heap.length;
function addHeapObject(obj) {

@@ -114,2 +102,14 @@ if (heap_next === heap.length) heap.push(heap.length + 1);

function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret = getObject(idx);
dropObject(idx);
return ret;
}
function isLikeNone(x) {

@@ -144,3 +144,3 @@ return x === undefined || x === null;

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));
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd125291c94f17248(arg0, arg1, addHeapObject(arg2));
}

@@ -176,4 +176,4 @@

}
function __wbg_adapter_63(arg0, arg1, arg2, arg3) {
wasm.wasm_bindgen__convert__closures__invoke2_mut__h19f62226ce422262(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
function __wbg_adapter_64(arg0, arg1, arg2, arg3) {
wasm.wasm_bindgen__convert__closures__invoke2_mut__h48fd5816c723cd64(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
}

@@ -222,3 +222,2 @@

* @param {string} style_text
* @returns {any}
*/

@@ -228,4 +227,3 @@ setStyle(style_text) {

var len0 = WASM_VECTOR_LEN;
var ret = wasm.driver_setStyle(this.ptr, ptr0, len0);
return takeObject(ret);
wasm.driver_setStyle(this.ptr, ptr0, len0);
}

@@ -292,6 +290,6 @@ /**

* 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));
}

@@ -352,3 +350,3 @@ /**

/**
* @returns {any}
* @returns {BibEntries}
*/

@@ -360,3 +358,3 @@ makeBibliography() {

/**
* @returns {any}
* @returns {BibliographyMeta}
*/

@@ -440,5 +438,14 @@ bibliographyMeta() {

/**
* Drains the `batchedUpdates` queue manually. Use it to avoid serializing an unneeded
* `UpdateSummary`.
* Returns all the clusters and bibliography entries in the document.
* Also drains the queue, just like batchedUpdates().
* Use this to rehydrate a document or run non-interactively.
* @returns {FullRender}
*/
fullRender() {
var ret = wasm.driver_fullRender(this.ptr);
return takeObject(ret);
}
/**
* Drains the `batchedUpdates` queue manually.
*/
drain() {

@@ -505,2 +512,6 @@ wasm.driver_drain(this.ptr);

};
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) {

@@ -528,6 +539,9 @@ takeObject(arg0);

};
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) {
var ret = JSON.parse(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) {

@@ -542,9 +556,2 @@ const obj = takeObject(arg0).original;

};
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_new_59cb74e423758ede = function() {

@@ -568,11 +575,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 {

@@ -584,3 +591,3 @@ var state0 = {a: arg0, b: arg1};

try {
return __wbg_adapter_63(a, state0.b, arg0, arg1);
return __wbg_adapter_64(a, state0.b, arg0, arg1);
} finally {

@@ -596,11 +603,11 @@ 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));

@@ -623,4 +630,4 @@ return addHeapObject(ret);

};
imports.wbg.__wbindgen_closure_wrapper835 = function(arg0, arg1, arg2) {
var ret = makeMutClosure(arg0, arg1, 197, __wbg_adapter_18);
imports.wbg.__wbindgen_closure_wrapper836 = function(arg0, arg1, arg2) {
var ret = makeMutClosure(arg0, arg1, 195, __wbg_adapter_18);
return addHeapObject(ret);

@@ -627,0 +634,0 @@ };

@@ -7,3 +7,3 @@ {

"description": "citeproc-rs, compiled to WebAssembly",
"version": "0.0.0-canary-36a6745",
"version": "0.0.0-canary-3f5d731",
"license": "MPL-2.0",

@@ -10,0 +10,0 @@ "repository": {

@@ -295,2 +295,10 @@ # `@citeproc-rs/wasm`

The "All" is based on which references your driver knows about. If you have
this set to "All", simply calling `driver.insertReference()` with a new
reference ID will result in an entry being added to the bibliography. Entries
in Specific mode do not have to exist when they are provided here; they can be,
for instance, the citekeys of collection of references in a reference library
which are subsequently provided in full to the driver, at which point they
appear in the bibliography, but not items from elsewhere in the library.
### 3. Call `driver.batchedUpdates()` and apply the diff

@@ -302,15 +310,26 @@

```javascript
import { UpdateSummary } from "@citeproc-rs/wasm"; // typescript users, annotate with this
// Get the diff since last time batchedUpdates, fullRender or drain was called.
let diff = driver.batchedUpdates();
// apply to the UI
diff.clusters.forEach(changedCluster => {
// apply cluster changes to the UI.
for (let changedCluster of diff.clusters) {
let [id, html] = changedCluster;
myDocument.updateCluster(id, html);
});
diff.bibliography.entryIds.forEach(citekey => {
let html = diff.updatedEntries[citekey];
myDocument.updateBibEntry(citekey, html);
});
}
// Null? No change to the bibliography.
if (diff.bibliography != null) {
let bib = diff.bibliography;
// Save the entries that have actually changed
for (let key of Object.keys(bib.updatedEntries)) {
let rendered = bib.updatedEntries[key];
myDocument.updateBibEntry(key, rendered);
}
// entryIds is the full list of entries in the bibliography.
// If a citekey isn't in there, it should be removed.
// It is non-null when it has changed.
if (bib.entryIds != null) {
myDocument.setBibliographyOrder(bib.entryIds);
}
}
```

@@ -321,3 +340,19 @@

### Bibliographies
Beyond the interactive batchedUpdates method, there are two functions for
producing a bibliography statically.
```javascript
// returns BibliographyMeta, with information about how a library consumer should
// lay out the bibliography. There is a similar API in citeproc-js.
let meta = driver.bibliographyMeta();
// This is an array of BibEntry
let bibliography = driver.makeBibliography();
for (let entry of bibliography) {
console.log(entry.id, entry.value);
}
```
### Preview citation clusters

@@ -361,21 +396,27 @@

// Re-hydrate the entire document
driver.resetReferences(allReferences);
// Re-hydrate the entire document based on the reference library and your
// document's clusters
driver.resetReferences(myDocument.allReferences);
driver.initClusters(allNotes.map(fn => fn.cluster));
driver.setClusterOrder(allNotes.map(fn => { id: note.cluster.id, note: note.number }));
driver.setClusterOrder(allNotes.map(fn => { id: fn.cluster.id, note: fn.number }));
// Build every cluster, only after the driver knows about all of them
allNotes.forEach(fn => {
fn.renderedHtml = driver.builtCluster(fn.cluster.id);
});
// Render every cluster and bibliography item.
// It then drains the update queue, leaving the diff empty for the next edit.
// see the FullRender typescript type
let render = driver.fullRender();
let bibliography = driver.makeBibliography();
// Write out the rendered clusters into the doc
for (let fn of allNotes) {
fn.renderedHtml = render.allClusters[fn.cluster.id];
}
// Drain the update queue, so the driver knows you're up to date and won't send
// you a whole-document diff
driver.drain();
// Write out the bibliography entries as well
let allBibKeys = render.bibEntries.map(entry => entry.id);
for (let bibEntry of render.bibEntries) {
myDocument.bibliographyMap[entry.id] = entry.value;
}
// Update the UI
updateUserInterface(allNotes, bibliography);
// Update your (example) UI
updateUserInterface(allNotes, myDocument, whatever);
```

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

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