You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main approach for the surface type layer of the library is based on function overloads. This approach helped with type inference of the different ways users could call the functions. However, overloads make the TS code really hard to read and maintain.
Although this might not be the ultimate solution (since TS library is a bit of a pain) it may greatly improve the ease for maintenance and change.
Considering microsoft/TypeScript#43371 , we might be able to shift towards a single function (and single input parameter) signature and get all the inferences right from a single parameter rather than having to define multiple overloads to tell apart the different use cases and types of the functions.
I believe this issue was also the reason of why we were requiring two parameters in createCustomServiceCall to be able to infer the callback type from the passed models.
🚧
The text was updated successfully, but these errors were encountered:
The main approach for the surface type layer of the library is based on function overloads. This approach helped with type inference of the different ways users could call the functions. However, overloads make the TS code really hard to read and maintain.
Although this might not be the ultimate solution (since TS library is a bit of a pain) it may greatly improve the ease for maintenance and change.
Considering microsoft/TypeScript#43371 , we might be able to shift towards a single function (and single input parameter) signature and get all the inferences right from a single parameter rather than having to define multiple overloads to tell apart the different use cases and types of the functions.
I believe this issue was also the reason of why we were requiring two parameters in
createCustomServiceCall
to be able to infer the callback type from the passed models.🚧
The text was updated successfully, but these errors were encountered: