typed-factorio 1.15.0 → 1.17.0

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typed-factorio",
3
- "version": "1.15.0",
3
+ "version": "1.17.0",
4
4
  "description": "Featureful typescript definitions for the the Factorio modding lua api.",
5
5
  "keywords": [
6
6
  "factorio",
@@ -33,30 +33,28 @@
33
33
  "typescript-to-lua": "^1.6.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@types/jest": "^29.5.1",
37
- "@types/node": "^20.2.3",
38
- "@types/prettier": "^2.7.2",
39
- "@typescript-eslint/eslint-plugin": "^5.59.7",
40
- "@typescript-eslint/parser": "^5.59.7",
36
+ "@types/jest": "^29.5.2",
37
+ "@types/node": "^20.3.1",
38
+ "@types/prettier": "^2.7.3",
39
+ "@typescript-eslint/eslint-plugin": "^5.59.11",
40
+ "@typescript-eslint/parser": "^5.59.11",
41
41
  "array.prototype.flatmap": "^1.3.1",
42
42
  "chalk": "^5.2.0",
43
- "eslint": "~8.41.0",
43
+ "eslint": "~8.42.0",
44
44
  "eslint-config-prettier": "^8.8.0",
45
- "eslint-config-standard": "^17.0.0",
46
45
  "eslint-import-resolver-typescript": "^3.5.5",
46
+ "eslint-plugin-eslint-comments": "latest",
47
47
  "eslint-plugin-import": "^2.27.5",
48
- "eslint-plugin-n": "^16.0.0",
49
48
  "eslint-plugin-node": "^11.1.0",
50
49
  "eslint-plugin-prettier": "^4.2.1",
51
- "eslint-plugin-promise": "^6.1.1",
52
50
  "jest": "^29.5.0",
53
51
  "lua-types": "^2.13.1",
54
52
  "prettier": "^2.8.8",
55
53
  "rimraf": "^5.0.1",
56
54
  "ts-jest": "^29.1.0",
57
55
  "ts-node": "^10.9.1",
58
- "typescript": "~5.0.4",
59
- "typescript-to-lua": "^1.15.1"
56
+ "typescript": "~5.1.3",
57
+ "typescript-to-lua": "^1.16.2"
60
58
  },
61
59
  "packageManager": "yarn@3.2.3"
62
60
  }
@@ -15,7 +15,7 @@ type float = number
15
15
  type double = number
16
16
 
17
17
  /**
18
- * 32-bit signed integer. Possible values are -2,147,483,648 to 2,147,483,647.
18
+ * 32-bit signed integer. Possible values are -2'147'483'648 to 2'147'483'647.
19
19
  * @see {@link https://lua-api.factorio.com/latest/Builtin-Types.html#int Online documentation}
20
20
  */
21
21
  type int = number
@@ -27,7 +27,7 @@ type int = number
27
27
  type int8 = number
28
28
 
29
29
  /**
30
- * 32-bit unsigned integer. Possible values are 0 to 4,294,967,295.
30
+ * 32-bit unsigned integer. Possible values are 0 to 4'294'967'295.
31
31
  * @see {@link https://lua-api.factorio.com/latest/Builtin-Types.html#uint Online documentation}
32
32
  */
33
33
  type uint = number
@@ -45,7 +45,7 @@ type uint8 = number
45
45
  type uint16 = number
46
46
 
47
47
  /**
48
- * 64-bit unsigned integer. Possible values are 0 to 18,446,744,073,709,551,615.
48
+ * 64-bit unsigned integer. Possible values are 0 to 18'446'744'073'709'551'615.
49
49
  * @see {@link https://lua-api.factorio.com/latest/Builtin-Types.html#uint64 Online documentation}
50
50
  */
51
51
  type uint64 = number
@@ -1760,6 +1760,16 @@ interface LuaCustomInputPrototype {
1760
1760
  * @see {@link https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.alternative_key_sequence Online documentation}
1761
1761
  */
1762
1762
  readonly alternative_key_sequence?: string
1763
+ /**
1764
+ * The default controller key sequence for this custom input, if any
1765
+ * @see {@link https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.controller_key_sequence Online documentation}
1766
+ */
1767
+ readonly controller_key_sequence?: string
1768
+ /**
1769
+ * The default controller alternative key sequence for this custom input, if any
1770
+ * @see {@link https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.controller_alternative_key_sequence Online documentation}
1771
+ */
1772
+ readonly controller_alternative_key_sequence?: string
1763
1773
  /**
1764
1774
  * The linked game control name, if any.
1765
1775
  * @see {@link https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.linked_game_control Online documentation}
@@ -3350,6 +3360,9 @@ interface LuaEntity extends LuaControl {
3350
3360
  fluidbox: LuaFluidBox
3351
3361
  /**
3352
3362
  * The backer name assigned to this entity. Entities that support backer names are labs, locomotives, radars, roboports, and train stops. `nil` if this entity doesn't support backer names.
3363
+ *
3364
+ * **Raised events:**
3365
+ * - {@link OnEntityRenamedEvent on_entity_renamed} _instantly_
3353
3366
  * @remarks While train stops get the name of a backer when placed down, players can rename them if they want to. In this case, `backer_name` returns the player-given name of the entity.
3354
3367
  * @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.backer_name Online documentation}
3355
3368
  */
@@ -3365,7 +3378,7 @@ interface LuaEntity extends LuaControl {
3365
3378
  /**
3366
3379
  * The ticks left before a ghost, combat robot, highlight box or smoke with trigger is destroyed.
3367
3380
  *
3368
- * - for ghosts set to uint32 max (4,294,967,295) to never expire.
3381
+ * - for ghosts set to uint32 max (4'294'967'295) to never expire.
3369
3382
  * - for ghosts Cannot be set higher than {@link LuaForce#ghost_time_to_live LuaForce::ghost_time_to_live} of the entity's force.
3370
3383
  * @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.time_to_live Online documentation}
3371
3384
  */
@@ -4007,7 +4020,7 @@ interface LuaEntity extends LuaControl {
4007
4020
  * The storage filter for this logistic storage container.
4008
4021
  * @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.storage_filter Online documentation}
4009
4022
  */
4010
- storage_filter: LuaItemPrototype
4023
+ storage_filter?: LuaItemPrototype
4011
4024
  /**
4012
4025
  * Whether this requester chest is set to also request from buffer chests.
4013
4026
  * @remarks Useable only on entities that have requester slots.
@@ -4862,6 +4875,9 @@ interface BaseEntity extends LuaControl {
4862
4875
  fluidbox: LuaFluidBox
4863
4876
  /**
4864
4877
  * The backer name assigned to this entity. Entities that support backer names are labs, locomotives, radars, roboports, and train stops. `nil` if this entity doesn't support backer names.
4878
+ *
4879
+ * **Raised events:**
4880
+ * - {@link OnEntityRenamedEvent on_entity_renamed} _instantly_
4865
4881
  * @remarks While train stops get the name of a backer when placed down, players can rename them if they want to. In this case, `backer_name` returns the player-given name of the entity.
4866
4882
  * @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.backer_name Online documentation}
4867
4883
  */
@@ -4877,7 +4893,7 @@ interface BaseEntity extends LuaControl {
4877
4893
  /**
4878
4894
  * The ticks left before a ghost, combat robot, highlight box or smoke with trigger is destroyed.
4879
4895
  *
4880
- * - for ghosts set to uint32 max (4,294,967,295) to never expire.
4896
+ * - for ghosts set to uint32 max (4'294'967'295) to never expire.
4881
4897
  * - for ghosts Cannot be set higher than {@link LuaForce#ghost_time_to_live LuaForce::ghost_time_to_live} of the entity's force.
4882
4898
  * @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.time_to_live Online documentation}
4883
4899
  */
@@ -5149,7 +5165,7 @@ interface BaseEntity extends LuaControl {
5149
5165
  * The storage filter for this logistic storage container.
5150
5166
  * @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.storage_filter Online documentation}
5151
5167
  */
5152
- storage_filter: LuaItemPrototype
5168
+ storage_filter?: LuaItemPrototype
5153
5169
  /**
5154
5170
  * Whether this requester chest is set to also request from buffer chests.
5155
5171
  * @remarks Useable only on entities that have requester slots.
@@ -10815,6 +10831,11 @@ interface LuaFluidBox extends Array<Fluid | nil> {
10815
10831
  * @see {@link https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_connections Online documentation}
10816
10832
  */
10817
10833
  get_connections(index: uint): LuaFluidBox[]
10834
+ /**
10835
+ * Get the fluid box's connections and associated data.
10836
+ * @see {@link https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_pipe_connections Online documentation}
10837
+ */
10838
+ get_pipe_connections(index: uint): PipeConnection[]
10818
10839
  /**
10819
10840
  * Get a fluid box filter
10820
10841
  * @param index The index of the filter to get.
@@ -10848,6 +10869,12 @@ interface LuaFluidBox extends Array<Fluid | nil> {
10848
10869
  * @see {@link https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_fluid_system_id Online documentation}
10849
10870
  */
10850
10871
  get_fluid_system_id(index: uint): uint | nil
10872
+ /**
10873
+ * Gets counts of all fluids in the fluid system. May return `nil` for fluid wagon, fluid turret's internal buffer, or a fluidbox which does not belong to a fluid system.
10874
+ * @returns The counts, indexed by fluid name.
10875
+ * @see {@link https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_fluid_system_contents Online documentation}
10876
+ */
10877
+ get_fluid_system_contents(index: uint): Record<string, uint> | nil
10851
10878
  /**
10852
10879
  * Flushes all fluid from this fluidbox and its fluid system.
10853
10880
  * @param fluid If provided, only this fluid is flushed.
@@ -12035,7 +12062,7 @@ interface LuaGameScript {
12035
12062
  * @param name Name of the new surface.
12036
12063
  * @param settings Map generation settings.
12037
12064
  * @returns The surface that was just created.
12038
- * @remarks The game currently supports a maximum of 4,294,967,295 surfaces, including the default surface.<br>Surface names must be unique.
12065
+ * @remarks The game currently supports a maximum of 4'294'967'295 surfaces, including the default surface.<br>Surface names must be unique.
12039
12066
  * @see {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.create_surface Online documentation}
12040
12067
  */
12041
12068
  create_surface(name: string, settings?: MapGenSettingsWrite): LuaSurface
@@ -12454,7 +12481,7 @@ interface LuaGameScript {
12454
12481
  */
12455
12482
  readonly difficulty: defines.difficulty
12456
12483
  /**
12457
- * Get a table of all the forces that currently exist. This sparse table allows you to find forces by indexing it with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the array part of the table. Iterating with `ipairs()` will not work at all.
12484
+ * Get a table of all the forces that currently exist. This sparse table allows you to find forces by indexing it with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the hash part of the table. Iterating with `ipairs()` will not work at all.
12458
12485
  * @see {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.forces Online documentation}
12459
12486
  */
12460
12487
  readonly forces: LuaCustomTable<uint | string, LuaForce>
@@ -12625,8 +12652,9 @@ interface LuaGameScript {
12625
12652
  */
12626
12653
  readonly tick: uint
12627
12654
  /**
12628
- * The number of ticks since this game was 'created'. A game is 'created' either by using "new game" or "new game from scenario".
12629
- * @remarks This differs over {@link LuaGameScript#tick LuaGameScript::tick} in that making a game from a scenario always starts with ticks_played value at 0 even if the scenario has its own level data where the {@link LuaGameScript#tick LuaGameScript::tick} is > 0.<br>This value has no relation with {@link LuaGameScript#tick LuaGameScript::tick} and can be completely different values.
12655
+ * The number of ticks since this game was created using either "new game" or "new game from scenario". Notably, this number progresses even when the game is {@link LuaGameScript#tick_paused tick_paused}.
12656
+ *
12657
+ * This differs from {@link LuaGameScript#tick LuaGameScript::tick} in that creating a game from a scenario always starts with this value at `0`, even if the scenario has its own level data where the `tick` has progressed past `0`.
12630
12658
  * @see {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.ticks_played Online documentation}
12631
12659
  */
12632
12660
  readonly ticks_played: uint
@@ -12657,7 +12685,7 @@ interface LuaGameScript {
12657
12685
  */
12658
12686
  speed: float
12659
12687
  /**
12660
- * Get a table of all the surfaces that currently exist. This sparse table allows you to find surfaces by indexing it with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the array part of the table. Iterating with `ipairs()` will not work at all.
12688
+ * Get a table of all the surfaces that currently exist. This sparse table allows you to find surfaces by indexing it with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the hash part of the table. Iterating with `ipairs()` will not work at all.
12661
12689
  * @see {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.surfaces Online documentation}
12662
12690
  */
12663
12691
  readonly surfaces: LuaCustomTable<SurfaceIndex | string, LuaSurface>
@@ -12974,6 +13002,14 @@ interface BaseGuiSpec {
12974
13002
  * Where to position the child element when in the `relative` element.
12975
13003
  */
12976
13004
  readonly anchor?: GuiAnchor
13005
+ /**
13006
+ * How the element should interact with game controllers. Defaults to {@link defines.game_controller_interaction.normal}.
13007
+ */
13008
+ readonly game_controller_interaction?: defines.game_controller_interaction
13009
+ /**
13010
+ * Whether this element will raise {@link OnGuiHoverEvent on_gui_hover} and {@link OnGuiLeaveEvent on_gui_leave}. Defaults to `false`.
13011
+ */
13012
+ readonly raise_hover_events?: boolean
12977
13013
  }
12978
13014
 
12979
13015
  /**
@@ -13674,6 +13710,11 @@ interface BaseGuiElement {
13674
13710
  */
13675
13711
  get location(): GuiLocation | nil
13676
13712
  set location(value: GuiLocation | GuiLocationArray | nil)
13713
+ /**
13714
+ * How this element should interact with game controllers.
13715
+ * @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.game_controller_interaction Online documentation}
13716
+ */
13717
+ game_controller_interaction: defines.game_controller_interaction
13677
13718
  /**
13678
13719
  * Whether this GUI element is enabled. Disabled GUI elements don't trigger events when clicked.
13679
13720
  * @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.enabled Online documentation}
@@ -14074,7 +14115,7 @@ interface SpriteButtonGuiElementMembers extends BaseGuiElement {
14074
14115
  */
14075
14116
  auto_toggle: boolean
14076
14117
  /**
14077
- * Whether this button is currently toggled.
14118
+ * Whether this button is currently toggled. When a button is toggled, it will use the `selected_graphical_set` and `selected_font_color` defined in its style.
14078
14119
  *
14079
14120
  * _Can only be used if this is button or sprite-button_
14080
14121
  * @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.toggled Online documentation}
@@ -14253,7 +14294,7 @@ interface ButtonGuiElementMembers extends BaseGuiElement {
14253
14294
  */
14254
14295
  auto_toggle: boolean
14255
14296
  /**
14256
- * Whether this button is currently toggled.
14297
+ * Whether this button is currently toggled. When a button is toggled, it will use the `selected_graphical_set` and `selected_font_color` defined in its style.
14257
14298
  *
14258
14299
  * _Can only be used if this is button or sprite-button_
14259
14300
  * @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.toggled Online documentation}
@@ -18517,6 +18558,11 @@ interface LuaMiningDrillControlBehavior extends LuaGenericOnOffControlBehavior {
18517
18558
  * @noSelf
18518
18559
  */
18519
18560
  interface LuaModSettingPrototype {
18561
+ /**
18562
+ * Type of this prototype.
18563
+ * @see {@link https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.type Online documentation}
18564
+ */
18565
+ readonly type: string
18520
18566
  /**
18521
18567
  * Name of this prototype.
18522
18568
  * @see {@link https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.name Online documentation}
@@ -19531,6 +19577,11 @@ interface LuaPlayer extends LuaControl {
19531
19577
  * @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.render_mode Online documentation}
19532
19578
  */
19533
19579
  readonly render_mode: defines.render_mode
19580
+ /**
19581
+ * The input method of the player, mouse and keyboard or game controller
19582
+ * @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.input_method Online documentation}
19583
+ */
19584
+ readonly input_method: defines.input_method
19534
19585
  /**
19535
19586
  * If `true`, zoom-to-world noise effect will be disabled and environmental sounds will be based on zoom-to-world view instead of position of player's character.
19536
19587
  * @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.spectator Online documentation}
@@ -20223,6 +20274,10 @@ interface LuaRendering {
20223
20274
  * Length of the dashes that this line has. Used only if gap_length > 0. Default is 0.
20224
20275
  */
20225
20276
  readonly dash_length?: double
20277
+ /**
20278
+ * Starting offset to apply to dashes. Cannot be greater than dash_length + gap_length. Default is 0.
20279
+ */
20280
+ readonly dash_offset?: double
20226
20281
  readonly from: (MapPosition | MapPositionArray) | LuaEntity
20227
20282
  /**
20228
20283
  * Only used if `from` is a LuaEntity.
@@ -20570,6 +20625,9 @@ interface LuaRendering {
20570
20625
  */
20571
20626
  readonly y_scale?: double
20572
20627
  readonly tint?: Color | ColorArray
20628
+ /**
20629
+ * Render layer of the sprite. Defaults to `"arrow"`.
20630
+ */
20573
20631
  readonly render_layer?: RenderLayer
20574
20632
  /**
20575
20633
  * If given, the sprite rotates so that it faces this target. Note that `orientation` is still applied to the sprite.
@@ -20702,6 +20760,9 @@ interface LuaRendering {
20702
20760
  */
20703
20761
  readonly y_scale?: double
20704
20762
  readonly tint?: Color | ColorArray
20763
+ /**
20764
+ * Render layer of the animation. Defaults to `"arrow"`.
20765
+ */
20705
20766
  readonly render_layer?: RenderLayer
20706
20767
  /**
20707
20768
  * How many frames the animation goes forward per tick. Default is 1.
@@ -22904,7 +22965,7 @@ interface LuaSurface {
22904
22965
  readonly force?: ForceIdentification
22905
22966
  }): boolean
22906
22967
  /**
22907
- * Find a specific entity at a specific position.
22968
+ * Find an entity of the given type at the given position. This checks both the exact position and the bounding box of the entity.
22908
22969
  * @param entity Entity to look for.
22909
22970
  * @param position Coordinates to look at.
22910
22971
  * @returns `nil` if no such entity is found.
@@ -23425,6 +23486,16 @@ interface LuaSurface {
23425
23486
  position: MapPosition | MapPositionArray,
23426
23487
  force: ForceIdentification
23427
23488
  ): LuaLogisticNetwork | nil
23489
+ /**
23490
+ * Find the logistic network with a cell closest to a given position.
23491
+ * @param force Force the logistic network should belong to.
23492
+ * @returns The found network or `nil` if no such network was found.
23493
+ * @see {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_closest_logistic_network_by_position Online documentation}
23494
+ */
23495
+ find_closest_logistic_network_by_position(
23496
+ position: MapPosition | MapPositionArray,
23497
+ force: ForceIdentification
23498
+ ): LuaLogisticNetwork | nil
23428
23499
  /**
23429
23500
  * Finds all of the logistics networks whose construction area intersects with the given position.
23430
23501
  * @param force Force the logistic networks should belong to.
@@ -23568,11 +23639,18 @@ interface LuaSurface {
23568
23639
  * Gets all tiles of the given types that are connected horizontally or vertically to the given tile position including the given tile position.
23569
23640
  * @param position The tile position to start at.
23570
23641
  * @param tiles The tiles to search for.
23642
+ * @param include_diagonal Include tiles that are connected diagonally.
23643
+ * @param area The area to find connected tiles in. If provided the start position must be in this area.
23571
23644
  * @returns The resulting set of tiles.
23572
23645
  * @remarks This won't find tiles in non-generated chunks.
23573
23646
  * @see {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_connected_tiles Online documentation}
23574
23647
  */
23575
- get_connected_tiles(position: TilePosition | TilePositionArray, tiles: readonly string[]): TilePosition[]
23648
+ get_connected_tiles(
23649
+ position: TilePosition | TilePositionArray,
23650
+ tiles: readonly string[],
23651
+ include_diagonal?: boolean,
23652
+ area?: BoundingBoxWrite | BoundingBoxArray
23653
+ ): TilePosition[]
23576
23654
  /**
23577
23655
  * **Raised events:**
23578
23656
  * - {@link OnPreChunkDeletedEvent on_pre_chunk_deleted} _future_tick_
@@ -627,6 +627,11 @@ interface GameViewSettings {
627
627
  * @see {@link https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings#GameViewSettings.show_map_view_options Online documentation}
628
628
  */
629
629
  show_map_view_options: boolean
630
+ /**
631
+ * Shows or hides the tooltip that is displayed when selecting an entity.
632
+ * @see {@link https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings#GameViewSettings.show_entity_tooltip Online documentation}
633
+ */
634
+ show_entity_tooltip: boolean
630
635
  /**
631
636
  * Shows or hides quickbar of shortcuts.
632
637
  * @see {@link https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings#GameViewSettings.show_quickbar Online documentation}
@@ -637,6 +642,21 @@ interface GameViewSettings {
637
642
  * @see {@link https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings#GameViewSettings.show_shortcut_bar Online documentation}
638
643
  */
639
644
  show_shortcut_bar: boolean
645
+ /**
646
+ * Shows or hides the crafting queue.
647
+ * @see {@link https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings#GameViewSettings.show_crafting_queue Online documentation}
648
+ */
649
+ show_crafting_queue: boolean
650
+ /**
651
+ * Shows or hides the tool window with the weapons and armor.
652
+ * @see {@link https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings#GameViewSettings.show_tool_bar Online documentation}
653
+ */
654
+ show_tool_bar: boolean
655
+ /**
656
+ * Shows or hides the mouse and keyboard/controller button hints in the bottom left corner if they are enabled in the interface settings.
657
+ * @see {@link https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings#GameViewSettings.show_hotkey_suggestions Online documentation}
658
+ */
659
+ show_hotkey_suggestions: boolean
640
660
  }
641
661
 
642
662
  /**
@@ -800,26 +820,26 @@ interface EnemyExpansionMapSettings {
800
820
  */
801
821
  readonly settler_group_max_size: uint
802
822
  /**
803
- * The minimum time between expansions in ticks. The actual cooldown is adjusted to the current evolution levels. Defaults to `4*3,600=14,400` ticks.
823
+ * The minimum time between expansions in ticks. The actual cooldown is adjusted to the current evolution levels. Defaults to `4*3'600=14'400` ticks.
804
824
  */
805
825
  readonly min_expansion_cooldown: uint
806
826
  /**
807
- * The maximum time between expansions in ticks. The actual cooldown is adjusted to the current evolution levels. Defaults to `60*3,600=216,000` ticks.
827
+ * The maximum time between expansions in ticks. The actual cooldown is adjusted to the current evolution levels. Defaults to `60*3'600=216'000` ticks.
808
828
  */
809
829
  readonly max_expansion_cooldown: uint
810
830
  }
811
831
 
812
832
  interface UnitGroupMapSettings {
813
833
  /**
814
- * The minimum amount of time in ticks a group will spend gathering before setting off. The actual time is a random time between the minimum and maximum times. Defaults to `3,600` ticks.
834
+ * The minimum amount of time in ticks a group will spend gathering before setting off. The actual time is a random time between the minimum and maximum times. Defaults to `3'600` ticks.
815
835
  */
816
836
  readonly min_group_gathering_time: uint
817
837
  /**
818
- * The maximum amount of time in ticks a group will spend gathering before setting off. The actual time is a random time between the minimum and maximum times. Defaults to `10*3,600=36,000` ticks.
838
+ * The maximum amount of time in ticks a group will spend gathering before setting off. The actual time is a random time between the minimum and maximum times. Defaults to `10*3'600=36'000` ticks.
819
839
  */
820
840
  readonly max_group_gathering_time: uint
821
841
  /**
822
- * After gathering has finished, the group is allowed to wait this long in ticks for delayed members. New members are not accepted anymore however. Defaults to `2*3,600=7,200` ticks.
842
+ * After gathering has finished, the group is allowed to wait this long in ticks for delayed members. New members are not accepted anymore however. Defaults to `2*3'600=7'200` ticks.
823
843
  */
824
844
  readonly max_wait_time_for_late_members: uint
825
845
  /**
@@ -889,11 +909,11 @@ interface PathFinderMapSettings {
889
909
  */
890
910
  readonly goal_pressure_ratio: double
891
911
  /**
892
- * The maximum number of nodes that are expanded per tick. Defaults to `1,000`.
912
+ * The maximum number of nodes that are expanded per tick. Defaults to `1'000`.
893
913
  */
894
914
  readonly max_steps_worked_per_tick: double
895
915
  /**
896
- * The maximum amount of work each pathfinding job is allowed to do per tick. Defaults to `8,000`.
916
+ * The maximum amount of work each pathfinding job is allowed to do per tick. Defaults to `8'000`.
897
917
  */
898
918
  readonly max_work_done_per_tick: uint
899
919
  /**
@@ -2387,7 +2407,7 @@ interface HeatConnection {
2387
2407
  */
2388
2408
  interface FluidBoxConnection {
2389
2409
  /**
2390
- * The connection type: "input", "output", or "input-output".
2410
+ * One of "input", "output", or "input-output".
2391
2411
  */
2392
2412
  readonly type: "input" | "output" | "input-output"
2393
2413
  /**
@@ -2400,6 +2420,37 @@ interface FluidBoxConnection {
2400
2420
  readonly max_underground_distance?: uint
2401
2421
  }
2402
2422
 
2423
+ /**
2424
+ * A single pipe connection for a given fluidbox.
2425
+ * @see {@link https://lua-api.factorio.com/latest/Concepts.html#PipeConnection Online documentation}
2426
+ */
2427
+ interface PipeConnection {
2428
+ /**
2429
+ * One of "input", "output", or "input-output".
2430
+ */
2431
+ readonly flow_direction: "input" | "output" | "input-output"
2432
+ /**
2433
+ * One of "normal" or "underground".
2434
+ */
2435
+ readonly connection_type: "normal" | "underground"
2436
+ /**
2437
+ * The absolute position of this connection within the entity.
2438
+ */
2439
+ readonly position: MapPosition
2440
+ /**
2441
+ * The absolute position of the connection's intended target.
2442
+ */
2443
+ readonly target_position: MapPosition
2444
+ /**
2445
+ * The connected fluidbox, if any.
2446
+ */
2447
+ readonly target?: LuaFluidBox
2448
+ /**
2449
+ * The index of the connected fluidbox, if any.
2450
+ */
2451
+ readonly target_index?: uint
2452
+ }
2453
+
2403
2454
  interface ArithmeticCombinatorParameters {
2404
2455
  /**
2405
2456
  * First signal to use in an operation. If not specified, the second argument will be the value of `first_constant`.
@@ -1341,6 +1341,10 @@ declare namespace defines {
1341
1341
  * Event type: {@link OnGuiLeaveEvent}
1342
1342
  */
1343
1343
  const on_gui_leave: EventId<OnGuiLeaveEvent>
1344
+ /**
1345
+ * Event type: {@link OnEntityColorChangedEvent}
1346
+ */
1347
+ const on_entity_color_changed: EventId<OnEntityColorChangedEvent>
1344
1348
  /**
1345
1349
  * Event type: {@link OnCutsceneStartedEvent}
1346
1350
  */
@@ -1349,6 +1353,10 @@ declare namespace defines {
1349
1353
  * Event type: {@link OnCutsceneFinishedEvent}
1350
1354
  */
1351
1355
  const on_cutscene_finished: EventId<OnCutsceneFinishedEvent>
1356
+ /**
1357
+ * Event type: {@link OnPlayerInputMethodChangedEvent}
1358
+ */
1359
+ const on_player_input_method_changed: EventId<OnPlayerInputMethodChangedEvent>
1352
1360
  }
1353
1361
  /**
1354
1362
  * See the {@linkplain https://lua-api.factorio.com/latest/events.html events page} for more info on what events contain and when they get raised.
@@ -1365,6 +1373,23 @@ declare namespace defines {
1365
1373
  two_hundred_fifty_hours,
1366
1374
  one_thousand_hours,
1367
1375
  }
1376
+ enum game_controller_interaction {
1377
+ /**
1378
+ * Game controller will always hover this element regardless of type or state.
1379
+ * @see {@link https://lua-api.factorio.com/latest/defines.html#defines.game_controller_interaction.always Online documentation}
1380
+ */
1381
+ always,
1382
+ /**
1383
+ * Hover according to the element type and implementation.
1384
+ * @see {@link https://lua-api.factorio.com/latest/defines.html#defines.game_controller_interaction.never Online documentation}
1385
+ */
1386
+ never,
1387
+ /**
1388
+ * Never hover this element with a game controller.
1389
+ * @see {@link https://lua-api.factorio.com/latest/defines.html#defines.game_controller_interaction.normal Online documentation}
1390
+ */
1391
+ normal,
1392
+ }
1368
1393
  enum group_state {
1369
1394
  gathering,
1370
1395
  moving,
@@ -19,6 +19,10 @@ interface CustomInputEvent extends EventData {
19
19
  * The mouse cursor position when the custom input was activated.
20
20
  */
21
21
  readonly cursor_position: MapPosition
22
+ /**
23
+ * The mouse cursor display location when the custom input was activated.
24
+ */
25
+ readonly cursor_display_location: GuiLocation
22
26
  /**
23
27
  * Information about the prototype that is selected when the custom input is used. Needs to be enabled on the custom input's prototype. `nil` if none is selected.
24
28
  */
@@ -548,6 +552,26 @@ interface OnEntityClonedEvent extends EventData {
548
552
  readonly tick: uint
549
553
  }
550
554
 
555
+ /**
556
+ * Called after an entity has been recolored either by the player or through script.
557
+ * @remarks Automatic recoloring due to {@link LuaPlayer#color LuaPlayer::color} will not raise events, as that is a separate mechanism.
558
+ * @see {@link https://lua-api.factorio.com/latest/events.html#on_entity_color_changed Online documentation}
559
+ */
560
+ interface OnEntityColorChangedEvent extends EventData {
561
+ /**
562
+ * The entity that was recolored.
563
+ */
564
+ readonly entity: LuaEntity
565
+ /**
566
+ * Identifier of the event
567
+ */
568
+ readonly name: typeof defines.events.on_entity_color_changed
569
+ /**
570
+ * Tick the event was generated.
571
+ */
572
+ readonly tick: uint
573
+ }
574
+
551
575
  /**
552
576
  * Called when an entity is damaged. Can be filtered using {@link LuaEntityDamagedEventFilter}.
553
577
  * @remarks This is not called when an entities health is set directly by another mod.
@@ -983,6 +1007,10 @@ interface OnGuiClickEvent extends EventData {
983
1007
  * The mouse button used if any.
984
1008
  */
985
1009
  readonly button: defines.mouse_button_type
1010
+ /**
1011
+ * The display location of the player's cursor.
1012
+ */
1013
+ readonly cursor_display_location: GuiLocation
986
1014
  /**
987
1015
  * If alt was pressed.
988
1016
  */
@@ -2301,6 +2329,26 @@ interface OnPlayerGunInventoryChangedEvent extends EventData {
2301
2329
  readonly tick: uint
2302
2330
  }
2303
2331
 
2332
+ /**
2333
+ * Called when a player's input method changes.
2334
+ * @remarks See {@link LuaPlayer#input_method LuaPlayer::input_method}.
2335
+ * @see {@link https://lua-api.factorio.com/latest/events.html#on_player_input_method_changed Online documentation}
2336
+ */
2337
+ interface OnPlayerInputMethodChangedEvent extends EventData {
2338
+ /**
2339
+ * The player whose input method changed.
2340
+ */
2341
+ readonly player_index: PlayerIndex
2342
+ /**
2343
+ * Identifier of the event
2344
+ */
2345
+ readonly name: typeof defines.events.on_player_input_method_changed
2346
+ /**
2347
+ * Tick the event was generated.
2348
+ */
2349
+ readonly tick: uint
2350
+ }
2351
+
2304
2352
  /**
2305
2353
  * Called after a player joins the game. This is not called when loading a save file in singleplayer, as the player doesn't actually leave the game, and the save is just on pause until they rejoin.
2306
2354
  * @see {@link https://lua-api.factorio.com/latest/events.html#on_player_joined_game Online documentation}