Screeps-Typescript-Declarations icon indicating copy to clipboard operation
Screeps-Typescript-Declarations copied to clipboard

[Breaking Changes] Rewrite typings to be publishable to DefinitelyTyped

Open resir014 opened this issue 8 years ago • 4 comments

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.ts file.
  • [x] Write a simple tests file (screeps-tests.ts).
  • [x] Other minor tweaks and improvements.

resir014 avatar Aug 26 '17 13:08 resir014

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

resir014 avatar Oct 08 '17 02:10 resir014

I'm not sure how tests work either. When I have time, I will see what I can figure out.

thaelina avatar Oct 08 '17 12:10 thaelina

@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

resir014 avatar Oct 15 '17 15:10 resir014

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.

resir014 avatar Nov 26 '17 05:11 resir014