Skip to main content

Type Alias: InferPipelineOutput<TSteps, TInput>

InferPipelineOutput<TSteps, TInput> = TSteps extends readonly [] ? TInput : TSteps extends readonly [infer First, ...(infer Rest)] ? First extends PipelineStep ? Rest extends readonly PipelineStep[] ? InferPipelineOutput<Rest, InferStepOutput<First, TInput>> : InferStepOutput<First, TInput> : TInput : TInput

Defined in: packages/core/src/pipeline/types.ts:368

Recursively infer final output type from a sequence of pipeline steps. Folds left through the step array, threading output type to next input.

Type Parameters

TSteps

TSteps extends readonly any[]

TInput

TInput = any

Example

type Steps = [
Processable<string, number>,
ConditionalStep<number, boolean>,
LoopStep<boolean>
];
type Output = InferPipelineOutput<Steps, string>; // boolean