GenericFields
This commit is contained in:
2
shared-operations/declarations/Action.d.ts
vendored
2
shared-operations/declarations/Action.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
export interface Action {
|
||||
values: any;
|
||||
type: string;
|
||||
type: "wait" | "done" | "impose" | string;
|
||||
actions?: Action[];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { PdfFile } from "wrappers/PdfFile";
|
||||
import { Action } from "../../declarations/Action";
|
||||
import Joi from "@stirling-tools/joi";
|
||||
|
||||
@@ -33,7 +34,7 @@ export class Operator {
|
||||
this.actionValues = action.values;
|
||||
}
|
||||
|
||||
async run(input: any[], progressCallback: (progress: Progress) => void): Promise<any[]> {
|
||||
async run(input: PdfFile[] | any[], progressCallback: (progress: Progress) => void): Promise<PdfFile[] | any[]> {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// imports browserfs via index.html script-tag
|
||||
import wasmUrl from '../../../public/wasm/pdfcpu/pdfcpu.wasm?url'
|
||||
|
||||
let wasmLocation = "/wasm/pdfcpu/";
|
||||
|
||||
@@ -29,15 +30,12 @@ function configureFs() {
|
||||
}
|
||||
|
||||
function loadWasm() {
|
||||
const script = document.createElement("script");
|
||||
script.src = wasmLocation + "/wasm_exec.js";
|
||||
script.async = true;
|
||||
document.body.appendChild(script);
|
||||
import("./wasm_exec.js");
|
||||
}
|
||||
|
||||
const runWasm = async (param) => {
|
||||
if (window.cachedWasmResponse === undefined) {
|
||||
const response = await fetch(wasmLocation + "/pdfcpu.wasm");
|
||||
const response = await fetch(wasmUrl);
|
||||
const buffer = await response.arrayBuffer();
|
||||
window.cachedWasmResponse = buffer;
|
||||
window.go = new Go();
|
||||
|
||||
Reference in New Issue
Block a user