Skip to content

Commit 45c873b

Browse files
committed
Update readme for typings instruction
1 parent 7210e2a commit 45c873b

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

README.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
55
Discussion in [screep's community forum](http://support.screeps.com/hc/en-us/community/posts/207116485-Writing-Screep-bots-with-Typescript?page=1#)
66

7-
# Usage
7+
# Installation
88

9-
Run command:
9+
Run command:
1010

1111
```
1212
$ npm install screeps-typescript-declarations --save
@@ -18,15 +18,24 @@ Include declaration file in your typescript compiler (usually tsconfig.json), "f
1818
"files": ["./your_sources_folder/**/*.ts", "./node_modules/screeps-typescript-declarations/dist/screeps.d.ts"],
1919
```
2020

21+
Or if you use [typings](https://github.com/typings/typings), add this to your typings.json:
22+
```json
23+
{
24+
"globalDependencies": {
25+
"screeps": "github:screepers/Screeps-Typescript-Declarations/dist/screeps.d.ts#master"
26+
}
27+
}
28+
```
29+
2130
# Usage
2231

23-
Note: When using this API, you can't access creeps in manner suggested in Screeps' tutorial:
32+
Note: When using this API, you can't access creeps in manner suggested in Screeps' tutorial:
2433

2534
```
2635
Game.creeps.Worker1 // This is not allowed by TypeScript compiler
2736
```
2837

29-
Instead, you have to use
38+
Instead, you have to use
3039

3140
```
3241
Game.creeps['Worker1']
@@ -36,7 +45,7 @@ Game.creeps['Worker1']
3645

3746
This library will stay up to date only with the help of you! If active players don't update it, it'll get lost.
3847

39-
To update the declarations, edit the files in ./src folder.
48+
To update the declarations, edit the files in ./src folder.
4049

4150
To compile the declarations, run:
4251

@@ -49,7 +58,7 @@ npm run compile
4958
### v4.0.1
5059
- Fix issues with REACTIONS and LOOK_* constants
5160

52-
### v4.0.0
61+
### v4.0.0
5362
- Change `Map` to `GameMap` to avoid conflict with new ES6 Map type
5463
- Remove 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.
5564
- Spawn will now extends OwnStructure, and StructureContainer will extends Structure.
@@ -58,7 +67,7 @@ npm run compile
5867
- Add string as an acceptable params to moveByPath.
5968

6069
### v3.0.0 Change all usage of interface to class.
61-
Please raise an issue if this break your code!
70+
Please raise an issue if this break your code!
6271

6372
### v2.1.0 2016-06-23 [ChangeLog] (http://support.screeps.com/hc/en-us/articles/209164605-Changelog-2016-06-17)
6473
- Added new method StructureRampart.setPublic.
@@ -89,18 +98,18 @@ Thanks [Strategic-Link-Consulting](https://github.com/Strategic-Link-Consulting)
8998
- Allow optional argument and properties in transferEnergy and PathFinderOps
9099

91100
### v1.4.2 2016-03-10
92-
- Fix for CostMatrix
101+
- Fix for CostMatrix
93102

94103
### v1.4.1 2016-03-10 [ChangeLog](http://support.screeps.com/hc/en-us/articles/207929925)
95104
- Added Extractor, Lab, Terminal, Market, Mineral objects
96105
- New constants
97106
- Read more from docs
98107

99108
### v1.3.2 2016-03-10 [ChangeLog](http://support.screeps.com/hc/en-us/articles/207023879-PathFinder)
100-
- Updated all interfaces from 19.02 changelog and added docs to PathFinder [ChangeLog](http://support.screeps.com/hc/en-us/articles/207728995-Changelog-2016-02-19).
109+
- Updated all interfaces from 19.02 changelog and added docs to PathFinder [ChangeLog](http://support.screeps.com/hc/en-us/articles/207728995-Changelog-2016-02-19).
101110

102111
### v1.3.1 2016-02-25 [PathFinder](http://support.screeps.com/hc/en-us/articles/207023879-PathFinder)
103-
- NhanHo added new PathFinder interface [ChangeLog](http://support.screeps.com/hc/en-us/articles/207728995-Changelog-2016-02-19).
112+
- NhanHo added new PathFinder interface [ChangeLog](http://support.screeps.com/hc/en-us/articles/207728995-Changelog-2016-02-19).
104113
Unfortunately other changes in that changelog are not added yet. We're working on it
105114

106115
### v1.2.2 2016-02-08 [ChangeLog](http://support.screeps.com/hc/en-us/articles/206897739-Changelog-2016-02-08)

0 commit comments

Comments
 (0)