refkit-js 0.0.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +187 -187
- package/README.md +71 -2
- package/dist/build.json +4 -0
- package/dist/citation.d.ts +27 -0
- package/dist/citation.js +70 -0
- package/dist/document.d.ts +38 -0
- package/dist/document.js +110 -0
- package/dist/errors.d.ts +30 -0
- package/dist/errors.js +73 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +8 -0
- package/dist/inputs.d.ts +5 -0
- package/dist/inputs.js +34 -0
- package/dist/library.d.ts +26 -0
- package/dist/library.js +69 -0
- package/dist/node.d.ts +14 -0
- package/dist/node.js +89 -0
- package/dist/raw.d.ts +59 -0
- package/dist/raw.js +191 -0
- package/dist/runtime.d.ts +14 -0
- package/dist/runtime.js +58 -0
- package/dist/tidy.d.ts +5 -0
- package/dist/tidy.js +31 -0
- package/dist/types.d.ts +182 -0
- package/dist/types.js +1 -0
- package/dist/wasm/refkit_js_native.d.ts +142 -0
- package/dist/wasm/refkit_js_native.js +1184 -0
- package/dist/wasm/refkit_js_native_bg.wasm +0 -0
- package/dist/wasm/refkit_js_native_bg.wasm.d.ts +49 -0
- package/dist/wasm/version.d.ts +1 -0
- package/dist/wasm/version.js +1 -0
- package/package.json +60 -8
|
@@ -0,0 +1,1184 @@
|
|
|
1
|
+
/* @ts-self-types="./refkit_js_native.d.ts" */
|
|
2
|
+
|
|
3
|
+
export class NativeDocument {
|
|
4
|
+
__destroy_into_raw() {
|
|
5
|
+
const ptr = this.__wbg_ptr;
|
|
6
|
+
this.__wbg_ptr = 0;
|
|
7
|
+
NativeDocumentFinalization.unregister(this);
|
|
8
|
+
return ptr;
|
|
9
|
+
}
|
|
10
|
+
free() {
|
|
11
|
+
const ptr = this.__destroy_into_raw();
|
|
12
|
+
wasm.__wbg_nativedocument_free(ptr, 0);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @param {string} citations
|
|
16
|
+
* @returns {string}
|
|
17
|
+
*/
|
|
18
|
+
cited_bibliography(citations) {
|
|
19
|
+
let deferred3_0;
|
|
20
|
+
let deferred3_1;
|
|
21
|
+
try {
|
|
22
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
23
|
+
const ptr0 = passStringToWasm0(citations, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
24
|
+
const len0 = WASM_VECTOR_LEN;
|
|
25
|
+
wasm.nativedocument_cited_bibliography(retptr, this.__wbg_ptr, ptr0, len0);
|
|
26
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
27
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
28
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
29
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
30
|
+
var ptr2 = r0;
|
|
31
|
+
var len2 = r1;
|
|
32
|
+
if (r3) {
|
|
33
|
+
ptr2 = 0; len2 = 0;
|
|
34
|
+
throw takeObject(r2);
|
|
35
|
+
}
|
|
36
|
+
deferred3_0 = ptr2;
|
|
37
|
+
deferred3_1 = len2;
|
|
38
|
+
return getStringFromWasm0(ptr2, len2);
|
|
39
|
+
} finally {
|
|
40
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
41
|
+
wasm.__wbindgen_export(deferred3_0, deferred3_1, 1);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @returns {string}
|
|
46
|
+
*/
|
|
47
|
+
full_bibliography() {
|
|
48
|
+
let deferred2_0;
|
|
49
|
+
let deferred2_1;
|
|
50
|
+
try {
|
|
51
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
52
|
+
wasm.nativedocument_full_bibliography(retptr, this.__wbg_ptr);
|
|
53
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
54
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
55
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
56
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
57
|
+
var ptr1 = r0;
|
|
58
|
+
var len1 = r1;
|
|
59
|
+
if (r3) {
|
|
60
|
+
ptr1 = 0; len1 = 0;
|
|
61
|
+
throw takeObject(r2);
|
|
62
|
+
}
|
|
63
|
+
deferred2_0 = ptr1;
|
|
64
|
+
deferred2_1 = len1;
|
|
65
|
+
return getStringFromWasm0(ptr1, len1);
|
|
66
|
+
} finally {
|
|
67
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
68
|
+
wasm.__wbindgen_export(deferred2_0, deferred2_1, 1);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @param {NativeLibrary} library
|
|
73
|
+
* @param {NativeStyle} style
|
|
74
|
+
* @param {string | null} [locale]
|
|
75
|
+
*/
|
|
76
|
+
constructor(library, style, locale) {
|
|
77
|
+
_assertClass(library, NativeLibrary);
|
|
78
|
+
_assertClass(style, NativeStyle);
|
|
79
|
+
var ptr0 = isLikeNone(locale) ? 0 : passStringToWasm0(locale, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
80
|
+
var len0 = WASM_VECTOR_LEN;
|
|
81
|
+
const ret = wasm.nativedocument_new(library.__wbg_ptr, style.__wbg_ptr, ptr0, len0);
|
|
82
|
+
this.__wbg_ptr = ret;
|
|
83
|
+
NativeDocumentFinalization.register(this, this.__wbg_ptr, this);
|
|
84
|
+
return this;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* @param {string} citations
|
|
88
|
+
* @returns {string}
|
|
89
|
+
*/
|
|
90
|
+
render(citations) {
|
|
91
|
+
let deferred3_0;
|
|
92
|
+
let deferred3_1;
|
|
93
|
+
try {
|
|
94
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
95
|
+
const ptr0 = passStringToWasm0(citations, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
96
|
+
const len0 = WASM_VECTOR_LEN;
|
|
97
|
+
wasm.nativedocument_render(retptr, this.__wbg_ptr, ptr0, len0);
|
|
98
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
99
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
100
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
101
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
102
|
+
var ptr2 = r0;
|
|
103
|
+
var len2 = r1;
|
|
104
|
+
if (r3) {
|
|
105
|
+
ptr2 = 0; len2 = 0;
|
|
106
|
+
throw takeObject(r2);
|
|
107
|
+
}
|
|
108
|
+
deferred3_0 = ptr2;
|
|
109
|
+
deferred3_1 = len2;
|
|
110
|
+
return getStringFromWasm0(ptr2, len2);
|
|
111
|
+
} finally {
|
|
112
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
113
|
+
wasm.__wbindgen_export(deferred3_0, deferred3_1, 1);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (Symbol.dispose) NativeDocument.prototype[Symbol.dispose] = NativeDocument.prototype.free;
|
|
118
|
+
|
|
119
|
+
export class NativeLibrary {
|
|
120
|
+
static __wrap(ptr) {
|
|
121
|
+
const obj = Object.create(NativeLibrary.prototype);
|
|
122
|
+
obj.__wbg_ptr = ptr;
|
|
123
|
+
NativeLibraryFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
124
|
+
return obj;
|
|
125
|
+
}
|
|
126
|
+
__destroy_into_raw() {
|
|
127
|
+
const ptr = this.__wbg_ptr;
|
|
128
|
+
this.__wbg_ptr = 0;
|
|
129
|
+
NativeLibraryFinalization.unregister(this);
|
|
130
|
+
return ptr;
|
|
131
|
+
}
|
|
132
|
+
free() {
|
|
133
|
+
const ptr = this.__destroy_into_raw();
|
|
134
|
+
wasm.__wbg_nativelibrary_free(ptr, 0);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* @returns {string}
|
|
138
|
+
*/
|
|
139
|
+
diagnostics() {
|
|
140
|
+
let deferred1_0;
|
|
141
|
+
let deferred1_1;
|
|
142
|
+
try {
|
|
143
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
144
|
+
wasm.nativelibrary_diagnostics(retptr, this.__wbg_ptr);
|
|
145
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
146
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
147
|
+
deferred1_0 = r0;
|
|
148
|
+
deferred1_1 = r1;
|
|
149
|
+
return getStringFromWasm0(r0, r1);
|
|
150
|
+
} finally {
|
|
151
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
152
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* @param {string} keys
|
|
157
|
+
* @returns {string}
|
|
158
|
+
*/
|
|
159
|
+
get_many(keys) {
|
|
160
|
+
let deferred3_0;
|
|
161
|
+
let deferred3_1;
|
|
162
|
+
try {
|
|
163
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
164
|
+
const ptr0 = passStringToWasm0(keys, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
165
|
+
const len0 = WASM_VECTOR_LEN;
|
|
166
|
+
wasm.nativelibrary_get_many(retptr, this.__wbg_ptr, ptr0, len0);
|
|
167
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
168
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
169
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
170
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
171
|
+
var ptr2 = r0;
|
|
172
|
+
var len2 = r1;
|
|
173
|
+
if (r3) {
|
|
174
|
+
ptr2 = 0; len2 = 0;
|
|
175
|
+
throw takeObject(r2);
|
|
176
|
+
}
|
|
177
|
+
deferred3_0 = ptr2;
|
|
178
|
+
deferred3_1 = len2;
|
|
179
|
+
return getStringFromWasm0(ptr2, len2);
|
|
180
|
+
} finally {
|
|
181
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
182
|
+
wasm.__wbindgen_export(deferred3_0, deferred3_1, 1);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* @param {string} key
|
|
187
|
+
* @returns {string}
|
|
188
|
+
*/
|
|
189
|
+
get_record(key) {
|
|
190
|
+
let deferred2_0;
|
|
191
|
+
let deferred2_1;
|
|
192
|
+
try {
|
|
193
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
194
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
195
|
+
const len0 = WASM_VECTOR_LEN;
|
|
196
|
+
wasm.nativelibrary_get_record(retptr, this.__wbg_ptr, ptr0, len0);
|
|
197
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
198
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
199
|
+
deferred2_0 = r0;
|
|
200
|
+
deferred2_1 = r1;
|
|
201
|
+
return getStringFromWasm0(r0, r1);
|
|
202
|
+
} finally {
|
|
203
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
204
|
+
wasm.__wbindgen_export(deferred2_0, deferred2_1, 1);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* @returns {string}
|
|
209
|
+
*/
|
|
210
|
+
keys() {
|
|
211
|
+
let deferred1_0;
|
|
212
|
+
let deferred1_1;
|
|
213
|
+
try {
|
|
214
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
215
|
+
wasm.nativelibrary_keys(retptr, this.__wbg_ptr);
|
|
216
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
217
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
218
|
+
deferred1_0 = r0;
|
|
219
|
+
deferred1_1 = r1;
|
|
220
|
+
return getStringFromWasm0(r0, r1);
|
|
221
|
+
} finally {
|
|
222
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
223
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* @param {string} source
|
|
228
|
+
* @param {string} recovery
|
|
229
|
+
* @returns {NativeLibrary}
|
|
230
|
+
*/
|
|
231
|
+
static parse_bibtex(source, recovery) {
|
|
232
|
+
try {
|
|
233
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
234
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
235
|
+
const len0 = WASM_VECTOR_LEN;
|
|
236
|
+
const ptr1 = passStringToWasm0(recovery, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
237
|
+
const len1 = WASM_VECTOR_LEN;
|
|
238
|
+
wasm.nativelibrary_parse_bibtex(retptr, ptr0, len0, ptr1, len1);
|
|
239
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
240
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
241
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
242
|
+
if (r2) {
|
|
243
|
+
throw takeObject(r1);
|
|
244
|
+
}
|
|
245
|
+
return NativeLibrary.__wrap(r0);
|
|
246
|
+
} finally {
|
|
247
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* @param {string} source
|
|
252
|
+
* @returns {NativeLibrary}
|
|
253
|
+
*/
|
|
254
|
+
static parse_yaml(source) {
|
|
255
|
+
try {
|
|
256
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
257
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
258
|
+
const len0 = WASM_VECTOR_LEN;
|
|
259
|
+
wasm.nativelibrary_parse_yaml(retptr, ptr0, len0);
|
|
260
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
261
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
262
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
263
|
+
if (r2) {
|
|
264
|
+
throw takeObject(r1);
|
|
265
|
+
}
|
|
266
|
+
return NativeLibrary.__wrap(r0);
|
|
267
|
+
} finally {
|
|
268
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* @param {string | null} [fields]
|
|
273
|
+
* @param {string | null} [keys]
|
|
274
|
+
* @returns {string}
|
|
275
|
+
*/
|
|
276
|
+
project(fields, keys) {
|
|
277
|
+
let deferred4_0;
|
|
278
|
+
let deferred4_1;
|
|
279
|
+
try {
|
|
280
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
281
|
+
var ptr0 = isLikeNone(fields) ? 0 : passStringToWasm0(fields, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
282
|
+
var len0 = WASM_VECTOR_LEN;
|
|
283
|
+
var ptr1 = isLikeNone(keys) ? 0 : passStringToWasm0(keys, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
284
|
+
var len1 = WASM_VECTOR_LEN;
|
|
285
|
+
wasm.nativelibrary_project(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
286
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
287
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
288
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
289
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
290
|
+
var ptr3 = r0;
|
|
291
|
+
var len3 = r1;
|
|
292
|
+
if (r3) {
|
|
293
|
+
ptr3 = 0; len3 = 0;
|
|
294
|
+
throw takeObject(r2);
|
|
295
|
+
}
|
|
296
|
+
deferred4_0 = ptr3;
|
|
297
|
+
deferred4_1 = len3;
|
|
298
|
+
return getStringFromWasm0(ptr3, len3);
|
|
299
|
+
} finally {
|
|
300
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
301
|
+
wasm.__wbindgen_export(deferred4_0, deferred4_1, 1);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* @returns {string}
|
|
306
|
+
*/
|
|
307
|
+
records() {
|
|
308
|
+
let deferred1_0;
|
|
309
|
+
let deferred1_1;
|
|
310
|
+
try {
|
|
311
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
312
|
+
wasm.nativelibrary_records(retptr, this.__wbg_ptr);
|
|
313
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
314
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
315
|
+
deferred1_0 = r0;
|
|
316
|
+
deferred1_1 = r1;
|
|
317
|
+
return getStringFromWasm0(r0, r1);
|
|
318
|
+
} finally {
|
|
319
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
320
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* @param {string} selector
|
|
325
|
+
* @returns {string}
|
|
326
|
+
*/
|
|
327
|
+
select_records(selector) {
|
|
328
|
+
let deferred3_0;
|
|
329
|
+
let deferred3_1;
|
|
330
|
+
try {
|
|
331
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
332
|
+
const ptr0 = passStringToWasm0(selector, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
333
|
+
const len0 = WASM_VECTOR_LEN;
|
|
334
|
+
wasm.nativelibrary_select_records(retptr, this.__wbg_ptr, ptr0, len0);
|
|
335
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
336
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
337
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
338
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
339
|
+
var ptr2 = r0;
|
|
340
|
+
var len2 = r1;
|
|
341
|
+
if (r3) {
|
|
342
|
+
ptr2 = 0; len2 = 0;
|
|
343
|
+
throw takeObject(r2);
|
|
344
|
+
}
|
|
345
|
+
deferred3_0 = ptr2;
|
|
346
|
+
deferred3_1 = len2;
|
|
347
|
+
return getStringFromWasm0(ptr2, len2);
|
|
348
|
+
} finally {
|
|
349
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
350
|
+
wasm.__wbindgen_export(deferred3_0, deferred3_1, 1);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* @returns {number}
|
|
355
|
+
*/
|
|
356
|
+
get size() {
|
|
357
|
+
const ret = wasm.nativelibrary_size(this.__wbg_ptr);
|
|
358
|
+
return ret >>> 0;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
if (Symbol.dispose) NativeLibrary.prototype[Symbol.dispose] = NativeLibrary.prototype.free;
|
|
362
|
+
|
|
363
|
+
export class NativeRawDocument {
|
|
364
|
+
static __wrap(ptr) {
|
|
365
|
+
const obj = Object.create(NativeRawDocument.prototype);
|
|
366
|
+
obj.__wbg_ptr = ptr;
|
|
367
|
+
NativeRawDocumentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
368
|
+
return obj;
|
|
369
|
+
}
|
|
370
|
+
__destroy_into_raw() {
|
|
371
|
+
const ptr = this.__wbg_ptr;
|
|
372
|
+
this.__wbg_ptr = 0;
|
|
373
|
+
NativeRawDocumentFinalization.unregister(this);
|
|
374
|
+
return ptr;
|
|
375
|
+
}
|
|
376
|
+
free() {
|
|
377
|
+
const ptr = this.__destroy_into_raw();
|
|
378
|
+
wasm.__wbg_nativerawdocument_free(ptr, 0);
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* @returns {string}
|
|
382
|
+
*/
|
|
383
|
+
entries() {
|
|
384
|
+
let deferred1_0;
|
|
385
|
+
let deferred1_1;
|
|
386
|
+
try {
|
|
387
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
388
|
+
wasm.nativerawdocument_entries(retptr, this.__wbg_ptr);
|
|
389
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
390
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
391
|
+
deferred1_0 = r0;
|
|
392
|
+
deferred1_1 = r1;
|
|
393
|
+
return getStringFromWasm0(r0, r1);
|
|
394
|
+
} finally {
|
|
395
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
396
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* @param {string} key
|
|
401
|
+
* @returns {string}
|
|
402
|
+
*/
|
|
403
|
+
entries_for_key(key) {
|
|
404
|
+
let deferred2_0;
|
|
405
|
+
let deferred2_1;
|
|
406
|
+
try {
|
|
407
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
408
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
409
|
+
const len0 = WASM_VECTOR_LEN;
|
|
410
|
+
wasm.nativerawdocument_entries_for_key(retptr, this.__wbg_ptr, ptr0, len0);
|
|
411
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
412
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
413
|
+
deferred2_0 = r0;
|
|
414
|
+
deferred2_1 = r1;
|
|
415
|
+
return getStringFromWasm0(r0, r1);
|
|
416
|
+
} finally {
|
|
417
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
418
|
+
wasm.__wbindgen_export(deferred2_0, deferred2_1, 1);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* @returns {number}
|
|
423
|
+
*/
|
|
424
|
+
entry_count() {
|
|
425
|
+
const ret = wasm.nativerawdocument_entry_count(this.__wbg_ptr);
|
|
426
|
+
return ret >>> 0;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* @returns {string}
|
|
430
|
+
*/
|
|
431
|
+
entry_keys() {
|
|
432
|
+
let deferred1_0;
|
|
433
|
+
let deferred1_1;
|
|
434
|
+
try {
|
|
435
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
436
|
+
wasm.nativerawdocument_entry_keys(retptr, this.__wbg_ptr);
|
|
437
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
438
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
439
|
+
deferred1_0 = r0;
|
|
440
|
+
deferred1_1 = r1;
|
|
441
|
+
return getStringFromWasm0(r0, r1);
|
|
442
|
+
} finally {
|
|
443
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
444
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* @param {number} entry_id
|
|
449
|
+
* @param {number} field_id
|
|
450
|
+
* @returns {string}
|
|
451
|
+
*/
|
|
452
|
+
field(entry_id, field_id) {
|
|
453
|
+
let deferred2_0;
|
|
454
|
+
let deferred2_1;
|
|
455
|
+
try {
|
|
456
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
457
|
+
wasm.nativerawdocument_field(retptr, this.__wbg_ptr, entry_id, field_id);
|
|
458
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
459
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
460
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
461
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
462
|
+
var ptr1 = r0;
|
|
463
|
+
var len1 = r1;
|
|
464
|
+
if (r3) {
|
|
465
|
+
ptr1 = 0; len1 = 0;
|
|
466
|
+
throw takeObject(r2);
|
|
467
|
+
}
|
|
468
|
+
deferred2_0 = ptr1;
|
|
469
|
+
deferred2_1 = len1;
|
|
470
|
+
return getStringFromWasm0(ptr1, len1);
|
|
471
|
+
} finally {
|
|
472
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
473
|
+
wasm.__wbindgen_export(deferred2_0, deferred2_1, 1);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* @param {number} entry_id
|
|
478
|
+
* @returns {number}
|
|
479
|
+
*/
|
|
480
|
+
field_count(entry_id) {
|
|
481
|
+
try {
|
|
482
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
483
|
+
wasm.nativerawdocument_field_count(retptr, this.__wbg_ptr, entry_id);
|
|
484
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
485
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
486
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
487
|
+
if (r2) {
|
|
488
|
+
throw takeObject(r1);
|
|
489
|
+
}
|
|
490
|
+
return r0 >>> 0;
|
|
491
|
+
} finally {
|
|
492
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* @param {number} entry_id
|
|
497
|
+
* @returns {string}
|
|
498
|
+
*/
|
|
499
|
+
field_keys(entry_id) {
|
|
500
|
+
let deferred2_0;
|
|
501
|
+
let deferred2_1;
|
|
502
|
+
try {
|
|
503
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
504
|
+
wasm.nativerawdocument_field_keys(retptr, this.__wbg_ptr, entry_id);
|
|
505
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
506
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
507
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
508
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
509
|
+
var ptr1 = r0;
|
|
510
|
+
var len1 = r1;
|
|
511
|
+
if (r3) {
|
|
512
|
+
ptr1 = 0; len1 = 0;
|
|
513
|
+
throw takeObject(r2);
|
|
514
|
+
}
|
|
515
|
+
deferred2_0 = ptr1;
|
|
516
|
+
deferred2_1 = len1;
|
|
517
|
+
return getStringFromWasm0(ptr1, len1);
|
|
518
|
+
} finally {
|
|
519
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
520
|
+
wasm.__wbindgen_export(deferred2_0, deferred2_1, 1);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* @param {number} entry_id
|
|
525
|
+
* @returns {string}
|
|
526
|
+
*/
|
|
527
|
+
fields(entry_id) {
|
|
528
|
+
let deferred2_0;
|
|
529
|
+
let deferred2_1;
|
|
530
|
+
try {
|
|
531
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
532
|
+
wasm.nativerawdocument_fields(retptr, this.__wbg_ptr, entry_id);
|
|
533
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
534
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
535
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
536
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
537
|
+
var ptr1 = r0;
|
|
538
|
+
var len1 = r1;
|
|
539
|
+
if (r3) {
|
|
540
|
+
ptr1 = 0; len1 = 0;
|
|
541
|
+
throw takeObject(r2);
|
|
542
|
+
}
|
|
543
|
+
deferred2_0 = ptr1;
|
|
544
|
+
deferred2_1 = len1;
|
|
545
|
+
return getStringFromWasm0(ptr1, len1);
|
|
546
|
+
} finally {
|
|
547
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
548
|
+
wasm.__wbindgen_export(deferred2_0, deferred2_1, 1);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* @param {number} entry_id
|
|
553
|
+
* @param {string} key
|
|
554
|
+
* @returns {string}
|
|
555
|
+
*/
|
|
556
|
+
fields_for_key(entry_id, key) {
|
|
557
|
+
let deferred3_0;
|
|
558
|
+
let deferred3_1;
|
|
559
|
+
try {
|
|
560
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
561
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
562
|
+
const len0 = WASM_VECTOR_LEN;
|
|
563
|
+
wasm.nativerawdocument_fields_for_key(retptr, this.__wbg_ptr, entry_id, ptr0, len0);
|
|
564
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
565
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
566
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
567
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
568
|
+
var ptr2 = r0;
|
|
569
|
+
var len2 = r1;
|
|
570
|
+
if (r3) {
|
|
571
|
+
ptr2 = 0; len2 = 0;
|
|
572
|
+
throw takeObject(r2);
|
|
573
|
+
}
|
|
574
|
+
deferred3_0 = ptr2;
|
|
575
|
+
deferred3_1 = len2;
|
|
576
|
+
return getStringFromWasm0(ptr2, len2);
|
|
577
|
+
} finally {
|
|
578
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
579
|
+
wasm.__wbindgen_export(deferred3_0, deferred3_1, 1);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* @returns {string}
|
|
584
|
+
*/
|
|
585
|
+
metadata() {
|
|
586
|
+
let deferred1_0;
|
|
587
|
+
let deferred1_1;
|
|
588
|
+
try {
|
|
589
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
590
|
+
wasm.nativerawdocument_metadata(retptr, this.__wbg_ptr);
|
|
591
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
592
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
593
|
+
deferred1_0 = r0;
|
|
594
|
+
deferred1_1 = r1;
|
|
595
|
+
return getStringFromWasm0(r0, r1);
|
|
596
|
+
} finally {
|
|
597
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
598
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* @param {string} source
|
|
603
|
+
* @returns {NativeRawDocument}
|
|
604
|
+
*/
|
|
605
|
+
static parse(source) {
|
|
606
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
607
|
+
const len0 = WASM_VECTOR_LEN;
|
|
608
|
+
const ret = wasm.nativerawdocument_parse(ptr0, len0);
|
|
609
|
+
return NativeRawDocument.__wrap(ret);
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* @param {number} entry_id
|
|
613
|
+
* @param {number} field_id
|
|
614
|
+
* @param {string} value
|
|
615
|
+
*/
|
|
616
|
+
set_field_value(entry_id, field_id, value) {
|
|
617
|
+
try {
|
|
618
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
619
|
+
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
620
|
+
const len0 = WASM_VECTOR_LEN;
|
|
621
|
+
wasm.nativerawdocument_set_field_value(retptr, this.__wbg_ptr, entry_id, field_id, ptr0, len0);
|
|
622
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
623
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
624
|
+
if (r1) {
|
|
625
|
+
throw takeObject(r0);
|
|
626
|
+
}
|
|
627
|
+
} finally {
|
|
628
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* @returns {string}
|
|
633
|
+
*/
|
|
634
|
+
to_bibtex() {
|
|
635
|
+
let deferred2_0;
|
|
636
|
+
let deferred2_1;
|
|
637
|
+
try {
|
|
638
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
639
|
+
wasm.nativerawdocument_to_bibtex(retptr, this.__wbg_ptr);
|
|
640
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
641
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
642
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
643
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
644
|
+
var ptr1 = r0;
|
|
645
|
+
var len1 = r1;
|
|
646
|
+
if (r3) {
|
|
647
|
+
ptr1 = 0; len1 = 0;
|
|
648
|
+
throw takeObject(r2);
|
|
649
|
+
}
|
|
650
|
+
deferred2_0 = ptr1;
|
|
651
|
+
deferred2_1 = len1;
|
|
652
|
+
return getStringFromWasm0(ptr1, len1);
|
|
653
|
+
} finally {
|
|
654
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
655
|
+
wasm.__wbindgen_export(deferred2_0, deferred2_1, 1);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* @param {string} key
|
|
660
|
+
* @returns {string}
|
|
661
|
+
*/
|
|
662
|
+
unique_entry(key) {
|
|
663
|
+
let deferred3_0;
|
|
664
|
+
let deferred3_1;
|
|
665
|
+
try {
|
|
666
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
667
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
668
|
+
const len0 = WASM_VECTOR_LEN;
|
|
669
|
+
wasm.nativerawdocument_unique_entry(retptr, this.__wbg_ptr, ptr0, len0);
|
|
670
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
671
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
672
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
673
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
674
|
+
var ptr2 = r0;
|
|
675
|
+
var len2 = r1;
|
|
676
|
+
if (r3) {
|
|
677
|
+
ptr2 = 0; len2 = 0;
|
|
678
|
+
throw takeObject(r2);
|
|
679
|
+
}
|
|
680
|
+
deferred3_0 = ptr2;
|
|
681
|
+
deferred3_1 = len2;
|
|
682
|
+
return getStringFromWasm0(ptr2, len2);
|
|
683
|
+
} finally {
|
|
684
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
685
|
+
wasm.__wbindgen_export(deferred3_0, deferred3_1, 1);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* @param {number} entry_id
|
|
690
|
+
* @param {string} key
|
|
691
|
+
* @returns {string}
|
|
692
|
+
*/
|
|
693
|
+
unique_field(entry_id, key) {
|
|
694
|
+
let deferred3_0;
|
|
695
|
+
let deferred3_1;
|
|
696
|
+
try {
|
|
697
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
698
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
699
|
+
const len0 = WASM_VECTOR_LEN;
|
|
700
|
+
wasm.nativerawdocument_unique_field(retptr, this.__wbg_ptr, entry_id, ptr0, len0);
|
|
701
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
702
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
703
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
704
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
705
|
+
var ptr2 = r0;
|
|
706
|
+
var len2 = r1;
|
|
707
|
+
if (r3) {
|
|
708
|
+
ptr2 = 0; len2 = 0;
|
|
709
|
+
throw takeObject(r2);
|
|
710
|
+
}
|
|
711
|
+
deferred3_0 = ptr2;
|
|
712
|
+
deferred3_1 = len2;
|
|
713
|
+
return getStringFromWasm0(ptr2, len2);
|
|
714
|
+
} finally {
|
|
715
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
716
|
+
wasm.__wbindgen_export(deferred3_0, deferred3_1, 1);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
if (Symbol.dispose) NativeRawDocument.prototype[Symbol.dispose] = NativeRawDocument.prototype.free;
|
|
721
|
+
|
|
722
|
+
export class NativeStyle {
|
|
723
|
+
static __wrap(ptr) {
|
|
724
|
+
const obj = Object.create(NativeStyle.prototype);
|
|
725
|
+
obj.__wbg_ptr = ptr;
|
|
726
|
+
NativeStyleFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
727
|
+
return obj;
|
|
728
|
+
}
|
|
729
|
+
__destroy_into_raw() {
|
|
730
|
+
const ptr = this.__wbg_ptr;
|
|
731
|
+
this.__wbg_ptr = 0;
|
|
732
|
+
NativeStyleFinalization.unregister(this);
|
|
733
|
+
return ptr;
|
|
734
|
+
}
|
|
735
|
+
free() {
|
|
736
|
+
const ptr = this.__destroy_into_raw();
|
|
737
|
+
wasm.__wbg_nativestyle_free(ptr, 0);
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* @param {string} xml
|
|
741
|
+
* @returns {NativeStyle}
|
|
742
|
+
*/
|
|
743
|
+
static from_xml(xml) {
|
|
744
|
+
try {
|
|
745
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
746
|
+
const ptr0 = passStringToWasm0(xml, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
747
|
+
const len0 = WASM_VECTOR_LEN;
|
|
748
|
+
wasm.nativestyle_from_xml(retptr, ptr0, len0);
|
|
749
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
750
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
751
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
752
|
+
if (r2) {
|
|
753
|
+
throw takeObject(r1);
|
|
754
|
+
}
|
|
755
|
+
return NativeStyle.__wrap(r0);
|
|
756
|
+
} finally {
|
|
757
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* @returns {string}
|
|
762
|
+
*/
|
|
763
|
+
get id() {
|
|
764
|
+
let deferred1_0;
|
|
765
|
+
let deferred1_1;
|
|
766
|
+
try {
|
|
767
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
768
|
+
wasm.nativestyle_id(retptr, this.__wbg_ptr);
|
|
769
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
770
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
771
|
+
deferred1_0 = r0;
|
|
772
|
+
deferred1_1 = r1;
|
|
773
|
+
return getStringFromWasm0(r0, r1);
|
|
774
|
+
} finally {
|
|
775
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
776
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* @param {string} name
|
|
781
|
+
* @returns {NativeStyle}
|
|
782
|
+
*/
|
|
783
|
+
static load(name) {
|
|
784
|
+
try {
|
|
785
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
786
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
787
|
+
const len0 = WASM_VECTOR_LEN;
|
|
788
|
+
wasm.nativestyle_load(retptr, ptr0, len0);
|
|
789
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
790
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
791
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
792
|
+
if (r2) {
|
|
793
|
+
throw takeObject(r1);
|
|
794
|
+
}
|
|
795
|
+
return NativeStyle.__wrap(r0);
|
|
796
|
+
} finally {
|
|
797
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* @returns {string}
|
|
802
|
+
*/
|
|
803
|
+
get title() {
|
|
804
|
+
let deferred1_0;
|
|
805
|
+
let deferred1_1;
|
|
806
|
+
try {
|
|
807
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
808
|
+
wasm.nativestyle_title(retptr, this.__wbg_ptr);
|
|
809
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
810
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
811
|
+
deferred1_0 = r0;
|
|
812
|
+
deferred1_1 = r1;
|
|
813
|
+
return getStringFromWasm0(r0, r1);
|
|
814
|
+
} finally {
|
|
815
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
816
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
if (Symbol.dispose) NativeStyle.prototype[Symbol.dispose] = NativeStyle.prototype.free;
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* @returns {string}
|
|
824
|
+
*/
|
|
825
|
+
export function build_info() {
|
|
826
|
+
let deferred1_0;
|
|
827
|
+
let deferred1_1;
|
|
828
|
+
try {
|
|
829
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
830
|
+
wasm.build_info(retptr);
|
|
831
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
832
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
833
|
+
deferred1_0 = r0;
|
|
834
|
+
deferred1_1 = r1;
|
|
835
|
+
return getStringFromWasm0(r0, r1);
|
|
836
|
+
} finally {
|
|
837
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
838
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* @param {Uint8Array} bytes
|
|
844
|
+
* @returns {string}
|
|
845
|
+
*/
|
|
846
|
+
export function decode_bibliography(bytes) {
|
|
847
|
+
let deferred2_0;
|
|
848
|
+
let deferred2_1;
|
|
849
|
+
try {
|
|
850
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
851
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export2);
|
|
852
|
+
const len0 = WASM_VECTOR_LEN;
|
|
853
|
+
wasm.decode_bibliography(retptr, ptr0, len0);
|
|
854
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
855
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
856
|
+
deferred2_0 = r0;
|
|
857
|
+
deferred2_1 = r1;
|
|
858
|
+
return getStringFromWasm0(r0, r1);
|
|
859
|
+
} finally {
|
|
860
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
861
|
+
wasm.__wbindgen_export(deferred2_0, deferred2_1, 1);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* @param {string} code
|
|
867
|
+
* @returns {boolean}
|
|
868
|
+
*/
|
|
869
|
+
export function is_bundled_locale(code) {
|
|
870
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
871
|
+
const len0 = WASM_VECTOR_LEN;
|
|
872
|
+
const ret = wasm.is_bundled_locale(ptr0, len0);
|
|
873
|
+
return ret !== 0;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* @param {string} source
|
|
878
|
+
* @param {string} options
|
|
879
|
+
* @returns {string}
|
|
880
|
+
*/
|
|
881
|
+
export function tidy_bibtex(source, options) {
|
|
882
|
+
let deferred4_0;
|
|
883
|
+
let deferred4_1;
|
|
884
|
+
try {
|
|
885
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
886
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
887
|
+
const len0 = WASM_VECTOR_LEN;
|
|
888
|
+
const ptr1 = passStringToWasm0(options, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
889
|
+
const len1 = WASM_VECTOR_LEN;
|
|
890
|
+
wasm.tidy_bibtex(retptr, ptr0, len0, ptr1, len1);
|
|
891
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
892
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
893
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
894
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
895
|
+
var ptr3 = r0;
|
|
896
|
+
var len3 = r1;
|
|
897
|
+
if (r3) {
|
|
898
|
+
ptr3 = 0; len3 = 0;
|
|
899
|
+
throw takeObject(r2);
|
|
900
|
+
}
|
|
901
|
+
deferred4_0 = ptr3;
|
|
902
|
+
deferred4_1 = len3;
|
|
903
|
+
return getStringFromWasm0(ptr3, len3);
|
|
904
|
+
} finally {
|
|
905
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
906
|
+
wasm.__wbindgen_export(deferred4_0, deferred4_1, 1);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* @param {string} options
|
|
912
|
+
*/
|
|
913
|
+
export function validate_tidy_options(options) {
|
|
914
|
+
try {
|
|
915
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
916
|
+
const ptr0 = passStringToWasm0(options, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
917
|
+
const len0 = WASM_VECTOR_LEN;
|
|
918
|
+
wasm.validate_tidy_options(retptr, ptr0, len0);
|
|
919
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
920
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
921
|
+
if (r1) {
|
|
922
|
+
throw takeObject(r0);
|
|
923
|
+
}
|
|
924
|
+
} finally {
|
|
925
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
function __wbg_get_imports() {
|
|
929
|
+
const import0 = {
|
|
930
|
+
__proto__: null,
|
|
931
|
+
__wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
|
|
932
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
933
|
+
},
|
|
934
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
935
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
936
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
937
|
+
return addHeapObject(ret);
|
|
938
|
+
},
|
|
939
|
+
__wbindgen_object_drop_ref: function(arg0) {
|
|
940
|
+
takeObject(arg0);
|
|
941
|
+
},
|
|
942
|
+
};
|
|
943
|
+
return {
|
|
944
|
+
__proto__: null,
|
|
945
|
+
"./refkit_js_native_bg.js": import0,
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
const NativeDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
950
|
+
? { register: () => {}, unregister: () => {} }
|
|
951
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nativedocument_free(ptr, 1));
|
|
952
|
+
const NativeLibraryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
953
|
+
? { register: () => {}, unregister: () => {} }
|
|
954
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nativelibrary_free(ptr, 1));
|
|
955
|
+
const NativeRawDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
956
|
+
? { register: () => {}, unregister: () => {} }
|
|
957
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nativerawdocument_free(ptr, 1));
|
|
958
|
+
const NativeStyleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
959
|
+
? { register: () => {}, unregister: () => {} }
|
|
960
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nativestyle_free(ptr, 1));
|
|
961
|
+
|
|
962
|
+
function addHeapObject(obj) {
|
|
963
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
964
|
+
const idx = heap_next;
|
|
965
|
+
heap_next = heap[idx];
|
|
966
|
+
|
|
967
|
+
heap[idx] = obj;
|
|
968
|
+
return idx;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
function _assertClass(instance, klass) {
|
|
972
|
+
if (!(instance instanceof klass)) {
|
|
973
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
function dropObject(idx) {
|
|
978
|
+
if (idx < 1028) return;
|
|
979
|
+
heap[idx] = heap_next;
|
|
980
|
+
heap_next = idx;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
let cachedDataViewMemory0 = null;
|
|
984
|
+
function getDataViewMemory0() {
|
|
985
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
986
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
987
|
+
}
|
|
988
|
+
return cachedDataViewMemory0;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
function getStringFromWasm0(ptr, len) {
|
|
992
|
+
return decodeText(ptr >>> 0, len);
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
let cachedUint8ArrayMemory0 = null;
|
|
996
|
+
function getUint8ArrayMemory0() {
|
|
997
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
998
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
999
|
+
}
|
|
1000
|
+
return cachedUint8ArrayMemory0;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
function getObject(idx) { return heap[idx]; }
|
|
1004
|
+
|
|
1005
|
+
let heap = new Array(1024).fill(undefined);
|
|
1006
|
+
heap.push(undefined, null, true, false);
|
|
1007
|
+
|
|
1008
|
+
let heap_next = heap.length;
|
|
1009
|
+
|
|
1010
|
+
function isLikeNone(x) {
|
|
1011
|
+
return x === undefined || x === null;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
1015
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1016
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1017
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1018
|
+
return ptr;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1022
|
+
if (realloc === undefined) {
|
|
1023
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1024
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1025
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1026
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1027
|
+
return ptr;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
let len = arg.length;
|
|
1031
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1032
|
+
|
|
1033
|
+
const mem = getUint8ArrayMemory0();
|
|
1034
|
+
|
|
1035
|
+
let offset = 0;
|
|
1036
|
+
|
|
1037
|
+
for (; offset < len; offset++) {
|
|
1038
|
+
const code = arg.charCodeAt(offset);
|
|
1039
|
+
if (code > 0x7F) break;
|
|
1040
|
+
mem[ptr + offset] = code;
|
|
1041
|
+
}
|
|
1042
|
+
if (offset !== len) {
|
|
1043
|
+
if (offset !== 0) {
|
|
1044
|
+
arg = arg.slice(offset);
|
|
1045
|
+
}
|
|
1046
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1047
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1048
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1049
|
+
|
|
1050
|
+
offset += ret.written;
|
|
1051
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
WASM_VECTOR_LEN = offset;
|
|
1055
|
+
return ptr;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
function takeObject(idx) {
|
|
1059
|
+
const ret = getObject(idx);
|
|
1060
|
+
dropObject(idx);
|
|
1061
|
+
return ret;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1065
|
+
cachedTextDecoder.decode();
|
|
1066
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1067
|
+
let numBytesDecoded = 0;
|
|
1068
|
+
function decodeText(ptr, len) {
|
|
1069
|
+
numBytesDecoded += len;
|
|
1070
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1071
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1072
|
+
cachedTextDecoder.decode();
|
|
1073
|
+
numBytesDecoded = len;
|
|
1074
|
+
}
|
|
1075
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1079
|
+
|
|
1080
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1081
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1082
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1083
|
+
view.set(buf);
|
|
1084
|
+
return {
|
|
1085
|
+
read: arg.length,
|
|
1086
|
+
written: buf.length
|
|
1087
|
+
};
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
let WASM_VECTOR_LEN = 0;
|
|
1092
|
+
|
|
1093
|
+
let wasmModule, wasmInstance, wasm;
|
|
1094
|
+
function __wbg_finalize_init(instance, module) {
|
|
1095
|
+
wasmInstance = instance;
|
|
1096
|
+
wasm = instance.exports;
|
|
1097
|
+
wasmModule = module;
|
|
1098
|
+
cachedDataViewMemory0 = null;
|
|
1099
|
+
cachedUint8ArrayMemory0 = null;
|
|
1100
|
+
return wasm;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
async function __wbg_load(module, imports) {
|
|
1104
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1105
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1106
|
+
try {
|
|
1107
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1108
|
+
} catch (e) {
|
|
1109
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
1110
|
+
|
|
1111
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1112
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
1113
|
+
|
|
1114
|
+
} else { throw e; }
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
const bytes = await module.arrayBuffer();
|
|
1119
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1120
|
+
} else {
|
|
1121
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1122
|
+
|
|
1123
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1124
|
+
return { instance, module };
|
|
1125
|
+
} else {
|
|
1126
|
+
return instance;
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
function expectedResponseType(type) {
|
|
1131
|
+
switch (type) {
|
|
1132
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
1133
|
+
}
|
|
1134
|
+
return false;
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
function initSync(module) {
|
|
1139
|
+
if (wasm !== undefined) return wasm;
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
if (module !== undefined) {
|
|
1143
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1144
|
+
({module} = module)
|
|
1145
|
+
} else {
|
|
1146
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
const imports = __wbg_get_imports();
|
|
1151
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1152
|
+
module = new WebAssembly.Module(module);
|
|
1153
|
+
}
|
|
1154
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1155
|
+
return __wbg_finalize_init(instance, module);
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
async function __wbg_init(module_or_path) {
|
|
1159
|
+
if (wasm !== undefined) return wasm;
|
|
1160
|
+
|
|
1161
|
+
|
|
1162
|
+
if (module_or_path !== undefined) {
|
|
1163
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1164
|
+
({module_or_path} = module_or_path)
|
|
1165
|
+
} else {
|
|
1166
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
if (module_or_path === undefined) {
|
|
1171
|
+
module_or_path = new URL('refkit_js_native_bg.wasm', import.meta.url);
|
|
1172
|
+
}
|
|
1173
|
+
const imports = __wbg_get_imports();
|
|
1174
|
+
|
|
1175
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1176
|
+
module_or_path = fetch(module_or_path);
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1180
|
+
|
|
1181
|
+
return __wbg_finalize_init(instance, module);
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
export { initSync, __wbg_init as default };
|