From 02957f7757ae1da963b040a5d27527101548df40 Mon Sep 17 00:00:00 2001 From: Felix Kaspar Date: Tue, 14 Nov 2023 17:34:50 +0100 Subject: [PATCH] Cleanup after merge --- shared-operations/declarations/Action.d.ts | 6 +++++- shared-operations/declarations/Operation.d.ts | 9 --------- shared-operations/declarations/PDF.d.ts | 5 ----- shared-operations/src/workflow/traverseOperations.ts | 4 ++-- 4 files changed, 7 insertions(+), 17 deletions(-) delete mode 100644 shared-operations/declarations/Operation.d.ts delete mode 100644 shared-operations/declarations/PDF.d.ts diff --git a/shared-operations/declarations/Action.d.ts b/shared-operations/declarations/Action.d.ts index b0cfac95..822fc163 100644 --- a/shared-operations/declarations/Action.d.ts +++ b/shared-operations/declarations/Action.d.ts @@ -1,5 +1,9 @@ export interface Action { - values: any; + protected values: any; type: string; actions?: Action[]; +} + +export interface WaitAction extends Action { + values: { id: number } } \ No newline at end of file diff --git a/shared-operations/declarations/Operation.d.ts b/shared-operations/declarations/Operation.d.ts deleted file mode 100644 index 85297d16..00000000 --- a/shared-operations/declarations/Operation.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface Operation { - protected values: any; - type: string; - operations?: Operation[]; -} - -export interface WaitOperation extends Operation { - values: { id: number } -} \ No newline at end of file diff --git a/shared-operations/declarations/PDF.d.ts b/shared-operations/declarations/PDF.d.ts deleted file mode 100644 index 0e6b1da0..00000000 --- a/shared-operations/declarations/PDF.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface PDF { - originalFileName: string; - fileName: string; - buffer: Uint8Array; -} \ No newline at end of file diff --git a/shared-operations/src/workflow/traverseOperations.ts b/shared-operations/src/workflow/traverseOperations.ts index 29b80a12..6991210b 100644 --- a/shared-operations/src/workflow/traverseOperations.ts +++ b/shared-operations/src/workflow/traverseOperations.ts @@ -1,5 +1,5 @@ import { organizeWaitOperations } from "./organizeWaitOperations"; -import { Action } from "../../declarations/Action"; +import { Action, WaitAction } from "../../declarations/Action"; import { OperationsType } from "../../src/index"; import { PdfFile } from "../wrappers/PdfFile"; @@ -34,7 +34,7 @@ export async function * traverseOperations(operations: Action[], input: PdfFile[ case "done": // Skip this, because it is a valid node. break; case "wait": - const waitOperation = waitOperations[action.values.id]; + const waitOperation = waitOperations[(action as WaitAction).values.id]; if(Array.isArray(input)) { waitOperation.input.concat(input); // TODO: May have unexpected concequences. Needs further testing!