refkit-js 0.0.0 → 0.2.1

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/dist/raw.js ADDED
@@ -0,0 +1,191 @@
1
+ import { NativeRawDocument } from "./wasm/refkit_js_native.js";
2
+ import { assertInitialized } from "./runtime.js";
3
+ import { callNative, readNative } from "./errors.js";
4
+ import { string } from "./inputs.js";
5
+ import { tidyBibtex } from "./tidy.js";
6
+ let entryMap;
7
+ let entry;
8
+ let fieldMap;
9
+ let field;
10
+ const sourceDiagnostics = new WeakMap();
11
+ export function setBibDecodingDiagnostic(document, diagnostic) {
12
+ sourceDiagnostics.set(document, diagnostic ? [diagnostic] : []);
13
+ }
14
+ export class BibDocument {
15
+ #native;
16
+ constructor(native) {
17
+ this.#native = native;
18
+ }
19
+ static parse(source) {
20
+ assertInitialized();
21
+ return new BibDocument(callNative(() => NativeRawDocument.parse(string(source, "source"))));
22
+ }
23
+ #metadata() {
24
+ return readNative(() => this.#native.metadata());
25
+ }
26
+ get entries() {
27
+ return entryMap(this.#native);
28
+ }
29
+ get diagnostics() {
30
+ return [
31
+ ...structuredClone(sourceDiagnostics.get(this) ?? []),
32
+ ...this.#metadata().diagnostics,
33
+ ];
34
+ }
35
+ get comments() {
36
+ return this.#metadata().comments;
37
+ }
38
+ get preamble() {
39
+ return this.#metadata().preamble;
40
+ }
41
+ get strings() {
42
+ return this.#metadata().strings;
43
+ }
44
+ get failedBlocks() {
45
+ return this.#metadata().failedBlocks;
46
+ }
47
+ get blocks() {
48
+ return this.#metadata().blocks;
49
+ }
50
+ toBibtex() {
51
+ return callNative(() => this.#native.to_bibtex());
52
+ }
53
+ tidy(settings = {}) {
54
+ return tidyBibtex(this.toBibtex(), settings);
55
+ }
56
+ }
57
+ export class BibEntryMap {
58
+ #native;
59
+ constructor(native) {
60
+ this.#native = native;
61
+ }
62
+ static {
63
+ entryMap = (native) => new BibEntryMap(native);
64
+ }
65
+ #records() {
66
+ return readNative(() => this.#native.entries());
67
+ }
68
+ uniqueKeys() {
69
+ return readNative(() => this.#native.entry_keys());
70
+ }
71
+ occurrenceKeys() {
72
+ return this.#records().map((info) => info.key);
73
+ }
74
+ occurrences() {
75
+ return this.#records().map((info) => entry(this.#native, info));
76
+ }
77
+ getAll(key) {
78
+ const records = readNative(() => this.#native.entries_for_key(string(key, "key")));
79
+ return records.map((info) => entry(this.#native, info));
80
+ }
81
+ getUnique(key) {
82
+ const info = readNative(() => this.#native.unique_entry(string(key, "key")));
83
+ return info === null ? null : entry(this.#native, info);
84
+ }
85
+ get size() {
86
+ return callNative(() => this.#native.entry_count());
87
+ }
88
+ isEmpty() {
89
+ return this.size === 0;
90
+ }
91
+ has(key) {
92
+ return this.getAll(key).length > 0;
93
+ }
94
+ [Symbol.iterator]() {
95
+ return this.occurrences()[Symbol.iterator]();
96
+ }
97
+ }
98
+ export class BibEntry {
99
+ #native;
100
+ #info;
101
+ constructor(native, info) {
102
+ this.#native = native;
103
+ this.#info = info;
104
+ }
105
+ static {
106
+ entry = (native, info) => new BibEntry(native, info);
107
+ }
108
+ get key() {
109
+ return this.#info.key;
110
+ }
111
+ get kind() {
112
+ return this.#info.kind;
113
+ }
114
+ get span() {
115
+ return [...this.#info.span];
116
+ }
117
+ get fields() {
118
+ return fieldMap(this.#native, this.#info.id);
119
+ }
120
+ }
121
+ export class BibFieldMap {
122
+ #native;
123
+ #entryId;
124
+ constructor(native, entryId) {
125
+ this.#native = native;
126
+ this.#entryId = entryId;
127
+ }
128
+ static {
129
+ fieldMap = (native, entryId) => new BibFieldMap(native, entryId);
130
+ }
131
+ #records() {
132
+ return readNative(() => this.#native.fields(this.#entryId));
133
+ }
134
+ uniqueKeys() {
135
+ return readNative(() => this.#native.field_keys(this.#entryId));
136
+ }
137
+ occurrenceKeys() {
138
+ return this.#records().map((info) => info.name);
139
+ }
140
+ occurrences() {
141
+ return this.#records().map((info) => field(this.#native, this.#entryId, info));
142
+ }
143
+ getAll(key) {
144
+ const records = readNative(() => this.#native.fields_for_key(this.#entryId, string(key, "key")));
145
+ return records.map((info) => field(this.#native, this.#entryId, info));
146
+ }
147
+ getUnique(key) {
148
+ const info = readNative(() => this.#native.unique_field(this.#entryId, string(key, "key")));
149
+ return info === null ? null : field(this.#native, this.#entryId, info);
150
+ }
151
+ get size() {
152
+ return callNative(() => this.#native.field_count(this.#entryId));
153
+ }
154
+ isEmpty() {
155
+ return this.size === 0;
156
+ }
157
+ has(key) {
158
+ return this.getAll(key).length > 0;
159
+ }
160
+ [Symbol.iterator]() {
161
+ return this.occurrences()[Symbol.iterator]();
162
+ }
163
+ }
164
+ export class BibField {
165
+ #native;
166
+ #entryId;
167
+ #id;
168
+ constructor(native, entryId, info) {
169
+ this.#native = native;
170
+ this.#entryId = entryId;
171
+ this.#id = info.id;
172
+ }
173
+ static {
174
+ field = (native, entryId, info) => new BibField(native, entryId, info);
175
+ }
176
+ #info() {
177
+ return readNative(() => this.#native.field(this.#entryId, this.#id));
178
+ }
179
+ get name() {
180
+ return this.#info().name;
181
+ }
182
+ get span() {
183
+ return this.#info().span;
184
+ }
185
+ get value() {
186
+ return this.#info().value;
187
+ }
188
+ set value(value) {
189
+ callNative(() => this.#native.set_field_value(this.#entryId, this.#id, string(value, "value")));
190
+ }
191
+ }
@@ -0,0 +1,14 @@
1
+ import { type InitInput, type SyncInitInput } from "./wasm/refkit_js_native.js";
2
+ export type InitOptions = InitInput | Promise<InitInput> | {
3
+ module_or_path: InitInput | Promise<InitInput>;
4
+ };
5
+ /** Initialize the shared WebAssembly module before calling the browser API. */
6
+ export declare function init(input?: InitOptions): Promise<void>;
7
+ export declare function initializeSync(module: SyncInitInput): void;
8
+ export declare function assertInitialized(): void;
9
+ export interface BuildInfo {
10
+ readonly version: string;
11
+ readonly buildMode: "debug" | "release";
12
+ readonly target: string;
13
+ }
14
+ export declare function getBuildInfo(): BuildInfo;
@@ -0,0 +1,58 @@
1
+ import initialize, { build_info, initSync, } from "./wasm/refkit_js_native.js";
2
+ import { RefkitError, readNative } from "./errors.js";
3
+ import { version } from "./wasm/version.js";
4
+ const supportsFinalization = typeof FinalizationRegistry === "function";
5
+ let ready = false;
6
+ let pending;
7
+ /** Initialize the shared WebAssembly module before calling the browser API. */
8
+ export function init(input) {
9
+ assertRuntimeSupport();
10
+ if (ready)
11
+ return Promise.resolve();
12
+ if (!pending) {
13
+ const moduleOrPath = input && typeof input === "object" && "module_or_path" in input
14
+ ? input.module_or_path
15
+ : (input ??
16
+ new URL("./wasm/refkit_js_native_bg.wasm", import.meta.url));
17
+ pending = initialize({ module_or_path: moduleOrPath })
18
+ .then(() => {
19
+ verifyVersion();
20
+ ready = true;
21
+ })
22
+ .catch((error) => {
23
+ pending = undefined;
24
+ throw error;
25
+ });
26
+ }
27
+ return pending;
28
+ }
29
+ export function initializeSync(module) {
30
+ assertRuntimeSupport();
31
+ if (ready)
32
+ return;
33
+ if (pending) {
34
+ throw new RefkitError("Await the pending browser initialization before importing refkit-js/node.");
35
+ }
36
+ initSync({ module });
37
+ verifyVersion();
38
+ ready = true;
39
+ }
40
+ export function assertInitialized() {
41
+ if (!ready)
42
+ throw new RefkitError("RefKit is not initialized. Await init() before calling the browser API.");
43
+ }
44
+ function verifyVersion() {
45
+ const info = readNative(() => build_info());
46
+ if (info.version !== version) {
47
+ throw new RefkitError(`WebAssembly version ${info.version} is incompatible with refkit-js ${version}. Install JavaScript and WebAssembly from the same release.`);
48
+ }
49
+ }
50
+ export function getBuildInfo() {
51
+ assertInitialized();
52
+ return readNative(() => build_info());
53
+ }
54
+ function assertRuntimeSupport() {
55
+ if (!supportsFinalization) {
56
+ throw new RefkitError("RefKit requires FinalizationRegistry. Use Node.js 22.19 or newer, or update your browser.");
57
+ }
58
+ }
package/dist/tidy.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import type { TidyOptions, TidyResult } from "./types.js";
2
+ export interface TidySettings {
3
+ options?: TidyOptions | null;
4
+ }
5
+ export declare function tidyBibtex(source: string, settings?: TidySettings): TidyResult;
package/dist/tidy.js ADDED
@@ -0,0 +1,31 @@
1
+ import { tidy_bibtex } from "./wasm/refkit_js_native.js";
2
+ import { assertInitialized } from "./runtime.js";
3
+ import { readNative } from "./errors.js";
4
+ import { object, string } from "./inputs.js";
5
+ export function tidyBibtex(source, settings = {}) {
6
+ assertInitialized();
7
+ string(source, "source");
8
+ object(settings, "settings", ["options"]);
9
+ const options = settings.options ?? {};
10
+ object(options, "options");
11
+ const input = JSON.stringify(options, function (key, value) {
12
+ if (value === undefined && Array.isArray(this)) {
13
+ throw new TypeError("tidy option arrays must contain defined values");
14
+ }
15
+ const original = key === "" ? options : this[key];
16
+ if (original !== null &&
17
+ typeof original === "object" &&
18
+ !Array.isArray(original)) {
19
+ object(original, "tidy option");
20
+ if (value !== original)
21
+ throw new TypeError("tidy options must contain plain values");
22
+ }
23
+ if (typeof value === "number" && !Number.isFinite(value))
24
+ throw new TypeError("tidy options require finite numbers");
25
+ if (["function", "symbol", "bigint"].includes(typeof value)) {
26
+ throw new TypeError("tidy options must contain JSON values");
27
+ }
28
+ return value;
29
+ });
30
+ return readNative(() => tidy_bibtex(source, input));
31
+ }
@@ -0,0 +1,182 @@
1
+ export type RecoveryPolicy = "error" | "report";
2
+ export type RawSpan = readonly [number, number];
3
+ export interface Diagnostic {
4
+ readonly code: string;
5
+ readonly severity: "error" | "warning";
6
+ readonly action: "rejected" | "dropped_block" | "dropped_field" | "literalized" | "decoded";
7
+ readonly span: RawSpan | null;
8
+ readonly entry: string | null;
9
+ readonly field: string | null;
10
+ readonly message: string;
11
+ }
12
+ export interface Entry {
13
+ readonly key: string;
14
+ readonly entryType: string;
15
+ readonly title: string | null;
16
+ readonly date: string | null;
17
+ readonly doi: string | null;
18
+ readonly volume: string | null;
19
+ readonly parents: readonly Entry[];
20
+ }
21
+ export type ProjectionField = "key" | "entryType" | "type" | "title" | "date" | "doi" | "volume";
22
+ export interface ProjectionRow {
23
+ key?: string;
24
+ entryType?: string;
25
+ type?: string;
26
+ title?: string | null;
27
+ date?: string | null;
28
+ doi?: string | null;
29
+ volume?: string | null;
30
+ }
31
+ export interface BibliographyLayout {
32
+ readonly hangingIndent: boolean;
33
+ readonly secondFieldAlign: "Margin" | "Flush" | null;
34
+ readonly lineSpacing: number;
35
+ readonly entrySpacing: number;
36
+ }
37
+ export type RenderedMeta = {
38
+ readonly kind: "Entry";
39
+ readonly key: string;
40
+ readonly itemIndex: number;
41
+ } | {
42
+ readonly kind: "Names";
43
+ readonly roles: readonly string[];
44
+ } | {
45
+ readonly kind: "Name";
46
+ readonly role: string;
47
+ readonly index: number;
48
+ } | {
49
+ readonly kind: "Date" | "Text" | "Number" | "Label" | "CitationNumber" | "CitationLabel";
50
+ };
51
+ export interface RenderedFormatting {
52
+ readonly fontStyle: "Normal" | "Italic";
53
+ readonly fontVariant: "Normal" | "SmallCaps";
54
+ readonly fontWeight: "Normal" | "Bold" | "Light";
55
+ readonly textDecoration: "None" | "Underline";
56
+ readonly verticalAlign: "None" | "Baseline" | "Sup" | "Sub";
57
+ }
58
+ export interface RenderedText {
59
+ readonly kind: "Text";
60
+ readonly text: string;
61
+ readonly formatting: RenderedFormatting;
62
+ }
63
+ export interface RenderedElement {
64
+ readonly kind: "Element";
65
+ readonly display: "Block" | "LeftMargin" | "RightInline" | "Indent" | null;
66
+ readonly meta: RenderedMeta | null;
67
+ readonly children: readonly RenderedNode[];
68
+ }
69
+ export interface RenderedMarkup {
70
+ readonly kind: "Markup";
71
+ readonly value: string;
72
+ }
73
+ export interface RenderedLink {
74
+ readonly kind: "Link";
75
+ readonly text: string;
76
+ readonly url: string;
77
+ readonly formatting: RenderedFormatting;
78
+ }
79
+ export interface RenderedTransparent {
80
+ readonly kind: "Transparent";
81
+ readonly citeIdx: number;
82
+ readonly formatting: RenderedFormatting;
83
+ }
84
+ export type RenderedNode = RenderedText | RenderedElement | RenderedMarkup | RenderedLink | RenderedTransparent;
85
+ export interface BibliographyEntry {
86
+ readonly kind: "bibliography-entry";
87
+ readonly key: string;
88
+ readonly label: RenderedNode | null;
89
+ readonly content: readonly RenderedNode[];
90
+ }
91
+ export type RenderedTree = readonly (RenderedNode | BibliographyEntry)[];
92
+ export interface Rendered {
93
+ readonly text: string;
94
+ readonly html: string;
95
+ readonly layout: BibliographyLayout | null;
96
+ readonly tree: RenderedTree;
97
+ }
98
+ export interface RawWhitespaceBlock {
99
+ readonly kind: "whitespace";
100
+ readonly span: RawSpan;
101
+ }
102
+ export interface RawCommentBlock {
103
+ readonly kind: "comment";
104
+ readonly raw: string;
105
+ readonly span: RawSpan;
106
+ }
107
+ export interface RawPreambleBlock {
108
+ readonly kind: "preamble";
109
+ readonly value: string;
110
+ readonly span: RawSpan;
111
+ }
112
+ export interface RawStringBlock {
113
+ readonly kind: "string";
114
+ readonly key: string;
115
+ readonly value: string;
116
+ readonly span: RawSpan;
117
+ }
118
+ export interface RawEntryBlock {
119
+ readonly kind: "entry";
120
+ readonly id: number;
121
+ readonly key: string;
122
+ readonly span: RawSpan;
123
+ }
124
+ export interface RawFailedBlock {
125
+ readonly kind: "failed";
126
+ readonly raw: string;
127
+ readonly error: string;
128
+ readonly span: RawSpan;
129
+ }
130
+ export interface RawOtherBlock {
131
+ readonly kind: "other";
132
+ readonly raw: string;
133
+ readonly span: RawSpan;
134
+ }
135
+ export type RawBlock = RawWhitespaceBlock | RawCommentBlock | RawPreambleBlock | RawStringBlock | RawEntryBlock | RawFailedBlock | RawOtherBlock;
136
+ export type DuplicateRule = "doi" | "key" | "abstract" | "citation";
137
+ export type MergeStrategy = "first" | "last" | "combine" | "overwrite";
138
+ export interface TidyOptions {
139
+ omit?: readonly string[] | null;
140
+ curly?: boolean;
141
+ numeric?: boolean;
142
+ months?: boolean;
143
+ space?: number;
144
+ tab?: boolean;
145
+ align?: boolean | number | null;
146
+ blankLines?: boolean;
147
+ sort?: boolean | readonly string[] | null;
148
+ duplicates?: readonly DuplicateRule[] | null;
149
+ merge?: MergeStrategy | null;
150
+ stripEnclosingBraces?: boolean;
151
+ dropAllCaps?: boolean;
152
+ escape?: boolean;
153
+ sortFields?: boolean | readonly string[] | null;
154
+ stripComments?: boolean;
155
+ trailingCommas?: boolean;
156
+ encodeUrls?: boolean;
157
+ tidyComments?: boolean;
158
+ removeEmptyFields?: boolean;
159
+ removeDuplicateFields?: boolean;
160
+ generateKeys?: boolean | string | null;
161
+ maxAuthors?: number | null;
162
+ lowercase?: boolean;
163
+ enclosingBraces?: boolean | readonly string[] | null;
164
+ removeBraces?: boolean | readonly string[] | null;
165
+ wrap?: boolean | number | null;
166
+ }
167
+ export interface TidyWarning {
168
+ readonly code: "missing_key" | "duplicate_entry";
169
+ readonly rule: DuplicateRule | null;
170
+ readonly message: string;
171
+ }
172
+ export interface TidyRename {
173
+ readonly entryId: number;
174
+ readonly oldKey: string;
175
+ readonly newKey: string;
176
+ }
177
+ export interface TidyResult {
178
+ readonly bibtex: string;
179
+ readonly warnings: readonly TidyWarning[];
180
+ readonly renames: readonly TidyRename[];
181
+ readonly count: number;
182
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,142 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export class NativeDocument {
5
+ free(): void;
6
+ [Symbol.dispose](): void;
7
+ cited_bibliography(citations: string): string;
8
+ full_bibliography(): string;
9
+ constructor(library: NativeLibrary, style: NativeStyle, locale?: string | null);
10
+ render(citations: string): string;
11
+ }
12
+
13
+ export class NativeLibrary {
14
+ private constructor();
15
+ free(): void;
16
+ [Symbol.dispose](): void;
17
+ diagnostics(): string;
18
+ get_many(keys: string): string;
19
+ get_record(key: string): string;
20
+ keys(): string;
21
+ static parse_bibtex(source: string, recovery: string): NativeLibrary;
22
+ static parse_yaml(source: string): NativeLibrary;
23
+ project(fields?: string | null, keys?: string | null): string;
24
+ records(): string;
25
+ select_records(selector: string): string;
26
+ readonly size: number;
27
+ }
28
+
29
+ export class NativeRawDocument {
30
+ private constructor();
31
+ free(): void;
32
+ [Symbol.dispose](): void;
33
+ entries(): string;
34
+ entries_for_key(key: string): string;
35
+ entry_count(): number;
36
+ entry_keys(): string;
37
+ field(entry_id: number, field_id: number): string;
38
+ field_count(entry_id: number): number;
39
+ field_keys(entry_id: number): string;
40
+ fields(entry_id: number): string;
41
+ fields_for_key(entry_id: number, key: string): string;
42
+ metadata(): string;
43
+ static parse(source: string): NativeRawDocument;
44
+ set_field_value(entry_id: number, field_id: number, value: string): void;
45
+ to_bibtex(): string;
46
+ unique_entry(key: string): string;
47
+ unique_field(entry_id: number, key: string): string;
48
+ }
49
+
50
+ export class NativeStyle {
51
+ private constructor();
52
+ free(): void;
53
+ [Symbol.dispose](): void;
54
+ static from_xml(xml: string): NativeStyle;
55
+ static load(name: string): NativeStyle;
56
+ readonly id: string;
57
+ readonly title: string;
58
+ }
59
+
60
+ export function build_info(): string;
61
+
62
+ export function decode_bibliography(bytes: Uint8Array): string;
63
+
64
+ export function is_bundled_locale(code: string): boolean;
65
+
66
+ export function tidy_bibtex(source: string, options: string): string;
67
+
68
+ export function validate_tidy_options(options: string): void;
69
+
70
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
71
+
72
+ export interface InitOutput {
73
+ readonly memory: WebAssembly.Memory;
74
+ readonly __wbg_nativedocument_free: (a: number, b: number) => void;
75
+ readonly __wbg_nativelibrary_free: (a: number, b: number) => void;
76
+ readonly __wbg_nativerawdocument_free: (a: number, b: number) => void;
77
+ readonly __wbg_nativestyle_free: (a: number, b: number) => void;
78
+ readonly build_info: (a: number) => void;
79
+ readonly decode_bibliography: (a: number, b: number, c: number) => void;
80
+ readonly is_bundled_locale: (a: number, b: number) => number;
81
+ readonly nativedocument_cited_bibliography: (a: number, b: number, c: number, d: number) => void;
82
+ readonly nativedocument_full_bibliography: (a: number, b: number) => void;
83
+ readonly nativedocument_new: (a: number, b: number, c: number, d: number) => number;
84
+ readonly nativedocument_render: (a: number, b: number, c: number, d: number) => void;
85
+ readonly nativelibrary_diagnostics: (a: number, b: number) => void;
86
+ readonly nativelibrary_get_many: (a: number, b: number, c: number, d: number) => void;
87
+ readonly nativelibrary_get_record: (a: number, b: number, c: number, d: number) => void;
88
+ readonly nativelibrary_keys: (a: number, b: number) => void;
89
+ readonly nativelibrary_parse_bibtex: (a: number, b: number, c: number, d: number, e: number) => void;
90
+ readonly nativelibrary_parse_yaml: (a: number, b: number, c: number) => void;
91
+ readonly nativelibrary_project: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
92
+ readonly nativelibrary_records: (a: number, b: number) => void;
93
+ readonly nativelibrary_select_records: (a: number, b: number, c: number, d: number) => void;
94
+ readonly nativelibrary_size: (a: number) => number;
95
+ readonly nativerawdocument_entries: (a: number, b: number) => void;
96
+ readonly nativerawdocument_entries_for_key: (a: number, b: number, c: number, d: number) => void;
97
+ readonly nativerawdocument_entry_count: (a: number) => number;
98
+ readonly nativerawdocument_entry_keys: (a: number, b: number) => void;
99
+ readonly nativerawdocument_field: (a: number, b: number, c: number, d: number) => void;
100
+ readonly nativerawdocument_field_count: (a: number, b: number, c: number) => void;
101
+ readonly nativerawdocument_field_keys: (a: number, b: number, c: number) => void;
102
+ readonly nativerawdocument_fields: (a: number, b: number, c: number) => void;
103
+ readonly nativerawdocument_fields_for_key: (a: number, b: number, c: number, d: number, e: number) => void;
104
+ readonly nativerawdocument_metadata: (a: number, b: number) => void;
105
+ readonly nativerawdocument_parse: (a: number, b: number) => number;
106
+ readonly nativerawdocument_set_field_value: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
107
+ readonly nativerawdocument_to_bibtex: (a: number, b: number) => void;
108
+ readonly nativerawdocument_unique_entry: (a: number, b: number, c: number, d: number) => void;
109
+ readonly nativerawdocument_unique_field: (a: number, b: number, c: number, d: number, e: number) => void;
110
+ readonly nativestyle_from_xml: (a: number, b: number, c: number) => void;
111
+ readonly nativestyle_id: (a: number, b: number) => void;
112
+ readonly nativestyle_load: (a: number, b: number, c: number) => void;
113
+ readonly nativestyle_title: (a: number, b: number) => void;
114
+ readonly tidy_bibtex: (a: number, b: number, c: number, d: number, e: number) => void;
115
+ readonly validate_tidy_options: (a: number, b: number, c: number) => void;
116
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
117
+ readonly __wbindgen_export: (a: number, b: number, c: number) => void;
118
+ readonly __wbindgen_export2: (a: number, b: number) => number;
119
+ readonly __wbindgen_export3: (a: number, b: number, c: number, d: number) => number;
120
+ }
121
+
122
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
123
+
124
+ /**
125
+ * Instantiates the given `module`, which can either be bytes or
126
+ * a precompiled `WebAssembly.Module`.
127
+ *
128
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
129
+ *
130
+ * @returns {InitOutput}
131
+ */
132
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
133
+
134
+ /**
135
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
136
+ * for everything else, calls `WebAssembly.instantiate` directly.
137
+ *
138
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
139
+ *
140
+ * @returns {Promise<InitOutput>}
141
+ */
142
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;