Solved type issues in traverseOperations etc. Changed functions to take a object single parameter. Condensed endpoints into a function call

This commit is contained in:
Saud Fatayerji
2023-11-14 03:26:42 +03:00
parent 77274e6117
commit 9956367384
18 changed files with 377 additions and 260 deletions

View File

@@ -1,14 +1,17 @@
import SharedOperations, { OperationsUseages } from "@stirling-pdf/shared-operations/src";
import SharedOperations, { OperationsType } from "@stirling-pdf/shared-operations/src";
import { ImposeParamsType } from '@stirling-pdf/shared-operations/src/functions/impose'
import { PdfFile } from "@stirling-pdf/shared-operations/src/wrappers/PdfFile";
// Import injected libraries here!
//import * as pdfcpuWrapper from "@stirling-pdf/shared-operations/wasm/pdfcpu/pdfcpu-wrapper-node.js";
async function impose(snapshot: any, nup: number, format: string) {
return SharedOperations.impose(snapshot, nup, format, null); // TODO change null to pdfcpuWrapper
async function impose(params: ImposeParamsType): Promise<PdfFile> {
const paramsToUse = { ...params, pdfcpuWrapper: null }; // TODO change null to pdfcpuWrapper
return SharedOperations.impose(paramsToUse);
}
const toExport: OperationsUseages = {
const toExport: OperationsType = {
...SharedOperations,
impose,
}