Kewin Dousse

league-typedef

Duration
-
Technologies
typescript, nodejs
Repository
github.com/Protectator/league-typedef

league-typedef is a library encapsulating all of League of Legends' API endpoints into type definitions.

Context

As I was discovering TypeScript, I wanted to contribute writing type definitions. A lot of popular libraries were already done and updated by that time, but I found nothing related to the game League of Legends. So I decided to make type definitions for that game’s public API endpoints.

Model

The library consists of a single huge file containing the type definitions of all endpoints in the API, and also all data structure it uses.

Once this was done, it was also the starting point for the project league-typenode.

league-typenode

This also open-source library wraps calls to the official API using the type definitions defined earlier. It uses node.js + TypeScript to wrap queries into functions that are easy to use, and whose results are easy to consume thanks to the static typing TypeScript provides.

Its primary goal was to be an example on how to use type definitions, but it is also a working library on its own, usable both on the client and server side.

Result

The type definitions are usually up to date with the current API version. When changes are made in the official API, I include and adapt them as soon as possible.