T extends readonly [infer H, ...any[]] ? H : T extends readonly [] ? any : T extends (infer E)[] ? E : never