typed-screeps
typed-screeps copied to clipboard
Make the memory interface merging docs more explicit.
It doesn't need to be in a .d.ts, just in an ambient context. This means it can be:
- In a non-module source file (
.tswithout any imports or exports) in the formdeclare let thing: ... - In a module source file (
.tswith imports or exports) in the formdeclare global { let thing: ... } - In a declaration file (
.d.ts) in the formdeclare let thing: ...
Well, I'm happy as long as the docs are improved so that new users don't have to go through this same thing again.
Maybe the readme should link to https://github.com/screepers/screeps-typescript-starter/blob/master/src/types.d.ts and we put an example of CreepMemory in there?
@ahmedcharles Suggested change:
Example:
[code snip]
**Note:** This code needs to be in a file with a `.d.ts` extension and
the name cannot match any of the other base names in the same directory,
i.e. `memory.d.ts` without an adjecent `memory.ts`. See
[the declarations on the TypeScript starter kit](https://github.com/screepers/screeps-typescript-starter/blob/master/src/types.d.ts)
for example.