Hello,
I am trying to wrap my head around providing type inference to consumers while prototyping a type safe wrapper around some other libraries.
The issue I am having (along with accompanying codebase) is here: https://github.com/Tracktile/Axiom/blob/broken-provider/example/index.tsx
As you see, on line 31 User.schema is properly inferred.
However, on line 32 direct.User.schema is NOT properly inferred and receives a wider typing.
The difference, is that direct is the result of my createApi function which essentially binds my model objects to a query client. What this function does works, its the type inference of the result I am having issues with.
I want line 32 to be inferred to be the same type as 33.
Please let me know if you see what I've missed. I did have this working at some point, and have been starring at it for to long now.