@canvist/web 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.
Files changed (47) hide show
  1. package/dist/collab.d.ts +99 -0
  2. package/dist/collab.js +211 -0
  3. package/dist/edit-context.d.ts +59 -0
  4. package/dist/edit-context.js +16 -0
  5. package/dist/editor.d.ts +301 -0
  6. package/dist/editor.js +776 -0
  7. package/dist/font-watcher.d.ts +28 -0
  8. package/dist/font-watcher.js +88 -0
  9. package/dist/fonts.d.ts +130 -0
  10. package/dist/fonts.js +343 -0
  11. package/dist/full.d.ts +40 -0
  12. package/dist/full.js +25 -0
  13. package/dist/input.d.ts +68 -0
  14. package/dist/input.js +551 -0
  15. package/dist/load.d.ts +9 -0
  16. package/dist/load.js +21 -0
  17. package/dist/measure.d.ts +56 -0
  18. package/dist/measure.js +524 -0
  19. package/dist/menus.d.ts +71 -0
  20. package/dist/menus.js +173 -0
  21. package/dist/mirror.d.ts +24 -0
  22. package/dist/mirror.js +73 -0
  23. package/dist/mod.d.ts +30 -0
  24. package/dist/mod.js +7 -0
  25. package/dist/placeholder.d.ts +27 -0
  26. package/dist/placeholder.js +69 -0
  27. package/dist/platform.d.ts +9 -0
  28. package/dist/platform.js +12 -0
  29. package/dist/plugin.d.ts +39 -0
  30. package/dist/plugin.js +1 -0
  31. package/package.json +87 -1
  32. package/readme.md +92 -0
  33. package/wasm/canvist_web.d.ts +358 -0
  34. package/wasm/canvist_web.js +1175 -0
  35. package/wasm/canvist_web_bg.wasm +0 -0
  36. package/wasm/canvist_web_bg.wasm.d.ts +59 -0
  37. package/wasm-collab/canvist_web.d.ts +391 -0
  38. package/wasm-collab/canvist_web.js +1343 -0
  39. package/wasm-collab/canvist_web_bg.wasm +0 -0
  40. package/wasm-collab/canvist_web_bg.wasm.d.ts +64 -0
  41. package/wasm-full/canvist_web.d.ts +358 -0
  42. package/wasm-full/canvist_web.js +1175 -0
  43. package/wasm-full/canvist_web_bg.wasm +0 -0
  44. package/wasm-full/canvist_web_bg.wasm.d.ts +59 -0
  45. package/CHANGELOG.md +0 -3
  46. package/LICENSE +0 -24
  47. package/README.md +0 -3
