Extract Generic
/**
* Extract a generic of a type
**/
// Your type
type TypeWithGeneric<T> = T[]
// Extract a generic from a type (helper)
type ExtractGeneric<Type> = Type extends TypeWithGeneric<infer X> ? X : Type
// Use
type extracted = ExtractGeneric<TypeWithGeneric<number>>
Source: https://stackoverflow.com/questions/44851268/typescript-how-to-extract-the-generic-parameter-from-a-type