TTTaevas / osu-api-v2-js

Package to easily access the new api of osu!
https://osu-v2.taevas.xyz
The Unlicense
6 stars 0 forks source link

Get rid of optional properties #26

Closed TTTaevas closed 11 months ago

TTTaevas commented 11 months ago

Optional properties have always been something I disliked with this package In my opinion, they make it almost impossible to predict what properties will be in the received object

This PR aims to deal with that issue by making many interfaces that extend other interfaces, and use each of them (kinda) as the return type of the different functions this package offers For example, there's now a distinction between what kind of object api.getUser() and api.getResourceOwner() returns to you, even if they remain closely related thanks to interface extensions