rewrote impose to use new Operator class,

dependencies (pdfcpu) can be made environment-aware using tsconfig.json
This commit is contained in:
Felix Kaspar
2023-11-20 21:04:49 +01:00
parent 42904788bf
commit a5060f0fd3
17 changed files with 188 additions and 187 deletions

View File

@@ -1,16 +0,0 @@
import SharedOperations, { OperatorsType, OperatorParametersType } from "@stirling-pdf/shared-operations/src"
import { PdfFile } from "@stirling-pdf/shared-operations/src/wrappers/PdfFile"
// Import injected libraries here!
import * as pdfcpuWrapper from "@stirling-pdf/shared-operations/src/wasm/pdfcpu/pdfcpu-wrapper-node.js";
async function impose(params: OperatorParametersType["Impose"]): Promise<PdfFile> {
return SharedOperations.Impose.exec(params, pdfcpuWrapper);
}
const toExport: OperatorsType = {
...SharedOperations,
Impose: {exec: impose, spec: SharedOperations.Impose.spec},
}
export default toExport;