mlogjs 0.1.11 → 0.2.2
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.
- package/LICENSE +21 -21
- package/README.md +68 -18
- package/build/bin.cjs +69 -0
- package/dist/bin.cjs +69 -0
- package/dist/index.cjs +1817 -0
- package/dist/index.mjs +1813 -0
- package/dist/types/Compiler.d.ts +18 -0
- package/{build → dist/types}/Scope.d.ts +8 -11
- package/dist/types/bin.d.ts +1 -0
- package/dist/types/handlers/BlockStatement.d.ts +2 -0
- package/dist/types/handlers/CallExpression.d.ts +3 -0
- package/dist/types/handlers/ForStatement.d.ts +2 -0
- package/{build → dist/types}/handlers/Function.d.ts +0 -0
- package/{build → dist/types}/handlers/Identifier.d.ts +0 -0
- package/dist/types/handlers/IfStatement.d.ts +2 -0
- package/{build → dist/types}/handlers/Literal.d.ts +0 -0
- package/{build → dist/types}/handlers/Object.d.ts +0 -0
- package/{build → dist/types}/handlers/OperationExpressions.d.ts +0 -0
- package/dist/types/handlers/Program.d.ts +2 -0
- package/dist/types/handlers/Statements.d.ts +5 -0
- package/dist/types/handlers/TemplateExpression.d.ts +2 -0
- package/dist/types/handlers/VariableDeclaration.d.ts +3 -0
- package/dist/types/handlers/WhileStatement.d.ts +2 -0
- package/{build → dist/types}/handlers/index.d.ts +0 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/initScope.d.ts +2 -0
- package/{build → dist/types}/instructions/AddressResolver.d.ts +1 -1
- package/{build → dist/types}/instructions/ControlInstructions.d.ts +0 -0
- package/{build → dist/types}/instructions/EndInstruction.d.ts +0 -0
- package/{build → dist/types}/instructions/InstructionBase.d.ts +2 -2
- package/{build → dist/types}/instructions/JumpInstruction.d.ts +1 -1
- package/{build → dist/types}/instructions/OperationInstruction.d.ts +1 -1
- package/{build → dist/types}/instructions/SetCounterInstruction.d.ts +0 -0
- package/{build → dist/types}/instructions/SetInstruction.d.ts +0 -0
- package/{build → dist/types}/instructions/ZeroSpaceInstruction.d.ts +0 -0
- package/{build → dist/types}/instructions/index.d.ts +0 -0
- package/dist/types/macros/Building.d.ts +11 -0
- package/dist/types/macros/Function.d.ts +12 -0
- package/{build → dist/types}/macros/Math.d.ts +0 -0
- package/{build/macros/Blocks.d.ts → dist/types/macros/Memory.d.ts} +1 -1
- package/dist/types/macros/Namespace.d.ts +21 -0
- package/{build/macros/Draw.d.ts → dist/types/macros/Other.d.ts} +1 -1
- package/dist/types/macros/RawValue.d.ts +5 -0
- package/dist/types/macros/commands/Control.d.ts +5 -0
- package/dist/types/macros/commands/Draw.d.ts +5 -0
- package/dist/types/macros/commands/DrawFlush.d.ts +5 -0
- package/dist/types/macros/commands/GetLink.d.ts +5 -0
- package/dist/types/macros/commands/Lookup.d.ts +5 -0
- package/dist/types/macros/commands/Print.d.ts +5 -0
- package/dist/types/macros/commands/PrintFlush.d.ts +5 -0
- package/dist/types/macros/commands/Radar.d.ts +7 -0
- package/dist/types/macros/commands/Sensor.d.ts +5 -0
- package/dist/types/macros/commands/UnitBind.d.ts +5 -0
- package/dist/types/macros/commands/UnitControl.d.ts +5 -0
- package/dist/types/macros/commands/UnitLocate.d.ts +5 -0
- package/dist/types/macros/commands/UnitRadar.d.ts +5 -0
- package/dist/types/macros/commands/Wait.d.ts +5 -0
- package/dist/types/macros/commands/index.d.ts +14 -0
- package/dist/types/macros/index.d.ts +7 -0
- package/{build → dist/types}/operators.d.ts +3 -0
- package/dist/types/types.d.ts +100 -0
- package/{build → dist/types}/utils.d.ts +1 -0
- package/{build → dist/types}/values/BaseValue.d.ts +0 -0
- package/{build → dist/types}/values/FunctionValue.d.ts +1 -1
- package/{build → dist/types}/values/LiteralValue.d.ts +0 -0
- package/dist/types/values/ObjectValue.d.ts +19 -0
- package/{build → dist/types}/values/StoreValue.d.ts +0 -0
- package/{build → dist/types}/values/TempValue.d.ts +0 -0
- package/{build → dist/types}/values/VoidValue.d.ts +3 -1
- package/{build → dist/types}/values/index.d.ts +0 -0
- package/{docs → doc}/README.md +9 -17
- package/lib/commands.d.ts +326 -0
- package/lib/eslib/index.d.ts +3 -0
- package/lib/eslib/lib.d.ts +9 -0
- package/lib/eslib/lib.es2015.collection.d.ts +89 -0
- package/lib/eslib/lib.es2015.core.d.ts +16 -0
- package/lib/eslib/lib.es2015.d.ts +30 -0
- package/lib/eslib/lib.es2015.generator.d.ts +79 -0
- package/lib/eslib/lib.es2015.iterable.d.ts +70 -0
- package/lib/eslib/lib.es5.d.ts +295 -0
- package/lib/eslib/lib.es6.d.ts +18 -0
- package/lib/globals.d.ts +328 -0
- package/lib/helpers.d.ts +23 -0
- package/lib/index.d.ts +7 -0
- package/lib/kinds.d.ts +36 -0
- package/lib/memory.d.ts +17 -0
- package/lib/traits.d.ts +120 -0
- package/lib/util.d.ts +32 -0
- package/package.json +63 -37
- package/.gitattributes +0 -2
- package/build/Compiler.d.ts +0 -18
- package/build/Compiler.js +0 -93
- package/build/Compiler.js.map +0 -1
- package/build/Scope.js +0 -61
- package/build/Scope.js.map +0 -1
- package/build/bin.d.ts +0 -2
- package/build/bin.js +0 -35
- package/build/bin.js.map +0 -1
- package/build/handlers/BlockStatement.d.ts +0 -2
- package/build/handlers/BlockStatement.js +0 -14
- package/build/handlers/BlockStatement.js.map +0 -1
- package/build/handlers/CallExpression.d.ts +0 -3
- package/build/handlers/CallExpression.js +0 -20
- package/build/handlers/CallExpression.js.map +0 -1
- package/build/handlers/ForStatement.d.ts +0 -2
- package/build/handlers/ForStatement.js +0 -32
- package/build/handlers/ForStatement.js.map +0 -1
- package/build/handlers/Function.js +0 -33
- package/build/handlers/Function.js.map +0 -1
- package/build/handlers/Identifier.js +0 -8
- package/build/handlers/Identifier.js.map +0 -1
- package/build/handlers/IfStatement.d.ts +0 -2
- package/build/handlers/IfStatement.js +0 -25
- package/build/handlers/IfStatement.js.map +0 -1
- package/build/handlers/Literal.js +0 -16
- package/build/handlers/Literal.js.map +0 -1
- package/build/handlers/Object.js +0 -44
- package/build/handlers/Object.js.map +0 -1
- package/build/handlers/OperationExpressions.js +0 -32
- package/build/handlers/OperationExpressions.js.map +0 -1
- package/build/handlers/Program.d.ts +0 -2
- package/build/handlers/Program.js +0 -9
- package/build/handlers/Program.js.map +0 -1
- package/build/handlers/Statements.d.ts +0 -5
- package/build/handlers/Statements.js +0 -28
- package/build/handlers/Statements.js.map +0 -1
- package/build/handlers/TemplateExpression.d.ts +0 -2
- package/build/handlers/TemplateExpression.js +0 -18
- package/build/handlers/TemplateExpression.js.map +0 -1
- package/build/handlers/VariableDeclaration.d.ts +0 -3
- package/build/handlers/VariableDeclaration.js +0 -32
- package/build/handlers/VariableDeclaration.js.map +0 -1
- package/build/handlers/WhileStatement.d.ts +0 -2
- package/build/handlers/WhileStatement.js +0 -23
- package/build/handlers/WhileStatement.js.map +0 -1
- package/build/handlers/index.js +0 -27
- package/build/handlers/index.js.map +0 -1
- package/build/index.d.ts +0 -1
- package/build/index.js +0 -8
- package/build/index.js.map +0 -1
- package/build/instructions/AddressResolver.js +0 -32
- package/build/instructions/AddressResolver.js.map +0 -1
- package/build/instructions/ControlInstructions.js +0 -23
- package/build/instructions/ControlInstructions.js.map +0 -1
- package/build/instructions/EndInstruction.js +0 -11
- package/build/instructions/EndInstruction.js.map +0 -1
- package/build/instructions/InstructionBase.js +0 -21
- package/build/instructions/InstructionBase.js.map +0 -1
- package/build/instructions/JumpInstruction.js +0 -22
- package/build/instructions/JumpInstruction.js.map +0 -1
- package/build/instructions/OperationInstruction.js +0 -11
- package/build/instructions/OperationInstruction.js.map +0 -1
- package/build/instructions/SetCounterInstruction.js +0 -11
- package/build/instructions/SetCounterInstruction.js.map +0 -1
- package/build/instructions/SetInstruction.js +0 -11
- package/build/instructions/SetInstruction.js.map +0 -1
- package/build/instructions/ZeroSpaceInstruction.js +0 -11
- package/build/instructions/ZeroSpaceInstruction.js.map +0 -1
- package/build/instructions/index.js +0 -22
- package/build/instructions/index.js.map +0 -1
- package/build/macros/Blocks.js +0 -137
- package/build/macros/Blocks.js.map +0 -1
- package/build/macros/Draw.js +0 -34
- package/build/macros/Draw.js.map +0 -1
- package/build/macros/Function.d.ts +0 -12
- package/build/macros/Function.js +0 -20
- package/build/macros/Function.js.map +0 -1
- package/build/macros/Math.js +0 -57
- package/build/macros/Math.js.map +0 -1
- package/build/macros/Other.d.ts +0 -8
- package/build/macros/Other.js +0 -29
- package/build/macros/Other.js.map +0 -1
- package/build/macros/TypeFactory.d.ts +0 -8
- package/build/macros/TypeFactory.js +0 -22
- package/build/macros/TypeFactory.js.map +0 -1
- package/build/macros/index.d.ts +0 -5
- package/build/macros/index.js +0 -18
- package/build/macros/index.js.map +0 -1
- package/build/operators.js +0 -39
- package/build/operators.js.map +0 -1
- package/build/scopes/FunctionScope.d.ts +0 -5
- package/build/scopes/FunctionScope.js +0 -13
- package/build/scopes/FunctionScope.js.map +0 -1
- package/build/scopes/LoopScope.d.ts +0 -5
- package/build/scopes/LoopScope.js +0 -13
- package/build/scopes/LoopScope.js.map +0 -1
- package/build/scopes/Scope.d.ts +0 -36
- package/build/scopes/Scope.js +0 -93
- package/build/scopes/Scope.js.map +0 -1
- package/build/scopes/index.d.ts +0 -3
- package/build/scopes/index.js +0 -16
- package/build/scopes/index.js.map +0 -1
- package/build/types.d.ts +0 -49
- package/build/types.js +0 -24
- package/build/types.js.map +0 -1
- package/build/utils.js +0 -9
- package/build/utils.js.map +0 -1
- package/build/values/BaseValue.js +0 -102
- package/build/values/BaseValue.js.map +0 -1
- package/build/values/FunctionValue.js +0 -101
- package/build/values/FunctionValue.js.map +0 -1
- package/build/values/LiteralValue.js +0 -89
- package/build/values/LiteralValue.js.map +0 -1
- package/build/values/ObjectValue.d.ts +0 -17
- package/build/values/ObjectValue.js +0 -50
- package/build/values/ObjectValue.js.map +0 -1
- package/build/values/StoreValue.js +0 -31
- package/build/values/StoreValue.js.map +0 -1
- package/build/values/TempValue.js +0 -53
- package/build/values/TempValue.js.map +0 -1
- package/build/values/VoidValue.js +0 -31
- package/build/values/VoidValue.js.map +0 -1
- package/build/values/index.js +0 -19
- package/build/values/index.js.map +0 -1
- package/dist/bundle.js +0 -553
- package/docs/.nojekyll +0 -0
- package/docs/_coverpage.md +0 -8
- package/docs/_sidebar.md +0 -3
- package/docs/data-types.md +0 -56
- package/docs/getting-started.md +0 -19
- package/docs/index.html +0 -41
- package/docs/mlogjs.png +0 -0
- package/mlogjs.d.ts +0 -72
- package/tsconfig.json +0 -22
- package/webpack.config.js +0 -22
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import "./kind";
|
|
2
|
+
import { TRadarFilter, TRadarSort, TUnitLocateBuildingGroup } from "./util";
|
|
3
|
+
declare global {
|
|
4
|
+
/**
|
|
5
|
+
* Appends the items to the print buffer, calling this function
|
|
6
|
+
* on its own will not print any contents to a message block.
|
|
7
|
+
*
|
|
8
|
+
* To print the contents of the print buffer and empty it call `printFlush`.
|
|
9
|
+
*
|
|
10
|
+
* @param items The items to be added to the print buffer.
|
|
11
|
+
*/
|
|
12
|
+
function print(...items: unknown[]): void;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Appends draw contents to the draw buffer.
|
|
16
|
+
*
|
|
17
|
+
* Warning: these methods only append data to the draw buffer,
|
|
18
|
+
* which is used by `drawFlush` to actually draw content on a display.
|
|
19
|
+
*/
|
|
20
|
+
function draw(mode: "clear", r: number, g: number, b: number): void;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Appends draw contents to the draw buffer.
|
|
24
|
+
*
|
|
25
|
+
* Warning: these methods only append data to the draw buffer,
|
|
26
|
+
* which is used by `drawFlush` to actually draw content on a display.
|
|
27
|
+
*/
|
|
28
|
+
function draw(
|
|
29
|
+
mode: "color",
|
|
30
|
+
r: number,
|
|
31
|
+
g: number,
|
|
32
|
+
b: number,
|
|
33
|
+
a: number
|
|
34
|
+
): void;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Appends draw contents to the draw buffer.
|
|
38
|
+
*
|
|
39
|
+
* Warning: these methods only append data to the draw buffer,
|
|
40
|
+
* which is used by `drawFlush` to actually draw content on a display.
|
|
41
|
+
*/
|
|
42
|
+
function draw(mode: "stroke", width: number): void;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Appends draw contents to the draw buffer.
|
|
46
|
+
*
|
|
47
|
+
* Warning: these methods only append data to the draw buffer,
|
|
48
|
+
* which is used by `drawFlush` to actually draw content on a display.
|
|
49
|
+
*/
|
|
50
|
+
function draw(
|
|
51
|
+
mode: "line",
|
|
52
|
+
x1: number,
|
|
53
|
+
y1: number,
|
|
54
|
+
x2: number,
|
|
55
|
+
y2: number
|
|
56
|
+
): void;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Appends draw contents to the draw buffer.
|
|
60
|
+
*
|
|
61
|
+
* Warning: these methods only append data to the draw buffer,
|
|
62
|
+
* which is used by `drawFlush` to actually draw content on a display.
|
|
63
|
+
*/
|
|
64
|
+
function draw(
|
|
65
|
+
mode: "rect",
|
|
66
|
+
x: number,
|
|
67
|
+
y: number,
|
|
68
|
+
width: number,
|
|
69
|
+
height: number
|
|
70
|
+
): void;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Appends draw contents to the draw buffer.
|
|
74
|
+
*
|
|
75
|
+
* Warning: these methods only append data to the draw buffer,
|
|
76
|
+
* which is used by `drawFlush` to actually draw content on a display.
|
|
77
|
+
*/
|
|
78
|
+
function draw(
|
|
79
|
+
mode: "lineRect",
|
|
80
|
+
x: number,
|
|
81
|
+
y: number,
|
|
82
|
+
width: number,
|
|
83
|
+
height: number
|
|
84
|
+
): void;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Appends draw contents to the draw buffer.
|
|
88
|
+
*
|
|
89
|
+
* Warning: these methods only append data to the draw buffer,
|
|
90
|
+
* which is used by `drawFlush` to actually draw content on a display.
|
|
91
|
+
*/
|
|
92
|
+
function draw(
|
|
93
|
+
mode: "poly",
|
|
94
|
+
x: number,
|
|
95
|
+
y: number,
|
|
96
|
+
sides: number,
|
|
97
|
+
radius: number,
|
|
98
|
+
rotation: number
|
|
99
|
+
): void;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Appends draw contents to the draw buffer.
|
|
103
|
+
*
|
|
104
|
+
* Warning: these methods only append data to the draw buffer,
|
|
105
|
+
* which is used by `drawFlush` to actually draw content on a display.
|
|
106
|
+
*/
|
|
107
|
+
function draw(
|
|
108
|
+
mode: "linePoly",
|
|
109
|
+
x: number,
|
|
110
|
+
y: number,
|
|
111
|
+
sides: number,
|
|
112
|
+
radius: number,
|
|
113
|
+
rotation: number
|
|
114
|
+
): void;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Appends draw contents to the draw buffer.
|
|
118
|
+
*
|
|
119
|
+
* Warning: these methods only append data to the draw buffer,
|
|
120
|
+
* which is used by `drawFlush` to actually draw content on a display.
|
|
121
|
+
*/
|
|
122
|
+
function draw(
|
|
123
|
+
mode: "triangle",
|
|
124
|
+
x: number,
|
|
125
|
+
y: number,
|
|
126
|
+
x2: number,
|
|
127
|
+
y2: number,
|
|
128
|
+
x3: number,
|
|
129
|
+
y3: number
|
|
130
|
+
): void;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Appends draw contents to the draw buffer.
|
|
134
|
+
*
|
|
135
|
+
* Warning: these methods only append data to the draw buffer,
|
|
136
|
+
* which is used by `drawFlush` to actually draw content on a display.
|
|
137
|
+
*/
|
|
138
|
+
function draw(
|
|
139
|
+
mode: "image",
|
|
140
|
+
x: number,
|
|
141
|
+
y: number,
|
|
142
|
+
image: symbol,
|
|
143
|
+
size: number,
|
|
144
|
+
rotation: number
|
|
145
|
+
): void;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Writes the contents of the print buffer into the target message
|
|
149
|
+
* and clears the buffer afterwards.
|
|
150
|
+
* @param target
|
|
151
|
+
*/
|
|
152
|
+
function printFlush(target: BasicBuilding): void;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Writes the contents of the draw buffer into the target display
|
|
156
|
+
* and clears the buffer afterwards.
|
|
157
|
+
* @param target
|
|
158
|
+
*/
|
|
159
|
+
function drawFlush(target: BasicBuilding): void;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Gets a block link by its index.
|
|
163
|
+
* @param index
|
|
164
|
+
*/
|
|
165
|
+
function getLink<T extends BasicBuilding = AnyBuilding>(index: number): T;
|
|
166
|
+
|
|
167
|
+
function control(
|
|
168
|
+
kind: "enabled",
|
|
169
|
+
building: BasicBuilding,
|
|
170
|
+
value: boolean
|
|
171
|
+
): void;
|
|
172
|
+
|
|
173
|
+
function control(
|
|
174
|
+
kind: "shoot",
|
|
175
|
+
building: BasicBuilding & Shooting,
|
|
176
|
+
x: number,
|
|
177
|
+
y: number,
|
|
178
|
+
shoot: boolean
|
|
179
|
+
): void;
|
|
180
|
+
|
|
181
|
+
function control(
|
|
182
|
+
kind: "shootp",
|
|
183
|
+
building: BasicBuilding & Shooting,
|
|
184
|
+
unit: BasicUnit,
|
|
185
|
+
shoot: boolean
|
|
186
|
+
): void;
|
|
187
|
+
|
|
188
|
+
function control(
|
|
189
|
+
kind: "config",
|
|
190
|
+
building: BasicBuilding,
|
|
191
|
+
value: symbol
|
|
192
|
+
): void;
|
|
193
|
+
|
|
194
|
+
function control(
|
|
195
|
+
kind: "color",
|
|
196
|
+
building: BasicBuilding,
|
|
197
|
+
r: number,
|
|
198
|
+
g: number,
|
|
199
|
+
b: number
|
|
200
|
+
): void;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Detects an unit nearby this `building`.
|
|
204
|
+
* @param building The building used to detect potential targets
|
|
205
|
+
* @param filter1 First filter for selecting a target. Setting it to "any" ignores it
|
|
206
|
+
* @param filter2 Second filter for selecting a target. Setting it to "any" ignores it
|
|
207
|
+
* @param filter3 Third filter for selecting a target. Setting it to "any" ignores it
|
|
208
|
+
* @param order The n th unit that fits these requirements based on the sorting method
|
|
209
|
+
* (1 => first unit, 2 => second unit and so on)
|
|
210
|
+
* @param sort The method on which the results should be sorted
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* const turret = getBuilding("cyclone1")
|
|
214
|
+
* // returns the second nearest enemy unit
|
|
215
|
+
* const result = radar(turret, "enemy", "any", "any", 2, "distance")
|
|
216
|
+
*/
|
|
217
|
+
function radar<T extends BasicUnit = AnyUnit>(
|
|
218
|
+
building: BasicBuilding,
|
|
219
|
+
filter1: TRadarFilter,
|
|
220
|
+
filter2: TRadarFilter,
|
|
221
|
+
filter3: TRadarFilter,
|
|
222
|
+
order: number,
|
|
223
|
+
sort: TRadarSort
|
|
224
|
+
): T;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Alternate way to access special properties on objects.
|
|
228
|
+
*
|
|
229
|
+
* This method allows you to use customly created symbols
|
|
230
|
+
* and sensor them on buildings.
|
|
231
|
+
* @param property The property to be sensed on the building
|
|
232
|
+
* @param target
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* let myBuilding = getBuilding("container1")
|
|
236
|
+
* // jsdoc doesn't allow me to type this
|
|
237
|
+
* // variable, but you should type it as a symbol in this case
|
|
238
|
+
* let myCustomSymbol = getVar("@custom-symbol") // problably defined by a mod
|
|
239
|
+
* let result = sensor(myCustomSymbol, myBuilding)
|
|
240
|
+
*/
|
|
241
|
+
function sensor<T>(property: symbol, target: BasicBuilding | BasicUnit): T;
|
|
242
|
+
|
|
243
|
+
function wait(seconds: number): void;
|
|
244
|
+
|
|
245
|
+
function lookup(kind: "block", index: number): BlockSymbol | null;
|
|
246
|
+
function lookup(kind: "unit", index: number): UnitSymbol | null;
|
|
247
|
+
function lookup(kind: "item", index: number): ItemSymbol | null;
|
|
248
|
+
function lookup(kind: "liquid", index: number): LiquidSymbol | null;
|
|
249
|
+
|
|
250
|
+
function unitBind(type: UnitSymbol): void;
|
|
251
|
+
|
|
252
|
+
function unitControl(mode: "idle"): void;
|
|
253
|
+
function unitControl(mode: "stop"): void;
|
|
254
|
+
function unitControl(mode: "move", x: number, y: number): void;
|
|
255
|
+
function unitControl(
|
|
256
|
+
mode: "approach",
|
|
257
|
+
x: number,
|
|
258
|
+
y: number,
|
|
259
|
+
radius: number
|
|
260
|
+
): void;
|
|
261
|
+
function unitControl(mode: "boost", enable: boolean): void;
|
|
262
|
+
function unitControl(mode: "pathfind"): void;
|
|
263
|
+
function unitControl(
|
|
264
|
+
mode: "target",
|
|
265
|
+
x: number,
|
|
266
|
+
y: number,
|
|
267
|
+
shoot: boolean
|
|
268
|
+
): void;
|
|
269
|
+
function unitControl(mode: "targetp", unit: BasicUnit, shoot: boolean): void;
|
|
270
|
+
function unitControl(
|
|
271
|
+
mode: "itemDrop",
|
|
272
|
+
target: BasicBuilding | typeof Blocks.air,
|
|
273
|
+
amount: number
|
|
274
|
+
): void;
|
|
275
|
+
function unitControl(
|
|
276
|
+
mode: "itemTake",
|
|
277
|
+
target: BasicBuilding,
|
|
278
|
+
item: ItemSymbol,
|
|
279
|
+
amount: number
|
|
280
|
+
): void;
|
|
281
|
+
function unitControl(mode: "payDrop"): void;
|
|
282
|
+
function unitControl(mode: "payTake", takeUnits: boolean): void;
|
|
283
|
+
function unitControl(mode: "payEnter"): void;
|
|
284
|
+
function unitControl(mode: "mine", x: number, y: number): void;
|
|
285
|
+
function unitControl(mode: "flag", value: number): void;
|
|
286
|
+
function unitControl(
|
|
287
|
+
mode: "build",
|
|
288
|
+
x: number,
|
|
289
|
+
y: number,
|
|
290
|
+
block: BlockSymbol,
|
|
291
|
+
rotation: number,
|
|
292
|
+
config: unknown
|
|
293
|
+
): void;
|
|
294
|
+
function unitControl<T extends BasicBuilding = AnyBuilding>(
|
|
295
|
+
mode: "getBlock",
|
|
296
|
+
x: number,
|
|
297
|
+
y: number
|
|
298
|
+
): [type: BlockSymbol | null, building: T | null];
|
|
299
|
+
function unitControl(
|
|
300
|
+
mode: "within",
|
|
301
|
+
x: number,
|
|
302
|
+
y: number,
|
|
303
|
+
radius: number
|
|
304
|
+
): boolean;
|
|
305
|
+
|
|
306
|
+
function unitRadar<T extends BasicUnit>(
|
|
307
|
+
filter1: TRadarFilter,
|
|
308
|
+
filter2: TRadarFilter,
|
|
309
|
+
filter3: TRadarFilter,
|
|
310
|
+
order: number,
|
|
311
|
+
sort: TRadarSort
|
|
312
|
+
): T;
|
|
313
|
+
|
|
314
|
+
function unitLocate(
|
|
315
|
+
find: "ore",
|
|
316
|
+
ore: ItemSymbol
|
|
317
|
+
): [found: false] | [found: true, x: number, y: number];
|
|
318
|
+
function unitLocate<T extends BasicBuilding = AnyBuilding>(
|
|
319
|
+
find: "building",
|
|
320
|
+
group: TUnitLocateBuildingGroup,
|
|
321
|
+
enemy: boolean
|
|
322
|
+
): [found: false] | [found: true, x: number, y: number, building: T];
|
|
323
|
+
function unitLocate<T extends BasicBuilding = AnyBuilding>(
|
|
324
|
+
find: "spawn" | "damaged"
|
|
325
|
+
): [found: false] | [found: true, x: number, y: number, building: T];
|
|
326
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
All files in this folder are dryed up versions of the original ones.
|
|
3
|
+
|
|
4
|
+
This makes updates more manageable.
|
|
5
|
+
***************************************************************************** */
|
|
6
|
+
|
|
7
|
+
/// <reference no-default-lib="true"/>
|
|
8
|
+
|
|
9
|
+
/// <reference lib="es5" />
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
|
|
17
|
+
|
|
18
|
+
/// <reference no-default-lib="true"/>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
interface Map<K, V> {
|
|
22
|
+
clear(): void;
|
|
23
|
+
delete(key: K): boolean;
|
|
24
|
+
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
|
|
25
|
+
get(key: K): V | undefined;
|
|
26
|
+
has(key: K): boolean;
|
|
27
|
+
set(key: K, value: V): this;
|
|
28
|
+
readonly size: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface MapConstructor {
|
|
32
|
+
new(): Map<any, any>;
|
|
33
|
+
new<K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
|
|
34
|
+
readonly prototype: Map<any, any>;
|
|
35
|
+
}
|
|
36
|
+
declare var Map: MapConstructor;
|
|
37
|
+
|
|
38
|
+
interface ReadonlyMap<K, V> {
|
|
39
|
+
forEach(callbackfn: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: any): void;
|
|
40
|
+
get(key: K): V | undefined;
|
|
41
|
+
has(key: K): boolean;
|
|
42
|
+
readonly size: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface WeakMap<K extends object, V> {
|
|
46
|
+
delete(key: K): boolean;
|
|
47
|
+
get(key: K): V | undefined;
|
|
48
|
+
has(key: K): boolean;
|
|
49
|
+
set(key: K, value: V): this;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface WeakMapConstructor {
|
|
53
|
+
new <K extends object = object, V = any>(entries?: readonly [K, V][] | null): WeakMap<K, V>;
|
|
54
|
+
readonly prototype: WeakMap<object, any>;
|
|
55
|
+
}
|
|
56
|
+
declare var WeakMap: WeakMapConstructor;
|
|
57
|
+
|
|
58
|
+
interface Set<T> {
|
|
59
|
+
add(value: T): this;
|
|
60
|
+
clear(): void;
|
|
61
|
+
delete(value: T): boolean;
|
|
62
|
+
forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
|
|
63
|
+
has(value: T): boolean;
|
|
64
|
+
readonly size: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface SetConstructor {
|
|
68
|
+
new <T = any>(values?: readonly T[] | null): Set<T>;
|
|
69
|
+
readonly prototype: Set<any>;
|
|
70
|
+
}
|
|
71
|
+
declare var Set: SetConstructor;
|
|
72
|
+
|
|
73
|
+
interface ReadonlySet<T> {
|
|
74
|
+
forEach(callbackfn: (value: T, value2: T, set: ReadonlySet<T>) => void, thisArg?: any): void;
|
|
75
|
+
has(value: T): boolean;
|
|
76
|
+
readonly size: number;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface WeakSet<T extends object> {
|
|
80
|
+
add(value: T): this;
|
|
81
|
+
delete(value: T): boolean;
|
|
82
|
+
has(value: T): boolean;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface WeakSetConstructor {
|
|
86
|
+
new <T extends object = object>(values?: readonly T[] | null): WeakSet<T>;
|
|
87
|
+
readonly prototype: WeakSet<object>;
|
|
88
|
+
}
|
|
89
|
+
declare var WeakSet: WeakSetConstructor;
|
|
@@ -0,0 +1,16 @@
|
|
|
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"/>
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
|
|
17
|
+
|
|
18
|
+
/// <reference no-default-lib="true"/>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/// <reference lib="es5" />
|
|
22
|
+
/// <reference lib="es2015.core" />
|
|
23
|
+
/// <reference lib="es2015.collection" />
|
|
24
|
+
/// <reference lib="es2015.iterable" />
|
|
25
|
+
/// <reference lib="es2015.generator" />
|
|
26
|
+
/// <reference lib="es2015.promise" />
|
|
27
|
+
/// <reference lib="es2015.proxy" />
|
|
28
|
+
/// <reference lib="es2015.reflect" />
|
|
29
|
+
/// <reference lib="es2015.symbol" />
|
|
30
|
+
/// <reference lib="es2015.symbol.wellknown" />
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
|
|
17
|
+
|
|
18
|
+
/// <reference no-default-lib="true"/>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/// <reference lib="es2015.iterable" />
|
|
22
|
+
|
|
23
|
+
interface Generator<T = unknown, TReturn = any, TNext = unknown> extends Iterator<T, TReturn, TNext> {
|
|
24
|
+
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
|
|
25
|
+
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
|
|
26
|
+
return(value: TReturn): IteratorResult<T, TReturn>;
|
|
27
|
+
throw(e: any): IteratorResult<T, TReturn>;
|
|
28
|
+
[Symbol.iterator](): Generator<T, TReturn, TNext>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface GeneratorFunction {
|
|
32
|
+
/**
|
|
33
|
+
* Creates a new Generator object.
|
|
34
|
+
* @param args A list of arguments the function accepts.
|
|
35
|
+
*/
|
|
36
|
+
new (...args: any[]): Generator;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new Generator object.
|
|
39
|
+
* @param args A list of arguments the function accepts.
|
|
40
|
+
*/
|
|
41
|
+
(...args: any[]): Generator;
|
|
42
|
+
/**
|
|
43
|
+
* The length of the arguments.
|
|
44
|
+
*/
|
|
45
|
+
readonly length: number;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the name of the function.
|
|
48
|
+
*/
|
|
49
|
+
readonly name: string;
|
|
50
|
+
/**
|
|
51
|
+
* A reference to the prototype.
|
|
52
|
+
*/
|
|
53
|
+
readonly prototype: Generator;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface GeneratorFunctionConstructor {
|
|
57
|
+
/**
|
|
58
|
+
* Creates a new Generator function.
|
|
59
|
+
* @param args A list of arguments the function accepts.
|
|
60
|
+
*/
|
|
61
|
+
new (...args: string[]): GeneratorFunction;
|
|
62
|
+
/**
|
|
63
|
+
* Creates a new Generator function.
|
|
64
|
+
* @param args A list of arguments the function accepts.
|
|
65
|
+
*/
|
|
66
|
+
(...args: string[]): GeneratorFunction;
|
|
67
|
+
/**
|
|
68
|
+
* The length of the arguments.
|
|
69
|
+
*/
|
|
70
|
+
readonly length: number;
|
|
71
|
+
/**
|
|
72
|
+
* Returns the name of the function.
|
|
73
|
+
*/
|
|
74
|
+
readonly name: string;
|
|
75
|
+
/**
|
|
76
|
+
* A reference to the prototype.
|
|
77
|
+
*/
|
|
78
|
+
readonly prototype: GeneratorFunction;
|
|
79
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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.symbol" />
|
|
19
|
+
|
|
20
|
+
interface SymbolConstructor {
|
|
21
|
+
/**
|
|
22
|
+
* A method that returns the default iterator for an object. Called by the semantics of the
|
|
23
|
+
* for-of statement.
|
|
24
|
+
*/
|
|
25
|
+
readonly iterator: symbol;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface IteratorYieldResult<TYield> {
|
|
29
|
+
done?: false;
|
|
30
|
+
value: TYield;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface IteratorReturnResult<TReturn> {
|
|
34
|
+
done: true;
|
|
35
|
+
value: TReturn;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type IteratorResult<T, TReturn = any> =
|
|
39
|
+
| IteratorYieldResult<T>
|
|
40
|
+
| IteratorReturnResult<TReturn>;
|
|
41
|
+
|
|
42
|
+
interface Iterator<T, TReturn = any, TNext = undefined> {
|
|
43
|
+
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
|
|
44
|
+
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
|
|
45
|
+
return?(value?: TReturn): IteratorResult<T, TReturn>;
|
|
46
|
+
throw?(e?: any): IteratorResult<T, TReturn>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface Iterable<T> {
|
|
50
|
+
[Symbol.iterator](): Iterator<T>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface IterableIterator<T> extends Iterator<T> {
|
|
54
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface Array<T> {
|
|
58
|
+
/** Iterator */
|
|
59
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface ReadonlyArray<T> {
|
|
63
|
+
/** Iterator of values in the array. */
|
|
64
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface IArguments {
|
|
68
|
+
/** Iterator */
|
|
69
|
+
[Symbol.iterator](): IterableIterator<any>;
|
|
70
|
+
}
|