import type { ContextMethodKeys, TaskHostCtor, TaskInput, TaskOutput, WorkflowHostCtor, WorkflowInput, WorkflowOutput } from "./shared.js"; /** * Reference to a task within a {@link TaskHost} */ export interface TaskRef> { readonly host: C; readonly method: ContextMethodKeys>; } /** * Reference to a workflow as a {@link WorkflowHost} */ export interface WorkflowRef> { readonly host: C; } /** * Represents any callable reference. * Note that externally only TaskRef and WorkflowRef are supported. */ export type AnyCallableRef = TaskRef | WorkflowRef; /** * Extracts the input type of the callable reference. */ export type InputOfRef = R extends TaskRef ? TaskInput : R extends WorkflowRef ? WorkflowInput : never; /** * Extracts the output type of the callable reference. */ export type OutputOfRef = R extends TaskRef ? TaskOutput : R extends WorkflowRef ? WorkflowOutput : never;