quickwin 3.0.1 → 3.0.3
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/README.en.md +3 -0
- package/README.md +2 -0
- package/package.json +2 -3
- package/qwin-nowasm-x86.exe +0 -0
- package/qwin-nowasm.exe +0 -0
- package/qwin-x86.exe +0 -0
- package/qwin.exe +0 -0
- package/examples/PdfCanvas.js +0 -38
- package/examples/PdfCanvas.tsx +0 -54
- package/examples/execd/main.js +0 -23379
- package/examples/execd/tray.js +0 -192
- package/examples/execd/worker.js +0 -122
- package/examples/pdf_preview2.js +0 -398
- package/examples/pdf_preview2.ts +0 -353
- package/examples/pdf_viewer.js +0 -22515
- package/examples/pdf_viewer.tsx +0 -228
- package/examples/test_gallery.js +0 -18692
- package/examples/test_gallery.tsx +0 -291
- package/examples/test_react_lazy.js +0 -18560
- package/examples/test_react_lazy.tsx +0 -65
- package/examples/test_react_listbox.js +0 -18562
- package/examples/test_react_listbox.tsx +0 -73
- package/examples/test_root_window.js +0 -18532
- package/examples/test_root_window.tsx +0 -41
- package/examples/test_tab.js +0 -18563
- package/examples/test_tab.tsx +0 -77
- package/examples/tray_demo.js +0 -86
- package/examples/tray_demo.tsx +0 -89
- package/test/add.wasm +0 -0
- package/test/bench_ffi_callraw.js +0 -235
- package/test/bench_ffi_callraw.ts +0 -235
- package/test/bench_ffi_overhead.js +0 -139
- package/test/bench_ffi_overhead.ts +0 -141
- package/test/bench_sendmessage.js +0 -104
- package/test/bench_sendmessage.ts +0 -100
- package/test/bench_sendmessage_nonnull.js +0 -187
- package/test/bench_sendmessage_nonnull.ts +0 -188
- package/test/complex.wasm +0 -0
- package/test/complex_imports.wasm +0 -0
- package/test/debug/http_server_e2e.js +0 -31
- package/test/debug/minwasm.js +0 -52
- package/test/debug/mupdf_debug.js +0 -86
- package/test/debug/wasm.js +0 -122
- package/test/debug/wasm_export_debug.js +0 -54
- package/test/debug/wasm_names.js +0 -36
- package/test/example.pdf +0 -0
- package/test/global_imports.wasm +0 -0
- package/test/import_func.wasm +0 -0
- package/test/imports.wasm +0 -0
- package/test/mupdf-cdn.js +0 -40
- package/test/mupdf-cdn.ts +0 -43
- package/test/run.js +0 -111
- package/test/run.ts +0 -116
- package/test/sjlj.wasm +0 -0
- package/test/test_basic.js +0 -7
- package/test/test_basic.ts +0 -9
- package/test/test_basic_fetch.js +0 -63
- package/test/test_basic_fetch.ts +0 -59
- package/test/test_brotli.js +0 -48
- package/test/test_brotli.ts +0 -52
- package/test/test_fetch_cache.js +0 -169
- package/test/test_fetch_cache.ts +0 -187
- package/test/test_ffi.js +0 -157
- package/test/test_ffi.ts +0 -170
- package/test/test_ffi_abi.js +0 -290
- package/test/test_ffi_abi.ts +0 -274
- package/test/test_ffi_array.js +0 -116
- package/test/test_ffi_array.ts +0 -141
- package/test/test_ffi_bind.js +0 -656
- package/test/test_ffi_bind.ts +0 -670
- package/test/test_ffi_struct.js +0 -779
- package/test/test_ffi_struct.ts +0 -828
- package/test/test_ffi_struct_layout.js +0 -495
- package/test/test_ffi_struct_layout.ts +0 -543
- package/test/test_ffi_user32.js +0 -103
- package/test/test_ffi_user32.ts +0 -113
- package/test/test_ffi_windows.js +0 -172
- package/test/test_ffi_windows.ts +0 -187
- package/test/test_files.js +0 -102
- package/test/test_files.ts +0 -121
- package/test/test_frame_encoding.js +0 -128
- package/test/test_frame_encoding.ts +0 -132
- package/test/test_gdi_draw.js +0 -681
- package/test/test_gdi_draw.ts +0 -725
- package/test/test_helper.js +0 -91
- package/test/test_helper.ts +0 -88
- package/test/test_http_import.js +0 -96
- package/test/test_http_import.ts +0 -93
- package/test/test_http_server.js +0 -214
- package/test/test_http_server.ts +0 -211
- package/test/test_import_dir.js +0 -4
- package/test/test_import_dir.ts +0 -5
- package/test/test_ipv6.js +0 -134
- package/test/test_ipv6.ts +0 -130
- package/test/test_jsx.js +0 -1314
- package/test/test_meta_url.js +0 -3
- package/test/test_meta_url.ts +0 -4
- package/test/test_mupdf_render.js +0 -51
- package/test/test_mupdf_render.ts +0 -55
- package/test/test_mupdf_twice.js +0 -62
- package/test/test_mupdf_twice.ts +0 -65
- package/test/test_mupdf_wasm.js +0 -39
- package/test/test_mupdf_wasm.ts +0 -32
- package/test/test_net_event.js +0 -57
- package/test/test_net_event.ts +0 -56
- package/test/test_net_fetch.js +0 -384
- package/test/test_net_fetch.ts +0 -373
- package/test/test_net_websocket.js +0 -180
- package/test/test_net_websocket.ts +0 -164
- package/test/test_polyfill.js +0 -144
- package/test/test_polyfill.ts +0 -159
- package/test/test_printer.js +0 -137
- package/test/test_printer.ts +0 -148
- package/test/test_proc.js +0 -141
- package/test/test_proc.ts +0 -163
- package/test/test_react_complex.js +0 -18678
- package/test/test_react_counter.js +0 -18555
- package/test/test_react_flex.js +0 -18871
- package/test/test_react_hidden.js +0 -18560
- package/test/test_react_listview_link.js +0 -18590
- package/test/test_react_notify.js +0 -18797
- package/test/test_react_render.js +0 -18550
- package/test/test_registry.js +0 -74
- package/test/test_registry.ts +0 -95
- package/test/test_sysinfo.js +0 -122
- package/test/test_sysinfo.ts +0 -141
- package/test/test_url.js +0 -173
- package/test/test_url.ts +0 -183
- package/test/test_wasm_basic.js +0 -85
- package/test/test_wasm_basic.ts +0 -73
- package/test/test_wasm_import_global.js +0 -41
- package/test/test_wasm_import_global.ts +0 -45
- package/test/test_wasm_sjlj.js +0 -145
- package/test/test_wasm_sjlj.ts +0 -125
- package/test/test_wasm_types.js +0 -97
- package/test/test_wasm_types.ts +0 -124
- package/test/test_wolfssl_read.js +0 -203
- package/test/test_wolfssl_read.ts +0 -184
- package/test/test_worker.js +0 -21
- package/test/test_worker.ts +0 -24
- package/test/test_worker_concurrent.js +0 -45
- package/test/test_worker_concurrent.ts +0 -56
- package/test/test_worker_data_url.js +0 -46
- package/test/test_worker_data_url.ts +0 -51
- package/test/test_worker_fetch.js +0 -26
- package/test/test_worker_fetch.ts +0 -27
- package/test/test_worker_net.js +0 -69
- package/test/test_worker_net.ts +0 -66
- package/test/test_worker_wasm_concurrent.js +0 -44
- package/test/test_worker_wasm_concurrent.ts +0 -45
- package/test/types.wasm +0 -0
- package/test/worker_fetch.js +0 -13
- package/test/worker_fetch.ts +0 -13
- package/test/worker_helper.js +0 -1
- package/test/worker_helper.ts +0 -1
- package/test/worker_http.js +0 -18
- package/test/worker_http.ts +0 -20
- package/test/worker_import_lib.js +0 -12
- package/test/worker_import_lib.ts +0 -13
- package/test/worker_module.js +0 -16
- package/test/worker_module.ts +0 -17
- package/test/worker_wasm_concurrent.js +0 -22
- package/test/worker_wasm_concurrent.ts +0 -22
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Tester, readWasmFile } from './test_helper.js'
|
|
2
|
-
import * as os from 'os'
|
|
3
|
-
|
|
4
|
-
export const suite = {
|
|
5
|
-
name: 'worker-wasm',
|
|
6
|
-
run: async (t: Tester) => {
|
|
7
|
-
const wasmBuf = readWasmFile('./add.wasm')
|
|
8
|
-
if (!wasmBuf) { t.fail++; return }
|
|
9
|
-
|
|
10
|
-
const complexBuf = readWasmFile('./complex.wasm')
|
|
11
|
-
if (!complexBuf) { t.fail++; return }
|
|
12
|
-
|
|
13
|
-
t.section('concurrent')
|
|
14
|
-
|
|
15
|
-
const worker = new os.Worker('./worker_wasm_concurrent.js')
|
|
16
|
-
const workerResult = new Promise<any>((resolve, reject) => {
|
|
17
|
-
const timer = os.setTimeout(() => reject(new Error('worker timeout')), 5000)
|
|
18
|
-
worker.onmessage = (e: any) => {
|
|
19
|
-
os.clearTimeout(timer)
|
|
20
|
-
resolve(e.data)
|
|
21
|
-
}
|
|
22
|
-
worker.postMessage({
|
|
23
|
-
type: 'start',
|
|
24
|
-
wasmBuf,
|
|
25
|
-
calls: [['add', [1, 2]], ['add', [10, 20]]]
|
|
26
|
-
})
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
const mainMod = new WebAssembly.Module(wasmBuf)
|
|
30
|
-
const mainInst = new WebAssembly.Instance<{ add: (a: number, b: number) => number }>(mainMod)
|
|
31
|
-
const mainExp = mainInst.exports
|
|
32
|
-
const mainR1 = mainExp.add(1, 2)
|
|
33
|
-
const mainR2 = mainExp.add(10, 20)
|
|
34
|
-
|
|
35
|
-
const wr = await workerResult
|
|
36
|
-
t.check('main add(1, 2)', 3, mainR1)
|
|
37
|
-
t.check('main add(10, 20)', 30, mainR2)
|
|
38
|
-
t.check('worker ok', true, wr.ok)
|
|
39
|
-
t.check('worker add(1, 2)', 3, wr.results[0])
|
|
40
|
-
t.check('worker add(10, 20)', 30, wr.results[1])
|
|
41
|
-
|
|
42
|
-
worker.postMessage({ type: 'done' })
|
|
43
|
-
worker.onmessage = null
|
|
44
|
-
}
|
|
45
|
-
}
|
package/test/types.wasm
DELETED
|
Binary file
|
package/test/worker_fetch.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import '../lib/fetch.js';
|
|
2
|
-
import * as os from 'os';
|
|
3
|
-
const parent = os.Worker.parent;
|
|
4
|
-
parent.onmessage = (e) => {
|
|
5
|
-
if (e.data.type === 'start') {
|
|
6
|
-
fetch('http://localhost:18923/')
|
|
7
|
-
.then(r => parent.postMessage({ type: 'result', ok: r.ok, status: r.status }))
|
|
8
|
-
.catch(err => parent.postMessage({ type: 'error', msg: String(err) }));
|
|
9
|
-
}
|
|
10
|
-
else if (e.data.type === 'done') {
|
|
11
|
-
parent.onmessage = null;
|
|
12
|
-
}
|
|
13
|
-
};
|
package/test/worker_fetch.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import '../lib/fetch.js'
|
|
2
|
-
import * as os from 'os'
|
|
3
|
-
const parent = os.Worker.parent
|
|
4
|
-
|
|
5
|
-
parent.onmessage = (e: any) => {
|
|
6
|
-
if (e.data.type === 'start') {
|
|
7
|
-
fetch('http://localhost:18923/')
|
|
8
|
-
.then(r => parent.postMessage({ type: 'result', ok: r.ok, status: r.status }))
|
|
9
|
-
.catch(err => parent.postMessage({ type: 'error', msg: String(err) }))
|
|
10
|
-
} else if (e.data.type === 'done') {
|
|
11
|
-
parent.onmessage = null
|
|
12
|
-
}
|
|
13
|
-
}
|
package/test/worker_helper.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const value = 42;
|
package/test/worker_helper.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const value = 42
|
package/test/worker_http.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as os from 'os';
|
|
2
|
-
// Use variable to bypass compiler's static module resolution
|
|
3
|
-
const url = 'https://esm.sh/' + 'isarray';
|
|
4
|
-
const { default: isArray } = await import(url);
|
|
5
|
-
const parent = os.Worker.parent;
|
|
6
|
-
parent.onmessage = (e) => {
|
|
7
|
-
const d = e.data;
|
|
8
|
-
if (d.type === 'start') {
|
|
9
|
-
parent.postMessage({
|
|
10
|
-
type: 'result',
|
|
11
|
-
isArrayWorks: isArray([]) === true,
|
|
12
|
-
isArrayRejects: isArray({}) === false,
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
else if (d.type === 'done') {
|
|
16
|
-
parent.onmessage = null;
|
|
17
|
-
}
|
|
18
|
-
};
|
package/test/worker_http.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as os from 'os'
|
|
2
|
-
|
|
3
|
-
// Use variable to bypass compiler's static module resolution
|
|
4
|
-
const url = 'https://esm.sh/' + 'isarray'
|
|
5
|
-
const { default: isArray } = await import(url)
|
|
6
|
-
|
|
7
|
-
const parent = os.Worker.parent
|
|
8
|
-
|
|
9
|
-
parent.onmessage = (e) => {
|
|
10
|
-
const d = e.data as { type: string; [key: string]: unknown }
|
|
11
|
-
if (d.type === 'start') {
|
|
12
|
-
parent.postMessage({
|
|
13
|
-
type: 'result',
|
|
14
|
-
isArrayWorks: isArray([]) === true,
|
|
15
|
-
isArrayRejects: isArray({}) === false,
|
|
16
|
-
})
|
|
17
|
-
} else if (d.type === 'done') {
|
|
18
|
-
parent.onmessage = null
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as os from 'os';
|
|
2
|
-
import { value } from './worker_helper.js';
|
|
3
|
-
const parent = os.Worker.parent;
|
|
4
|
-
parent.onmessage = (e) => {
|
|
5
|
-
const d = e.data;
|
|
6
|
-
if (d.type === 'start') {
|
|
7
|
-
parent.postMessage({ type: 'result', value });
|
|
8
|
-
}
|
|
9
|
-
else if (d.type === 'done') {
|
|
10
|
-
parent.onmessage = null;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as os from 'os'
|
|
2
|
-
import { value } from './worker_helper.js'
|
|
3
|
-
|
|
4
|
-
const parent = os.Worker.parent
|
|
5
|
-
|
|
6
|
-
parent.onmessage = (e) => {
|
|
7
|
-
const d = e.data as { type: string }
|
|
8
|
-
if (d.type === 'start') {
|
|
9
|
-
parent.postMessage({ type: 'result', value })
|
|
10
|
-
} else if (d.type === 'done') {
|
|
11
|
-
parent.onmessage = null
|
|
12
|
-
}
|
|
13
|
-
}
|
package/test/worker_module.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as os from 'os';
|
|
2
|
-
import { value } from './worker_helper.js';
|
|
3
|
-
const parent = os.Worker.parent;
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
// console.log('Hello from worker', globalThis)
|
|
6
|
-
parent.onmessage = (e) => {
|
|
7
|
-
console.log(e);
|
|
8
|
-
const d = e.data;
|
|
9
|
-
if (d.type === 'start') {
|
|
10
|
-
console.log(d.type);
|
|
11
|
-
parent.postMessage({ type: 'result', value });
|
|
12
|
-
}
|
|
13
|
-
else if (d.type === 'done') {
|
|
14
|
-
parent.onmessage = null;
|
|
15
|
-
}
|
|
16
|
-
};
|
package/test/worker_module.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as os from 'os'
|
|
2
|
-
import { value } from './worker_helper.js'
|
|
3
|
-
|
|
4
|
-
const parent = os.Worker.parent
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
// console.log('Hello from worker', globalThis)
|
|
7
|
-
|
|
8
|
-
parent.onmessage = (e) => {
|
|
9
|
-
console.log(e)
|
|
10
|
-
const d = e.data as { type: string }
|
|
11
|
-
if (d.type === 'start') {
|
|
12
|
-
console.log(d.type)
|
|
13
|
-
parent.postMessage({ type: 'result', value })
|
|
14
|
-
} else if (d.type === 'done') {
|
|
15
|
-
parent.onmessage = null
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as os from 'os';
|
|
2
|
-
const parent = os.Worker.parent;
|
|
3
|
-
parent.onmessage = (e) => {
|
|
4
|
-
const d = e.data;
|
|
5
|
-
if (d.type === 'start') {
|
|
6
|
-
try {
|
|
7
|
-
const mod = new WebAssembly.Module(d.wasmBuf);
|
|
8
|
-
const inst = new WebAssembly.Instance(mod, d.imports || {});
|
|
9
|
-
const results = [];
|
|
10
|
-
for (const [name, args] of d.calls) {
|
|
11
|
-
results.push(inst.exports[name](...args));
|
|
12
|
-
}
|
|
13
|
-
parent.postMessage({ ok: true, results });
|
|
14
|
-
}
|
|
15
|
-
catch (err) {
|
|
16
|
-
parent.postMessage({ ok: false, error: String(err) });
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
else if (d.type === 'done') {
|
|
20
|
-
parent.onmessage = null;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as os from 'os'
|
|
2
|
-
|
|
3
|
-
const parent = os.Worker.parent
|
|
4
|
-
|
|
5
|
-
parent.onmessage = (e) => {
|
|
6
|
-
const d = e.data as { type: string; wasmBuf: ArrayBuffer; imports?: Record<string, unknown>; calls: [string, unknown[]][] }
|
|
7
|
-
if (d.type === 'start') {
|
|
8
|
-
try {
|
|
9
|
-
const mod = new WebAssembly.Module(d.wasmBuf)
|
|
10
|
-
const inst = new WebAssembly.Instance(mod, d.imports || {})
|
|
11
|
-
const results: number[] = []
|
|
12
|
-
for (const [name, args] of d.calls) {
|
|
13
|
-
results.push((inst.exports[name] as Function)(...args))
|
|
14
|
-
}
|
|
15
|
-
parent.postMessage({ ok: true, results })
|
|
16
|
-
} catch (err) {
|
|
17
|
-
parent.postMessage({ ok: false, error: String(err) })
|
|
18
|
-
}
|
|
19
|
-
} else if (d.type === 'done') {
|
|
20
|
-
parent.onmessage = null
|
|
21
|
-
}
|
|
22
|
-
}
|