mlogjs 0.1.9 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/README.md +1 -1
  2. package/build/Compiler.js +40 -13
  3. package/build/Compiler.js.map +1 -1
  4. package/build/Scope.js.map +1 -1
  5. package/build/bin.js +16 -9
  6. package/build/bin.js.map +1 -1
  7. package/build/handlers/BlockStatement.js.map +1 -1
  8. package/build/handlers/CallExpression.js.map +1 -1
  9. package/build/handlers/ForStatement.js.map +1 -1
  10. package/build/handlers/Function.js +6 -3
  11. package/build/handlers/Function.js.map +1 -1
  12. package/build/handlers/Identifier.js.map +1 -1
  13. package/build/handlers/IfStatement.js.map +1 -1
  14. package/build/handlers/Literal.js +3 -1
  15. package/build/handlers/Literal.js.map +1 -1
  16. package/build/handlers/Object.d.ts +1 -0
  17. package/build/handlers/Object.js +12 -1
  18. package/build/handlers/Object.js.map +1 -1
  19. package/build/handlers/OperationExpressions.js +2 -1
  20. package/build/handlers/OperationExpressions.js.map +1 -1
  21. package/build/handlers/Program.js.map +1 -1
  22. package/build/handlers/Statements.js +3 -1
  23. package/build/handlers/Statements.js.map +1 -1
  24. package/build/handlers/TemplateExpression.js.map +1 -1
  25. package/build/handlers/VariableDeclaration.js +43 -19
  26. package/build/handlers/VariableDeclaration.js.map +1 -1
  27. package/build/handlers/WhileStatement.js.map +1 -1
  28. package/build/handlers/index.js +5 -1
  29. package/build/handlers/index.js.map +1 -1
  30. package/build/index.js.map +1 -1
  31. package/build/instructions/AddressResolver.js +1 -2
  32. package/build/instructions/AddressResolver.js.map +1 -1
  33. package/build/instructions/ControlInstructions.js.map +1 -1
  34. package/build/instructions/EndInstruction.js.map +1 -1
  35. package/build/instructions/InstructionBase.js.map +1 -1
  36. package/build/instructions/JumpInstruction.js.map +1 -1
  37. package/build/instructions/OperationInstruction.js.map +1 -1
  38. package/build/instructions/SetCounterInstruction.js.map +1 -1
  39. package/build/instructions/SetInstruction.js.map +1 -1
  40. package/build/instructions/ZeroSpaceInstruction.js.map +1 -1
  41. package/build/instructions/index.js +5 -1
  42. package/build/instructions/index.js.map +1 -1
  43. package/build/macros/Blocks.js +15 -6
  44. package/build/macros/Blocks.js.map +1 -1
  45. package/build/macros/Building.d.ts +11 -0
  46. package/build/macros/Building.js +81 -0
  47. package/build/macros/Building.js.map +1 -0
  48. package/build/macros/Draw.js +7 -2
  49. package/build/macros/Draw.js.map +1 -1
  50. package/build/macros/Function.js.map +1 -1
  51. package/build/macros/Items.d.ts +5 -0
  52. package/build/macros/Items.js +20 -0
  53. package/build/macros/Items.js.map +1 -0
  54. package/build/macros/Liquids.d.ts +5 -0
  55. package/build/macros/Liquids.js +18 -0
  56. package/build/macros/Liquids.js.map +1 -0
  57. package/build/macros/Math.js +9 -9
  58. package/build/macros/Math.js.map +1 -1
  59. package/build/macros/Memory.d.ts +5 -0
  60. package/build/macros/Memory.js +61 -0
  61. package/build/macros/Memory.js.map +1 -0
  62. package/build/macros/Namespace.d.ts +21 -0
  63. package/build/macros/Namespace.js +98 -0
  64. package/build/macros/Namespace.js.map +1 -0
  65. package/build/macros/Other.d.ts +0 -3
  66. package/build/macros/Other.js +2 -11
  67. package/build/macros/Other.js.map +1 -1
  68. package/build/macros/RawValue.d.ts +5 -0
  69. package/build/macros/RawValue.js +16 -0
  70. package/build/macros/RawValue.js.map +1 -0
  71. package/build/macros/Symbol.d.ts +0 -0
  72. package/build/macros/Symbol.js +1 -0
  73. package/build/macros/Symbol.js.map +1 -0
  74. package/build/macros/SymbolNamespace.d.ts +0 -0
  75. package/build/macros/SymbolNamespace.js +1 -0
  76. package/build/macros/SymbolNamespace.js.map +1 -0
  77. package/build/macros/TypeFactory.js.map +1 -1
  78. package/build/macros/Units.d.ts +5 -0
  79. package/build/macros/Units.js +18 -0
  80. package/build/macros/Units.js.map +1 -0
  81. package/build/macros/Vars.d.ts +5 -0
  82. package/build/macros/Vars.js +18 -0
  83. package/build/macros/Vars.js.map +1 -0
  84. package/build/macros/commands/Asm.d.ts +5 -0
  85. package/build/macros/commands/Asm.js +21 -0
  86. package/build/macros/commands/Asm.js.map +1 -0
  87. package/build/macros/commands/Draw.d.ts +5 -0
  88. package/build/macros/commands/Draw.js +39 -0
  89. package/build/macros/commands/Draw.js.map +1 -0
  90. package/build/macros/commands/DrawFlush.d.ts +5 -0
  91. package/build/macros/commands/DrawFlush.js +17 -0
  92. package/build/macros/commands/DrawFlush.js.map +1 -0
  93. package/build/macros/commands/GetLink.d.ts +5 -0
  94. package/build/macros/commands/GetLink.js +21 -0
  95. package/build/macros/commands/GetLink.js.map +1 -0
  96. package/build/macros/commands/Lookup.d.ts +5 -0
  97. package/build/macros/commands/Lookup.js +24 -0
  98. package/build/macros/commands/Lookup.js.map +1 -0
  99. package/build/macros/commands/Print.d.ts +5 -0
  100. package/build/macros/commands/Print.js +14 -0
  101. package/build/macros/commands/Print.js.map +1 -0
  102. package/build/macros/commands/PrintFlush.d.ts +5 -0
  103. package/build/macros/commands/PrintFlush.js +17 -0
  104. package/build/macros/commands/PrintFlush.js.map +1 -0
  105. package/build/macros/commands/Radar.d.ts +7 -0
  106. package/build/macros/commands/Radar.js +61 -0
  107. package/build/macros/commands/Radar.js.map +1 -0
  108. package/build/macros/commands/Sensor.d.ts +5 -0
  109. package/build/macros/commands/Sensor.js +20 -0
  110. package/build/macros/commands/Sensor.js.map +1 -0
  111. package/build/macros/commands/UnitBind.d.ts +5 -0
  112. package/build/macros/commands/UnitBind.js +17 -0
  113. package/build/macros/commands/UnitBind.js.map +1 -0
  114. package/build/macros/commands/UnitControl.d.ts +5 -0
  115. package/build/macros/commands/UnitControl.js +68 -0
  116. package/build/macros/commands/UnitControl.js.map +1 -0
  117. package/build/macros/commands/UnitLocate.d.ts +5 -0
  118. package/build/macros/commands/UnitLocate.js +55 -0
  119. package/build/macros/commands/UnitLocate.js.map +1 -0
  120. package/build/macros/commands/UnitRadar.d.ts +5 -0
  121. package/build/macros/commands/UnitRadar.js +41 -0
  122. package/build/macros/commands/UnitRadar.js.map +1 -0
  123. package/build/macros/commands/Wait.d.ts +5 -0
  124. package/build/macros/commands/Wait.js +18 -0
  125. package/build/macros/commands/Wait.js.map +1 -0
  126. package/build/macros/commands/control.d.ts +5 -0
  127. package/build/macros/commands/control.js +25 -0
  128. package/build/macros/commands/control.js.map +1 -0
  129. package/build/macros/commands/index.d.ts +14 -0
  130. package/build/macros/commands/index.js +33 -0
  131. package/build/macros/commands/index.js.map +1 -0
  132. package/build/macros/commands/io.d.ts +8 -0
  133. package/build/macros/commands/io.js +47 -0
  134. package/build/macros/commands/io.js.map +1 -0
  135. package/build/macros/helpers/GetBuilding.d.ts +5 -0
  136. package/build/macros/helpers/GetBuilding.js +16 -0
  137. package/build/macros/helpers/GetBuilding.js.map +1 -0
  138. package/build/macros/helpers/GetVar.d.ts +5 -0
  139. package/build/macros/helpers/GetVar.js +16 -0
  140. package/build/macros/helpers/GetVar.js.map +1 -0
  141. package/build/macros/helpers/index.d.ts +2 -0
  142. package/build/{scopes → macros/helpers}/index.js +2 -3
  143. package/build/macros/helpers/index.js.map +1 -0
  144. package/build/macros/index.d.ts +4 -2
  145. package/build/macros/index.js +25 -3
  146. package/build/macros/index.js.map +1 -1
  147. package/build/operators.d.ts +3 -0
  148. package/build/operators.js +79 -16
  149. package/build/operators.js.map +1 -1
  150. package/build/types.js +5 -1
  151. package/build/types.js.map +1 -1
  152. package/build/utils.d.ts +1 -0
  153. package/build/utils.js +5 -1
  154. package/build/utils.js.map +1 -1
  155. package/build/values/BaseValue.js +13 -3
  156. package/build/values/BaseValue.js.map +1 -1
  157. package/build/values/FunctionValue.js +5 -2
  158. package/build/values/FunctionValue.js.map +1 -1
  159. package/build/values/LiteralValue.js +4 -5
  160. package/build/values/LiteralValue.js.map +1 -1
  161. package/build/values/ObjectValue.js.map +1 -1
  162. package/build/values/StoreValue.js.map +1 -1
  163. package/build/values/TempValue.js +16 -2
  164. package/build/values/TempValue.js.map +1 -1
  165. package/build/values/VoidValue.js.map +1 -1
  166. package/build/values/index.js +5 -1
  167. package/build/values/index.js.map +1 -1
  168. package/dist/bundle.js +1 -553
  169. package/lib/commands.d.ts +326 -0
  170. package/lib/eslib/index.d.ts +3 -0
  171. package/lib/eslib/lib.d.ts +9 -0
  172. package/lib/eslib/lib.es2015.collection.d.ts +89 -0
  173. package/lib/eslib/lib.es2015.core.d.ts +16 -0
  174. package/lib/eslib/lib.es2015.d.ts +30 -0
  175. package/lib/eslib/lib.es2015.generator.d.ts +79 -0
  176. package/lib/eslib/lib.es2015.iterable.d.ts +70 -0
  177. package/lib/eslib/lib.es5.d.ts +295 -0
  178. package/lib/eslib/lib.es6.d.ts +18 -0
  179. package/lib/globals.d.ts +328 -0
  180. package/lib/helpers.d.ts +23 -0
  181. package/lib/index.d.ts +7 -0
  182. package/lib/kinds.d.ts +36 -0
  183. package/lib/memory.d.ts +17 -0
  184. package/lib/traits.d.ts +121 -0
  185. package/lib/util.d.ts +32 -0
  186. package/package.json +21 -10
  187. package/.gitattributes +0 -2
  188. package/build/scopes/FunctionScope.d.ts +0 -5
  189. package/build/scopes/FunctionScope.js +0 -13
  190. package/build/scopes/FunctionScope.js.map +0 -1
  191. package/build/scopes/LoopScope.d.ts +0 -5
  192. package/build/scopes/LoopScope.js +0 -13
  193. package/build/scopes/LoopScope.js.map +0 -1
  194. package/build/scopes/Scope.d.ts +0 -36
  195. package/build/scopes/Scope.js +0 -93
  196. package/build/scopes/Scope.js.map +0 -1
  197. package/build/scopes/index.d.ts +0 -3
  198. package/build/scopes/index.js.map +0 -1
  199. package/mlogjs.d.ts +0 -72
  200. package/tsconfig.json +0 -22
  201. package/webpack.config.js +0 -22
