benweier / blizzard.js

A promise-based Node.JS library for the Blizzard Battle.net Community Platform API
MIT License
146 stars 29 forks source link

Missing types #175

Open oliv-tree opened 9 months ago

oliv-tree commented 9 months ago

Hey,

Perhaps this has not been implemented, but I don't seem to be able to get any types when using this library?

E.g., if I do the below I do not get any hints on what is returned by this query.

let profile = await wowClient.characterPVP({
  realm: "silvermoon",
  name: "abc",
})
console.log(profile.data.)
benweier commented 9 months ago

Hey @oliv-tree, unfortunately providing all the response types isn't a specific goal as the effort to implement and maintenance to stay on top of it is too much for me to be able to commit to. The class methods are generic, however, and you're able to easily declare the response types for whatever method you need in your project.

let profile = await wowClient.characterPVP<CharacterPvpResponseType>({
  realm: "silvermoon",
  name: "abc",
})

If the library was enough demand or a willing contributor opened a PR I'd be happy to include the types, but unfortunately it's not something I can guarantee personally

oliv-tree commented 9 months ago

Good to know it wasn't on my end at least.

If the library was enough demand or a willing contributor opened a PR I'd be happy to include the types, but unfortunately it's not something I can guarantee personally

Understandable. Honestly something AI is pretty ideal for.

benweier commented 9 months ago

That's an excellent point and I'll look into what kind of results I can get from AI tools