@kreuzberg/wasm 4.4.1 → 4.4.2
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.md +1 -1
- package/dist/extraction/batch.d.ts +7 -4
- package/dist/extraction/batch.d.ts.map +1 -1
- package/dist/extraction/bytes.d.ts +7 -4
- package/dist/extraction/bytes.d.ts.map +1 -1
- package/dist/index.js +192 -7
- package/dist/index.js.map +1 -1
- package/dist/initialization/wasm-loader.d.ts.map +1 -1
- package/dist/ocr/enabler.d.ts.map +1 -1
- package/dist/ocr/ocr-worker.d.ts +23 -0
- package/dist/ocr/ocr-worker.d.ts.map +1 -0
- package/dist/ocr/ocr-worker.js +78 -0
- package/dist/ocr/ocr-worker.js.map +1 -0
- package/dist/ocr/worker-bridge.d.ts +29 -0
- package/dist/ocr/worker-bridge.d.ts.map +1 -0
- package/dist/pkg/README.md +1 -1
- package/dist/pkg/kreuzberg_wasm.js +12 -12
- package/dist/pkg/kreuzberg_wasm_bg.js +12 -12
- package/dist/pkg/kreuzberg_wasm_bg.wasm +0 -0
- package/dist/pkg/kreuzberg_wasm_bg.wasm.d.ts +5 -5
- package/package.json +120 -120
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasm-loader.d.ts","sourceRoot":"","sources":["../../typescript/initialization/wasm-loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;CAChC;AA+BD,OAAO,EACN,sBAAsB,EAEtB,aAAa,EACb,aAAa,EACb,KAAK,UAAU,EAKf,KAAK,UAAU,EACf,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AAEvC;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB;;;;;GAKG;AACH,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAElC;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAWnC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,wBAAsB,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"wasm-loader.d.ts","sourceRoot":"","sources":["../../typescript/initialization/wasm-loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;CAChC;AA+BD,OAAO,EACN,sBAAsB,EAEtB,aAAa,EACb,aAAa,EACb,KAAK,UAAU,EAKf,KAAK,UAAU,EACf,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AAEvC;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB;;;;;GAKG;AACH,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAElC;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAWnC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,wBAAsB,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAsFvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enabler.d.ts","sourceRoot":"","sources":["../../typescript/ocr/enabler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"enabler.d.ts","sourceRoot":"","sources":["../../typescript/ocr/enabler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAsMH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAkC/C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OCR Worker Script
|
|
3
|
+
*
|
|
4
|
+
* Runs ocrRecognize() in a worker thread so the main event loop stays responsive.
|
|
5
|
+
* Supports both Node.js worker_threads and browser Web Workers.
|
|
6
|
+
*
|
|
7
|
+
* Protocol:
|
|
8
|
+
* - Node.js: receives init data via workerData, auto-initializes WASM
|
|
9
|
+
* - Browser: waits for { type: 'init', wasmGluePath, wasmBinary? } message
|
|
10
|
+
* - Posts { type: 'ready' } when WASM is initialized
|
|
11
|
+
* - Receives { type: 'ocr', id, imageData, tessdata, language }
|
|
12
|
+
* - Posts { type: 'result', id, text } or { type: 'error', id, error }
|
|
13
|
+
*/
|
|
14
|
+
interface OcrWasm {
|
|
15
|
+
ocrRecognize(imageBytes: Uint8Array, tessdata: Uint8Array, language: string): string;
|
|
16
|
+
default(input?: BufferSource | WebAssembly.Module): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
declare let wasm: OcrWasm | null;
|
|
19
|
+
declare let postFn: (data: unknown) => void;
|
|
20
|
+
declare function initWasm(wasmGluePath: string, wasmBinary?: ArrayBufferLike): Promise<void>;
|
|
21
|
+
declare function onMessage(msg: Record<string, unknown>): void;
|
|
22
|
+
declare function bootstrap(): Promise<void>;
|
|
23
|
+
//# sourceMappingURL=ocr-worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ocr-worker.d.ts","sourceRoot":"","sources":["../../typescript/ocr/ocr-worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,UAAU,OAAO;IAChB,YAAY,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IACrF,OAAO,CAAC,KAAK,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE;AAED,QAAA,IAAI,IAAI,EAAE,OAAO,GAAG,IAAW,CAAC;AAEhC,QAAA,IAAI,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAE9B,CAAC;AAEF,iBAAe,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAWzF;AAED,iBAAS,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CA0BrD;AAED,iBAAe,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAsBxC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// typescript/ocr/ocr-worker.ts
|
|
2
|
+
var wasm = null;
|
|
3
|
+
var postFn = () => {
|
|
4
|
+
throw new Error("Worker message handler not initialized");
|
|
5
|
+
};
|
|
6
|
+
async function initWasm(wasmGluePath, wasmBinary) {
|
|
7
|
+
const glue = await import(
|
|
8
|
+
/* @vite-ignore */
|
|
9
|
+
wasmGluePath
|
|
10
|
+
);
|
|
11
|
+
if (typeof glue.default === "function") {
|
|
12
|
+
if (wasmBinary) {
|
|
13
|
+
await glue.default(wasmBinary);
|
|
14
|
+
} else {
|
|
15
|
+
await glue.default();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
wasm = glue;
|
|
19
|
+
postFn({ type: "ready" });
|
|
20
|
+
}
|
|
21
|
+
function onMessage(msg) {
|
|
22
|
+
switch (msg["type"]) {
|
|
23
|
+
case "init":
|
|
24
|
+
initWasm(msg["wasmGluePath"], msg["wasmBinary"]).catch((e) => {
|
|
25
|
+
postFn({ type: "init-error", error: e instanceof Error ? e.message : String(e) });
|
|
26
|
+
});
|
|
27
|
+
break;
|
|
28
|
+
case "ocr": {
|
|
29
|
+
const id = msg["id"];
|
|
30
|
+
if (!wasm) {
|
|
31
|
+
postFn({ type: "error", id, error: "WASM OCR not initialized" });
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
const text = wasm.ocrRecognize(
|
|
36
|
+
msg["imageData"],
|
|
37
|
+
msg["tessdata"],
|
|
38
|
+
msg["language"]
|
|
39
|
+
);
|
|
40
|
+
postFn({ type: "result", id, text });
|
|
41
|
+
} catch (e) {
|
|
42
|
+
postFn({ type: "error", id, error: e instanceof Error ? e.message : String(e) });
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async function bootstrap() {
|
|
49
|
+
const isNodeEnv = typeof process !== "undefined" && !!process.versions?.node;
|
|
50
|
+
if (isNodeEnv) {
|
|
51
|
+
const { parentPort, workerData } = await import(
|
|
52
|
+
/* @vite-ignore */
|
|
53
|
+
"worker_threads"
|
|
54
|
+
);
|
|
55
|
+
if (!parentPort) throw new Error("ocr-worker must be run as a worker thread");
|
|
56
|
+
postFn = (data) => parentPort.postMessage(data);
|
|
57
|
+
parentPort.on("message", (msg) => onMessage(msg));
|
|
58
|
+
const wd = workerData;
|
|
59
|
+
if (wd?.wasmGluePath) {
|
|
60
|
+
await initWasm(wd.wasmGluePath, wd.wasmBinary);
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
const self_ = globalThis;
|
|
64
|
+
postFn = (data) => self_.postMessage(data);
|
|
65
|
+
self_.onmessage = (e) => onMessage(e.data);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
bootstrap().catch((e) => {
|
|
69
|
+
try {
|
|
70
|
+
if (typeof process !== "undefined" && process.stderr) {
|
|
71
|
+
process.stderr.write(`[ocr-worker] bootstrap failed: ${e}
|
|
72
|
+
`);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
} catch {
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=ocr-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../typescript/ocr/ocr-worker.ts"],"sourcesContent":["/**\n * OCR Worker Script\n *\n * Runs ocrRecognize() in a worker thread so the main event loop stays responsive.\n * Supports both Node.js worker_threads and browser Web Workers.\n *\n * Protocol:\n * - Node.js: receives init data via workerData, auto-initializes WASM\n * - Browser: waits for { type: 'init', wasmGluePath, wasmBinary? } message\n * - Posts { type: 'ready' } when WASM is initialized\n * - Receives { type: 'ocr', id, imageData, tessdata, language }\n * - Posts { type: 'result', id, text } or { type: 'error', id, error }\n */\n\ninterface OcrWasm {\n\tocrRecognize(imageBytes: Uint8Array, tessdata: Uint8Array, language: string): string;\n\tdefault(input?: BufferSource | WebAssembly.Module): Promise<void>;\n}\n\nlet wasm: OcrWasm | null = null;\n\nlet postFn: (data: unknown) => void = () => {\n\tthrow new Error(\"Worker message handler not initialized\");\n};\n\nasync function initWasm(wasmGluePath: string, wasmBinary?: ArrayBufferLike): Promise<void> {\n\tconst glue = (await import(/* @vite-ignore */ wasmGluePath)) as OcrWasm;\n\tif (typeof glue.default === \"function\") {\n\t\tif (wasmBinary) {\n\t\t\tawait glue.default(wasmBinary);\n\t\t} else {\n\t\t\tawait glue.default();\n\t\t}\n\t}\n\twasm = glue;\n\tpostFn({ type: \"ready\" });\n}\n\nfunction onMessage(msg: Record<string, unknown>): void {\n\tswitch (msg[\"type\"]) {\n\t\tcase \"init\":\n\t\t\tinitWasm(msg[\"wasmGluePath\"] as string, msg[\"wasmBinary\"] as ArrayBufferLike | undefined).catch((e: unknown) => {\n\t\t\t\tpostFn({ type: \"init-error\", error: e instanceof Error ? e.message : String(e) });\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"ocr\": {\n\t\t\tconst id = msg[\"id\"] as number;\n\t\t\tif (!wasm) {\n\t\t\t\tpostFn({ type: \"error\", id, error: \"WASM OCR not initialized\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst text = wasm.ocrRecognize(\n\t\t\t\t\tmsg[\"imageData\"] as Uint8Array,\n\t\t\t\t\tmsg[\"tessdata\"] as Uint8Array,\n\t\t\t\t\tmsg[\"language\"] as string,\n\t\t\t\t);\n\t\t\t\tpostFn({ type: \"result\", id, text });\n\t\t\t} catch (e: unknown) {\n\t\t\t\tpostFn({ type: \"error\", id, error: e instanceof Error ? e.message : String(e) });\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nasync function bootstrap(): Promise<void> {\n\tconst isNodeEnv = typeof process !== \"undefined\" && !!process.versions?.node;\n\n\tif (isNodeEnv) {\n\t\tconst { parentPort, workerData } = await import(/* @vite-ignore */ \"node:worker_threads\");\n\t\tif (!parentPort) throw new Error(\"ocr-worker must be run as a worker thread\");\n\n\t\tpostFn = (data: unknown) => parentPort.postMessage(data);\n\t\tparentPort.on(\"message\", (msg: Record<string, unknown>) => onMessage(msg));\n\n\t\t// Node.js: init data arrives via workerData\n\t\tconst wd = workerData as { wasmGluePath?: string; wasmBinary?: ArrayBufferLike } | null;\n\t\tif (wd?.wasmGluePath) {\n\t\t\tawait initWasm(wd.wasmGluePath, wd.wasmBinary);\n\t\t}\n\t} else {\n\t\t// Browser Web Worker\n\t\tconst self_ = globalThis as unknown as DedicatedWorkerGlobalScope;\n\t\tpostFn = (data: unknown) => self_.postMessage(data);\n\t\tself_.onmessage = (e: MessageEvent) => onMessage(e.data as Record<string, unknown>);\n\t\t// Browser: waits for 'init' message from main thread\n\t}\n}\n\nbootstrap().catch((e: unknown) => {\n\ttry {\n\t\tif (typeof process !== \"undefined\" && process.stderr) {\n\t\t\tprocess.stderr.write(`[ocr-worker] bootstrap failed: ${e}\\n`);\n\t\t\tprocess.exit(1);\n\t\t}\n\t} catch {\n\t\t// Nothing we can do\n\t}\n});\n"],"mappings":";AAmBA,IAAI,OAAuB;AAE3B,IAAI,SAAkC,MAAM;AAC3C,QAAM,IAAI,MAAM,wCAAwC;AACzD;AAEA,eAAe,SAAS,cAAsB,YAA6C;AAC1F,QAAM,OAAQ,MAAM;AAAA;AAAA,IAA0B;AAAA;AAC9C,MAAI,OAAO,KAAK,YAAY,YAAY;AACvC,QAAI,YAAY;AACf,YAAM,KAAK,QAAQ,UAAU;AAAA,IAC9B,OAAO;AACN,YAAM,KAAK,QAAQ;AAAA,IACpB;AAAA,EACD;AACA,SAAO;AACP,SAAO,EAAE,MAAM,QAAQ,CAAC;AACzB;AAEA,SAAS,UAAU,KAAoC;AACtD,UAAQ,IAAI,MAAM,GAAG;AAAA,IACpB,KAAK;AACJ,eAAS,IAAI,cAAc,GAAa,IAAI,YAAY,CAAgC,EAAE,MAAM,CAAC,MAAe;AAC/G,eAAO,EAAE,MAAM,cAAc,OAAO,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC,EAAE,CAAC;AAAA,MACjF,CAAC;AACD;AAAA,IACD,KAAK,OAAO;AACX,YAAM,KAAK,IAAI,IAAI;AACnB,UAAI,CAAC,MAAM;AACV,eAAO,EAAE,MAAM,SAAS,IAAI,OAAO,2BAA2B,CAAC;AAC/D;AAAA,MACD;AACA,UAAI;AACH,cAAM,OAAO,KAAK;AAAA,UACjB,IAAI,WAAW;AAAA,UACf,IAAI,UAAU;AAAA,UACd,IAAI,UAAU;AAAA,QACf;AACA,eAAO,EAAE,MAAM,UAAU,IAAI,KAAK,CAAC;AAAA,MACpC,SAAS,GAAY;AACpB,eAAO,EAAE,MAAM,SAAS,IAAI,OAAO,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC,EAAE,CAAC;AAAA,MAChF;AACA;AAAA,IACD;AAAA,EACD;AACD;AAEA,eAAe,YAA2B;AACzC,QAAM,YAAY,OAAO,YAAY,eAAe,CAAC,CAAC,QAAQ,UAAU;AAExE,MAAI,WAAW;AACd,UAAM,EAAE,YAAY,WAAW,IAAI,MAAM;AAAA;AAAA,MAA0B;AAAA,IAAqB;AACxF,QAAI,CAAC,WAAY,OAAM,IAAI,MAAM,2CAA2C;AAE5E,aAAS,CAAC,SAAkB,WAAW,YAAY,IAAI;AACvD,eAAW,GAAG,WAAW,CAAC,QAAiC,UAAU,GAAG,CAAC;AAGzE,UAAM,KAAK;AACX,QAAI,IAAI,cAAc;AACrB,YAAM,SAAS,GAAG,cAAc,GAAG,UAAU;AAAA,IAC9C;AAAA,EACD,OAAO;AAEN,UAAM,QAAQ;AACd,aAAS,CAAC,SAAkB,MAAM,YAAY,IAAI;AAClD,UAAM,YAAY,CAAC,MAAoB,UAAU,EAAE,IAA+B;AAAA,EAEnF;AACD;AAEA,UAAU,EAAE,MAAM,CAAC,MAAe;AACjC,MAAI;AACH,QAAI,OAAO,YAAY,eAAe,QAAQ,QAAQ;AACrD,cAAQ,OAAO,MAAM,kCAAkC,CAAC;AAAA,CAAI;AAC5D,cAAQ,KAAK,CAAC;AAAA,IACf;AAAA,EACD,QAAQ;AAAA,EAER;AACD,CAAC;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OCR Worker Bridge
|
|
3
|
+
*
|
|
4
|
+
* Manages the OCR worker lifecycle and provides an async interface for running
|
|
5
|
+
* ocrRecognize() off the main thread. Falls back to direct (blocking) invocation
|
|
6
|
+
* when workers are not available (e.g. edge runtimes).
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Create and initialize the OCR worker.
|
|
10
|
+
*
|
|
11
|
+
* @param wasmGluePath - Absolute path (Node.js) or URL (browser) to the WASM glue JS module
|
|
12
|
+
* @param wasmBinary - Pre-loaded WASM binary (Node.js file-system loaded bytes)
|
|
13
|
+
* @param directFallback - Direct blocking function used when workers are unavailable
|
|
14
|
+
*/
|
|
15
|
+
export declare function createOcrWorker(wasmGluePath: string, wasmBinary: Uint8Array | undefined, directFallback: (imageData: Uint8Array, tessdata: Uint8Array, language: string) => string): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Run OCR in the worker thread. Returns a Promise that resolves with the recognized text.
|
|
18
|
+
* Falls back to direct (blocking) call if workers are unavailable.
|
|
19
|
+
*/
|
|
20
|
+
export declare function runOcrInWorker(imageData: Uint8Array, tessdata: Uint8Array, language: string): Promise<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Check whether OCR is using the worker thread or the direct fallback.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isUsingWorker(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Terminate the OCR worker and clean up resources.
|
|
27
|
+
*/
|
|
28
|
+
export declare function terminateOcrWorker(): Promise<void>;
|
|
29
|
+
//# sourceMappingURL=worker-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-bridge.d.ts","sourceRoot":"","sources":["../../typescript/ocr/worker-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA8DH;;;;;;GAMG;AACH,wBAAsB,eAAe,CACpC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,UAAU,GAAG,SAAS,EAClC,cAAc,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,GACvF,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAyDD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwB7G;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAcxD"}
|
package/dist/pkg/README.md
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<img src="https://img.shields.io/maven-central/v/dev.kreuzberg/kreuzberg?label=Java&color=007ec6" alt="Java">
|
|
23
23
|
</a>
|
|
24
24
|
<a href="https://github.com/kreuzberg-dev/kreuzberg/releases">
|
|
25
|
-
<img src="https://img.shields.io/github/v/tag/kreuzberg-dev/kreuzberg?label=Go&color=007ec6&filter=v4.4.
|
|
25
|
+
<img src="https://img.shields.io/github/v/tag/kreuzberg-dev/kreuzberg?label=Go&color=007ec6&filter=v4.4.2" alt="Go">
|
|
26
26
|
</a>
|
|
27
27
|
<a href="https://www.nuget.org/packages/Kreuzberg/">
|
|
28
28
|
<img src="https://img.shields.io/nuget/v/Kreuzberg?label=C%23&color=007ec6" alt="C#">
|
|
@@ -1584,7 +1584,7 @@ function __wbg_get_imports() {
|
|
|
1584
1584
|
const a = state0.a;
|
|
1585
1585
|
state0.a = 0;
|
|
1586
1586
|
try {
|
|
1587
|
-
return
|
|
1587
|
+
return wasm_bindgen_179aebea8749b817___convert__closures_____invoke___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
1588
1588
|
} finally {
|
|
1589
1589
|
state0.a = a;
|
|
1590
1590
|
}
|
|
@@ -1606,7 +1606,7 @@ function __wbg_get_imports() {
|
|
|
1606
1606
|
const a = state0.a;
|
|
1607
1607
|
state0.a = 0;
|
|
1608
1608
|
try {
|
|
1609
|
-
return
|
|
1609
|
+
return wasm_bindgen_179aebea8749b817___convert__closures_____invoke___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
1610
1610
|
} finally {
|
|
1611
1611
|
state0.a = a;
|
|
1612
1612
|
}
|
|
@@ -1769,13 +1769,13 @@ function __wbg_get_imports() {
|
|
|
1769
1769
|
console.warn(arg0);
|
|
1770
1770
|
},
|
|
1771
1771
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1772
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1773
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1772
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 21, function: Function { arguments: [Externref], shim_idx: 23, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1773
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_179aebea8749b817___closure__destroy___dyn_core_dde6c4b55a98adc4___ops__function__FnMut__wasm_bindgen_179aebea8749b817___JsValue____Output_______, wasm_bindgen_179aebea8749b817___convert__closures_____invoke___wasm_bindgen_179aebea8749b817___JsValue______true_);
|
|
1774
1774
|
return ret;
|
|
1775
1775
|
},
|
|
1776
1776
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1777
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1778
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1777
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3518, function: Function { arguments: [Externref], shim_idx: 3519, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1778
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_179aebea8749b817___closure__destroy___dyn_core_dde6c4b55a98adc4___ops__function__FnMut__wasm_bindgen_179aebea8749b817___JsValue____Output___core_dde6c4b55a98adc4___result__Result_____wasm_bindgen_179aebea8749b817___JsError___, wasm_bindgen_179aebea8749b817___convert__closures_____invoke___wasm_bindgen_179aebea8749b817___JsValue__core_dde6c4b55a98adc4___result__Result_____wasm_bindgen_179aebea8749b817___JsError___true_);
|
|
1779
1779
|
return ret;
|
|
1780
1780
|
},
|
|
1781
1781
|
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
@@ -1817,19 +1817,19 @@ function __wbg_get_imports() {
|
|
|
1817
1817
|
};
|
|
1818
1818
|
}
|
|
1819
1819
|
|
|
1820
|
-
function
|
|
1821
|
-
wasm.
|
|
1820
|
+
function wasm_bindgen_179aebea8749b817___convert__closures_____invoke___wasm_bindgen_179aebea8749b817___JsValue______true_(arg0, arg1, arg2) {
|
|
1821
|
+
wasm.wasm_bindgen_179aebea8749b817___convert__closures_____invoke___wasm_bindgen_179aebea8749b817___JsValue______true_(arg0, arg1, arg2);
|
|
1822
1822
|
}
|
|
1823
1823
|
|
|
1824
|
-
function
|
|
1825
|
-
const ret = wasm.
|
|
1824
|
+
function wasm_bindgen_179aebea8749b817___convert__closures_____invoke___wasm_bindgen_179aebea8749b817___JsValue__core_dde6c4b55a98adc4___result__Result_____wasm_bindgen_179aebea8749b817___JsError___true_(arg0, arg1, arg2) {
|
|
1825
|
+
const ret = wasm.wasm_bindgen_179aebea8749b817___convert__closures_____invoke___wasm_bindgen_179aebea8749b817___JsValue__core_dde6c4b55a98adc4___result__Result_____wasm_bindgen_179aebea8749b817___JsError___true_(arg0, arg1, arg2);
|
|
1826
1826
|
if (ret[1]) {
|
|
1827
1827
|
throw takeFromExternrefTable0(ret[0]);
|
|
1828
1828
|
}
|
|
1829
1829
|
}
|
|
1830
1830
|
|
|
1831
|
-
function
|
|
1832
|
-
wasm.
|
|
1831
|
+
function wasm_bindgen_179aebea8749b817___convert__closures_____invoke___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
|
|
1832
|
+
wasm.wasm_bindgen_179aebea8749b817___convert__closures_____invoke___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
1833
1833
|
}
|
|
1834
1834
|
|
|
1835
1835
|
const ModuleInfoFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -1497,7 +1497,7 @@ export function __wbg_new_d098e265629cd10f(arg0, arg1) {
|
|
|
1497
1497
|
const a = state0.a;
|
|
1498
1498
|
state0.a = 0;
|
|
1499
1499
|
try {
|
|
1500
|
-
return
|
|
1500
|
+
return wasm_bindgen_179aebea8749b817___convert__closures_____invoke___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
1501
1501
|
} finally {
|
|
1502
1502
|
state0.a = a;
|
|
1503
1503
|
}
|
|
@@ -1519,7 +1519,7 @@ export function __wbg_new_typed_aaaeaf29cf802876(arg0, arg1) {
|
|
|
1519
1519
|
const a = state0.a;
|
|
1520
1520
|
state0.a = 0;
|
|
1521
1521
|
try {
|
|
1522
|
-
return
|
|
1522
|
+
return wasm_bindgen_179aebea8749b817___convert__closures_____invoke___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
1523
1523
|
} finally {
|
|
1524
1524
|
state0.a = a;
|
|
1525
1525
|
}
|
|
@@ -1682,13 +1682,13 @@ export function __wbg_warn_69424c2d92a2fa73(arg0) {
|
|
|
1682
1682
|
console.warn(arg0);
|
|
1683
1683
|
}
|
|
1684
1684
|
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
1685
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1686
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1685
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 21, function: Function { arguments: [Externref], shim_idx: 23, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1686
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_179aebea8749b817___closure__destroy___dyn_core_dde6c4b55a98adc4___ops__function__FnMut__wasm_bindgen_179aebea8749b817___JsValue____Output_______, wasm_bindgen_179aebea8749b817___convert__closures_____invoke___wasm_bindgen_179aebea8749b817___JsValue______true_);
|
|
1687
1687
|
return ret;
|
|
1688
1688
|
}
|
|
1689
1689
|
export function __wbindgen_cast_0000000000000002(arg0, arg1) {
|
|
1690
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1691
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1690
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3518, function: Function { arguments: [Externref], shim_idx: 3519, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1691
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_179aebea8749b817___closure__destroy___dyn_core_dde6c4b55a98adc4___ops__function__FnMut__wasm_bindgen_179aebea8749b817___JsValue____Output___core_dde6c4b55a98adc4___result__Result_____wasm_bindgen_179aebea8749b817___JsError___, wasm_bindgen_179aebea8749b817___convert__closures_____invoke___wasm_bindgen_179aebea8749b817___JsValue__core_dde6c4b55a98adc4___result__Result_____wasm_bindgen_179aebea8749b817___JsError___true_);
|
|
1692
1692
|
return ret;
|
|
1693
1693
|
}
|
|
1694
1694
|
export function __wbindgen_cast_0000000000000003(arg0) {
|
|
@@ -1721,19 +1721,19 @@ export function __wbindgen_init_externref_table() {
|
|
|
1721
1721
|
table.set(offset + 2, true);
|
|
1722
1722
|
table.set(offset + 3, false);
|
|
1723
1723
|
}
|
|
1724
|
-
function
|
|
1725
|
-
wasm.
|
|
1724
|
+
function wasm_bindgen_179aebea8749b817___convert__closures_____invoke___wasm_bindgen_179aebea8749b817___JsValue______true_(arg0, arg1, arg2) {
|
|
1725
|
+
wasm.wasm_bindgen_179aebea8749b817___convert__closures_____invoke___wasm_bindgen_179aebea8749b817___JsValue______true_(arg0, arg1, arg2);
|
|
1726
1726
|
}
|
|
1727
1727
|
|
|
1728
|
-
function
|
|
1729
|
-
const ret = wasm.
|
|
1728
|
+
function wasm_bindgen_179aebea8749b817___convert__closures_____invoke___wasm_bindgen_179aebea8749b817___JsValue__core_dde6c4b55a98adc4___result__Result_____wasm_bindgen_179aebea8749b817___JsError___true_(arg0, arg1, arg2) {
|
|
1729
|
+
const ret = wasm.wasm_bindgen_179aebea8749b817___convert__closures_____invoke___wasm_bindgen_179aebea8749b817___JsValue__core_dde6c4b55a98adc4___result__Result_____wasm_bindgen_179aebea8749b817___JsError___true_(arg0, arg1, arg2);
|
|
1730
1730
|
if (ret[1]) {
|
|
1731
1731
|
throw takeFromExternrefTable0(ret[0]);
|
|
1732
1732
|
}
|
|
1733
1733
|
}
|
|
1734
1734
|
|
|
1735
|
-
function
|
|
1736
|
-
wasm.
|
|
1735
|
+
function wasm_bindgen_179aebea8749b817___convert__closures_____invoke___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
|
|
1736
|
+
wasm.wasm_bindgen_179aebea8749b817___convert__closures_____invoke___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
1737
1737
|
}
|
|
1738
1738
|
|
|
1739
1739
|
const ModuleInfoFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
Binary file
|
|
@@ -45,11 +45,11 @@ export const read_block_from_callback_wasm: (a: number, b: number, c: number, d:
|
|
|
45
45
|
export const write_block_from_callback_wasm: (a: number, b: number, c: number) => number;
|
|
46
46
|
export const compress: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
47
47
|
export const decompress: (a: any, b: number, c: number, d: any) => [number, number];
|
|
48
|
-
export const
|
|
49
|
-
export const
|
|
50
|
-
export const
|
|
51
|
-
export const
|
|
52
|
-
export const
|
|
48
|
+
export const wasm_bindgen_179aebea8749b817___closure__destroy___dyn_core_dde6c4b55a98adc4___ops__function__FnMut__wasm_bindgen_179aebea8749b817___JsValue____Output_______: (a: number, b: number) => void;
|
|
49
|
+
export const wasm_bindgen_179aebea8749b817___closure__destroy___dyn_core_dde6c4b55a98adc4___ops__function__FnMut__wasm_bindgen_179aebea8749b817___JsValue____Output___core_dde6c4b55a98adc4___result__Result_____wasm_bindgen_179aebea8749b817___JsError___: (a: number, b: number) => void;
|
|
50
|
+
export const wasm_bindgen_179aebea8749b817___convert__closures_____invoke___wasm_bindgen_179aebea8749b817___JsValue__core_dde6c4b55a98adc4___result__Result_____wasm_bindgen_179aebea8749b817___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
51
|
+
export const wasm_bindgen_179aebea8749b817___convert__closures_____invoke___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined___js_sys_3900621f03eac4bc___Function_fn_wasm_bindgen_179aebea8749b817___JsValue_____wasm_bindgen_179aebea8749b817___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
52
|
+
export const wasm_bindgen_179aebea8749b817___convert__closures_____invoke___wasm_bindgen_179aebea8749b817___JsValue______true_: (a: number, b: number, c: any) => void;
|
|
53
53
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
54
54
|
export const __wbindgen_malloc_command_export: (a: number, b: number) => number;
|
|
55
55
|
export const __wbindgen_realloc_command_export: (a: number, b: number, c: number, d: number) => number;
|
package/package.json
CHANGED
|
@@ -1,122 +1,122 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
2
|
+
"name": "@kreuzberg/wasm",
|
|
3
|
+
"version": "4.4.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"packageManager": "pnpm@10.17.0",
|
|
6
|
+
"description": "Kreuzberg document intelligence - WebAssembly bindings",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Na'aman Hirschfeld",
|
|
9
|
+
"email": "nhirschfeld@gmail.com",
|
|
10
|
+
"url": "https://kreuzberg.dev"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://kreuzberg.dev",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/kreuzberg-dev/kreuzberg/issues"
|
|
15
|
+
},
|
|
16
|
+
"main": "dist/index.js",
|
|
17
|
+
"module": "dist/index.js",
|
|
18
|
+
"types": "dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"import": "./dist/index.js",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./dist/pkg/*": "./dist/pkg/*",
|
|
26
|
+
"./dist/kreuzberg_wasm.js": "./dist/kreuzberg_wasm.js",
|
|
27
|
+
"./kreuzberg_wasm_bg.wasm": "./dist/pkg/kreuzberg_wasm_bg.wasm",
|
|
28
|
+
"./runtime": {
|
|
29
|
+
"types": "./dist/runtime.d.ts",
|
|
30
|
+
"import": "./dist/runtime.js",
|
|
31
|
+
"default": "./dist/runtime.js"
|
|
32
|
+
},
|
|
33
|
+
"./adapters/wasm-adapter": {
|
|
34
|
+
"types": "./dist/adapters/wasm-adapter.d.ts",
|
|
35
|
+
"import": "./dist/adapters/wasm-adapter.js",
|
|
36
|
+
"default": "./dist/adapters/wasm-adapter.js"
|
|
37
|
+
},
|
|
38
|
+
"./ocr/registry": {
|
|
39
|
+
"types": "./dist/ocr/registry.d.ts",
|
|
40
|
+
"import": "./dist/ocr/registry.js",
|
|
41
|
+
"default": "./dist/ocr/registry.js"
|
|
42
|
+
},
|
|
43
|
+
"./ocr/tesseract-wasm-backend": {
|
|
44
|
+
"types": "./dist/ocr/tesseract-wasm-backend.d.ts",
|
|
45
|
+
"import": "./dist/ocr/tesseract-wasm-backend.js",
|
|
46
|
+
"default": "./dist/ocr/tesseract-wasm-backend.js"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "https://github.com/kreuzberg-dev/kreuzberg.git"
|
|
52
|
+
},
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"keywords": [
|
|
55
|
+
"wasm",
|
|
56
|
+
"webassembly",
|
|
57
|
+
"document-intelligence",
|
|
58
|
+
"document-extraction",
|
|
59
|
+
"text-extraction",
|
|
60
|
+
"pdf-extraction",
|
|
61
|
+
"ocr",
|
|
62
|
+
"pdf",
|
|
63
|
+
"docx",
|
|
64
|
+
"xlsx",
|
|
65
|
+
"pptx",
|
|
66
|
+
"office-documents",
|
|
67
|
+
"table-extraction",
|
|
68
|
+
"metadata-extraction",
|
|
69
|
+
"rust",
|
|
70
|
+
"binding",
|
|
71
|
+
"typescript"
|
|
72
|
+
],
|
|
73
|
+
"files": [
|
|
74
|
+
"dist",
|
|
75
|
+
"pkg",
|
|
76
|
+
"*.wasm",
|
|
77
|
+
"*.d.ts",
|
|
78
|
+
"README.md"
|
|
79
|
+
],
|
|
80
|
+
"engines": {
|
|
81
|
+
"node": ">= 16"
|
|
82
|
+
},
|
|
83
|
+
"publishConfig": {
|
|
84
|
+
"registry": "https://registry.npmjs.org/",
|
|
85
|
+
"access": "public"
|
|
86
|
+
},
|
|
87
|
+
"scripts": {
|
|
88
|
+
"build:wasm:web": "wasm-pack build --target web --out-dir pkg --release -- --features ocr-wasm",
|
|
89
|
+
"build:wasm:bundler": "wasm-pack build --target bundler --out-dir pkg --release -- --features ocr-wasm",
|
|
90
|
+
"build:wasm:nodejs": "wasm-pack build --target nodejs --out-dir pkg-nodejs --release -- --features ocr-wasm",
|
|
91
|
+
"build:wasm:deno": "wasm-pack build --target deno --out-dir pkg --release -- --features ocr-wasm",
|
|
92
|
+
"build:ts": "tsup && tsc --emitDeclarationOnly && node scripts/fix-type-exports.js",
|
|
93
|
+
"build:ts:minify": "tsup --minify && tsc --emitDeclarationOnly && node scripts/fix-type-exports.js",
|
|
94
|
+
"fix:wasi": "node scripts/fix-wasi-imports.js",
|
|
95
|
+
"copy:pkg": "node scripts/copy-pkg.js",
|
|
96
|
+
"build": "npm run build:wasm:web && npm run fix:wasi && npm run build:ts && npm run copy:pkg",
|
|
97
|
+
"build:ci": "npm run build:wasm:web && npm run fix:wasi && npm run build:ts:minify && npm run copy:pkg",
|
|
98
|
+
"build:all": "npm run build:wasm:web && npm run build:wasm:bundler && npm run build:wasm:nodejs && npm run build:wasm:deno && npm run fix:wasi && npm run build:ts && npm run copy:pkg",
|
|
99
|
+
"typecheck": "tsc --noEmit",
|
|
100
|
+
"lint": "biome check typescript && oxlint typescript",
|
|
101
|
+
"lint:fix": "biome check --write typescript",
|
|
102
|
+
"format": "biome format --write typescript",
|
|
103
|
+
"test": "vitest run",
|
|
104
|
+
"test:watch": "vitest",
|
|
105
|
+
"test:coverage": "vitest run --coverage",
|
|
106
|
+
"test:ui": "vitest --ui",
|
|
107
|
+
"prepublishOnly": "npm run build"
|
|
108
|
+
},
|
|
109
|
+
"devDependencies": {
|
|
110
|
+
"@types/node": "^25.3.3",
|
|
111
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
112
|
+
"@vitest/ui": "^4.0.18",
|
|
113
|
+
"jsdom": "^28.1.0",
|
|
114
|
+
"oxlint": "^1.51.0",
|
|
115
|
+
"tsup": "^8.5.1",
|
|
116
|
+
"typescript": "^5.9.3",
|
|
117
|
+
"vitest": "^4.0.18"
|
|
118
|
+
},
|
|
119
|
+
"optionalDependencies": {
|
|
120
|
+
"tesseract-wasm": "^0.11.0"
|
|
121
|
+
}
|
|
122
122
|
}
|