@citeproc-rs/wasm
Advanced tools
Comparing version 0.0.0-canary-7e0838c to 0.0.0-canary-7f67551
@@ -8,2 +8,3 @@ /* tslint:disable */ | ||
export function driver_setStyle(a: number, b: number, c: number): number; | ||
export function driver_setOutputFormat(a: number, b: number, c: number, d: number): number; | ||
export function driver_resetReferences(a: number, b: number, c: number): number; | ||
@@ -10,0 +11,0 @@ export function driver_insertReferences(a: number, b: number, c: number): number; |
@@ -10,2 +10,6 @@ /* tslint:disable */ | ||
interface FormatOptions { | ||
linkAnchors?: boolean, | ||
} | ||
interface InitOptions { | ||
@@ -23,2 +27,4 @@ /** A CSL style as an XML string */ | ||
format: "html" | "rtf" | "plain", | ||
/** Configuration for the formatter */ | ||
formatOptions?: FormatOptions, | ||
@@ -275,3 +281,3 @@ /** A locale to use instead of the style's default-locale. | ||
* * `fetcher` must implement the `Fetcher` interface | ||
* * `format` is one of { "html", "rtf" } | ||
* * `format` is one of { "html", "rtf", "plain" } | ||
* | ||
@@ -284,3 +290,3 @@ * Throws an error if it cannot parse the style you gave it. | ||
/** | ||
* Sets the style (which will also cause everything to be recomputed) | ||
* Sets the style (which will also cause everything to be recomputed, use sparingly) | ||
* @param {string} style_text | ||
@@ -291,2 +297,14 @@ * @returns {WasmResult<undefined>} | ||
/** | ||
* Sets the output format (which will also cause everything to be recomputed, use sparingly) | ||
* | ||
* @param {"html" | "rtf" | "plain"} format The new output format as a string, same as | ||
* `Driver.new` | ||
* | ||
* @param {FormatOptions | null} options If absent, this is set to the default FormatOptions. | ||
* @param {string} format | ||
* @param {FormatOptions | undefined} options | ||
* @returns {WasmResult<undefined>} | ||
*/ | ||
setOutputFormat(format: string, options?: FormatOptions): WasmResult<undefined>; | ||
/** | ||
* Completely overwrites the references library. | ||
@@ -293,0 +311,0 @@ * This **will** delete references that are not in the provided list. |
@@ -13,2 +13,16 @@ 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 WASM_VECTOR_LEN = 0; | ||
@@ -85,16 +99,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 }); | ||
@@ -189,3 +189,3 @@ | ||
} | ||
function __wbg_adapter_81(arg0, arg1, arg2, arg3) { | ||
function __wbg_adapter_82(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h4915090d68cfd6bd(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
@@ -224,3 +224,3 @@ } | ||
* * `fetcher` must implement the `Fetcher` interface | ||
* * `format` is one of { "html", "rtf" } | ||
* * `format` is one of { "html", "rtf", "plain" } | ||
* | ||
@@ -236,3 +236,3 @@ * Throws an error if it cannot parse the style you gave it. | ||
/** | ||
* Sets the style (which will also cause everything to be recomputed) | ||
* Sets the style (which will also cause everything to be recomputed, use sparingly) | ||
* @param {string} style_text | ||
@@ -248,2 +248,19 @@ * @returns {WasmResult<undefined>} | ||
/** | ||
* Sets the output format (which will also cause everything to be recomputed, use sparingly) | ||
* | ||
* @param {"html" | "rtf" | "plain"} format The new output format as a string, same as | ||
* `Driver.new` | ||
* | ||
* @param {FormatOptions | null} options If absent, this is set to the default FormatOptions. | ||
* @param {string} format | ||
* @param {FormatOptions | undefined} options | ||
* @returns {WasmResult<undefined>} | ||
*/ | ||
setOutputFormat(format, options) { | ||
var ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
var ret = wasm.driver_setOutputFormat(this.ptr, ptr0, len0, isLikeNone(options) ? 0 : addHeapObject(options)); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* Completely overwrites the references library. | ||
@@ -491,16 +508,2 @@ * This **will** delete references that are not in the provided list. | ||
module.exports.__wbindgen_json_serialize = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
var ret = JSON.stringify(obj === undefined ? null : obj); | ||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}; | ||
module.exports.__wbg_fetchLocale_d644d4ae2ca50f81 = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).fetchLocale(getStringFromWasm0(arg1, arg2)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_object_drop_ref = function(arg0) { | ||
@@ -534,4 +537,13 @@ takeObject(arg0); | ||
module.exports.__wbg_get_1edc26456ed84f9b = function(arg0, arg1) { | ||
var ret = getObject(arg0)[takeObject(arg1)]; | ||
module.exports.__wbindgen_json_serialize = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
var ret = JSON.stringify(obj === undefined ? null : obj); | ||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}; | ||
module.exports.__wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
@@ -555,7 +567,2 @@ }; | ||
module.exports.__wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_driver_new = function(arg0) { | ||
@@ -581,2 +588,7 @@ var ret = Driver.__wrap(arg0); | ||
module.exports.__wbg_get_1edc26456ed84f9b = function(arg0, arg1) { | ||
var ret = getObject(arg0)[takeObject(arg1)]; | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_new_8d5f3cd64eaaa8b5 = function(arg0, arg1) { | ||
@@ -608,2 +620,7 @@ var ret = new CiteprocRsDriverError(takeObject(arg0), takeObject(arg1)); | ||
module.exports.__wbg_fetchLocale_d644d4ae2ca50f81 = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).fetchLocale(getStringFromWasm0(arg1, arg2)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_new_59cb74e423758ede = function() { | ||
@@ -642,3 +659,3 @@ var ret = new Error(); | ||
try { | ||
return __wbg_adapter_81(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_82(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -721,4 +738,4 @@ state0.a = a; | ||
module.exports.__wbindgen_closure_wrapper949 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 226, __wbg_adapter_24); | ||
module.exports.__wbindgen_closure_wrapper961 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 230, __wbg_adapter_24); | ||
return addHeapObject(ret); | ||
@@ -725,0 +742,0 @@ }; |
@@ -10,2 +10,16 @@ import { WasmResult, CiteprocRsError, CiteprocRsDriverError, CslStyleError } from './snippets/wasm-1883a0b9dcad429e/src/js/include.js'; | ||
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 WASM_VECTOR_LEN = 0; | ||
@@ -84,16 +98,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; | ||
} | ||
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; | ||
@@ -190,3 +190,3 @@ | ||
} | ||
function __wbg_adapter_81(arg0, arg1, arg2, arg3) { | ||
function __wbg_adapter_82(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h4915090d68cfd6bd(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
@@ -225,3 +225,3 @@ } | ||
* * `fetcher` must implement the `Fetcher` interface | ||
* * `format` is one of { "html", "rtf" } | ||
* * `format` is one of { "html", "rtf", "plain" } | ||
* | ||
@@ -237,3 +237,3 @@ * Throws an error if it cannot parse the style you gave it. | ||
/** | ||
* Sets the style (which will also cause everything to be recomputed) | ||
* Sets the style (which will also cause everything to be recomputed, use sparingly) | ||
* @param {string} style_text | ||
@@ -249,2 +249,19 @@ * @returns {WasmResult<undefined>} | ||
/** | ||
* Sets the output format (which will also cause everything to be recomputed, use sparingly) | ||
* | ||
* @param {"html" | "rtf" | "plain"} format The new output format as a string, same as | ||
* `Driver.new` | ||
* | ||
* @param {FormatOptions | null} options If absent, this is set to the default FormatOptions. | ||
* @param {string} format | ||
* @param {FormatOptions | undefined} options | ||
* @returns {WasmResult<undefined>} | ||
*/ | ||
setOutputFormat(format, options) { | ||
var ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
var ret = wasm.driver_setOutputFormat(this.ptr, ptr0, len0, isLikeNone(options) ? 0 : addHeapObject(options)); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* Completely overwrites the references library. | ||
@@ -491,16 +508,2 @@ * This **will** delete references that are not in the provided list. | ||
export const __wbindgen_json_serialize = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
var ret = JSON.stringify(obj === undefined ? null : obj); | ||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}; | ||
export const __wbg_fetchLocale_d644d4ae2ca50f81 = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).fetchLocale(getStringFromWasm0(arg1, arg2)); | ||
return addHeapObject(ret); | ||
}; | ||
export const __wbindgen_object_drop_ref = function(arg0) { | ||
@@ -534,4 +537,13 @@ takeObject(arg0); | ||
export const __wbg_get_1edc26456ed84f9b = function(arg0, arg1) { | ||
var ret = getObject(arg0)[takeObject(arg1)]; | ||
export const __wbindgen_json_serialize = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
var ret = JSON.stringify(obj === undefined ? null : obj); | ||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}; | ||
export const __wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
@@ -555,7 +567,2 @@ }; | ||
export const __wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
export const __wbg_driver_new = function(arg0) { | ||
@@ -581,2 +588,7 @@ var ret = Driver.__wrap(arg0); | ||
export const __wbg_get_1edc26456ed84f9b = function(arg0, arg1) { | ||
var ret = getObject(arg0)[takeObject(arg1)]; | ||
return addHeapObject(ret); | ||
}; | ||
export const __wbg_new_8d5f3cd64eaaa8b5 = function(arg0, arg1) { | ||
@@ -608,2 +620,7 @@ var ret = new CiteprocRsDriverError(takeObject(arg0), takeObject(arg1)); | ||
export const __wbg_fetchLocale_d644d4ae2ca50f81 = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).fetchLocale(getStringFromWasm0(arg1, arg2)); | ||
return addHeapObject(ret); | ||
}; | ||
export const __wbg_new_59cb74e423758ede = function() { | ||
@@ -642,3 +659,3 @@ var ret = new Error(); | ||
try { | ||
return __wbg_adapter_81(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_82(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -721,6 +738,6 @@ state0.a = a; | ||
export const __wbindgen_closure_wrapper949 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 226, __wbg_adapter_24); | ||
export const __wbindgen_closure_wrapper961 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 230, __wbg_adapter_24); | ||
return addHeapObject(ret); | ||
}; | ||
@@ -8,2 +8,3 @@ /* tslint:disable */ | ||
export function driver_setStyle(a: number, b: number, c: number): number; | ||
export function driver_setOutputFormat(a: number, b: number, c: number, d: number): number; | ||
export function driver_resetReferences(a: number, b: number, c: number): number; | ||
@@ -10,0 +11,0 @@ export function driver_insertReferences(a: number, b: number, c: number): number; |
@@ -10,2 +10,6 @@ /* tslint:disable */ | ||
interface FormatOptions { | ||
linkAnchors?: boolean, | ||
} | ||
interface InitOptions { | ||
@@ -23,2 +27,4 @@ /** A CSL style as an XML string */ | ||
format: "html" | "rtf" | "plain", | ||
/** Configuration for the formatter */ | ||
formatOptions?: FormatOptions, | ||
@@ -275,3 +281,3 @@ /** A locale to use instead of the style's default-locale. | ||
* * `fetcher` must implement the `Fetcher` interface | ||
* * `format` is one of { "html", "rtf" } | ||
* * `format` is one of { "html", "rtf", "plain" } | ||
* | ||
@@ -284,3 +290,3 @@ * Throws an error if it cannot parse the style you gave it. | ||
/** | ||
* Sets the style (which will also cause everything to be recomputed) | ||
* Sets the style (which will also cause everything to be recomputed, use sparingly) | ||
* @param {string} style_text | ||
@@ -291,2 +297,14 @@ * @returns {WasmResult<undefined>} | ||
/** | ||
* Sets the output format (which will also cause everything to be recomputed, use sparingly) | ||
* | ||
* @param {"html" | "rtf" | "plain"} format The new output format as a string, same as | ||
* `Driver.new` | ||
* | ||
* @param {FormatOptions | null} options If absent, this is set to the default FormatOptions. | ||
* @param {string} format | ||
* @param {FormatOptions | undefined} options | ||
* @returns {WasmResult<undefined>} | ||
*/ | ||
setOutputFormat(format: string, options?: FormatOptions): WasmResult<undefined>; | ||
/** | ||
* Completely overwrites the references library. | ||
@@ -293,0 +311,0 @@ * This **will** delete references that are not in the provided list. |
@@ -8,2 +8,3 @@ /* tslint:disable */ | ||
export function driver_setStyle(a: number, b: number, c: number): number; | ||
export function driver_setOutputFormat(a: number, b: number, c: number, d: number): number; | ||
export function driver_resetReferences(a: number, b: number, c: number): number; | ||
@@ -10,0 +11,0 @@ export function driver_insertReferences(a: number, b: number, c: number): number; |
@@ -11,2 +11,6 @@ declare namespace wasm_bindgen { | ||
interface FormatOptions { | ||
linkAnchors?: boolean, | ||
} | ||
interface InitOptions { | ||
@@ -24,2 +28,4 @@ /** A CSL style as an XML string */ | ||
format: "html" | "rtf" | "plain", | ||
/** Configuration for the formatter */ | ||
formatOptions?: FormatOptions, | ||
@@ -276,3 +282,3 @@ /** A locale to use instead of the style's default-locale. | ||
* * `fetcher` must implement the `Fetcher` interface | ||
* * `format` is one of { "html", "rtf" } | ||
* * `format` is one of { "html", "rtf", "plain" } | ||
* | ||
@@ -285,3 +291,3 @@ * Throws an error if it cannot parse the style you gave it. | ||
/** | ||
* Sets the style (which will also cause everything to be recomputed) | ||
* Sets the style (which will also cause everything to be recomputed, use sparingly) | ||
* @param {string} style_text | ||
@@ -292,2 +298,14 @@ * @returns {WasmResult<undefined>} | ||
/** | ||
* Sets the output format (which will also cause everything to be recomputed, use sparingly) | ||
* | ||
* @param {"html" | "rtf" | "plain"} format The new output format as a string, same as | ||
* `Driver.new` | ||
* | ||
* @param {FormatOptions | null} options If absent, this is set to the default FormatOptions. | ||
* @param {string} format | ||
* @param {FormatOptions | undefined} options | ||
* @returns {WasmResult<undefined>} | ||
*/ | ||
setOutputFormat(format: string, options?: FormatOptions): WasmResult<undefined>; | ||
/** | ||
* Completely overwrites the references library. | ||
@@ -460,2 +478,3 @@ * This **will** delete references that are not in the provided list. | ||
readonly driver_setStyle: (a: number, b: number, c: number) => number; | ||
readonly driver_setOutputFormat: (a: number, b: number, c: number, d: number) => number; | ||
readonly driver_resetReferences: (a: number, b: number, c: number) => number; | ||
@@ -462,0 +481,0 @@ readonly driver_insertReferences: (a: number, b: number, c: number) => number; |
@@ -12,2 +12,16 @@ let wasm_bindgen; | ||
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 WASM_VECTOR_LEN = 0; | ||
@@ -84,16 +98,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 }); | ||
@@ -188,3 +188,3 @@ | ||
} | ||
function __wbg_adapter_81(arg0, arg1, arg2, arg3) { | ||
function __wbg_adapter_82(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h4915090d68cfd6bd(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
@@ -223,3 +223,3 @@ } | ||
* * `fetcher` must implement the `Fetcher` interface | ||
* * `format` is one of { "html", "rtf" } | ||
* * `format` is one of { "html", "rtf", "plain" } | ||
* | ||
@@ -235,3 +235,3 @@ * Throws an error if it cannot parse the style you gave it. | ||
/** | ||
* Sets the style (which will also cause everything to be recomputed) | ||
* Sets the style (which will also cause everything to be recomputed, use sparingly) | ||
* @param {string} style_text | ||
@@ -247,2 +247,19 @@ * @returns {WasmResult<undefined>} | ||
/** | ||
* Sets the output format (which will also cause everything to be recomputed, use sparingly) | ||
* | ||
* @param {"html" | "rtf" | "plain"} format The new output format as a string, same as | ||
* `Driver.new` | ||
* | ||
* @param {FormatOptions | null} options If absent, this is set to the default FormatOptions. | ||
* @param {string} format | ||
* @param {FormatOptions | undefined} options | ||
* @returns {WasmResult<undefined>} | ||
*/ | ||
setOutputFormat(format, options) { | ||
var ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
var ret = wasm.driver_setOutputFormat(this.ptr, ptr0, len0, isLikeNone(options) ? 0 : addHeapObject(options)); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* Completely overwrites the references library. | ||
@@ -533,14 +550,2 @@ * This **will** delete references that are not in the provided list. | ||
imports.wbg = {}; | ||
imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
var ret = JSON.stringify(obj === undefined ? null : obj); | ||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}; | ||
imports.wbg.__wbg_fetchLocale_d644d4ae2ca50f81 = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).fetchLocale(getStringFromWasm0(arg1, arg2)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) { | ||
@@ -567,4 +572,12 @@ takeObject(arg0); | ||
}; | ||
imports.wbg.__wbg_get_1edc26456ed84f9b = function(arg0, arg1) { | ||
var ret = getObject(arg0)[takeObject(arg1)]; | ||
imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
var ret = JSON.stringify(obj === undefined ? null : obj); | ||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}; | ||
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
@@ -585,6 +598,2 @@ }; | ||
}; | ||
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_driver_new = function(arg0) { | ||
@@ -606,2 +615,6 @@ var ret = Driver.__wrap(arg0); | ||
}; | ||
imports.wbg.__wbg_get_1edc26456ed84f9b = function(arg0, arg1) { | ||
var ret = getObject(arg0)[takeObject(arg1)]; | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_new_16465ddabcb4a719 = function(arg0, arg1) { | ||
@@ -628,2 +641,6 @@ var ret = new CiteprocRsDriverError(takeObject(arg0), takeObject(arg1)); | ||
}; | ||
imports.wbg.__wbg_fetchLocale_d644d4ae2ca50f81 = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).fetchLocale(getStringFromWasm0(arg1, arg2)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_new_59cb74e423758ede = function() { | ||
@@ -658,3 +675,3 @@ var ret = new Error(); | ||
try { | ||
return __wbg_adapter_81(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_82(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -723,4 +740,4 @@ state0.a = a; | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper949 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 226, __wbg_adapter_24); | ||
imports.wbg.__wbindgen_closure_wrapper961 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 230, __wbg_adapter_24); | ||
return addHeapObject(ret); | ||
@@ -727,0 +744,0 @@ }; |
@@ -8,2 +8,3 @@ /* tslint:disable */ | ||
export function driver_setStyle(a: number, b: number, c: number): number; | ||
export function driver_setOutputFormat(a: number, b: number, c: number, d: number): number; | ||
export function driver_resetReferences(a: number, b: number, c: number): number; | ||
@@ -10,0 +11,0 @@ export function driver_insertReferences(a: number, b: number, c: number): number; |
@@ -10,2 +10,6 @@ /* tslint:disable */ | ||
interface FormatOptions { | ||
linkAnchors?: boolean, | ||
} | ||
interface InitOptions { | ||
@@ -23,2 +27,4 @@ /** A CSL style as an XML string */ | ||
format: "html" | "rtf" | "plain", | ||
/** Configuration for the formatter */ | ||
formatOptions?: FormatOptions, | ||
@@ -275,3 +281,3 @@ /** A locale to use instead of the style's default-locale. | ||
* * `fetcher` must implement the `Fetcher` interface | ||
* * `format` is one of { "html", "rtf" } | ||
* * `format` is one of { "html", "rtf", "plain" } | ||
* | ||
@@ -284,3 +290,3 @@ * Throws an error if it cannot parse the style you gave it. | ||
/** | ||
* Sets the style (which will also cause everything to be recomputed) | ||
* Sets the style (which will also cause everything to be recomputed, use sparingly) | ||
* @param {string} style_text | ||
@@ -291,2 +297,14 @@ * @returns {WasmResult<undefined>} | ||
/** | ||
* Sets the output format (which will also cause everything to be recomputed, use sparingly) | ||
* | ||
* @param {"html" | "rtf" | "plain"} format The new output format as a string, same as | ||
* `Driver.new` | ||
* | ||
* @param {FormatOptions | null} options If absent, this is set to the default FormatOptions. | ||
* @param {string} format | ||
* @param {FormatOptions | undefined} options | ||
* @returns {WasmResult<undefined>} | ||
*/ | ||
setOutputFormat(format: string, options?: FormatOptions): WasmResult<undefined>; | ||
/** | ||
* Completely overwrites the references library. | ||
@@ -457,2 +475,3 @@ * This **will** delete references that are not in the provided list. | ||
readonly driver_setStyle: (a: number, b: number, c: number) => number; | ||
readonly driver_setOutputFormat: (a: number, b: number, c: number, d: number) => number; | ||
readonly driver_resetReferences: (a: number, b: number, c: number) => number; | ||
@@ -459,0 +478,0 @@ readonly driver_insertReferences: (a: number, b: number, c: number) => number; |
@@ -11,2 +11,16 @@ import { WasmResult, CiteprocRsError, CiteprocRsDriverError, CslStyleError } from './snippets/wasm-1883a0b9dcad429e/src/js/include.js'; | ||
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 WASM_VECTOR_LEN = 0; | ||
@@ -83,16 +97,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 }); | ||
@@ -187,3 +187,3 @@ | ||
} | ||
function __wbg_adapter_81(arg0, arg1, arg2, arg3) { | ||
function __wbg_adapter_82(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h4915090d68cfd6bd(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
@@ -222,3 +222,3 @@ } | ||
* * `fetcher` must implement the `Fetcher` interface | ||
* * `format` is one of { "html", "rtf" } | ||
* * `format` is one of { "html", "rtf", "plain" } | ||
* | ||
@@ -234,3 +234,3 @@ * Throws an error if it cannot parse the style you gave it. | ||
/** | ||
* Sets the style (which will also cause everything to be recomputed) | ||
* Sets the style (which will also cause everything to be recomputed, use sparingly) | ||
* @param {string} style_text | ||
@@ -246,2 +246,19 @@ * @returns {WasmResult<undefined>} | ||
/** | ||
* Sets the output format (which will also cause everything to be recomputed, use sparingly) | ||
* | ||
* @param {"html" | "rtf" | "plain"} format The new output format as a string, same as | ||
* `Driver.new` | ||
* | ||
* @param {FormatOptions | null} options If absent, this is set to the default FormatOptions. | ||
* @param {string} format | ||
* @param {FormatOptions | undefined} options | ||
* @returns {WasmResult<undefined>} | ||
*/ | ||
setOutputFormat(format, options) { | ||
var ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
var ret = wasm.driver_setOutputFormat(this.ptr, ptr0, len0, isLikeNone(options) ? 0 : addHeapObject(options)); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* Completely overwrites the references library. | ||
@@ -525,14 +542,2 @@ * This **will** delete references that are not in the provided list. | ||
imports.wbg = {}; | ||
imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
var ret = JSON.stringify(obj === undefined ? null : obj); | ||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}; | ||
imports.wbg.__wbg_fetchLocale_d644d4ae2ca50f81 = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).fetchLocale(getStringFromWasm0(arg1, arg2)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) { | ||
@@ -559,4 +564,12 @@ takeObject(arg0); | ||
}; | ||
imports.wbg.__wbg_get_1edc26456ed84f9b = function(arg0, arg1) { | ||
var ret = getObject(arg0)[takeObject(arg1)]; | ||
imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
var ret = JSON.stringify(obj === undefined ? null : obj); | ||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}; | ||
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
@@ -577,6 +590,2 @@ }; | ||
}; | ||
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_driver_new = function(arg0) { | ||
@@ -598,2 +607,6 @@ var ret = Driver.__wrap(arg0); | ||
}; | ||
imports.wbg.__wbg_get_1edc26456ed84f9b = function(arg0, arg1) { | ||
var ret = getObject(arg0)[takeObject(arg1)]; | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_new_8d5f3cd64eaaa8b5 = function(arg0, arg1) { | ||
@@ -620,2 +633,6 @@ var ret = new CiteprocRsDriverError(takeObject(arg0), takeObject(arg1)); | ||
}; | ||
imports.wbg.__wbg_fetchLocale_d644d4ae2ca50f81 = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).fetchLocale(getStringFromWasm0(arg1, arg2)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_new_59cb74e423758ede = function() { | ||
@@ -650,3 +667,3 @@ var ret = new Error(); | ||
try { | ||
return __wbg_adapter_81(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_82(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -715,4 +732,4 @@ state0.a = a; | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper949 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 226, __wbg_adapter_24); | ||
imports.wbg.__wbindgen_closure_wrapper961 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 230, __wbg_adapter_24); | ||
return addHeapObject(ret); | ||
@@ -719,0 +736,0 @@ }; |
@@ -8,2 +8,3 @@ /* tslint:disable */ | ||
export function driver_setStyle(a: number, b: number, c: number): number; | ||
export function driver_setOutputFormat(a: number, b: number, c: number, d: number): number; | ||
export function driver_resetReferences(a: number, b: number, c: number): number; | ||
@@ -10,0 +11,0 @@ export function driver_insertReferences(a: number, b: number, c: number): number; |
@@ -11,2 +11,6 @@ declare namespace wasm_bindgen { | ||
interface FormatOptions { | ||
linkAnchors?: boolean, | ||
} | ||
interface InitOptions { | ||
@@ -24,2 +28,4 @@ /** A CSL style as an XML string */ | ||
format: "html" | "rtf" | "plain", | ||
/** Configuration for the formatter */ | ||
formatOptions?: FormatOptions, | ||
@@ -276,3 +282,3 @@ /** A locale to use instead of the style's default-locale. | ||
* * `fetcher` must implement the `Fetcher` interface | ||
* * `format` is one of { "html", "rtf" } | ||
* * `format` is one of { "html", "rtf", "plain" } | ||
* | ||
@@ -285,3 +291,3 @@ * Throws an error if it cannot parse the style you gave it. | ||
/** | ||
* Sets the style (which will also cause everything to be recomputed) | ||
* Sets the style (which will also cause everything to be recomputed, use sparingly) | ||
* @param {string} style_text | ||
@@ -292,2 +298,14 @@ * @returns {WasmResult<undefined>} | ||
/** | ||
* Sets the output format (which will also cause everything to be recomputed, use sparingly) | ||
* | ||
* @param {"html" | "rtf" | "plain"} format The new output format as a string, same as | ||
* `Driver.new` | ||
* | ||
* @param {FormatOptions | null} options If absent, this is set to the default FormatOptions. | ||
* @param {string} format | ||
* @param {FormatOptions | undefined} options | ||
* @returns {WasmResult<undefined>} | ||
*/ | ||
setOutputFormat(format: string, options?: FormatOptions): WasmResult<undefined>; | ||
/** | ||
* Completely overwrites the references library. | ||
@@ -460,2 +478,3 @@ * This **will** delete references that are not in the provided list. | ||
readonly driver_setStyle: (a: number, b: number, c: number) => number; | ||
readonly driver_setOutputFormat: (a: number, b: number, c: number, d: number) => number; | ||
readonly driver_resetReferences: (a: number, b: number, c: number) => number; | ||
@@ -462,0 +481,0 @@ readonly driver_insertReferences: (a: number, b: number, c: number) => number; |
@@ -12,2 +12,16 @@ let wasm_bindgen; | ||
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 WASM_VECTOR_LEN = 0; | ||
@@ -84,16 +98,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 }); | ||
@@ -188,3 +188,3 @@ | ||
} | ||
function __wbg_adapter_81(arg0, arg1, arg2, arg3) { | ||
function __wbg_adapter_82(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h4915090d68cfd6bd(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
@@ -223,3 +223,3 @@ } | ||
* * `fetcher` must implement the `Fetcher` interface | ||
* * `format` is one of { "html", "rtf" } | ||
* * `format` is one of { "html", "rtf", "plain" } | ||
* | ||
@@ -235,3 +235,3 @@ * Throws an error if it cannot parse the style you gave it. | ||
/** | ||
* Sets the style (which will also cause everything to be recomputed) | ||
* Sets the style (which will also cause everything to be recomputed, use sparingly) | ||
* @param {string} style_text | ||
@@ -247,2 +247,19 @@ * @returns {WasmResult<undefined>} | ||
/** | ||
* Sets the output format (which will also cause everything to be recomputed, use sparingly) | ||
* | ||
* @param {"html" | "rtf" | "plain"} format The new output format as a string, same as | ||
* `Driver.new` | ||
* | ||
* @param {FormatOptions | null} options If absent, this is set to the default FormatOptions. | ||
* @param {string} format | ||
* @param {FormatOptions | undefined} options | ||
* @returns {WasmResult<undefined>} | ||
*/ | ||
setOutputFormat(format, options) { | ||
var ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
var ret = wasm.driver_setOutputFormat(this.ptr, ptr0, len0, isLikeNone(options) ? 0 : addHeapObject(options)); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* Completely overwrites the references library. | ||
@@ -533,14 +550,2 @@ * This **will** delete references that are not in the provided list. | ||
imports.wbg = {}; | ||
imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
var ret = JSON.stringify(obj === undefined ? null : obj); | ||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}; | ||
imports.wbg.__wbg_fetchLocale_d644d4ae2ca50f81 = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).fetchLocale(getStringFromWasm0(arg1, arg2)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) { | ||
@@ -567,4 +572,12 @@ takeObject(arg0); | ||
}; | ||
imports.wbg.__wbg_get_1edc26456ed84f9b = function(arg0, arg1) { | ||
var ret = getObject(arg0)[takeObject(arg1)]; | ||
imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
var ret = JSON.stringify(obj === undefined ? null : obj); | ||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}; | ||
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
@@ -585,6 +598,2 @@ }; | ||
}; | ||
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_driver_new = function(arg0) { | ||
@@ -606,2 +615,6 @@ var ret = Driver.__wrap(arg0); | ||
}; | ||
imports.wbg.__wbg_get_1edc26456ed84f9b = function(arg0, arg1) { | ||
var ret = getObject(arg0)[takeObject(arg1)]; | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_new_16465ddabcb4a719 = function(arg0, arg1) { | ||
@@ -628,2 +641,6 @@ var ret = new Zotero.CiteprocRs.CiteprocRsDriverError(takeObject(arg0), takeObject(arg1)); | ||
}; | ||
imports.wbg.__wbg_fetchLocale_d644d4ae2ca50f81 = function(arg0, arg1, arg2) { | ||
var ret = getObject(arg0).fetchLocale(getStringFromWasm0(arg1, arg2)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_new_59cb74e423758ede = function() { | ||
@@ -658,3 +675,3 @@ var ret = new Error(); | ||
try { | ||
return __wbg_adapter_81(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_82(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -723,4 +740,4 @@ state0.a = a; | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper949 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 226, __wbg_adapter_24); | ||
imports.wbg.__wbindgen_closure_wrapper961 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 230, __wbg_adapter_24); | ||
return addHeapObject(ret); | ||
@@ -727,0 +744,0 @@ }; |
@@ -7,3 +7,3 @@ { | ||
"description": "citeproc-rs, compiled to WebAssembly", | ||
"version": "0.0.0-canary-7e0838c", | ||
"version": "0.0.0-canary-7f67551", | ||
"license": "MPL-2.0", | ||
@@ -10,0 +10,0 @@ "repository": { |
@@ -286,2 +286,5 @@ # `@citeproc-rs/wasm` | ||
format: "html", // optional, html is the default | ||
formatOptions: { // optional | ||
linkAnchors: true, // optional, default true | ||
}, | ||
localeOverride: "de-DE", // optional, like setting default-locale on the style | ||
@@ -639,1 +642,21 @@ // bibliographyNoSort: true // disables sorting on the bibliography | ||
``` | ||
### `setOutputFormat` and `setStyle` | ||
If you wish to change the output format of the entire driver, you can use | ||
`setOutputFormat(format, formatOptions)`. The format is a string, one of `"html" | | ||
"rtf" | "plain"` just like the `Driver.new` method. The options is an optional | ||
argument with the same value as `formatOptions` in `Driver.new`. | ||
`setStyle(xmlString)` will change the CSL style used by the driver. | ||
Both of these methods will require throwing out almost all cached computation, | ||
so use sparingly. | ||
If you need to render a preview in a different format, there is an argument on | ||
`previewCitationCluster` for doing just that. It does not throw out all the | ||
computation. `citeproc-rs`' disambiguation procedures do take formatting into | ||
account, so `<i>Title</i>` can be distinct from `<b>Title</b>` in HTML and RTF, | ||
but not if the whole driver's output format is `"plain"`, since they both look | ||
identical in plain text. `previewCitationCluster` will simply translate the | ||
formatting into another format, without re-computing all the disambiguation. |
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
25244030
6260
661
8