Last updated 2 years ago
NotUndefined<Type>
A generic type NotUndefined represents any type instead of undefined. It takes generic type variable Type constrained by undefined which constraint causes its change to never.
NotUndefined
undefined
Type
never
type NotUndefined<Type> = Type extends undefined ? never : Type;
A generic type Type that is never undefined.