diff --git a/packages/core/src/task/base/TaskGraphBuilder.ts b/packages/core/src/task/base/TaskGraphBuilder.ts index 69c9554..bdb8e99 100644 --- a/packages/core/src/task/base/TaskGraphBuilder.ts +++ b/packages/core/src/task/base/TaskGraphBuilder.ts @@ -7,11 +7,12 @@ import EventEmitter from "eventemitter3"; import { GraphEvents } from "@sroussey/typescript-graph"; -import { DataFlow, TaskGraph } from "./TaskGraph"; +import { DataFlow, TaskGraph, TaskGraphJson } from "./TaskGraph"; import { TaskGraphRunner } from "./TaskGraphRunner"; import { CompoundTask, SingleTask, TaskBase, TaskInput } from "./Task"; import { TaskInputDefinition, TaskOutputDefinition } from "./TaskIOTypes"; import { TaskOutputRepository } from "../../storage/taskoutput/TaskOutputRepository"; +import { JsonTaskItem } from "../JsonTask"; export type TaskGraphBuilderHelper = (input?: Partial) => TaskGraphBuilder; @@ -168,11 +169,11 @@ export class TaskGraphBuilder { return this; } - toJSON() { + toJSON(): TaskGraphJson { return this._graph.toJSON(); } - toDependencyJSON() { + toDependencyJSON(): JsonTaskItem[] { return this._graph.toDependencyJSON(); } diff --git a/packages/web/src/App.tsx b/packages/web/src/App.tsx index 6787a38..9eecd11 100644 --- a/packages/web/src/App.tsx +++ b/packages/web/src/App.tsx @@ -6,6 +6,7 @@ import { IndexedDbTaskGraphRepository, IndexedDbTaskOutputRepository, JsonTask, + JsonTaskItem, TaskGraph, TaskGraphBuilder, } from "ellmers-core/browser"; @@ -61,7 +62,7 @@ taskGraphRepo.on("graph_cleared", () => { resetGraph(); builder.emit("reset"); }); -const initialJsonObj: JsonTask[] = builder.toDependencyJSON(); +const initialJsonObj: JsonTaskItem[] = builder.toDependencyJSON(); const initialJson = JSON.stringify(initialJsonObj, null, 2); // console access. what happens there will be reflected in the UI