@aseity/idocs-preview 0.1.0 → 0.3.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 +40 -0
- package/README.md +142 -14
- package/dist/core/display.d.ts +68 -6
- package/dist/core/engine.d.ts +1 -5
- package/dist/core/engine.js +27 -14
- package/dist/core/fonts.d.ts +10 -11
- package/dist/core/fonts.js +28 -14
- package/dist/core/index.d.ts +5 -8
- package/dist/core/index.js +59 -5
- package/dist/core/protocol.d.ts +46 -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 +7 -4
- package/wasm/idocs_wasm.js +31 -7
- package/wasm/idocs_wasm_bg.wasm +0 -0
- package/wasm/idocs_wasm_bg.wasm.d.ts +1 -0
package/wasm/idocs_wasm.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
export function exportDocx(bytes: Uint8Array, file_name: string, assets: Map<any, any>, measure: Function): any;
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
|
-
* Returns `{status: "needs" | "ready" | "failed", json, images}`; see
|
|
7
|
+
* Returns `{status: "needs" | "ready" | "failed", json, data?, images}`; see
|
|
6
8
|
* `web/src/core/protocol.ts` for the JSON shapes. `measure(family,
|
|
7
|
-
* declaredFamily, bold, italic, text)
|
|
8
|
-
*
|
|
9
|
+
* declaredFamily, bold, italic, text, kern)` selects browser fonts and returns
|
|
10
|
+
* em widths and optional ascent/descent (the Worker uses OffscreenCanvas).
|
|
9
11
|
*/
|
|
10
|
-
export function openDocument(kind: string, bytes: Uint8Array, file_name: string, assets: Map<any, any>,
|
|
12
|
+
export function openDocument(kind: string, bytes: Uint8Array, file_name: string, assets: Map<any, any>, measure: Function, on_page?: Function | null): any;
|
|
11
13
|
|
|
12
14
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
13
15
|
|
|
14
16
|
export interface InitOutput {
|
|
15
17
|
readonly memory: WebAssembly.Memory;
|
|
18
|
+
readonly exportDocx: (a: number, b: number, c: number, d: number, e: any, f: any) => any;
|
|
16
19
|
readonly openDocument: (a: number, b: number, c: number, d: number, e: number, f: number, g: any, h: any, i: number) => any;
|
|
17
20
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
18
21
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
package/wasm/idocs_wasm.js
CHANGED
|
@@ -1,26 +1,42 @@
|
|
|
1
1
|
/* @ts-self-types="./idocs_wasm.d.ts" */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* @param {Uint8Array} bytes
|
|
5
|
+
* @param {string} file_name
|
|
6
|
+
* @param {Map<any, any>} assets
|
|
7
|
+
* @param {Function} measure
|
|
8
|
+
* @returns {any}
|
|
9
|
+
*/
|
|
10
|
+
export function exportDocx(bytes, file_name, assets, measure) {
|
|
11
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
12
|
+
const len0 = WASM_VECTOR_LEN;
|
|
13
|
+
const ptr1 = passStringToWasm0(file_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
14
|
+
const len1 = WASM_VECTOR_LEN;
|
|
15
|
+
const ret = wasm.exportDocx(ptr0, len0, ptr1, len1, assets, measure);
|
|
16
|
+
return ret;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Returns `{status: "needs" | "ready" | "failed", json, data?, images}`; see
|
|
5
21
|
* `web/src/core/protocol.ts` for the JSON shapes. `measure(family,
|
|
6
|
-
* declaredFamily, bold, italic, text)
|
|
7
|
-
*
|
|
22
|
+
* declaredFamily, bold, italic, text, kern)` selects browser fonts and returns
|
|
23
|
+
* em widths and optional ascent/descent (the Worker uses OffscreenCanvas).
|
|
8
24
|
* @param {string} kind
|
|
9
25
|
* @param {Uint8Array} bytes
|
|
10
26
|
* @param {string} file_name
|
|
11
27
|
* @param {Map<any, any>} assets
|
|
12
|
-
* @param {
|
|
13
|
-
* @param {Function | null} [
|
|
28
|
+
* @param {Function} measure
|
|
29
|
+
* @param {Function | null} [on_page]
|
|
14
30
|
* @returns {any}
|
|
15
31
|
*/
|
|
16
|
-
export function openDocument(kind, bytes, file_name, assets,
|
|
32
|
+
export function openDocument(kind, bytes, file_name, assets, measure, on_page) {
|
|
17
33
|
const ptr0 = passStringToWasm0(kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
18
34
|
const len0 = WASM_VECTOR_LEN;
|
|
19
35
|
const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
20
36
|
const len1 = WASM_VECTOR_LEN;
|
|
21
37
|
const ptr2 = passStringToWasm0(file_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
22
38
|
const len2 = WASM_VECTOR_LEN;
|
|
23
|
-
const ret = wasm.openDocument(ptr0, len0, ptr1, len1, ptr2, len2, assets,
|
|
39
|
+
const ret = wasm.openDocument(ptr0, len0, ptr1, len1, ptr2, len2, assets, measure, isLikeNone(on_page) ? 0 : addToExternrefTable0(on_page));
|
|
24
40
|
return ret;
|
|
25
41
|
}
|
|
26
42
|
function __wbg_get_imports() {
|
|
@@ -46,6 +62,14 @@ function __wbg_get_imports() {
|
|
|
46
62
|
const ret = arg0.apply(arg1, arg2);
|
|
47
63
|
return ret;
|
|
48
64
|
}, arguments); },
|
|
65
|
+
__wbg_call_6bcf8d3e20937e46: function() { return handleError(function (arg0, arg1, arg2) {
|
|
66
|
+
const ret = arg0.call(arg1, arg2);
|
|
67
|
+
return ret;
|
|
68
|
+
}, arguments); },
|
|
69
|
+
__wbg_get_989d0a1309644f2b: function() { return handleError(function (arg0, arg1) {
|
|
70
|
+
const ret = Reflect.get(arg0, arg1);
|
|
71
|
+
return ret;
|
|
72
|
+
}, arguments); },
|
|
49
73
|
__wbg_get_a37df09994f49571: function(arg0, arg1) {
|
|
50
74
|
const ret = arg0.get(arg1);
|
|
51
75
|
return ret;
|
package/wasm/idocs_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const exportDocx: (a: number, b: number, c: number, d: number, e: any, f: any) => any;
|
|
4
5
|
export const openDocument: (a: number, b: number, c: number, d: number, e: number, f: number, g: any, h: any, i: number) => any;
|
|
5
6
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
6
7
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|