Type alias OverloadMapRaw<F> Overload Map Raw < F > : F extends { ( ... a ) : R0 ; ( ... a ) : R1 ; ( ... a ) : R2 ; ( ... a ) : R3 ; ( ... a ) : R4 ; ( ... a ) : R5 ; ( ... a ) : R6 ; ( ... a ) : R7 ; ( ... a ) : R8 ; ( ... a ) : R9 ; } ? [ [ NeverUnknown < A0 > , R0 ] , [ NeverUnknown < A1 > , R1 ] , [ NeverUnknown < A2 > , R2 ] , [ NeverUnknown < A3 > , R3 ] , [ NeverUnknown < A4 > , R4 ] , [ NeverUnknown < A5 > , R5 ] , [ NeverUnknown < A6 > , R6 ] , [ NeverUnknown < A7 > , R7 ] , [ NeverUnknown < A8 > , R8 ] , [ NeverUnknown < A9 > , R9 ] ] : F extends { ( ... a ) : R0 ; ( ... a ) : R1 ; ( ... a ) : R2 ; ( ... a ) : R3 ; ( ... a ) : R4 ; ( ... a ) : R5 ; ( ... a ) : R6 ; ( ... a ) : R7 ; ( ... a ) : R8 ; } ? [ [ NeverUnknown < A0 > , R0 ] , [ NeverUnknown < A1 > , R1 ] , [ NeverUnknown < A2 > , R2 ] , [ NeverUnknown < A3 > , R3 ] , [ NeverUnknown < A4 > , R4 ] , [ NeverUnknown < A5 > , R5 ] , [ NeverUnknown < A6 > , R6 ] , [ NeverUnknown < A7 > , R7 ] , [ NeverUnknown < A8 > , R8 ] ] : F extends { ( ... a ) : R0 ; ( ... a ) : R1 ; ( ... a ) : R2 ; ( ... a ) : R3 ; ( ... a ) : R4 ; ( ... a ) : R5 ; ( ... a ) : R6 ; ( ... a ) : R7 ; } ? [ [ NeverUnknown < A0 > , R0 ] , [ NeverUnknown < A1 > , R1 ] , [ NeverUnknown < A2 > , R2 ] , [ NeverUnknown < A3 > , R3 ] , [ NeverUnknown < A4 > , R4 ] , [ NeverUnknown < A5 > , R5 ] , [ NeverUnknown < A6 > , R6 ] , [ NeverUnknown < A7 > , R7 ] ] : F extends { ( ... a ) : R0 ; ( ... a ) : R1 ; ( ... a ) : R2 ; ( ... a ) : R3 ; ( ... a ) : R4 ; ( ... a ) : R5 ; ( ... a ) : R6 ; } ? [ [ NeverUnknown < A0 > , R0 ] , [ NeverUnknown < A1 > , R1 ] , [ NeverUnknown < A2 > , R2 ] , [ NeverUnknown < A3 > , R3 ] , [ NeverUnknown < A4 > , R4 ] , [ NeverUnknown < A5 > , R5 ] , [ NeverUnknown < A6 > , R6 ] ] : F extends { ( ... a ) : R0 ; ( ... a ) : R1 ; ( ... a ) : R2 ; ( ... a ) : R3 ; ( ... a ) : R4 ; ( ... a ) : R5 ; } ? [ [ NeverUnknown < A0 > , R0 ] , [ NeverUnknown < A1 > , R1 ] , [ NeverUnknown < A2 > , R2 ] , [ NeverUnknown < A3 > , R3 ] , [ NeverUnknown < A4 > , R4 ] , [ NeverUnknown < A5 > , R5 ] ] : F extends { ( ... a ) : R0 ; ( ... a ) : R1 ; ( ... a ) : R2 ; ( ... a ) : R3 ; ( ... a ) : R4 ; } ? [ [ NeverUnknown < A0 > , R0 ] , [ NeverUnknown < A1 > , R1 ] , [ NeverUnknown < A2 > , R2 ] , [ NeverUnknown < A3 > , R3 ] , [ NeverUnknown < A4 > , R4 ] ] : F extends { ( ... a ) : R0 ; ( ... a ) : R1 ; ( ... a ) : R2 ; ( ... a ) : R3 ; } ? [ [ NeverUnknown < A0 > , R0 ] , [ NeverUnknown < A1 > , R1 ] , [ NeverUnknown < A2 > , R2 ] , [ NeverUnknown < A3 > , R3 ] ] : F extends { ( ... a ) : R0 ; ( ... a ) : R1 ; ( ... a ) : R2 ; } ? [ [ NeverUnknown < A0 > , R0 ] , [ NeverUnknown < A1 > , R1 ] , [ NeverUnknown < A2 > , R2 ] ] : F extends { ( ... a ) : R0 ; ( ... a ) : R1 ; } ? [ [ NeverUnknown < A0 > , R0 ] , [ NeverUnknown < A1 > , R1 ] ] : F extends ( ( ... a ) => infer R0 ) ? [ [ NeverUnknown < A0 > , R0 ] ] : never
Turn an overload function into a
[Parameters,ReturnType][]
list. Always contains 10 entries, any that do not correspond to a defined function signature are sometimes[never, unknown]
. and sometimes just fail to extend. Haven't figured out why it works sometimes one way and sometimes another. These are filtered out in the subsequent step if it matches the first type.