PokeAPI / pokeapi-js-wrapper

PokeAPI browser wrapper, fully async with built-in cache
Mozilla Public License 2.0
273 stars 43 forks source link

Update types declaration #53

Closed climaxmba closed 5 months ago

climaxmba commented 6 months ago

Update types declaration

This will extend the declaration to include the return type of the Promise returned in each method and some extra descriptions.

image

Previously, they were just plain Promise<object>.

Naramsim commented 6 months ago

Thanks for your time! A question: how did you generate these changes? Did you do everything by hand? Or you used some kind of generator?

climaxmba commented 6 months ago

Thanks for your time!

You are very welcome, thanks for yours too.

A question: how did you generate these changes? Did you do everything by hand? Or you used some kind of generator?

Well, no. Initially I studied the Pokedex object using this repository's README and the browser's console, to write it. Then I went through the declaration for pokedex-promise-v2 and copied most of what is seen in this PR. It is very precise and definitive. After that, I edited the things that were different, like the config to fit pokeapi-js-wrapper.

The file can also be generated with TypeScript or some NPM package, it won't include those extra writings that explains each property or object in a way that is preferred. But it can serve as a base.

Naramsim commented 5 months ago

Thanks a lot!

climaxmba commented 5 months ago

Anytime!