ReturnType<T>

The utility type that gives the return type of a function type T.

In more detail

ReturnType<typeof processOrder> reads the result type from the function itself, so wrappers stay correct when it changes. It is defined with a conditional type and infer.

Related terms

Taught in

References