@embedpdf/engine-runtime 3.0.0-next.11 → 3.0.0-next.13
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/dist/core/pdf-functions.generated.d.ts +5424 -1504
- package/dist/core/pdf-runtime-module.d.ts +17 -0
- package/dist/index.browser.js +106 -5
- package/dist/index.browser.js.map +1 -1
- package/dist/index.d.cts +108 -5
- package/dist/index.d.ts +108 -5
- package/dist/index.node.cjs +151 -5
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +151 -5
- package/dist/index.node.js.map +1 -1
- package/package.json +11 -11
|
@@ -40,6 +40,10 @@ export interface PdfRuntimeFileAccess {
|
|
|
40
40
|
fromMemory(bytes: Uint8Array | ArrayBuffer): PdfFileAccessHandle;
|
|
41
41
|
/** Native/node only: range-reads a local file without loading it into JS. */
|
|
42
42
|
fromNodeFile(path: string): PdfFileAccessHandle;
|
|
43
|
+
/** Native/node only: the bytes `[offset, offset + length)` of a local file (short at EOF). */
|
|
44
|
+
readRange(path: string, offset: number, length: number): Uint8Array;
|
|
45
|
+
/** Native/node only: byte length of a local file. */
|
|
46
|
+
sizeOf(path: string): number;
|
|
43
47
|
}
|
|
44
48
|
export interface PdfFileWriteHandle {
|
|
45
49
|
/** Pointer to the owned FPDF_FILEWRITE struct. */
|
|
@@ -47,9 +51,22 @@ export interface PdfFileWriteHandle {
|
|
|
47
51
|
/** Flushes/closes the underlying writer and releases native resources. */
|
|
48
52
|
close(): void;
|
|
49
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Local-file operations the engine services need beyond PDFium's own
|
|
56
|
+
* writers: patching a few bytes in place (sealing a signing candidate),
|
|
57
|
+
* appending (streaming a verbatim copy), and removing a discarded file.
|
|
58
|
+
* Node-only; the wasm runtime throws, exactly as `toNodeFile` does. Kept
|
|
59
|
+
* here so the shared services never import a node module themselves.
|
|
60
|
+
*/
|
|
50
61
|
export interface PdfRuntimeFileWrite {
|
|
51
62
|
/** Native/node only: writes PDFium output directly to a local file. */
|
|
52
63
|
toNodeFile(path: string): PdfFileWriteHandle;
|
|
64
|
+
/** Native/node only: overwrite `bytes` at `offset` in place (the file must already extend past it). */
|
|
65
|
+
writeRange(path: string, offset: number, bytes: Uint8Array): void;
|
|
66
|
+
/** Native/node only: append `bytes` to a local file, creating it when absent. */
|
|
67
|
+
appendBytes(path: string, bytes: Uint8Array): void;
|
|
68
|
+
/** Native/node only: delete a local file; a missing file is not an error. */
|
|
69
|
+
removeFile(path: string): void;
|
|
53
70
|
}
|
|
54
71
|
export interface PdfRuntimeModule {
|
|
55
72
|
readonly kind: 'wasm' | 'native';
|