typed-factorio 0.14.1 → 0.17.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.
@@ -2,8 +2,8 @@
2
2
 
3
3
  ///<reference types="lua-types/5.2" />
4
4
  ///<reference path="builtin-types.d.ts" />
5
+ ///<reference path="global-objects.d.ts" />
5
6
  ///<reference path="defines.d.ts" />
6
7
  ///<reference path="events.d.ts" />
7
8
  ///<reference path="classes.d.ts" />
8
9
  ///<reference path="concepts.d.ts" />
9
- ///<reference path="global-objects.d.ts" />
@@ -0,0 +1,9 @@
1
+ declare module "typescript" {
2
+ interface JSDocContainer {
3
+ jsDoc?: JSDoc[]
4
+ }
5
+ interface Node {
6
+ emitNode?: unknown
7
+ }
8
+ }
9
+ export {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typed-factorio",
3
- "version": "0.14.1",
3
+ "version": "0.17.1",
4
4
  "description": "Featureful typescript definitions for the the Factorio modding lua api.",
5
5
  "keywords": [
6
6
  "factorio",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "peerDependencies": {
30
30
  "lua-types": "^2.11.0",
31
- "typescript-to-lua": "^1.0.0"
31
+ "typescript-to-lua": "^1.3.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/jest": "^27.0.3",
@@ -53,6 +53,6 @@
53
53
  "ts-jest": "^27.1.0",
54
54
  "ts-node": "^10.4.0",
55
55
  "typescript": "4.5.2",
56
- "typescript-to-lua": "^1.2.0"
56
+ "typescript-to-lua": "^1.3.1"
57
57
  }
58
58
  }
@@ -1,13 +1,14 @@
1
1
  /** @noSelfInFile */
2
2
 
3
- /** Iterating with `pairs` will only iterate the array part of a {@link LuaCustomTable}. */
4
- declare function pairs<V>(table: LuaCustomTable<number | string, V>): LuaIterable<LuaMultiReturn<[number, V]>>
5
-
6
- declare function pairs<K extends keyof any, V>(table: LuaCustomTable<K, V>): LuaIterable<LuaMultiReturn<[K, V]>>
7
-
8
3
  /**
9
- * {@link LuaCustomTable} cannot be iterated with `ipairs`. Use `pairs` instead.
4
+ * Iterating with `pairs` will only iterate the array part of a {@link LuaCustomTable}.
10
5
  *
11
- * @deprecated
6
+ * **Note**: you can also iterate on a LuaCustomTable directly without using `pairs`, e.g. `for(const [k, v] of table)`.
12
7
  */
8
+ declare function pairs<V>(table: LuaCustomTable<number | string, V>): LuaIterable<LuaMultiReturn<[number, V]>>
9
+
10
+ /** **Note**: you can also iterate on a LuaCustomTable directly without using `pairs`, e.g. `for(const [k, v] of table)`. */
11
+ declare function pairs<K extends number | string, V>(table: LuaCustomTable<K, V>): LuaIterable<LuaMultiReturn<[K, V]>>
12
+
13
+ /** @deprecated {@link LuaCustomTable} cannot be iterated with `ipairs`; Use {@link pairs} instead. */
13
14
  declare function ipairs(table: LuaCustomTable<any, any>): never
package/runtime/util.d.ts CHANGED
@@ -33,11 +33,7 @@ declare module "util" {
33
33
  direction: defines.direction.north | defines.direction.east | defines.direction.south | defines.direction.west,
34
34
  distance: number
35
35
  ): Position
36
- function moveposition(
37
- position: Position,
38
- direction: defines.direction, //todo: cardinal only
39
- distance: number
40
- ): Position | undefined
36
+ function moveposition(position: Position, direction: defines.direction, distance: number): Position | undefined
41
37
 
42
38
  function oppositedirection(direction: defines.direction): defines.direction
43
39