Open smikula opened 2 years ago
@smikula, I would be interested in seeing your ideas. I added the multi calls as more of an afterthought, so they don't fit in as well as the other calls.
I have a proof of concept idea in this PR: https://github.com/jgolla/torn-api/pull/318
Alternately, you could just define a big return type from multi
with all properties there but optional. That's a little annoying to work with as a consumer, but way easier for the library to code!
I'd love to see a type-safe return value from the
multi()
method on various APIs. I know this is easier said than done — I can't think of a way to do it when passing an array of selection strings — but I there are other ways it could work. Something like:Or:
Or with a little ingenuity I think even this could work:
What do you think? If you're interested, I'd be up for working on a PR.