@docmux/wasm 0.3.0 → 0.4.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.
@@ -0,0 +1,117 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * Convert a document from one format to another (fragment mode).
6
+ *
7
+ * # Arguments
8
+ * - `input` — the source document as a string
9
+ * - `from` — input format name or extension (e.g. `"markdown"`, `"md"`)
10
+ * - `to` — output format name or extension (e.g. `"html"`)
11
+ */
12
+ export function convert(input: string, from: string, to: string): string;
13
+
14
+ /**
15
+ * Convert binary input (e.g. DOCX bytes) to another format (fragment mode).
16
+ *
17
+ * # Arguments
18
+ * - `input` — the raw binary content (e.g. DOCX bytes from `FileReader`)
19
+ * - `from` — input format name or extension (e.g. `"docx"`)
20
+ * - `to` — output format name or extension (e.g. `"html"`)
21
+ */
22
+ export function convertBytes(input: Uint8Array, from: string, to: string): string;
23
+
24
+ /**
25
+ * Convert binary input producing a standalone file (full HTML, LaTeX with preamble, etc.).
26
+ */
27
+ export function convertBytesStandalone(input: Uint8Array, from: string, to: string): string;
28
+
29
+ /**
30
+ * Convert binary input to binary output (e.g. DOCX → DOCX), with additional resources.
31
+ */
32
+ export function convertBytesToBytes(input: Uint8Array, from: string, to: string, resources: Map<any, any>): Uint8Array;
33
+
34
+ /**
35
+ * Convert a document producing a standalone file (full HTML document, LaTeX with preamble, etc.).
36
+ */
37
+ export function convertStandalone(input: string, from: string, to: string): string;
38
+
39
+ /**
40
+ * Convert text input to binary output (e.g. markdown → DOCX), with image resources.
41
+ */
42
+ export function convertToBytes(input: string, from: string, to: string, resources: Map<any, any>): Uint8Array;
43
+
44
+ /**
45
+ * Convert text input to string output, with image resources for embedding.
46
+ */
47
+ export function convertWithResources(input: string, from: string, to: string, resources: Map<any, any>): string;
48
+
49
+ /**
50
+ * Return a list of supported input format names.
51
+ */
52
+ export function inputFormats(): string[];
53
+
54
+ /**
55
+ * Convert markdown to HTML (convenience wrapper).
56
+ */
57
+ export function markdownToHtml(input: string): string;
58
+
59
+ /**
60
+ * Return a list of supported output format names.
61
+ */
62
+ export function outputFormats(): string[];
63
+
64
+ /**
65
+ * Parse binary input and return the AST as pretty-printed JSON.
66
+ */
67
+ export function parseBytesToJson(input: Uint8Array, from: string): string;
68
+
69
+ /**
70
+ * Parse a document and return the AST as pretty-printed JSON.
71
+ */
72
+ export function parseToJson(input: string, from: string): string;
73
+
74
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
75
+
76
+ export interface InitOutput {
77
+ readonly memory: WebAssembly.Memory;
78
+ readonly convert: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
79
+ readonly convertBytes: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
80
+ readonly convertBytesStandalone: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
81
+ readonly convertBytesToBytes: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
82
+ readonly convertStandalone: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
83
+ readonly convertToBytes: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
84
+ readonly convertWithResources: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
85
+ readonly inputFormats: (a: number) => void;
86
+ readonly markdownToHtml: (a: number, b: number, c: number) => void;
87
+ readonly outputFormats: (a: number) => void;
88
+ readonly parseBytesToJson: (a: number, b: number, c: number, d: number, e: number) => void;
89
+ readonly parseToJson: (a: number, b: number, c: number, d: number, e: number) => void;
90
+ readonly __wasm_bindgen_func_elem_332: (a: number, b: number, c: number, d: number) => void;
91
+ readonly __wbindgen_export: (a: number, b: number) => number;
92
+ readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
93
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
94
+ readonly __wbindgen_export3: (a: number, b: number, c: number) => void;
95
+ }
96
+
97
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
98
+
99
+ /**
100
+ * Instantiates the given `module`, which can either be bytes or
101
+ * a precompiled `WebAssembly.Module`.
102
+ *
103
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
104
+ *
105
+ * @returns {InitOutput}
106
+ */
107
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
108
+
109
+ /**
110
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
111
+ * for everything else, calls `WebAssembly.instantiate` directly.
112
+ *
113
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
114
+ *
115
+ * @returns {Promise<InitOutput>}
116
+ */
117
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;