infer

A keyword used inside the extends part of a conditional type to capture part of a matched type in a new type variable.

In more detail

In T extends (infer E)[] ? E : T, E becomes the element type when T is an array. It only works in conditional types, and is how ReturnType, Parameters and Awaited are built.

Related terms

Taught in

References