Skip to content

Type-safe response from multi() #311

Description

@smikula

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:

await torn.user.multi().basic().battlestats().attacks().fetch();

Or:

await torn.user.multi(request => request.basic().battlestats().attacks());

Or with a little ingenuity I think even this could work:

await torn.user.basic().battlestats().attacks();

What do you think? If you're interested, I'd be up for working on a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions