typed-factorio 0.18.0 → 0.19.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.
@@ -3,8 +3,7 @@
3
3
  /** @noSelfInFile */
4
4
 
5
5
  /**
6
- * This is the main object, through which most of the API is accessed. It is, however, not available inside handlers
7
- * registered with {@link LuaBootstrap.on_load LuaBootstrap::on_load}.
6
+ * This is the main object, through which most of the API is accessed. It is, however, not available inside handlers registered with {@link LuaBootstrap#on_load LuaBootstrap::on_load}.
8
7
  *
9
8
  * {@link https://lua-api.factorio.com/latest/ View documentation}
10
9
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typed-factorio",
3
- "version": "0.18.0",
3
+ "version": "0.19.1",
4
4
  "description": "Featureful typescript definitions for the the Factorio modding lua api.",
5
5
  "keywords": [
6
6
  "factorio",
@@ -49,7 +49,6 @@
49
49
  "jest": "^27.4.3",
50
50
  "lua-types": "^2.11.0",
51
51
  "prettier": "^2.5.1",
52
- "prettier-plugin-jsdoc": "^0.3.30",
53
52
  "ts-jest": "^27.1.0",
54
53
  "ts-node": "^10.4.0",
55
54
  "typescript": "4.5.2",
package/runtime/util.d.ts CHANGED
@@ -13,9 +13,9 @@ declare module "util" {
13
13
 
14
14
  function copy<T>(table: T): T
15
15
 
16
- function distance(position1: Position, position2: Position): number
16
+ function distance(position1: MapPosition, position2: MapPosition): number
17
17
 
18
- function positiontostr(position: Position): string
18
+ function positiontostr(position: MapPosition): string
19
19
 
20
20
  function formattime(ticks: number): string
21
21
 
@@ -29,11 +29,11 @@ declare module "util" {
29
29
  function multiply_color(c1: Color, n: number): ColorArray
30
30
 
31
31
  function moveposition(
32
- position: Position,
32
+ position: MapPosition,
33
33
  direction: defines.direction.north | defines.direction.east | defines.direction.south | defines.direction.west,
34
34
  distance: number
35
- ): Position
36
- function moveposition(position: Position, direction: defines.direction, distance: number): Position | undefined
35
+ ): MapPosition
36
+ function moveposition(position: MapPosition, direction: defines.direction, distance: number): MapPosition | undefined
37
37
 
38
38
  function oppositedirection(direction: defines.direction): defines.direction
39
39
 
@@ -41,21 +41,21 @@ declare module "util" {
41
41
  function multiplystripes<T>(count: number, stripes: T[]): T[]
42
42
 
43
43
  /** Gets tile position by pixel */
44
- function by_pixel(x: number, y: number): Position
44
+ function by_pixel(x: number, y: number): MapPosition
45
45
 
46
46
  /** Gets tile position by pixel, hr */
47
- function by_pixel_hr(x: number, y: number): Position
47
+ function by_pixel_hr(x: number, y: number): MapPosition
48
48
 
49
49
  // omitted: foreach_sprite_definition
50
50
 
51
- function add_shift(a: PositionArray | undefined, b: PositionArray): PositionArray
52
- function add_shift(a: PositionArray, b: PositionArray | undefined): PositionArray
53
- function add_shift(a: PositionArray | undefined, b: PositionArray | undefined): PositionArray | undefined
51
+ function add_shift(a: MapPositionArray | undefined, b: MapPositionArray): MapPositionArray
52
+ function add_shift(a: MapPositionArray, b: MapPositionArray | undefined): MapPositionArray
53
+ function add_shift(a: MapPositionArray | undefined, b: MapPositionArray | undefined): MapPositionArray | undefined
54
54
 
55
55
  // omitted: add_shift_offset
56
56
 
57
- function mul_shift(shift: PositionArray, scale: number | undefined): PositionArray
58
- function mul_shift(shift: PositionArray | undefined, scale: number | undefined): PositionArray | undefined
57
+ function mul_shift(shift: MapPositionArray, scale: number | undefined): MapPositionArray
58
+ function mul_shift(shift: MapPositionArray | undefined, scale: number | undefined): MapPositionArray | undefined
59
59
 
60
60
  function format_number(amount: number, append_suffix?: boolean): string
61
61