mlogjs 0.2.0 → 0.2.1
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/Compiler.d.ts +18 -18
- package/build/Compiler.js +99 -119
- package/build/Compiler.js.map +1 -1
- package/build/Scope.d.ts +26 -26
- package/build/Scope.js +60 -60
- package/build/Scope.js.map +1 -1
- package/build/bin.d.ts +2 -2
- package/build/bin.js +60 -41
- package/build/bin.js.map +1 -1
- package/build/handlers/BlockStatement.d.ts +2 -2
- package/build/handlers/BlockStatement.js +13 -13
- package/build/handlers/CallExpression.d.ts +3 -3
- package/build/handlers/CallExpression.js +19 -19
- package/build/handlers/ForStatement.d.ts +2 -2
- package/build/handlers/ForStatement.js +31 -31
- package/build/handlers/Function.d.ts +4 -4
- package/build/handlers/Function.js +35 -35
- package/build/handlers/Identifier.d.ts +2 -2
- package/build/handlers/Identifier.js +7 -7
- package/build/handlers/IfStatement.d.ts +2 -2
- package/build/handlers/IfStatement.js +24 -24
- package/build/handlers/Literal.d.ts +2 -2
- package/build/handlers/Literal.js +17 -17
- package/build/handlers/Object.d.ts +4 -4
- package/build/handlers/Object.js +43 -43
- package/build/handlers/OperationExpressions.d.ts +7 -7
- package/build/handlers/OperationExpressions.js +32 -32
- package/build/handlers/Program.d.ts +2 -2
- package/build/handlers/Program.js +8 -8
- package/build/handlers/Program.js.map +1 -1
- package/build/handlers/Statements.d.ts +5 -5
- package/build/handlers/Statements.js +29 -29
- package/build/handlers/TemplateExpression.d.ts +2 -2
- package/build/handlers/TemplateExpression.js +17 -17
- package/build/handlers/VariableDeclaration.d.ts +3 -3
- package/build/handlers/VariableDeclaration.js +55 -55
- package/build/handlers/WhileStatement.d.ts +2 -2
- package/build/handlers/WhileStatement.js +22 -22
- package/build/handlers/index.d.ts +14 -14
- package/build/handlers/index.js +30 -30
- package/build/index.d.ts +1 -1
- package/build/index.js +7 -7
- package/build/initScope.d.ts +2 -0
- package/build/initScope.js +40 -0
- package/build/initScope.js.map +1 -0
- package/build/instructions/AddressResolver.d.ts +12 -12
- package/build/instructions/AddressResolver.js +30 -30
- package/build/instructions/ControlInstructions.d.ts +11 -11
- package/build/instructions/ControlInstructions.js +22 -22
- package/build/instructions/EndInstruction.d.ts +4 -4
- package/build/instructions/EndInstruction.js +10 -10
- package/build/instructions/InstructionBase.d.ts +10 -10
- package/build/instructions/InstructionBase.js +20 -20
- package/build/instructions/JumpInstruction.d.ts +15 -15
- package/build/instructions/JumpInstruction.js +21 -21
- package/build/instructions/OperationInstruction.d.ts +5 -5
- package/build/instructions/OperationInstruction.js +10 -10
- package/build/instructions/SetCounterInstruction.d.ts +5 -5
- package/build/instructions/SetCounterInstruction.js +10 -10
- package/build/instructions/SetInstruction.d.ts +5 -5
- package/build/instructions/SetInstruction.js +10 -10
- package/build/instructions/ZeroSpaceInstruction.d.ts +4 -4
- package/build/instructions/ZeroSpaceInstruction.js +10 -10
- package/build/instructions/index.d.ts +9 -9
- package/build/instructions/index.js +25 -25
- package/build/macros/Building.d.ts +11 -11
- package/build/macros/Building.js +80 -80
- package/build/macros/Function.d.ts +12 -12
- package/build/macros/Function.js +19 -19
- package/build/macros/Math.d.ts +5 -5
- package/build/macros/Math.js +56 -56
- package/build/macros/Math.js.map +1 -1
- package/build/macros/Memory.d.ts +5 -5
- package/build/macros/Memory.js +60 -60
- package/build/macros/Namespace.d.ts +21 -21
- package/build/macros/Namespace.js +97 -97
- package/build/macros/Other.d.ts +5 -5
- package/build/macros/Other.js +19 -19
- package/build/macros/RawValue.d.ts +5 -5
- package/build/macros/RawValue.js +15 -15
- package/build/macros/commands/{control.d.ts → Control.d.ts} +5 -5
- package/build/macros/commands/{control.js → Control.js} +24 -24
- package/build/macros/commands/{control.js.map → Control.js.map} +0 -0
- package/build/macros/commands/Draw.d.ts +5 -5
- package/build/macros/commands/Draw.js +38 -38
- package/build/macros/commands/DrawFlush.d.ts +5 -5
- package/build/macros/commands/DrawFlush.js +16 -16
- package/build/macros/commands/GetLink.d.ts +5 -5
- package/build/macros/commands/GetLink.js +20 -20
- package/build/macros/commands/Lookup.d.ts +5 -5
- package/build/macros/commands/Lookup.js +23 -23
- package/build/macros/commands/Print.d.ts +5 -5
- package/build/macros/commands/Print.js +13 -13
- package/build/macros/commands/PrintFlush.d.ts +5 -5
- package/build/macros/commands/PrintFlush.js +16 -16
- package/build/macros/commands/Radar.d.ts +7 -7
- package/build/macros/commands/Radar.js +60 -60
- package/build/macros/commands/Sensor.d.ts +5 -5
- package/build/macros/commands/Sensor.js +19 -19
- package/build/macros/commands/UnitBind.d.ts +5 -5
- package/build/macros/commands/UnitBind.js +16 -16
- package/build/macros/commands/UnitControl.d.ts +5 -5
- package/build/macros/commands/UnitControl.js +67 -67
- package/build/macros/commands/UnitLocate.d.ts +5 -5
- package/build/macros/commands/UnitLocate.js +54 -54
- package/build/macros/commands/UnitRadar.d.ts +5 -5
- package/build/macros/commands/UnitRadar.js +40 -40
- package/build/macros/commands/Wait.d.ts +5 -5
- package/build/macros/commands/Wait.js +17 -17
- package/build/macros/commands/index.d.ts +14 -14
- package/build/macros/commands/index.js +32 -32
- package/build/macros/index.d.ts +7 -7
- package/build/macros/index.js +39 -39
- package/build/operators.d.ts +25 -25
- package/build/operators.js +101 -101
- package/build/types.d.ts +49 -49
- package/build/types.js +27 -27
- package/build/utils.d.ts +3 -3
- package/build/utils.js +12 -12
- package/build/values/BaseValue.d.ts +5 -5
- package/build/values/BaseValue.js +111 -111
- package/build/values/FunctionValue.d.ts +34 -34
- package/build/values/FunctionValue.js +103 -103
- package/build/values/LiteralValue.d.ts +12 -12
- package/build/values/LiteralValue.js +87 -87
- package/build/values/LiteralValue.js.map +1 -1
- package/build/values/ObjectValue.d.ts +17 -17
- package/build/values/ObjectValue.js +49 -49
- package/build/values/StoreValue.d.ts +11 -11
- package/build/values/StoreValue.js +30 -30
- package/build/values/TempValue.d.ts +12 -12
- package/build/values/TempValue.js +66 -66
- package/build/values/TempValue.js.map +1 -1
- package/build/values/VoidValue.d.ts +11 -11
- package/build/values/VoidValue.js +30 -30
- package/build/values/index.d.ts +6 -6
- package/build/values/index.js +22 -22
- package/dist/mlogjs.es.js +6366 -0
- package/dist/mlogjs.umd.js +8 -0
- package/lib/commands.d.ts +326 -326
- package/lib/eslib/index.d.ts +3 -3
- package/lib/eslib/lib.d.ts +9 -9
- package/lib/eslib/lib.es2015.collection.d.ts +89 -89
- package/lib/eslib/lib.es2015.core.d.ts +16 -16
- package/lib/eslib/lib.es2015.d.ts +30 -30
- package/lib/eslib/lib.es2015.generator.d.ts +79 -79
- package/lib/eslib/lib.es2015.iterable.d.ts +70 -70
- package/lib/eslib/lib.es5.d.ts +295 -295
- package/lib/eslib/lib.es6.d.ts +18 -18
- package/lib/globals.d.ts +328 -328
- package/lib/helpers.d.ts +23 -23
- package/lib/index.d.ts +7 -7
- package/lib/kinds.d.ts +36 -36
- package/lib/memory.d.ts +17 -17
- package/lib/traits.d.ts +121 -121
- package/lib/util.d.ts +32 -32
- package/package.json +73 -48
- package/build/macros/Blocks.d.ts +0 -5
- package/build/macros/Blocks.js +0 -143
- package/build/macros/Blocks.js.map +0 -1
- package/build/macros/Draw.d.ts +0 -5
- package/build/macros/Draw.js +0 -39
- package/build/macros/Draw.js.map +0 -1
- package/build/macros/Items.d.ts +0 -5
- package/build/macros/Items.js +0 -20
- package/build/macros/Items.js.map +0 -1
- package/build/macros/Liquids.d.ts +0 -5
- package/build/macros/Liquids.js +0 -18
- package/build/macros/Liquids.js.map +0 -1
- package/build/macros/Symbol.d.ts +0 -0
- package/build/macros/Symbol.js +0 -1
- package/build/macros/Symbol.js.map +0 -1
- package/build/macros/SymbolNamespace.d.ts +0 -0
- package/build/macros/SymbolNamespace.js +0 -1
- package/build/macros/SymbolNamespace.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/Units.d.ts +0 -5
- package/build/macros/Units.js +0 -18
- package/build/macros/Units.js.map +0 -1
- package/build/macros/Vars.d.ts +0 -5
- package/build/macros/Vars.js +0 -18
- package/build/macros/Vars.js.map +0 -1
- package/build/macros/commands/Asm.d.ts +0 -5
- package/build/macros/commands/Asm.js +0 -21
- package/build/macros/commands/Asm.js.map +0 -1
- package/build/macros/commands/io.d.ts +0 -8
- package/build/macros/commands/io.js +0 -47
- package/build/macros/commands/io.js.map +0 -1
- package/build/macros/helpers/GetBuilding.d.ts +0 -5
- package/build/macros/helpers/GetBuilding.js +0 -16
- package/build/macros/helpers/GetBuilding.js.map +0 -1
- package/build/macros/helpers/GetVar.d.ts +0 -5
- package/build/macros/helpers/GetVar.js +0 -16
- package/build/macros/helpers/GetVar.js.map +0 -1
- package/build/macros/helpers/index.d.ts +0 -2
- package/build/macros/helpers/index.js +0 -15
- package/build/macros/helpers/index.js.map +0 -1
- package/dist/bundle.js +0 -1
package/lib/eslib/lib.es5.d.ts
CHANGED
|
@@ -1,295 +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 {}
|
|
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 {}
|
package/lib/eslib/lib.es6.d.ts
CHANGED
|
@@ -1,18 +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" />
|
|
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" />
|