@@ -0,0 +1,295 @@
1
+ /// <reference no-default-lib="true"/>
2
+
3
+ interface Symbol {}
4
+
5
+ interface SymbolConstructor {}
6
+
7
+ declare var Symbol: SymbolConstructor;
8
+ interface Object {}
9
+
10
+ /**
11
+ * Creates a new function.
12
+ */
13
+ interface Function {}
14
+
15
+ /**
16
+ * Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter.
17
+ */
18
+ type ThisParameterType<T> = T extends (this: infer U, ...args: any[]) => any
19
+ ? U
20
+ : unknown;
21
+
22
+ /**
23
+ * Removes the 'this' parameter from a function type.
24
+ */
25
+ type OmitThisParameter<T> = unknown extends ThisParameterType<T>
26
+ ? T
27
+ : T extends (...args: infer A) => infer R
28
+ ? (...args: A) => R
29
+ : T;
30
+
31
+ interface CallableFunction extends Function {}
32
+
33
+ interface NewableFunction extends Function {}
34
+
35
+ interface IArguments {}
36
+
37
+ interface String {
38
+ /** Returns the length of a String object. */
39
+ readonly length: number;
40
+ }
41
+
42
+ interface Boolean {}
43
+
44
+ interface Number {}
45
+
46
+ interface TemplateStringsArray extends ReadonlyArray<string> {
47
+ readonly raw: readonly string[];
48
+ }
49
+
50
+ /**
51
+ * The type of `import.meta`.
52
+ *
53
+ * If you need to declare that a given property exists on `import.meta`,
54
+ * this type may be augmented via interface merging.
55
+ */
56
+ interface ImportMeta {}
57
+
58
+ interface Math {
59
+ /**
60
+ * Returns the larger of two of supplied numeric expressions.
61
+ * @param a
62
+ * @param b
63
+ */
64
+ max(a: number, b: number): number;
65
+
66
+ /**
67
+ * Returns the smaller of two of supplied numeric expressions.
68
+ * @param a
69
+ * @param b
70
+ */
71
+ min(a: number, b: number): number;
72
+
73
+ /**
74
+ * Returns the angle of a vector in degrees
75
+ * @param a
76
+ * @param b
77
+ */
78
+ angle(a: number, b: number): number;
79
+
80
+ /**
81
+ * Returns the length of a vector
82
+ * @param a
83
+ * @param b
84
+ */
85
+ len(a: number, b: number): number;
86
+
87
+ /**
88
+ * Returns 2D simplex noise
89
+ * @param x
90
+ * @param y
91
+ */
92
+ noise(x: number, y: number): number;
93
+
94
+ /**
95
+ * Returns the absolute value of a number.
96
+ * @example
97
+ * Math.abs(-5) // 5
98
+ * Math.abs(5) // 5
99
+ * @param x
100
+ */
101
+ abs(x: number): number;
102
+
103
+ /**
104
+ * Returns the natural logarithm (base e) of a number
105
+ * @param x
106
+ */
107
+ log(x: number): number;
108
+
109
+ /**
110
+ * Returns the logarithm (base 10) of a number
111
+ * @param x
112
+ */
113
+ log10(x: number): number;
114
+
115
+ sin(x: number): number;
116
+ cos(x: number): number;
117
+ tan(x: number): number;
118
+ floor(x: number): number;
119
+ ceil(x: number): number;
120
+ sqrt(x: number): number;
121
+
122
+ /**
123
+ * Returns a random floating point number from 0 to `range` (excluding `range` istself)
124
+ * @param range
125
+ */
126
+ rand(range: number): number;
127
+ }
128
+ declare const Math: Math;
129
+
130
+ interface Error {}
131
+
132
+ interface EvalError extends Error {}
133
+
134
+ interface RangeError extends Error {}
135
+
136
+ interface ReferenceError extends Error {}
137
+
138
+ interface SyntaxError extends Error {}
139
+
140
+ interface TypeError extends Error {}
141
+
142
+ interface URIError extends Error {}
143
+
144
+ /////////////////////////////
145
+ /// ECMAScript Array API (specially handled by compiler)
146
+ /////////////////////////////
147
+
148
+ interface ReadonlyArray<T> {
149
+ /**
150
+ * Gets the length of the array. This is a number one higher than the highest element defined in an array.
151
+ */
152
+ readonly length: number;
153
+
154
+ readonly [n: number]: T;
155
+ }
156
+
157
+ interface ConcatArray<T> {
158
+ readonly length: number;
159
+ readonly [n: number]: T;
160
+ }
161
+
162
+ interface Array<T> {
163
+ /**
164
+ * Gets or sets the length of the array. This is a number one higher than the highest index in the array.
165
+ */
166
+ length: number;
167
+
168
+ [n: number]: T;
169
+ }
170
+
171
+ interface ArrayLike<T> {
172
+ readonly length: number;
173
+ readonly [n: number]: T;
174
+ }
175
+
176
+ /**
177
+ * Make all properties in T optional
178
+ */
179
+ type Partial<T> = {
180
+ [P in keyof T]?: T[P];
181
+ };
182
+
183
+ /**
184
+ * Make all properties in T required
185
+ */
186
+ type Required<T> = {
187
+ [P in keyof T]-?: T[P];
188
+ };
189
+
190
+ /**
191
+ * Make all properties in T readonly
192
+ */
193
+ type Readonly<T> = {
194
+ readonly [P in keyof T]: T[P];
195
+ };
196
+
197
+ /**
198
+ * From T, pick a set of properties whose keys are in the union K
199
+ */
200
+ type Pick<T, K extends keyof T> = {
201
+ [P in K]: T[P];
202
+ };
203
+
204
+ /**
205
+ * Construct a type with a set of properties K of type T
206
+ */
207
+ type Record<K extends keyof any, T> = {
208
+ [P in K]: T;
209
+ };
210
+
211
+ /**
212
+ * Exclude from T those types that are assignable to U
213
+ */
214
+ type Exclude<T, U> = T extends U ? never : T;
215
+
216
+ /**
217
+ * Extract from T those types that are assignable to U
218
+ */
219
+ type Extract<T, U> = T extends U ? T : never;
220
+
221
+ /**
222
+ * Construct a type with the properties of T except for those in type K.
223
+ */
224
+ type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
225
+
226
+ /**
227
+ * Exclude null and undefined from T
228
+ */
229
+ type NonNullable<T> = T extends null | undefined ? never : T;
230
+
231
+ /**
232
+ * Obtain the parameters of a function type in a tuple
233
+ */
234
+ type Parameters<T extends (...args: any) => any> = T extends (
235
+ ...args: infer P
236
+ ) => any
237
+ ? P
238
+ : never;
239
+
240
+ /**
241
+ * Obtain the parameters of a constructor function type in a tuple
242
+ */
243
+ type ConstructorParameters<T extends new (...args: any) => any> =
244
+ T extends new (...args: infer P) => any ? P : never;
245
+
246
+ /**
247
+ * Obtain the return type of a function type
248
+ */
249
+ type ReturnType<T extends (...args: any) => any> = T extends (
250
+ ...args: any
251
+ ) => infer R
252
+ ? R
253
+ : any;
254
+
255
+ /**
256
+ * Obtain the return type of a constructor function type
257
+ */
258
+ type InstanceType<T extends new (...args: any) => any> = T extends new (
259
+ ...args: any
260
+ ) => infer R
261
+ ? R
262
+ : any;
263
+
264
+ /**
265
+ * Convert string literal type to uppercase
266
+ */
267
+ type Uppercase<S extends string> = intrinsic;
268
+
269
+ /**
270
+ * Convert string literal type to lowercase
271
+ */
272
+ type Lowercase<S extends string> = intrinsic;
273
+
274
+ /**
275
+ * Convert first character of string literal type to uppercase
276
+ */
277
+ type Capitalize<S extends string> = intrinsic;
278
+
279
+ /**
280
+ * Convert first character of string literal type to lowercase
281
+ */
282
+ type Uncapitalize<S extends string> = intrinsic;
283
+
284
+ /**
285
+ * Marker for contextual 'this' type
286
+ */
287
+ interface ThisType<T> {}
288
+
289
+ /////////////////////////////
290
+ /// ECMAScript Internationalization API
291
+ /////////////////////////////
292
+
293
+ interface String {}
294
+
295
+ interface Number {}
@@ -0,0 +1,18 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+ /// <reference no-default-lib="true"/>
17
+
18
+ /// <reference lib="es2015" />
@@ -0,0 +1,328 @@
1
+ /// <reference path="./kinds.d.ts" />
2
+
3
+ declare enum ControlKind {
4
+ ctrlPlayer,
5
+ ctrlProcessor,
6
+ ctrlFormation,
7
+ }
8
+
9
+ interface Vars {
10
+ /** The processor currently executing this code */
11
+ readonly this: BasicBuilding &
12
+ Typed<
13
+ | typeof Blocks.microProcessor
14
+ | typeof Blocks.logicProcessor
15
+ | typeof Blocks.hyperProcessor
16
+ >;
17
+ /** The position on the x axis of this processor */
18
+ readonly thisx: number;
19
+ /** The position on the y axis of this processor */
20
+ readonly thisy: number;
21
+ /** The width of the map */
22
+ readonly mapw: number;
23
+ /** The height of the map */
24
+ readonly maph: number;
25
+ /** The number of blocks linked to this processor */
26
+ readonly links: number;
27
+ /** The amount of instructions run per second */
28
+ readonly ipt: number;
29
+ /** The unit bound to this processor */
30
+ readonly unit: AnyUnit;
31
+ }
32
+
33
+ declare const Vars: Vars;
34
+
35
+ declare namespace Items {
36
+ const copper: unique symbol;
37
+ const lead: unique symbol;
38
+ const metaglass: unique symbol;
39
+ const graphite: unique symbol;
40
+ const sand: unique symbol;
41
+ const coal: unique symbol;
42
+ const titanium: unique symbol;
43
+ const thorium: unique symbol;
44
+ const scrap: unique symbol;
45
+ const silicon: unique symbol;
46
+ const plastanium: unique symbol;
47
+ const phaseFabric: unique symbol;
48
+ const surgeAlloy: unique symbol;
49
+ const sporePod: unique symbol;
50
+ const blastCompound: unique symbol;
51
+ const pyratite: unique symbol;
52
+ }
53
+
54
+ type ItemSymbol = typeof Items[keyof typeof Items];
55
+
56
+ declare namespace Liquids {
57
+ const water: unique symbol;
58
+ const slag: unique symbol;
59
+ const oil: unique symbol;
60
+ const cryofluid: unique symbol;
61
+ }
62
+
63
+ type LiquidSymbol = typeof Liquids[keyof typeof Liquids];
64
+
65
+ declare namespace Units {
66
+ const dagger: unique symbol;
67
+ const mace: unique symbol;
68
+ const fortress: unique symbol;
69
+ const scepter: unique symbol;
70
+ const reign: unique symbol;
71
+ const nova: unique symbol;
72
+ const pulsar: unique symbol;
73
+ const quasar: unique symbol;
74
+ const vela: unique symbol;
75
+ const corvus: unique symbol;
76
+ const crawler: unique symbol;
77
+ const atrax: unique symbol;
78
+ const spiroct: unique symbol;
79
+ const arkyid: unique symbol;
80
+ const toxopid: unique symbol;
81
+ const flare: unique symbol;
82
+ const horizon: unique symbol;
83
+ const zenith: unique symbol;
84
+ const antumbra: unique symbol;
85
+ const eclipse: unique symbol;
86
+ const mono: unique symbol;
87
+ const poly: unique symbol;
88
+ const mega: unique symbol;
89
+ const quad: unique symbol;
90
+ const oct: unique symbol;
91
+ const risso: unique symbol;
92
+ const minke: unique symbol;
93
+ const bryde: unique symbol;
94
+ const sei: unique symbol;
95
+ const omura: unique symbol;
96
+ const retusa: unique symbol;
97
+ const oxynoe: unique symbol;
98
+ const cyerce: unique symbol;
99
+ const aegires: unique symbol;
100
+ const navanax: unique symbol;
101
+ const alpha: unique symbol;
102
+ const beta: unique symbol;
103
+ const gamma: unique symbol;
104
+ }
105
+
106
+ type UnitSymbol = typeof Units[keyof typeof Units];
107
+
108
+ declare namespace LAccess {
109
+ const totalItems: unique symbol;
110
+ const firstItem: unique symbol;
111
+ const totalLiquids: unique symbol;
112
+ const totalPower: unique symbol;
113
+ const itemCapacity: unique symbol;
114
+ const liquidCapacity: unique symbol;
115
+ const powerCapacity: unique symbol;
116
+ const powerNetStored: unique symbol;
117
+ const powerNetCapacity: unique symbol;
118
+ const powerNetIn: unique symbol;
119
+ const powerNetOut: unique symbol;
120
+ const ammo: unique symbol;
121
+ const ammoCapacity: unique symbol;
122
+ const health: unique symbol;
123
+ const maxHealth: unique symbol;
124
+ const heat: unique symbol;
125
+ const efficiency: unique symbol;
126
+ const progress: unique symbol;
127
+ const timescale: unique symbol;
128
+ const rotation: unique symbol;
129
+ const x: unique symbol;
130
+ const y: unique symbol;
131
+ const shootX: unique symbol;
132
+ const shootY: unique symbol;
133
+ const size: unique symbol;
134
+ const dead: unique symbol;
135
+ const range: unique symbol;
136
+ const shooting: unique symbol;
137
+ const boosting: unique symbol;
138
+ const mineX: unique symbol;
139
+ const mineY: unique symbol;
140
+ const mining: unique symbol;
141
+ const team: unique symbol;
142
+ const type: unique symbol;
143
+ const flag: unique symbol;
144
+ const controlled: unique symbol;
145
+ const controller: unique symbol;
146
+ const commanded: unique symbol;
147
+ const name: unique symbol;
148
+ const payloadCount: unique symbol;
149
+ const payloadType: unique symbol;
150
+ const enabled: unique symbol;
151
+ const shoot: unique symbol;
152
+ const shootp: unique symbol;
153
+ const config: unique symbol;
154
+ const color: unique symbol;
155
+ }
156
+
157
+ declare namespace UnitCommands {
158
+ const attack: unique symbol;
159
+ const rally: unique symbol;
160
+ const idle: unique symbol;
161
+ }
162
+
163
+ type UnitCommandSymbol = typeof UnitCommands[keyof typeof UnitCommands];
164
+
165
+ declare namespace Blocks {
166
+ // special "blocks" to reference stuff from the environment
167
+ const air: unique symbol;
168
+ const solid: unique symbol;
169
+
170
+ const siliconSmelter: unique symbol;
171
+ const siliconCrucible: unique symbol;
172
+ const kiln: unique symbol;
173
+ const graphitePress: unique symbol;
174
+ const plastaniumCompressor: unique symbol;
175
+ const multiPress: unique symbol;
176
+ const phaseWeaver: unique symbol;
177
+ const surgeSmelter: unique symbol;
178
+ const pyratiteMixer: unique symbol;
179
+ const blastMixer: unique symbol;
180
+ const cryofluidMixer: unique symbol;
181
+ const melter: unique symbol;
182
+ const separator: unique symbol;
183
+ const disassembler: unique symbol;
184
+ const sporePress: unique symbol;
185
+ const pulverizer: unique symbol;
186
+ const incinerator: unique symbol;
187
+ const coalCentrifuge: unique symbol;
188
+ const powerSource: unique symbol;
189
+ const powerVoid: unique symbol;
190
+ const itemSource: unique symbol;
191
+ const itemVoid: unique symbol;
192
+ const liquidSource: unique symbol;
193
+ const liquidVoid: unique symbol;
194
+ const payloadSource: unique symbol;
195
+ const payloadVoid: unique symbol;
196
+ const illuminator: unique symbol;
197
+ const copperWall: unique symbol;
198
+ const copperWallLarge: unique symbol;
199
+ const titaniumWall: unique symbol;
200
+ const titaniumWallLarge: unique symbol;
201
+ const plastaniumWall: unique symbol;
202
+ const plastaniumWallLarge: unique symbol;
203
+ const thoriumWall: unique symbol;
204
+ const thoriumWallLarge: unique symbol;
205
+ const door: unique symbol;
206
+ const doorLarge: unique symbol;
207
+ const phaseWall: unique symbol;
208
+ const phaseWallLarge: unique symbol;
209
+ const surgeWall: unique symbol;
210
+ const surgeWallLarge: unique symbol;
211
+ const mender: unique symbol;
212
+ const mendProjector: unique symbol;
213
+ const overdriveProjector: unique symbol;
214
+ const overdriveDome: unique symbol;
215
+ const forceProjector: unique symbol;
216
+ const shockMine: unique symbol;
217
+ const scrapWall: unique symbol;
218
+ const scrapWallLarge: unique symbol;
219
+ const scrapWallHuge: unique symbol;
220
+ const scrapWallGigantic: unique symbol;
221
+ const thruster: unique symbol;
222
+ const conveyor: unique symbol;
223
+ const titaniumConveyor: unique symbol;
224
+ const plastaniumConveyor: unique symbol;
225
+ const armoredConveyor: unique symbol;
226
+ const distributor: unique symbol;
227
+ const junction: unique symbol;
228
+ const itemBridge: unique symbol;
229
+ const phaseConveyor: unique symbol;
230
+ const sorter: unique symbol;
231
+ const invertedSorter: unique symbol;
232
+ const router: unique symbol;
233
+ const overflowGate: unique symbol;
234
+ const underflowGate: unique symbol;
235
+ const massDriver: unique symbol;
236
+ const duct: unique symbol;
237
+ const ductRouter: unique symbol;
238
+ const ductBridge: unique symbol;
239
+ const mechanicalPump: unique symbol;
240
+ const rotaryPump: unique symbol;
241
+ const thermalPump: unique symbol;
242
+ const conduit: unique symbol;
243
+ const pulseConduit: unique symbol;
244
+ const platedConduit: unique symbol;
245
+ const liquidRouter: unique symbol;
246
+ const liquidContainer: unique symbol;
247
+ const liquidTank: unique symbol;
248
+ const liquidJunction: unique symbol;
249
+ const bridgeConduit: unique symbol;
250
+ const phaseConduit: unique symbol;
251
+ const combustionGenerator: unique symbol;
252
+ const thermalGenerator: unique symbol;
253
+ const steamGenerator: unique symbol;
254
+ const differentialGenerator: unique symbol;
255
+ const rtgGenerator: unique symbol;
256
+ const solarPanel: unique symbol;
257
+ const largeSolarPanel: unique symbol;
258
+ const thoriumReactor: unique symbol;
259
+ const impactReactor: unique symbol;
260
+ const battery: unique symbol;
261
+ const batteryLarge: unique symbol;
262
+ const powerNode: unique symbol;
263
+ const powerNodeLarge: unique symbol;
264
+ const surgeTower: unique symbol;
265
+ const diode: unique symbol;
266
+ const mechanicalDrill: unique symbol;
267
+ const pneumaticDrill: unique symbol;
268
+ const laserDrill: unique symbol;
269
+ const blastDrill: unique symbol;
270
+ const waterExtractor: unique symbol;
271
+ const oilExtractor: unique symbol;
272
+ const cultivator: unique symbol;
273
+ const coreShard: unique symbol;
274
+ const coreFoundation: unique symbol;
275
+ const coreNucleus: unique symbol;
276
+ const vault: unique symbol;
277
+ const container: unique symbol;
278
+ const unloader: unique symbol;
279
+ const duo: unique symbol;
280
+ const scatter: unique symbol;
281
+ const scorch: unique symbol;
282
+ const hail: unique symbol;
283
+ const arc: unique symbol;
284
+ const wave: unique symbol;
285
+ const lancer: unique symbol;
286
+ const swarmer: unique symbol;
287
+ const salvo: unique symbol;
288
+ const fuse: unique symbol;
289
+ const ripple: unique symbol;
290
+ const cyclone: unique symbol;
291
+ const foreshadow: unique symbol;
292
+ const spectre: unique symbol;
293
+ const meltdown: unique symbol;
294
+ const segment: unique symbol;
295
+ const parallax: unique symbol;
296
+ const tsunami: unique symbol;
297
+ const commandCenter: unique symbol;
298
+ const groundFactory: unique symbol;
299
+ const airFactory: unique symbol;
300
+ const navalFactory: unique symbol;
301
+ const additiveReconstructor: unique symbol;
302
+ const multiplicativeReconstructor: unique symbol;
303
+ const exponentialReconstructor: unique symbol;
304
+ const tetrativeReconstructor: unique symbol;
305
+ const repairPoint: unique symbol;
306
+ const repairTurret: unique symbol;
307
+ const payloadConveyor: unique symbol;
308
+ const payloadRouter: unique symbol;
309
+ const payloadPropulsionTower: unique symbol;
310
+ const deconstructor: unique symbol;
311
+ const constructor: unique symbol;
312
+ const largeConstructor: unique symbol;
313
+ const payloadLoader: unique symbol;
314
+ const payloadUnloader: unique symbol;
315
+ const message: unique symbol;
316
+ const switchBlock: unique symbol;
317
+ const microProcessor: unique symbol;
318
+ const logicProcessor: unique symbol;
319
+ const hyperProcessor: unique symbol;
320
+ const largeLogicDisplay: unique symbol;
321
+ const logicDisplay: unique symbol;
322
+ const memoryCell: unique symbol;
323
+ const memoryBank: unique symbol;
324
+ const launchPad: unique symbol;
325
+ const interplanetaryAccelerator: unique symbol;
326
+ }
327
+
328
+ type BlockSymbol = typeof Blocks[keyof typeof Blocks];
@@ -0,0 +1,23 @@
1
+ /// <reference path="./kinds.d.ts" />
2
+
3
+ /**
4
+ * Allows getting unlisted processor variables or symbols.
5
+ *
6
+ * Using this method is discouraged because most values are
7
+ * already accessible under the namespaces `Units`, `Blocks`,
8
+ * `Items`, `Liquids`, `ControlKind`, `Vars` and `UnitCommands`.
9
+ *
10
+ * @param key The identifier of the value
11
+ */
12
+ declare function getVar<T>(key: string): T;
13
+
14
+ /**
15
+ * Gets a building linked to the processor by its name.
16
+ *
17
+ * @param name
18
+ */
19
+ declare function getBuilding<T extends BasicBuilding = AnyBuilding>(
20
+ name: string
21
+ ): T;
22
+
23
+ declare function concat(...strings: string[]): string;
package/lib/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ /// <reference path="./eslib/index.d.ts" />
2
+ /// <reference path="./commands.d.ts" />
3
+ /// <reference path="./globals.d.ts" />
4
+ /// <reference path="./helpers.d.ts" />
5
+ /// <reference path="./kinds.d.ts" />
6
+ /// <reference path="./memory.d.ts" />
7
+ /// <reference path="./traits.d.ts" />
package/lib/kinds.d.ts ADDED
@@ -0,0 +1,36 @@
1
+ /// <reference path="./traits.d.ts" />
2
+
3
+ interface BasicUnit
4
+ extends ItemHolder,
5
+ Shooting,
6
+ WithHealth,
7
+ Rotatable,
8
+ Spaced,
9
+ Ranged,
10
+ Typed<UnitSymbol>,
11
+ Flagged,
12
+ Controllable,
13
+ Nameable {}
14
+
15
+ interface AnyUnit extends BasicUnit, Boosted {}
16
+
17
+ interface BasicBuilding
18
+ extends LiquidHolder,
19
+ ItemHolder,
20
+ PowerHolder,
21
+ WithHealth,
22
+ WithEffiency,
23
+ WithTimescale,
24
+ Rotatable,
25
+ Spaced,
26
+ Ranged,
27
+ Typed<BlockSymbol>,
28
+ WithEnable,
29
+ WithConfig {}
30
+
31
+ interface BasicTurret extends BasicBuilding, Shooting, WithProgress {}
32
+
33
+ // just to make this future proof
34
+ interface AnyTurret extends BasicTurret {}
35
+
36
+ interface AnyBuilding extends AnyTurret, Heatable {}