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:384

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>,
Processable<number, boolean>,
(b: boolean) => string
];
type Output = InferPipelineOutput<Steps, string>; // string