Prevents duplicate autocompletion for functions whose type union resolves to Function when undefined and never are excluded.
For functions, explicitly adding "& Function" seems to get rid of the version without the method signature.
Remarks
For each key K of T, see if T[K] extends Function when not never or undefined.
If so, return T[K] & Function
If not, return T[K] (unchanged)
Type Parameters
T
Object type that presumably contains some methods that are potentially never/undefined
Prevents duplicate autocompletion for functions whose type union resolves to
Function
whenundefined
andnever
are excluded. For functions, explicitly adding "& Function" seems to get rid of the version without the method signature.Remarks
For each key
K
ofT
, see ifT[K]
extendsFunction
when notnever
orundefined
.T[K] & Function
T[K]
(unchanged)