@aseity/idocs-preview 0.1.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/CHANGELOG.md +34 -0
- package/README.md +111 -14
- package/dist/core/display.d.ts +68 -6
- package/dist/core/engine.d.ts +1 -5
- package/dist/core/engine.js +12 -12
- package/dist/core/fonts.d.ts +10 -11
- package/dist/core/fonts.js +28 -14
- package/dist/core/index.d.ts +3 -8
- package/dist/core/index.js +41 -4
- package/dist/core/protocol.d.ts +37 -6
- package/dist/core/wire.d.ts +14 -0
- package/dist/core/wire.js +100 -0
- package/dist/view/find.js +1 -1
- package/dist/view/index.d.ts +7 -4
- package/dist/view/index.js +156 -25
- package/dist/view/selection.js +8 -7
- package/dist/view/shell.d.ts +2 -0
- package/dist/view/shell.js +53 -3
- package/package.json +3 -3
- package/wasm/hyphenation-licenses/LICENSE-APACHE +201 -0
- package/wasm/hyphenation-licenses/LICENSE-MIT +21 -0
- package/wasm/hyphenation-licenses/README.md +26 -0
- package/wasm/hyphenation-licenses/en-gb.tex +8615 -0
- package/wasm/hyphenation-licenses/en-us.tex +5018 -0
- package/wasm/hyphenation-licenses/ushyphex.tex +1454 -0
- package/wasm/idocs_wasm.d.ts +4 -4
- package/wasm/idocs_wasm.js +15 -7
- package/wasm/idocs_wasm_bg.wasm +0 -0
package/wasm/idocs_wasm.d.ts
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Returns `{status: "needs" | "ready" | "failed", json, images}`; see
|
|
5
|
+
* Returns `{status: "needs" | "ready" | "failed", json, data?, images}`; see
|
|
6
6
|
* `web/src/core/protocol.ts` for the JSON shapes. `measure(family,
|
|
7
|
-
* declaredFamily, bold, italic, text)
|
|
8
|
-
*
|
|
7
|
+
* declaredFamily, bold, italic, text, kern)` selects browser fonts and returns
|
|
8
|
+
* em widths and optional ascent/descent (the Worker uses OffscreenCanvas).
|
|
9
9
|
*/
|
|
10
|
-
export function openDocument(kind: string, bytes: Uint8Array, file_name: string, assets: Map<any, any>,
|
|
10
|
+
export function openDocument(kind: string, bytes: Uint8Array, file_name: string, assets: Map<any, any>, measure: Function, on_page?: Function | null): any;
|
|
11
11
|
|
|
12
12
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
13
13
|
|
package/wasm/idocs_wasm.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/* @ts-self-types="./idocs_wasm.d.ts" */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Returns `{status: "needs" | "ready" | "failed", json, images}`; see
|
|
4
|
+
* Returns `{status: "needs" | "ready" | "failed", json, data?, images}`; see
|
|
5
5
|
* `web/src/core/protocol.ts` for the JSON shapes. `measure(family,
|
|
6
|
-
* declaredFamily, bold, italic, text)
|
|
7
|
-
*
|
|
6
|
+
* declaredFamily, bold, italic, text, kern)` selects browser fonts and returns
|
|
7
|
+
* em widths and optional ascent/descent (the Worker uses OffscreenCanvas).
|
|
8
8
|
* @param {string} kind
|
|
9
9
|
* @param {Uint8Array} bytes
|
|
10
10
|
* @param {string} file_name
|
|
11
11
|
* @param {Map<any, any>} assets
|
|
12
|
-
* @param {
|
|
13
|
-
* @param {Function | null} [
|
|
12
|
+
* @param {Function} measure
|
|
13
|
+
* @param {Function | null} [on_page]
|
|
14
14
|
* @returns {any}
|
|
15
15
|
*/
|
|
16
|
-
export function openDocument(kind, bytes, file_name, assets,
|
|
16
|
+
export function openDocument(kind, bytes, file_name, assets, measure, on_page) {
|
|
17
17
|
const ptr0 = passStringToWasm0(kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
18
18
|
const len0 = WASM_VECTOR_LEN;
|
|
19
19
|
const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
20
20
|
const len1 = WASM_VECTOR_LEN;
|
|
21
21
|
const ptr2 = passStringToWasm0(file_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
22
22
|
const len2 = WASM_VECTOR_LEN;
|
|
23
|
-
const ret = wasm.openDocument(ptr0, len0, ptr1, len1, ptr2, len2, assets,
|
|
23
|
+
const ret = wasm.openDocument(ptr0, len0, ptr1, len1, ptr2, len2, assets, measure, isLikeNone(on_page) ? 0 : addToExternrefTable0(on_page));
|
|
24
24
|
return ret;
|
|
25
25
|
}
|
|
26
26
|
function __wbg_get_imports() {
|
|
@@ -46,6 +46,14 @@ function __wbg_get_imports() {
|
|
|
46
46
|
const ret = arg0.apply(arg1, arg2);
|
|
47
47
|
return ret;
|
|
48
48
|
}, arguments); },
|
|
49
|
+
__wbg_call_6bcf8d3e20937e46: function() { return handleError(function (arg0, arg1, arg2) {
|
|
50
|
+
const ret = arg0.call(arg1, arg2);
|
|
51
|
+
return ret;
|
|
52
|
+
}, arguments); },
|
|
53
|
+
__wbg_get_989d0a1309644f2b: function() { return handleError(function (arg0, arg1) {
|
|
54
|
+
const ret = Reflect.get(arg0, arg1);
|
|
55
|
+
return ret;
|
|
56
|
+
}, arguments); },
|
|
49
57
|
__wbg_get_a37df09994f49571: function(arg0, arg1) {
|
|
50
58
|
const ret = arg0.get(arg1);
|
|
51
59
|
return ret;
|
package/wasm/idocs_wasm_bg.wasm
CHANGED
|
Binary file
|