I'm trying to get an array of type parameters of a function with all the declarations (Overloads) with or concatenation.
For example, I can use the Parameters<T>
but this function only get the last declaration.
interface FOO {
foo(a: string, b: string): string;
foo(a: boolean, b: string): string;
foo(a: boolean, b:string, c: number): string;
};
type params = Parameters<FOO["foo"]>; // [boolean, string, number]
Actually, the params type is [boolean, string, number]
but I expect the type as [string, string] | [boolean, string] | [boolean, string, number]
.