File tree 2 files changed +29
-20
lines changed
2 files changed +29
-20
lines changed Original file line number Diff line number Diff line change 1
1
import { ErrorMapper } from "utils/ErrorMapper" ;
2
2
3
+ declare global {
4
+ /*
5
+ Example types, expand on these or remove them and add your own.
6
+ Note: Values, properties defined here do no fully *exist* by this type definiton alone.
7
+ You must also give them an implemention if you would like to use them. (ex. actually setting a `role` property in a Creeps memory)
8
+
9
+ Types added in this `global` block are in an ambient, global context. This is needed because `main.ts` is a module file (uses import or export).
10
+ Interfaces matching on name from @types/screeps will be merged. This is how you can extend the 'built-in' interfaces from @types/screeps.
11
+ */
12
+ // Memory extension samples
13
+ interface Memory {
14
+ uuid : number ;
15
+ log : any ;
16
+ }
17
+
18
+ interface CreepMemory {
19
+ role : string ;
20
+ room : string ;
21
+ working : boolean ;
22
+ }
23
+
24
+ // Syntax for adding proprties to `global` (ex "global.log")
25
+ namespace NodeJS {
26
+ interface Global {
27
+ log : any ;
28
+ }
29
+ }
30
+ }
31
+
3
32
// When compiling TS to JS and bundling with rollup, the line numbers and file names in error messages change
4
33
// This utility uses source maps to get the line numbers and file names of the original, TS source code
5
34
export const loop = ErrorMapper . wrapLoop ( ( ) => {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments