Screeps Typescript Declarations
The repository for Screep's TypeScript type definitions. https://screeps.com/
Discussion in screep's community forum
$ npm install screeps-typescript-declarations --save
Include declaration file in your typescript compiler (usually tsconfig.json), "files" attribute.
Or if you use typings, add this to your typings.json:
Note: When using this API, you can't access creeps in manner suggested in Screeps' tutorial:
Game.creeps.Worker1 // This is not allowed by TypeScript compiler
Instead, you have to use
This library will stay up to date only with the help of you! If active players don't update it, it'll get lost.
To update the declarations, edit the files in ./src folder.
To compile the declarations, run:
npm run compile
- Added new toPublic option to
- Fixed some issue with using
- New Creep.withdraw
- Added and fixed a lot of constants
- Fixed issues with REACTIONS and LOOK_* constants
GameMapto avoid conflict with new ES6 Map type
- Removed Energy Interface and replace it with Resource. This could potentially break your code. Please change all reference of Energy to Resource and it should fix the issue.
- Spawn will now extends OwnStructure, and StructureContainer will extends Structure.
- Fixed createCreep return type to
number | string.
- Updated new options for findPath
- Added string as an acceptable params to moveByPath.
v3.0.0 Change all usage of interface to class.
Please raise an issue if this break your code!
- Added new method StructureRampart.setPublic.
- Added new property StructureRamprt.isPublic.
- Added new global property Game.constructionSites.
- Added new argument asArray to methods Room.lookAtArea and Room.lookForAtArea
- Method Creep.moveByPath now accepts paths returned from PathFinder.search.
- Missing constants
- Problem with the Game arrays.
- RoomPosition opts fix. Filter and algorithm are optional.
- Added new STRUCTURE_CONTAINER constant
- New structure: Container
- Added Game.map.getRoomLinearDistance method.
v1.4.3 2016-03-18 Commited by NhanHo
- Added typings for various list of global objects in Game
- Add serializePath and deserializePath to Room
- Allow optional argument and properties in transferEnergy and PathFinderOps
- Fix for CostMatrix
- Added Extractor, Lab, Terminal, Market, Mineral objects
- New constants
- Read more from docs
- Updated all interfaces from 19.02 changelog and added docs to PathFinder ChangeLog.
- NhanHo added new PathFinder interface ChangeLog. Unfortunately other changes in that changelog are not added yet. We're working on it
New body part (CLAIM)
Documentation updates to support claim
Fixed missing NOT_ENOUGH_ENERGY constant
- Change room.controller and room.storage to correct type
- Updated RoomPosition declarations #1
- Removed HashMap from Game interface. It caused migration issues from JS to TS. #2
- Declare construction site variable (to fix instanceof problem)
- Removed empty memory interfaces
- Fixed createScreep() method return type
- Updated all declarations. Everything should be quite close to Screep's API (with minor exceptions if I missed something accidentally)
- Nhan Ho - Current maintainer - NhanHo
- Marko Sulamägi - Converted Cameron's work to quickly installable TS skeleton app. - MarkoSulamagi
- vanhouc - Screep project with TS functionality. His gulpfile and screep.d.ts was very useful. - vanhouc
See also the list of contributors who participated in this project.
This project is licensed under the MIT license.