It is possible to specify void as a type parameter for generic function in TypeScript. And it works fine for return values of functions. However when void
void
You can cast undefined to void:
undefined
const x: void = undefined as void