From deae5fbaec7f18b38ca81180e144828fa54c79da Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sun, 30 Apr 2023 13:58:19 +1000 Subject: [PATCH] fix(ui): socket event types --- .../frontend/web/src/services/events/types.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/invokeai/frontend/web/src/services/events/types.ts b/invokeai/frontend/web/src/services/events/types.ts index 573dc0ac3a..2577b7fe92 100644 --- a/invokeai/frontend/web/src/services/events/types.ts +++ b/invokeai/frontend/web/src/services/events/types.ts @@ -1,4 +1,4 @@ -import { Graph, GraphExecutionState } from '../api'; +import { Graph, GraphExecutionState, InvokeAIMetadata } from '../api'; /** * A progress image, we get one for each step in the generation @@ -17,6 +17,12 @@ export type AnyInvocation = NonNullable[string]; export type AnyResult = GraphExecutionState['results'][string]; +export type BaseNode = { + id: string; + type: string; + [key: string]: NonNullable[string]; +}; + /** * A `generator_progress` socket.io event. * @@ -24,7 +30,7 @@ export type AnyResult = GraphExecutionState['results'][string]; */ export type GeneratorProgressEvent = { graph_execution_state_id: string; - node: AnyInvocation; + node: BaseNode; source_node_id: string; progress_image?: ProgressImage; step: number; @@ -40,7 +46,7 @@ export type GeneratorProgressEvent = { */ export type InvocationCompleteEvent = { graph_execution_state_id: string; - node: AnyInvocation; + node: BaseNode; source_node_id: string; result: AnyResult; }; @@ -52,7 +58,7 @@ export type InvocationCompleteEvent = { */ export type InvocationErrorEvent = { graph_execution_state_id: string; - node: AnyInvocation; + node: BaseNode; source_node_id: string; error: string; }; @@ -64,7 +70,7 @@ export type InvocationErrorEvent = { */ export type InvocationStartedEvent = { graph_execution_state_id: string; - node: AnyInvocation; + node: BaseNode; source_node_id: string; };