Skip to content

Commit

Permalink
fix some types
Browse files Browse the repository at this point in the history
  • Loading branch information
sroussey committed Apr 6, 2024
1 parent 3599ee9 commit 71d5cbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions packages/core/src/task/base/TaskGraphBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<I extends TaskInput> = (input?: Partial<I>) => TaskGraphBuilder;

Expand Down Expand Up @@ -168,11 +169,11 @@ export class TaskGraphBuilder {
return this;
}

toJSON() {
toJSON(): TaskGraphJson {
return this._graph.toJSON();
}

toDependencyJSON() {
toDependencyJSON(): JsonTaskItem[] {
return this._graph.toDependencyJSON();
}

Expand Down
3 changes: 2 additions & 1 deletion packages/web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
IndexedDbTaskGraphRepository,
IndexedDbTaskOutputRepository,
JsonTask,
JsonTaskItem,
TaskGraph,
TaskGraphBuilder,
} from "ellmers-core/browser";
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 71d5cbb

Please sign in to comment.