Screeps-Typescript-Declarations
Screeps-Typescript-Declarations copied to clipboard
[Breaking Changes] Rewrite typings to be publishable to DefinitelyTyped
Reference: #21
Note that this does not close that issue just yet, but this is one small step to finally get the type declarations publishable onto DefinitelyTyped. Once this PR is approved and merged I'll open a PR on DefinitelyTyped to make sure everything's installable via npm install @types/screeps-typescript-declarations.
- [x] Consolidated into one single
index.d.tsfile. - [x] Write a simple tests file (
screeps-tests.ts). - [x] Other minor tweaks and improvements.
This should be finished and ready for review. I'm still not sure how the tests on DT work, and I only got time to include tests for the Game objects.
cc: @Dessix @thaelina @anisoptera
I'm not sure how tests work either. When I have time, I will see what I can figure out.
@thaelina Seems like all the tests are basic JS routines and what the tests do is find out if no type errors exist.
Here's React's tests as a reference: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/test/index.ts
Okay, I figured out how to do the tests and added some basic tests. Note that this still doesn't cover every single API in the docs, but this is still ready to merge.