Binary file
@@ -0,0 +1,59 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const __wbg_webeditor_free: (a: number, b: number) => void;
5
+ export const webeditor_bodyStyle: (a: number) => [number, number];
6
+ export const webeditor_can: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
7
+ export const webeditor_caretRect: (a: number) => [number, number];
8
+ export const webeditor_caretRectAt: (a: number, b: number, c: number, d: number) => [number, number];
9
+ export const webeditor_characterBounds: (a: number, b: number, c: number) => [number, number];
10
+ export const webeditor_commitComposition: (a: number, b: number, c: number) => [number, number, number];
11
+ export const webeditor_copySelection: (a: number) => [number, number, number, number];
12
+ export const webeditor_cutSelection: (a: number) => [number, number, number, number];
13
+ export const webeditor_dropAt: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
14
+ export const webeditor_editContextState: (a: number) => any;
15
+ export const webeditor_export: (a: number, b: number, c: number) => [number, number, number, number];
16
+ export const webeditor_fonts: (a: number) => [number, number];
17
+ export const webeditor_fontsLoaded: (a: number, b: number, c: number) => number;
18
+ export const webeditor_forgetMeasurements: (a: number) => void;
19
+ export const webeditor_frame: (a: number) => [number, number, number, number];
20
+ export const webeditor_geometry: (a: number) => [number, number, number, number];
21
+ export const webeditor_hideFamilies: (a: number, b: number, c: number) => void;
22
+ export const webeditor_html: (a: number) => [number, number];
23
+ export const webeditor_insertText: (a: number, b: number, c: number) => [number, number, number];
24
+ export const webeditor_isEmpty: (a: number) => number;
25
+ export const webeditor_isInSelection: (a: number, b: number, c: number) => number;
26
+ export const webeditor_keyDown: (a: number, b: number, c: number, d: number) => [number, number, number];
27
+ export const webeditor_load: (a: number, b: number, c: number, d: number, e: number) => [number, number];
28
+ export const webeditor_new: (a: any, b: any, c: number, d: number, e: number, f: number) => [number, number, number];
29
+ export const webeditor_pasteHtml: (a: number, b: number, c: number) => [number, number, number];
30
+ export const webeditor_pasteText: (a: number, b: number, c: number) => [number, number, number];
31
+ export const webeditor_pointerDown: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
32
+ export const webeditor_pointerMove: (a: number, b: number, c: number) => [number, number, number];
33
+ export const webeditor_pointerUp: (a: number) => void;
34
+ export const webeditor_query: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
35
+ export const webeditor_redo: (a: number) => [number, number, number];
36
+ export const webeditor_replaceText: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
37
+ export const webeditor_resize: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
38
+ export const webeditor_run: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
39
+ export const webeditor_select: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
40
+ export const webeditor_selection: (a: number) => [number, number];
41
+ export const webeditor_selectionBounds: (a: number) => [number, number];
42
+ export const webeditor_setBorderScale: (a: number, b: number) => void;
43
+ export const webeditor_setCaretOn: (a: number, b: number) => void;
44
+ export const webeditor_setComposition: (a: number, b: number, c: number) => [number, number, number];
45
+ export const webeditor_setFocused: (a: number, b: number) => void;
46
+ export const webeditor_setPixelGrid: (a: number, b: number, c: number) => [number, number];
47
+ export const webeditor_setTop: (a: number, b: number) => void;
48
+ export const webeditor_stats: (a: number) => [number, number];
49
+ export const webeditor_svg: (a: number) => [number, number, number, number];
50
+ export const webeditor_undo: (a: number) => [number, number, number];
51
+ export const __wbindgen_malloc: (a: number, b: number) => number;
52
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
53
+ export const __wbindgen_exn_store: (a: number) => void;
54
+ export const __externref_table_alloc: () => number;
55
+ export const __wbindgen_externrefs: WebAssembly.Table;
56
+ export const __externref_drop_slice: (a: number, b: number) => void;
57
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
58
+ export const __externref_table_dealloc: (a: number) => void;
59
+ export const __wbindgen_start: () => void;
@@ -0,0 +1,391 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /** The JavaScript half of text measurement; `@canvist/web` implements it with a canvas. */
5
+ export interface HostMeasurer {
6
+ addFont(id: number, css: string): void;
7
+ paintFont(id: number): string;
8
+ measure(
9
+ metrics: Uint32Array,
10
+ lineFonts: Uint32Array,
11
+ lineHeights: Float32Array,
12
+ fonts: Uint32Array,
13
+ text: string,
14
+ lengths: Uint32Array,
15
+ ): Float32Array;
16
+ }
17
+
18
+
19
+
20
+ /**
21
+ * One editor on one canvas.
22
+ */
23
+ export class WebEditor {
24
+ free(): void;
25
+ [Symbol.dispose](): void;
26
+ /**
27
+ * Body text's CSS `font` shorthand and colour, as `[font, color]`, for
28
+ * text the host draws over the canvas in the document's style, such as
29
+ * a placeholder.
30
+ */
31
+ bodyStyle(): string[];
32
+ /**
33
+ * Whether the named command would apply. Nothing changes.
34
+ */
35
+ can(name: string, args: string): boolean;
36
+ /**
37
+ * The rectangle of a caret at `path` and `offset` (UTF-16 code units),
38
+ * in document coordinates as `[x, y, width, height]`, or an empty array
39
+ * when the document has no such position or it is not laid out. Hosts
40
+ * draw collaborators' carets with it.
41
+ */
42
+ caretRectAt(path: Uint32Array, offset: number): Float32Array;
43
+ /**
44
+ * The caret's rectangle in document coordinates as `[x, y, width,
45
+ * height]`, or an empty array when the selection is not a caret. Hosts
46
+ * place IME windows and scroll the caret into view with it.
47
+ */
48
+ caretRect(): Float32Array;
49
+ /**
50
+ * The rectangles of the characters in UTF-16 range `start..end` of the
51
+ * head's text block, as `[x, y, width, height]` per character in
52
+ * document coordinates, for placing IME candidate windows.
53
+ */
54
+ characterBounds(start: number, end: number): Float32Array;
55
+ /**
56
+ * Commit the composition as `text`.
57
+ */
58
+ commitComposition(text: string): boolean;
59
+ /**
60
+ * The selection as `[html, text]` for the clipboard, or empty when
61
+ * nothing is selected.
62
+ */
63
+ copySelection(): string[];
64
+ /**
65
+ * Cut the selection, returning it as [`WebEditor::copy_selection`]
66
+ * does.
67
+ */
68
+ cutSelection(): string[];
69
+ /**
70
+ * Drop content at `(x, y)`: `html` when the source offered it, otherwise
71
+ * `text`. With `moving`, the content is this editor's own selection,
72
+ * dragged: it leaves its old place. A drop inside the dragged selection
73
+ * does nothing.
74
+ */
75
+ dropAt(x: number, y: number, html: string | null | undefined, text: string, moving: boolean): boolean;
76
+ /**
77
+ * The text an `EditContext` edits: the text block holding the
78
+ * selection's head, and the selection within it in UTF-16 code units, as
79
+ * `[text, start, end]`. A selection reaching into another block is
80
+ * clamped to this one. Empty when the head is not in a text block.
81
+ */
82
+ editContextState(): [text: string, start: number, end: number] | [];
83
+ /**
84
+ * The document as `format`.
85
+ */
86
+ export(format: string): string;
87
+ /**
88
+ * This editor's changes since the last call, as y-sync messages for the
89
+ * server.
90
+ */
91
+ flushSync(): Uint8Array[];
92
+ /**
93
+ * Font faces of `families` finished loading: forget only the
94
+ * measurements of fonts that list one of them, so the blocks using them
95
+ * lay out again on the next frame. Returns how many measured blocks were
96
+ * invalidated.
97
+ */
98
+ fontsLoaded(families: string[]): number;
99
+ /**
100
+ * The CSS `font` shorthand of every font the layout has used, indexed
101
+ * by font id.
102
+ */
103
+ fonts(): string[];
104
+ /**
105
+ * Forget every measurement, as when the device pixel ratio changes:
106
+ * browsers round font metrics to device pixels, so line positions can
107
+ * move. Blocks lay out again as they come into view.
108
+ */
109
+ forgetMeasurements(): void;
110
+ /**
111
+ * Lay out the viewport and paint whatever changed since the last frame.
112
+ * Returns what it did as `[height, shift, laidOut, measured, drawn,
113
+ * full, painted]`: `height` is the document's height in CSS px, `shift`
114
+ * how far content at the viewport's top moved (add it to the scroll
115
+ * position), and the flags are 0 or 1.
116
+ */
117
+ frame(): Float64Array;
118
+ /**
119
+ * The whole document laid out, as JSON: block rectangles, caret stops,
120
+ * and text runs (see the parity tests). Lays out every block first.
121
+ */
122
+ geometry(): string;
123
+ /**
124
+ * Lay out text in `families` but draw it invisibly, as browsers do
125
+ * during a `font-display` block period. Pass an empty list once the
126
+ * faces load or the period ends.
127
+ */
128
+ hideFamilies(families: string[]): void;
129
+ /**
130
+ * Server-rendered HTML for the document at the current width, as
131
+ * `[fragment, stylesheet]`: what SSR sends down, and what the
132
+ * accessibility mirror shows.
133
+ */
134
+ html(): string[];
135
+ /**
136
+ * Replace the selection with `text`, running input rules as typing
137
+ * does. Returns whether anything changed.
138
+ */
139
+ insertText(text: string): boolean;
140
+ /**
141
+ * Whether the document is a single empty text block, as a new one is.
142
+ * Hosts show a placeholder then.
143
+ */
144
+ isEmpty(): boolean;
145
+ /**
146
+ * Whether `(x, y)` is inside a non-empty selection, where a press starts
147
+ * dragging the selection rather than selecting.
148
+ */
149
+ isInSelection(x: number, y: number): boolean;
150
+ /**
151
+ * Whether the editor holds a shared document, as it does once the
152
+ * server's state has arrived.
153
+ */
154
+ isShared(): boolean;
155
+ /**
156
+ * Start joining a shared document as yrs client `client_id`, which must
157
+ * be unique among the room's peers. Returns the message to send the
158
+ * server first. The current document stays on screen until the
159
+ * server's state arrives in [`WebEditor::receive_sync`].
160
+ */
161
+ join(client_id: number): Uint8Array;
162
+ /**
163
+ * Run the key binding for `key`, a DOM `KeyboardEvent.key`, with
164
+ * `modifiers` (bits: 1 Shift, 2 Ctrl, 4 Alt, 8 Meta). Returns whether a
165
+ * binding applied; when none did, the host lets the browser handle the
166
+ * key.
167
+ */
168
+ keyDown(key: string, modifiers: number): boolean;
169
+ /**
170
+ * Replace the document with `input` read as `format` (`json`, `html`,
171
+ * `markdown`, or `text`).
172
+ */
173
+ load(format: string, input: string): void;
174
+ /**
175
+ * An editor painting on `canvas`, measuring through `measurer`, with the
176
+ * named extensions and JSON `options` (see `@canvist/web`'s
177
+ * `EditorOptions`).
178
+ */
179
+ constructor(canvas: HTMLCanvasElement, measurer: HostMeasurer, extensions: string[], options: string);
180
+ /**
181
+ * Paste HTML over the selection.
182
+ * Excessive nesting throws a `parse` error without changing the document.
183
+ */
184
+ pasteHtml(html: string): boolean;
185
+ /**
186
+ * Paste plain text over the selection; paste rules apply.
187
+ */
188
+ pasteText(text: string): boolean;
189
+ /**
190
+ * Press the pointer at document coordinates `(x, y)`. One click places
191
+ * the caret, or extends the selection with `extend`; two select a word
192
+ * and three the whole text block, and dragging afterwards extends by
193
+ * that unit.
194
+ */
195
+ pointerDown(x: number, y: number, extend: boolean, clicks: number): boolean;
196
+ /**
197
+ * Move a pressed pointer to `(x, y)`, extending the selection from the
198
+ * press.
199
+ */
200
+ pointerMove(x: number, y: number): boolean;
201
+ /**
202
+ * Release the pointer.
203
+ */
204
+ pointerUp(): void;
205
+ /**
206
+ * Answer the query an extension registered as `name`, as JSON.
207
+ */
208
+ query(name: string, args: string): string;
209
+ /**
210
+ * Handle one binary y-sync message from the server, as
211
+ * `[replies, changed]`: the messages to send back, and whether the
212
+ * document changed, in which case the next frame shows it.
213
+ */
214
+ receiveSync(message: Uint8Array): [replies: Uint8Array[], changed: boolean];
215
+ /**
216
+ * Redo the last undone change.
217
+ */
218
+ redo(): boolean;
219
+ /**
220
+ * Replace UTF-16 range `start..end` of the head's text block with
221
+ * `text`, as an input method or the platform's text input does. A
222
+ * replacement at a caret is typing, so input rules apply.
223
+ */
224
+ replaceText(start: number, end: number, text: string): boolean;
225
+ /**
226
+ * Size the canvas: `width` and `height` in CSS pixels, `scale` device
227
+ * pixels per CSS pixel, and the backing store in device pixels. The
228
+ * document is laid out to `width`.
229
+ */
230
+ resize(width: number, height: number, scale: number, pixel_width: number, pixel_height: number): void;
231
+ /**
232
+ * Run the command an extension registered as `name`, with JSON `args`
233
+ * (`null` for none). Returns whether it applied.
234
+ */
235
+ run(name: string, args: string): boolean;
236
+ /**
237
+ * Select from (`anchor_path`, `anchor_offset`) to (`head_path`,
238
+ * `head_offset`). Offsets count UTF-16 code units.
239
+ */
240
+ select(anchor_path: Uint32Array, anchor_offset: number, head_path: Uint32Array, head_offset: number): void;
241
+ /**
242
+ * The smallest rectangle around the selection in document coordinates,
243
+ * as `[x, y, width, height]`: the caret's rectangle for a caret, and
244
+ * empty while the selection is not laid out. Hosts anchor menus to it.
245
+ */
246
+ selectionBounds(): Float32Array;
247
+ /**
248
+ * The anchor and head as JSON positions, or `null` for a block
249
+ * selection.
250
+ */
251
+ selection(): string;
252
+ /**
253
+ * Snap border widths down to `scale` device pixels per CSS pixel, as
254
+ * this browser draws them, or not at all when `scale` is not positive.
255
+ */
256
+ setBorderScale(scale: number): void;
257
+ /**
258
+ * Blink the caret.
259
+ */
260
+ setCaretOn(on: boolean): void;
261
+ /**
262
+ * Show `text` as IME preedit text at the selection, replacing any
263
+ * earlier preedit.
264
+ */
265
+ setComposition(text: string): boolean;
266
+ /**
267
+ * Show or hide the caret: hosts call this on focus and blur.
268
+ */
269
+ setFocused(focused: boolean): void;
270
+ /**
271
+ * Snap text baselines and rectangle edges to the grid the browser
272
+ * snaps DOM content to: `"device"` pixels, or `"css"` pixels for
273
+ * Chromium laying out in CSS units on a high-density screen.
274
+ */
275
+ setPixelGrid(grid: string): void;
276
+ /**
277
+ * Scroll so document coordinate `top` is at the canvas's top edge.
278
+ */
279
+ setTop(top: number): void;
280
+ /**
281
+ * Measurement and cache statistics as JSON: cache hits and misses,
282
+ * cached bytes per font, and how many segments and batches the browser
283
+ * measured. The host derives the hit rate, so no float is formatted here
284
+ * (see `canvist_layout::css_number`).
285
+ */
286
+ stats(): string;
287
+ /**
288
+ * The whole document as an SVG image painted from the same display
289
+ * list as the canvas. Lays out every block first.
290
+ */
291
+ svg(): string;
292
+ /**
293
+ * The message to send a server on reconnecting: sync step 1, which asks
294
+ * for what this editor missed.
295
+ */
296
+ syncStart(): Uint8Array;
297
+ /**
298
+ * Undo the last change. A shared document undoes only this editor's
299
+ * own changes.
300
+ */
301
+ undo(): boolean;
302
+ }
303
+
304
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
305
+
306
+ export interface InitOutput {
307
+ readonly memory: WebAssembly.Memory;
308
+ readonly __wbg_webeditor_free: (a: number, b: number) => void;
309
+ readonly webeditor_bodyStyle: (a: number) => [number, number];
310
+ readonly webeditor_can: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
311
+ readonly webeditor_caretRect: (a: number) => [number, number];
312
+ readonly webeditor_caretRectAt: (a: number, b: number, c: number, d: number) => [number, number];
313
+ readonly webeditor_characterBounds: (a: number, b: number, c: number) => [number, number];
314
+ readonly webeditor_commitComposition: (a: number, b: number, c: number) => [number, number, number];
315
+ readonly webeditor_copySelection: (a: number) => [number, number, number, number];
316
+ readonly webeditor_cutSelection: (a: number) => [number, number, number, number];
317
+ readonly webeditor_dropAt: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
318
+ readonly webeditor_editContextState: (a: number) => any;
319
+ readonly webeditor_export: (a: number, b: number, c: number) => [number, number, number, number];
320
+ readonly webeditor_flushSync: (a: number) => [number, number, number];
321
+ readonly webeditor_fonts: (a: number) => [number, number];
322
+ readonly webeditor_fontsLoaded: (a: number, b: number, c: number) => number;
323
+ readonly webeditor_forgetMeasurements: (a: number) => void;
324
+ readonly webeditor_frame: (a: number) => [number, number, number, number];
325
+ readonly webeditor_geometry: (a: number) => [number, number, number, number];
326
+ readonly webeditor_hideFamilies: (a: number, b: number, c: number) => void;
327
+ readonly webeditor_html: (a: number) => [number, number];
328
+ readonly webeditor_insertText: (a: number, b: number, c: number) => [number, number, number];
329
+ readonly webeditor_isEmpty: (a: number) => number;
330
+ readonly webeditor_isInSelection: (a: number, b: number, c: number) => number;
331
+ readonly webeditor_isShared: (a: number) => number;
332
+ readonly webeditor_join: (a: number, b: number) => [number, number];
333
+ readonly webeditor_keyDown: (a: number, b: number, c: number, d: number) => [number, number, number];
334
+ readonly webeditor_load: (a: number, b: number, c: number, d: number, e: number) => [number, number];
335
+ readonly webeditor_new: (a: any, b: any, c: number, d: number, e: number, f: number) => [number, number, number];
336
+ readonly webeditor_pasteHtml: (a: number, b: number, c: number) => [number, number, number];
337
+ readonly webeditor_pasteText: (a: number, b: number, c: number) => [number, number, number];
338
+ readonly webeditor_pointerDown: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
339
+ readonly webeditor_pointerMove: (a: number, b: number, c: number) => [number, number, number];
340
+ readonly webeditor_pointerUp: (a: number) => void;
341
+ readonly webeditor_query: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
342
+ readonly webeditor_receiveSync: (a: number, b: number, c: number) => [number, number, number];
343
+ readonly webeditor_redo: (a: number) => [number, number, number];
344
+ readonly webeditor_replaceText: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
345
+ readonly webeditor_resize: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
346
+ readonly webeditor_run: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
347
+ readonly webeditor_select: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
348
+ readonly webeditor_selection: (a: number) => [number, number];
349
+ readonly webeditor_selectionBounds: (a: number) => [number, number];
350
+ readonly webeditor_setBorderScale: (a: number, b: number) => void;
351
+ readonly webeditor_setCaretOn: (a: number, b: number) => void;
352
+ readonly webeditor_setComposition: (a: number, b: number, c: number) => [number, number, number];
353
+ readonly webeditor_setFocused: (a: number, b: number) => void;
354
+ readonly webeditor_setPixelGrid: (a: number, b: number, c: number) => [number, number];
355
+ readonly webeditor_setTop: (a: number, b: number) => void;
356
+ readonly webeditor_stats: (a: number) => [number, number];
357
+ readonly webeditor_svg: (a: number) => [number, number, number, number];
358
+ readonly webeditor_syncStart: (a: number) => [number, number, number, number];
359
+ readonly webeditor_undo: (a: number) => [number, number, number];
360
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
361
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
362
+ readonly __wbindgen_exn_store: (a: number) => void;
363
+ readonly __externref_table_alloc: () => number;
364
+ readonly __wbindgen_externrefs: WebAssembly.Table;
365
+ readonly __externref_drop_slice: (a: number, b: number) => void;
366
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
367
+ readonly __externref_table_dealloc: (a: number) => void;
368
+ readonly __wbindgen_start: () => void;
369
+ }
370
+
371
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
372
+
373
+ /**
374
+ * Instantiates the given `module`, which can either be bytes or
375
+ * a precompiled `WebAssembly.Module`.
376
+ *
377
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
378
+ *
379
+ * @returns {InitOutput}
380
+ */
381
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
382
+
383
+ /**
384
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
385
+ * for everything else, calls `WebAssembly.instantiate` directly.
386
+ *
387
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
388
+ *
389
+ * @returns {Promise<InitOutput>}
390
+ */
391
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;