fix: workflow 'when' should return T or undefined instead of Partial<T> (#8195)
* fix: workflow 'when' should return T or undefined instead of Partial<T> * fix when usage
This commit is contained in:
committed by
GitHub
parent
78b8a3c60f
commit
35c3759ed8
@@ -13,7 +13,7 @@ type ConditionFunction<T extends object | WorkflowData> = (
|
||||
type ThenFunc = <ThenResolver extends () => any>(
|
||||
resolver: ThenResolver
|
||||
) => ReturnType<ThenResolver> extends WorkflowData<infer ReturnedWorkflowData>
|
||||
? Partial<WorkflowData<ReturnedWorkflowData>>
|
||||
? WorkflowData<ReturnedWorkflowData> | undefined
|
||||
: ReturnType<ThenResolver>
|
||||
|
||||
export function when<T extends object | WorkflowData, Then extends Function>(
|
||||
|
||||
Reference in New Issue
Block a user