factorio-types 0.0.34 → 0.0.36

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/dist/classes.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  // Factorio API reference https://lua-api.factorio.com/latest/index.html
3
3
  // Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 1.1.78
5
+ // Factorio version 1.1.84
6
6
  // API version 3
7
7
 
8
8
  /**
@@ -35,7 +35,7 @@ interface LuaAISettings {
35
35
  readonly object_name: string
36
36
 
37
37
  /**
38
- * The pathing resolution modifier, must be between -8 and 8.
38
+ * Defines how coarse the pathfinder's grid is, where smaller values mean a coarser grid. Defaults to `0`, which equals a resolution of `1x1` tiles, centered on tile centers. Values range from `-8` to `8` inclusive, where each integer increment doubles/halves the resolution. So, a resolution of `-8` equals a grid of `256x256` tiles, and a resolution of `8` equals `1/256` of a tile.
39
39
  */
40
40
  path_resolution_modifier: number
41
41
 
@@ -366,6 +366,7 @@ interface LuaBootstrap {
366
366
  * - {@link script_raised_built | script_raised_built}
367
367
  * - {@link script_raised_destroy | script_raised_destroy}
368
368
  * - {@link script_raised_revive | script_raised_revive}
369
+ * - {@link script_raised_teleported | script_raised_teleported}
369
370
  * - {@link script_raised_set_tiles | script_raised_set_tiles}
370
371
  * @param data - Table with extra data that will be passed to the event handler. Any invalid LuaObjects will silently stop the event from being raised.
371
372
  * @param event - ID of the event to raise.
@@ -476,6 +477,22 @@ interface LuaBootstrap {
476
477
  *
477
478
  * @param metatable - The metatable to register.
478
479
  * @param name - The name of this metatable. Names must be unique per mod.
480
+ * @example
481
+ * The metatable first needs to be defined in the mod's root scope, then registered using this method. From then on, it will be properly restored for tables in [global](global).
482
+ * ```
483
+ * local metatable = {
484
+ * __index = function(key)
485
+ * return "no value for key " .. key
486
+ * end
487
+ * }
488
+ * script.register_metatable("my_metatable", metatable)
489
+ * ```
490
+ * This previously defined `metatable` can then be set on any table as usual:
491
+ * ```
492
+ * local table = {key="value"}
493
+ * setmetatable(table, metatable)
494
+ * ```
495
+ *
479
496
  */
480
497
  register_metatable(this: void,
481
498
  name: string,
@@ -589,7 +606,7 @@ interface LuaBurner {
589
606
  readonly burnt_result_inventory: LuaInventory
590
607
 
591
608
  /**
592
- * The currently burning item.
609
+ * The currently burning item. Writing `nil` will void the currently burning item without producing a {@link LuaBurner::burnt_result | LuaBurner::burnt_result}.
593
610
  * @remarks
594
611
  * Writing to this automatically handles correcting {@link LuaBurner::remaining_burning_fuel | LuaBurner::remaining_burning_fuel}.
595
612
  *
@@ -884,11 +901,12 @@ interface LuaConstantCombinatorControlBehavior extends LuaControlBehavior {
884
901
  help(this: void): void
885
902
 
886
903
  /**
887
- * Sets the signal at the given index
904
+ * Sets the signal at the given index.
905
+ * @param signal - Passing `nil` clears the signal.
888
906
  */
889
907
  set_signal(this: void,
890
908
  index: number,
891
- signal: Signal): void
909
+ signal?: Signal): void
892
910
 
893
911
  /**
894
912
  * Turns this constant combinator on and off.
@@ -908,7 +926,7 @@ interface LuaConstantCombinatorControlBehavior extends LuaControlBehavior {
908
926
  parameters?: ConstantCombinatorParameters[]
909
927
 
910
928
  /**
911
- * The number of signals this constant combinator supports
929
+ * The number of signals this constant combinator supports.
912
930
  */
913
931
  readonly signals_count: number
914
932
 
@@ -1058,7 +1076,12 @@ interface LuaControl {
1058
1076
  get_main_inventory(this: void): void
1059
1077
 
1060
1078
  /**
1061
- * The maximum inventory index this entity may use.
1079
+ * The highest index of all inventories this entity can use. Allows iteration over all of them if desired.
1080
+ * @example
1081
+ * ```
1082
+ * for k = 1, entity.get_max_inventory_index() do [...] end
1083
+ * ```
1084
+ *
1062
1085
  */
1063
1086
  get_max_inventory_index(this: void): void
1064
1087
 
@@ -1372,7 +1395,7 @@ interface LuaControl {
1372
1395
  force: ForceIdentification
1373
1396
 
1374
1397
  /**
1375
- * Unique {@link index | LuaForce::index} associated with the force of this entity.
1398
+ * Unique {@link index | LuaForce::index} (ID) associated with the force of this entity.
1376
1399
  */
1377
1400
  readonly force_index: number
1378
1401
 
@@ -1394,18 +1417,18 @@ interface LuaControl {
1394
1417
  /**
1395
1418
  * Current mining state.
1396
1419
  * @remarks
1397
- * When the player isn't mining tiles the player will mine what ever entity is currently selected. See {@link LuaControl::selected | LuaControl::selected} and {@link LuaControl::update_selected_entity | LuaControl::update_selected_entity}.
1420
+ * When the player isn't mining tiles, the player will mine what ever entity is currently selected. See {@link LuaControl::selected | LuaControl::selected} and {@link LuaControl::update_selected_entity | LuaControl::update_selected_entity}.
1398
1421
  *
1399
1422
  */
1400
1423
  mining_state: {
1401
1424
 
1402
1425
  /**
1403
- * Whether the player is mining at all
1426
+ * Whether the player is mining at all.
1404
1427
  */
1405
1428
  mining: boolean,
1406
1429
 
1407
1430
  /**
1408
- * What tiles the player is mining; only used when the player is mining tiles (holding a tile in the cursor).
1431
+ * What location the player is mining. Only relevant if `mining` is `true`.
1409
1432
  */
1410
1433
  position?: MapPosition
1411
1434
  }
@@ -1490,7 +1513,7 @@ interface LuaControl {
1490
1513
  readonly surface: LuaSurface
1491
1514
 
1492
1515
  /**
1493
- * Unique {@link index | LuaSurface::index} associated with the surface this entity is currently on.
1516
+ * Unique {@link index | LuaSurface::index} (ID) associated with the surface this entity is currently on.
1494
1517
  */
1495
1518
  readonly surface_index: number
1496
1519
 
@@ -1637,6 +1660,16 @@ interface LuaCustomInputPrototype {
1637
1660
  */
1638
1661
  readonly consuming: string
1639
1662
 
1663
+ /**
1664
+ * The default controller alternative key sequence for this custom input, if any
1665
+ */
1666
+ readonly controller_alternative_key_sequence?: string
1667
+
1668
+ /**
1669
+ * The default controller key sequence for this custom input, if any
1670
+ */
1671
+ readonly controller_key_sequence?: string
1672
+
1640
1673
  /**
1641
1674
  * Whether this custom input is enabled. Disabled custom inputs exist but are not used by the game.
1642
1675
  */
@@ -2458,7 +2491,7 @@ interface LuaEntity extends LuaControl {
2458
2491
  direction: defines.rail_direction): void
2459
2492
 
2460
2493
  /**
2461
- * Current recipe being assembled by this machine or `nil` if no recipe is set.
2494
+ * Current recipe being assembled by this machine, if any.
2462
2495
  * @remarks
2463
2496
  * Applies to subclasses: CraftingMachine
2464
2497
  *
@@ -2822,13 +2855,13 @@ interface LuaEntity extends LuaControl {
2822
2855
  /**
2823
2856
  * Sets the driver of this vehicle.
2824
2857
  * @remarks
2825
- * This differs over {@link LuaEntity::set_passenger | LuaEntity::set_passenger} in that the passenger can't drive the vehicle.
2858
+ * This differs from {@link LuaEntity::set_passenger | LuaEntity::set_passenger} in that the passenger can't drive the vehicle.
2826
2859
  * Applies to subclasses: Vehicle
2827
2860
  *
2828
- * @param driver - The new driver or `nil` to eject the current driver if any.
2861
+ * @param driver - The new driver. Writing `nil` ejects the current driver, if any.
2829
2862
  */
2830
2863
  set_driver(this: void,
2831
- driver: LuaEntity | PlayerIdentification): void
2864
+ driver?: LuaEntity | PlayerIdentification): void
2832
2865
 
2833
2866
  /**
2834
2867
  * Set the filter for a slot in an inserter, loader, or logistic storage container.
@@ -2877,22 +2910,23 @@ interface LuaEntity extends LuaControl {
2877
2910
  /**
2878
2911
  * Sets the passenger of this car or spidertron.
2879
2912
  * @remarks
2880
- * This differs over {@link LuaEntity::get_driver | LuaEntity::get_driver} in that the passenger can't drive the car.
2913
+ * This differs from {@link LuaEntity::get_driver | LuaEntity::get_driver} in that the passenger can't drive the car.
2881
2914
  * Applies to subclasses: Car,SpiderVehicle
2882
2915
  *
2916
+ * @param passenger - The new passenger. Writing `nil` ejects the current passenger, if any.
2883
2917
  */
2884
2918
  set_passenger(this: void,
2885
- passenger: LuaEntity | PlayerIdentification): void
2919
+ passenger?: LuaEntity | PlayerIdentification): void
2886
2920
 
2887
2921
  /**
2888
- * Sets the current recipe in this assembly machine.
2922
+ * Sets the given recipe in this assembly machine.
2889
2923
  * @remarks
2890
2924
  * Applies to subclasses: AssemblingMachine
2891
2925
  *
2892
- * @param recipe - The new recipe or `nil` to clear the recipe.
2926
+ * @param recipe - The new recipe. Writing `nil` clears the recipe, if any.
2893
2927
  */
2894
2928
  set_recipe(this: void,
2895
- recipe: string | LuaRecipe): void
2929
+ recipe?: string | LuaRecipe): void
2896
2930
 
2897
2931
  /**
2898
2932
  * Set a logistic requester slot.
@@ -3034,7 +3068,7 @@ interface LuaEntity extends LuaControl {
3034
3068
  auto_launch: boolean
3035
3069
 
3036
3070
  /**
3037
- * Destination of this spidertron's autopilot, if any.
3071
+ * Destination of this spidertron's autopilot, if any. Writing `nil` clears all destinations.
3038
3072
  * @remarks
3039
3073
  * Applies to subclasses: SpiderVehicle
3040
3074
  *
@@ -3071,12 +3105,12 @@ interface LuaEntity extends LuaControl {
3071
3105
  readonly belt_neighbours: {[key: string]: LuaEntity[]}
3072
3106
 
3073
3107
  /**
3074
- * `"input"` or `"output"`, depending on whether this underground belt goes down or up.
3108
+ * Whether this underground belt goes into or out of the ground.
3075
3109
  * @remarks
3076
3110
  * Applies to subclasses: TransportBeltToGround
3077
3111
  *
3078
3112
  */
3079
- readonly belt_to_ground_type: string
3113
+ readonly belt_to_ground_type: 'input' | 'output'
3080
3114
 
3081
3115
  /**
3082
3116
  * The bonus mining progress for this mining drill. Read yields a number in range [0, mining_target.prototype.mineable_properties.mining_time]. `nil` if this isn't a mining drill.
@@ -3382,7 +3416,7 @@ interface LuaEntity extends LuaControl {
3382
3416
  readonly energy_generated_last_tick: number
3383
3417
 
3384
3418
  /**
3385
- * The label on this entity, if any. `nil` if this is not a spider-vehicle.
3419
+ * The label on this spider-vehicle entity, if any. `nil` if this is not a spider-vehicle.
3386
3420
  */
3387
3421
  entity_label?: string
3388
3422
 
@@ -3641,12 +3675,12 @@ interface LuaEntity extends LuaControl {
3641
3675
  readonly loader_container?: LuaEntity
3642
3676
 
3643
3677
  /**
3644
- * `"input"` or `"output"`, depending on whether this loader puts to or gets from a container.
3678
+ * Whether this loader gets items from or puts item into a container.
3645
3679
  * @remarks
3646
3680
  * Applies to subclasses: Loader
3647
3681
  *
3648
3682
  */
3649
- loader_type: string
3683
+ loader_type: 'input' | 'output'
3650
3684
 
3651
3685
  readonly localised_description: LocalisedString
3652
3686
 
@@ -4073,7 +4107,7 @@ interface LuaEntity extends LuaControl {
4073
4107
  /**
4074
4108
  * The ticks left before a ghost, combat robot, highlight box or smoke with trigger is destroyed.
4075
4109
  *
4076
- * - for ghosts set to uint32 max (4,294,967,295) to never expire.
4110
+ * - for ghosts set to uint32 max (4'294'967'295) to never expire.
4077
4111
  * - for ghosts Cannot be set higher than {@link LuaForce::ghost_time_to_live | LuaForce::ghost_time_to_live} of the entity's force.
4078
4112
  */
4079
4113
  time_to_live: number
@@ -5148,9 +5182,9 @@ interface LuaEntityPrototype {
5148
5182
  readonly item_slot_count?: number
5149
5183
 
5150
5184
  /**
5151
- * Items that when placed will produce this entity, if any. Construction bots will always choose the first item in this list to build this entity.
5185
+ * Items that when placed will produce this entity, if any. Construction bots will choose the first item in the list to build this entity.
5152
5186
  */
5153
- readonly items_to_place_this?: SimpleItemStack[]
5187
+ readonly items_to_place_this?: ItemStackDefinition[]
5154
5188
 
5155
5189
  /**
5156
5190
  * The item prototype names that are the inputs of this lab prototype.
@@ -6230,7 +6264,7 @@ interface LuaEquipmentGrid {
6230
6264
  readonly height: number
6231
6265
 
6232
6266
  /**
6233
- * True if this movement bonus equipment is turned off, otherwise false.
6267
+ * Whether this grid's equipment movement bonus is active.
6234
6268
  */
6235
6269
  inhibit_movement_bonus: boolean
6236
6270
 
@@ -7205,8 +7239,10 @@ interface LuaForce {
7205
7239
 
7206
7240
  /**
7207
7241
  * Force a rechart of the whole chart.
7242
+ * @param surface - Which surface to rechart or all if not given.
7208
7243
  */
7209
- rechart(this: void): void
7244
+ rechart(this: void,
7245
+ surface?: SurfaceIdentification): void
7210
7246
 
7211
7247
  /**
7212
7248
  * Research all technologies.
@@ -7428,7 +7464,7 @@ interface LuaForce {
7428
7464
  ghost_time_to_live: number
7429
7465
 
7430
7466
  /**
7431
- * This force's unique ID, and index in {@link LuaGameScript::forces | LuaGameScript::forces}. It is assigned when a force is created, and remains so until it is {@link merged | on_force_merged} (ie. deleted). Indexes of merged forces can be reused.
7467
+ * This force's index in {@link LuaGameScript::forces | LuaGameScript::forces} (unique ID). It is assigned when a force is created, and remains so until it is {@link merged | on_forces_merged} (ie. deleted). Indexes of merged forces can be reused.
7432
7468
  */
7433
7469
  readonly index: number
7434
7470
 
@@ -7744,7 +7780,7 @@ interface LuaGameScript {
7744
7780
  /**
7745
7781
  * Create a new surface.
7746
7782
  * @remarks
7747
- * The game currently supports a maximum of 4,294,967,295 surfaces, including the default surface.
7783
+ * The game currently supports a maximum of 4'294'967'295 surfaces, including the default surface.
7748
7784
  * Surface names must be unique.
7749
7785
  *
7750
7786
  * @param name - Name of the new surface.
@@ -7808,7 +7844,7 @@ interface LuaGameScript {
7808
7844
  variables?: {[key: string]: number}): void
7809
7845
 
7810
7846
  /**
7811
- * Force a CRC check. Tells all peers to calculate their current map CRC; these CRC are then compared against each other. If a mismatch is detected, the game is desynced and some peers are forced to reconnect.
7847
+ * Force a CRC check. Tells all peers to calculate their current CRC, which are then compared to each other. If a mismatch is detected, the game desyncs and some peers are forced to reconnect.
7812
7848
  */
7813
7849
  force_crc(this: void): void
7814
7850
 
@@ -7996,7 +8032,7 @@ interface LuaGameScript {
7996
8032
  is_demo(this: void): void
7997
8033
 
7998
8034
  /**
7999
- * Is the map loaded is multiplayer?
8035
+ * Whether the save is loaded as a multiplayer map.
8000
8036
  */
8001
8037
  is_multiplayer(this: void): void
8002
8038
 
@@ -8426,7 +8462,7 @@ interface LuaGameScript {
8426
8462
  readonly font_prototypes: {[key: string]: LuaFontPrototype}
8427
8463
 
8428
8464
  /**
8429
- * 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.
8465
+ * 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.
8430
8466
  */
8431
8467
  readonly forces: {[key: string]: LuaForce}
8432
8468
 
@@ -8569,7 +8605,7 @@ interface LuaGameScript {
8569
8605
  readonly styles: {[key: string]: string}
8570
8606
 
8571
8607
  /**
8572
- * 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.
8608
+ * 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.
8573
8609
  */
8574
8610
  readonly surfaces: {[key: string]: LuaSurface}
8575
8611
 
@@ -8589,11 +8625,9 @@ interface LuaGameScript {
8589
8625
  tick_paused: boolean
8590
8626
 
8591
8627
  /**
8592
- * The number of ticks since this game was 'created'. A game is 'created' either by using "new game" or "new game from scenario".
8593
- * @remarks
8594
- * 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.
8595
- * This value has no relation with {@link LuaGameScript::tick | LuaGameScript::tick} and can be completely different values.
8596
- *
8628
+ * 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 tick_paused | LuaGameScript::tick_paused}.
8629
+ *
8630
+ * 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`.
8597
8631
  */
8598
8632
  readonly ticks_played: number
8599
8633
 
@@ -8814,7 +8848,7 @@ interface LuaGui {
8814
8848
  * - `"progressbar"`: A partially filled bar that can be used to indicate progress.
8815
8849
  * - `"table"`: An invisible container that lays out its children in a specific number of columns. The width of each column is determined by the widest element it contains.
8816
8850
  * - `"textfield"`: A single-line box the user can type into. Relevant events: {@link on_gui_text_changed | on_gui_text_changed}, {@link on_gui_confirmed | on_gui_confirmed}
8817
- * - `"radiobutton"`: A clickable element that is functionally identical to a `checkbox`, but has a circular appearance. Relevant event: {@link on_gui_checked_state_changed | on_gui_checked_state_changed}
8851
+ * - `"radiobutton"`: An element that is similar to a `checkbox`, but with a circular appearance. Clicking a selected radio button will not unselect it. Radio buttons are not linked to each other in any way. Relevant event: {@link on_gui_checked_state_changed | on_gui_checked_state_changed}
8818
8852
  * - `"sprite"`: An element that shows an image.
8819
8853
  * - `"scroll-pane"`: An invisible element that is similar to a `flow`, but has the ability to show and use scroll bars.
8820
8854
  * - `"drop-down"`: A drop-down containing strings of text. Relevant event: {@link on_gui_selection_state_changed | on_gui_selection_state_changed}
@@ -9196,6 +9230,14 @@ interface LuaGuiElement {
9196
9230
  */
9197
9231
  auto_center: boolean
9198
9232
 
9233
+ /**
9234
+ * Whether this button will automatically toggle when clicked.
9235
+ * @remarks
9236
+ * Applies to subclasses: button,sprite-button
9237
+ *
9238
+ */
9239
+ auto_toggle: boolean
9240
+
9199
9241
  /**
9200
9242
  * The text to display after the normal tab text (designed to work with numbers)
9201
9243
  * @remarks
@@ -9361,6 +9403,11 @@ interface LuaGuiElement {
9361
9403
  */
9362
9404
  force?: string
9363
9405
 
9406
+ /**
9407
+ * How this element should interact with game controllers.
9408
+ */
9409
+ game_controller_interaction: defines.game_controller_interaction
9410
+
9364
9411
  /**
9365
9412
  * The GUI this element is a child of.
9366
9413
  */
@@ -9510,6 +9557,11 @@ interface LuaGuiElement {
9510
9557
  */
9511
9558
  position: MapPosition
9512
9559
 
9560
+ /**
9561
+ * Whether this element will raise {@link on_gui_hover | on_gui_hover} and {@link on_gui_leave | on_gui_leave}.
9562
+ */
9563
+ raise_hover_events: boolean
9564
+
9513
9565
  /**
9514
9566
  * Whether this text-box is read-only. Defaults to `false`.
9515
9567
  * @remarks
@@ -9641,6 +9693,14 @@ interface LuaGuiElement {
9641
9693
  */
9642
9694
  text: string
9643
9695
 
9696
+ /**
9697
+ * 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.
9698
+ * @remarks
9699
+ * Applies to subclasses: button,sprite-button
9700
+ *
9701
+ */
9702
+ toggled: boolean
9703
+
9644
9704
  tooltip: LocalisedString
9645
9705
 
9646
9706
  /**
@@ -11255,7 +11315,7 @@ interface LuaItemStack {
11255
11315
  * Applies to subclasses: BlueprintItem
11256
11316
  *
11257
11317
  */
11258
- readonly default_icons: BlueprintItemIcon[]
11318
+ readonly default_icons: BlueprintSignalIcon[]
11259
11319
 
11260
11320
  /**
11261
11321
  * Durability of the contained item. Automatically capped at the item's maximum durability.
@@ -12102,6 +12162,11 @@ interface LuaModSettingPrototype {
12102
12162
 
12103
12163
  readonly setting_type: string
12104
12164
 
12165
+ /**
12166
+ * Type of this prototype.
12167
+ */
12168
+ readonly type: string
12169
+
12105
12170
  /**
12106
12171
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
12107
12172
  */
@@ -13029,7 +13094,7 @@ interface LuaPlayer extends LuaControl {
13029
13094
  hand_location?: ItemStackLocation
13030
13095
 
13031
13096
  /**
13032
- * This player's unique ID, and index in {@link LuaGameScript::players | LuaGameScript::players}. It is assigned when a player is created, and remains so (even when the player is not {@link connected | LuaPlayer::connected}) until the player is irreversably {@link removed | on_player_removed}. Indexes of removed players can be reused.
13097
+ * This player's index in {@link LuaGameScript::players | LuaGameScript::players} (unique ID). It is assigned when a player is created, and remains so (even when the player is not {@link connected | LuaPlayer::connected}) until the player is irreversably {@link removed | on_player_removed}. Indexes of removed players can be reused.
13033
13098
  */
13034
13099
  readonly index: number
13035
13100
 
@@ -13038,6 +13103,11 @@ interface LuaPlayer extends LuaControl {
13038
13103
  */
13039
13104
  infinity_inventory_filters: InfinityInventoryFilter[]
13040
13105
 
13106
+ /**
13107
+ * The input method of the player, mouse and keyboard or game controller
13108
+ */
13109
+ readonly input_method: defines.input_method
13110
+
13041
13111
  /**
13042
13112
  * At what tick this player was last online.
13043
13113
  */
@@ -13054,9 +13124,14 @@ interface LuaPlayer extends LuaControl {
13054
13124
  minimap_enabled: boolean
13055
13125
 
13056
13126
  /**
13057
- * The current per-player settings for the this player, indexed by prototype name. Returns the same structure as {@link LuaSettings::get_player_settings | LuaSettings::get_player_settings}.
13058
- * @remarks
13059
- * This table will become invalid if its associated player does.
13127
+ * The current per-player settings for the this player, indexed by prototype name. Returns the same structure as {@link LuaSettings::get_player_settings | LuaSettings::get_player_settings}. This table becomes invalid if its associated player does.
13128
+ *
13129
+ * Even though this attribute is marked as read-only, individual settings can be changed by overwriting their {@link ModSetting | ModSetting} table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
13130
+ * @example
13131
+ * ```
13132
+ * -- Change the value of the "active_lifestyle" setting
13133
+ * player.mod_settings["active_lifestyle"] = {value = true}
13134
+ * ```
13060
13135
  *
13061
13136
  */
13062
13137
  readonly mod_settings: {[key: string]: ModSetting}
@@ -13460,17 +13535,11 @@ interface LuaRecipe {
13460
13535
  hidden_from_flow_stats: boolean
13461
13536
 
13462
13537
  /**
13463
- * Ingredients for this recipe.
13538
+ * The ingredients to this recipe.
13464
13539
  * @example
13465
- * What the "steel-chest" recipe would return
13540
+ * The ingredients of `"advanced-oil-processing"` would look like this:
13466
13541
  * ```
13467
- * {{type="item", name="steel-plate", amount=8}}
13468
- * ```
13469
- *
13470
- * @example
13471
- * What the "advanced-oil-processing" recipe would return
13472
- * ```
13473
- * {{type="fluid", name="crude-oil", amount=10}, {type="fluid", name="water", amount=5}}
13542
+ * {{type="fluid", name="crude-oil", amount=100}, {type="fluid", name="water", amount=50}}
13474
13543
  * ```
13475
13544
  *
13476
13545
  */
@@ -13499,7 +13568,13 @@ interface LuaRecipe {
13499
13568
  readonly order: string
13500
13569
 
13501
13570
  /**
13502
- * The results of this recipe.
13571
+ * The results/products of this recipe.
13572
+ * @example
13573
+ * The products of `"advanced-oil-processing"` would look like this:
13574
+ * ```
13575
+ * {{type="fluid", name="heavy-oil", amount=25}, {type="fluid", name="light-oil", amount=45}, {type="fluid", name="petroleum-gas", amount=55}}
13576
+ * ```
13577
+ *
13503
13578
  */
13504
13579
  readonly products: Product[]
13505
13580
 
@@ -13635,7 +13710,13 @@ interface LuaRecipePrototype {
13635
13710
  readonly hidden_from_player_crafting: boolean
13636
13711
 
13637
13712
  /**
13638
- * Ingredients for this recipe.
13713
+ * The ingredients to this recipe.
13714
+ * @example
13715
+ * The ingredients of `"advanced-oil-processing"` would look like this:
13716
+ * ```
13717
+ * {{type="fluid", name="crude-oil", amount=100}, {type="fluid", name="water", amount=50}}
13718
+ * ```
13719
+ *
13639
13720
  */
13640
13721
  readonly ingredients: Ingredient[]
13641
13722
 
@@ -13672,7 +13753,13 @@ interface LuaRecipePrototype {
13672
13753
  readonly overload_multiplier: number
13673
13754
 
13674
13755
  /**
13675
- * The results of this recipe.
13756
+ * The results/products of this recipe.
13757
+ * @example
13758
+ * The products of `"advanced-oil-processing"` would look like this:
13759
+ * ```
13760
+ * {{type="fluid", name="heavy-oil", amount=25}, {type="fluid", name="light-oil", amount=45}, {type="fluid", name="petroleum-gas", amount=55}}
13761
+ * ```
13762
+ *
13676
13763
  */
13677
13764
  readonly products: Product[]
13678
13765
 
@@ -13778,8 +13865,8 @@ interface LuaRendering {
13778
13865
  id: number): void
13779
13866
 
13780
13867
  /**
13781
- * Destroys all render objects.
13782
- * @param mod_name - If provided, only the render objects created by this mod are destroyed.
13868
+ * Destroys all render objects. Passing an empty string (`""`)
13869
+ * @param mod_name - If provided, only the render objects created by this mod are destroyed. An empty string (`""`) refers to all objects not belonging to a mod, such as those created using console commands.
13783
13870
  */
13784
13871
  clear(this: void,
13785
13872
  mod_name?: string): void
@@ -13805,6 +13892,7 @@ interface LuaRendering {
13805
13892
  * @param table.target - Center of the animation.
13806
13893
  * @param table.target_offset - Only used if `target` is a LuaEntity.
13807
13894
  * @param table.time_to_live - In ticks. Defaults to living forever.
13895
+ * @param table.use_target_orientation - Only used if `orientation_target` is a LuaEntity.
13808
13896
  * @param table.visible - If this is rendered to anyone at all. Defaults to true.
13809
13897
  * @param table.x_scale - Horizontal scale of the animation. Default is 1.
13810
13898
  * @param table.y_scale - Vertical scale of the animation. Default is 1.
@@ -13821,6 +13909,7 @@ interface LuaRendering {
13821
13909
  animation_offset?: number,
13822
13910
  orientation_target?: MapPosition | LuaEntity,
13823
13911
  orientation_target_offset?: Vector,
13912
+ use_target_orientation?: boolean,
13824
13913
  oriented_offset?: Vector,
13825
13914
  target: MapPosition | LuaEntity,
13826
13915
  target_offset?: Vector,
@@ -13989,6 +14078,7 @@ interface LuaRendering {
13989
14078
  * @param table.target - Acts like an offset applied to all vertices that are not set to an entity.
13990
14079
  * @param table.target_offset - Only used if `target` is a LuaEntity.
13991
14080
  * @param table.time_to_live - In ticks. Defaults to living forever.
14081
+ * @param table.use_target_orientation - Only used if `orientation_target` is a LuaEntity.
13992
14082
  * @param table.visible - If this is rendered to anyone at all. Defaults to true.
13993
14083
  */
13994
14084
  draw_polygon(this: void,
@@ -14000,6 +14090,7 @@ interface LuaRendering {
14000
14090
  orientation?: RealOrientation,
14001
14091
  orientation_target?: MapPosition | LuaEntity,
14002
14092
  orientation_target_offset?: Vector,
14093
+ use_target_orientation?: boolean,
14003
14094
  surface: SurfaceIdentification,
14004
14095
  time_to_live?: number,
14005
14096
  forces?: ForceIdentification[],
@@ -14052,6 +14143,7 @@ interface LuaRendering {
14052
14143
  * @param table.target - Center of the sprite.
14053
14144
  * @param table.target_offset - Only used if `target` is a LuaEntity.
14054
14145
  * @param table.time_to_live - In ticks. Defaults to living forever.
14146
+ * @param table.use_target_orientation - Only used if `orientation_target` is a LuaEntity.
14055
14147
  * @param table.visible - If this is rendered to anyone at all. Defaults to true.
14056
14148
  * @param table.x_scale - Horizontal scale of the sprite. Default is 1.
14057
14149
  * @param table.y_scale - Vertical scale of the sprite. Default is 1.
@@ -14078,6 +14170,7 @@ interface LuaRendering {
14078
14170
  render_layer?: RenderLayer,
14079
14171
  orientation_target?: MapPosition | LuaEntity,
14080
14172
  orientation_target_offset?: Vector,
14173
+ use_target_orientation?: boolean,
14081
14174
  oriented_offset?: Vector,
14082
14175
  target: MapPosition | LuaEntity,
14083
14176
  target_offset?: Vector,
@@ -14142,7 +14235,7 @@ interface LuaRendering {
14142
14235
 
14143
14236
  /**
14144
14237
  * Gets an array of all valid object ids.
14145
- * @param mod_name - If provided, get only the render objects created by this mod.
14238
+ * @param mod_name - If provided, get only the render objects created by this mod. An empty string (`""`) refers to all objects not belonging to a mod, such as those created using console commands.
14146
14239
  */
14147
14240
  get_all_ids(this: void,
14148
14241
  mod_name?: string): void
@@ -14465,6 +14558,12 @@ interface LuaRendering {
14465
14558
  get_use_rich_text(this: void,
14466
14559
  id: number): void
14467
14560
 
14561
+ /**
14562
+ * Get whether this uses the target orientation.
14563
+ */
14564
+ get_use_target_orientation(this: void,
14565
+ id: number): void
14566
+
14468
14567
  /**
14469
14568
  * Get the vertical alignment of the text with this id.
14470
14569
  * @remarks
@@ -14916,6 +15015,13 @@ interface LuaRendering {
14916
15015
  id: number,
14917
15016
  use_rich_text: boolean): void
14918
15017
 
15018
+ /**
15019
+ * Set whether this uses the target orientation.
15020
+ */
15021
+ set_use_target_orientation(this: void,
15022
+ id: number,
15023
+ use_target_orientation: boolean): void
15024
+
14919
15025
  /**
14920
15026
  * Set the vertical alignment of the text with this id. Does nothing if this object is not a text.
14921
15027
  * @remarks
@@ -15060,9 +15166,14 @@ interface LuaRoboportControlBehavior extends LuaControlBehavior {
15060
15166
  */
15061
15167
  interface LuaSettings {
15062
15168
  /**
15063
- * Gets the current per-player settings for the given player, indexed by prototype name. Returns the same structure as {@link LuaPlayer::mod_settings | LuaPlayer::mod_settings}.
15064
- * @remarks
15065
- * This table will become invalid if its associated player does.
15169
+ * Gets the current per-player settings for the given player, indexed by prototype name. Returns the same structure as {@link LuaPlayer::mod_settings | LuaPlayer::mod_settings}. This table becomes invalid if its associated player does.
15170
+ *
15171
+ * Even though this attribute is marked as read-only, individual settings can be changed by overwriting their {@link ModSetting | ModSetting} table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
15172
+ * @example
15173
+ * ```
15174
+ * -- Change the value of the "active_lifestyle" setting
15175
+ * settings.get_player_settings(player_index)["active_lifestyle"] = {value = true}
15176
+ * ```
15066
15177
  *
15067
15178
  */
15068
15179
  get_player_settings(this: void,
@@ -15071,7 +15182,7 @@ interface LuaSettings {
15071
15182
  /**
15072
15183
  * The current global mod settings, indexed by prototype name.
15073
15184
  *
15074
- * Even though these are marked as read-only, they can be changed by overwriting individual {@link ModSetting | ModSetting} tables in the custom table. Mods can only change their own settings. Using the in-game console, all global settings can be changed.
15185
+ * Even though this attribute is marked as read-only, individual settings can be changed by overwriting their {@link ModSetting | ModSetting} table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
15075
15186
  */
15076
15187
  readonly global: {[key: string]: ModSetting}
15077
15188
 
@@ -15083,7 +15194,7 @@ interface LuaSettings {
15083
15194
  /**
15084
15195
  * The default player mod settings for this map, indexed by prototype name.
15085
15196
  *
15086
- * Even though these are marked as read-only, they can be changed by overwriting individual {@link ModSetting | ModSetting} tables in the custom table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
15197
+ * Even though this attribute is marked as read-only, individual settings can be changed by overwriting their {@link ModSetting | ModSetting} table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
15087
15198
  */
15088
15199
  readonly player: {[key: string]: ModSetting}
15089
15200
 
@@ -16004,6 +16115,14 @@ interface LuaSurface {
16004
16115
  use_map_generation_bounding_box: boolean,
16005
16116
  direction?: defines.direction): void
16006
16117
 
16118
+ /**
16119
+ * Find the logistic network with a cell closest to a given position.
16120
+ * @param force - Force the logistic network should belong to.
16121
+ */
16122
+ find_closest_logistic_network_by_position(this: void,
16123
+ position: MapPosition,
16124
+ force: ForceIdentification): void
16125
+
16007
16126
  /**
16008
16127
  * Find decoratives of a given name in a given area.
16009
16128
  *
@@ -16107,7 +16226,7 @@ interface LuaSurface {
16107
16226
  }): void
16108
16227
 
16109
16228
  /**
16110
- * Find a specific entity at a specific position.
16229
+ * Find an entity of the given type at the given position. This checks both the exact position and the bounding box of the entity.
16111
16230
  * @param entity - Entity to look for.
16112
16231
  * @param position - Coordinates to look at.
16113
16232
  * @example
@@ -16271,12 +16390,16 @@ interface LuaSurface {
16271
16390
  * @remarks
16272
16391
  * This won't find tiles in non-generated chunks.
16273
16392
  *
16393
+ * @param area - The area to find connected tiles in. If provided the start position must be in this area.
16394
+ * @param include_diagonal - Include tiles that are connected diagonally.
16274
16395
  * @param position - The tile position to start at.
16275
16396
  * @param tiles - The tiles to search for.
16276
16397
  */
16277
16398
  get_connected_tiles(this: void,
16278
16399
  position: TilePosition,
16279
- tiles: string[]): void
16400
+ tiles: string[],
16401
+ include_diagonal?: boolean,
16402
+ area?: BoundingBox): void
16280
16403
 
16281
16404
  /**
16282
16405
  * Returns all the military targets (entities with force) on this chunk for the given force.
@@ -16478,7 +16601,7 @@ interface LuaSurface {
16478
16601
  * @param table.entity_to_ignore - Makes the pathfinder ignore collisions with this entity if it is given.
16479
16602
  * @param table.force - The force for which to generate the path, determining which gates can be opened for example.
16480
16603
  * @param table.goal - The position to find a path to.
16481
- * @param table.path_resolution_modifier - Defines how coarse the pathfinder's grid is. Smaller values mean a coarser grid (negative numbers allowed). Allowed values are from -8 to 8. Defaults to `0`.
16604
+ * @param table.path_resolution_modifier - Defines how coarse the pathfinder's grid is, where smaller values mean a coarser grid. Defaults to `0`, which equals a resolution of `1x1` tiles, centered on tile centers. Values range from `-8` to `8` inclusive, where each integer increment doubles/halves the resolution. So, a resolution of `-8` equals a grid of `256x256` tiles, and a resolution of `8` equals `1/256` of a tile.
16482
16605
  * @param table.pathfind_flags - Flags that affect pathfinder behavior.
16483
16606
  * @param table.radius - How close the pathfinder needs to get to its `goal` (in tiles). Defaults to `1`.
16484
16607
  * @param table.start - The position from which to start pathfinding.
@@ -16645,12 +16768,12 @@ interface LuaSurface {
16645
16768
  generate_with_lab_tiles: boolean
16646
16769
 
16647
16770
  /**
16648
- * This surface's unique ID, and index in {@link LuaGameScript::surfaces | LuaGameScript::surfaces}. It is assigned when a surface is created, and remains so until it is {@link deleted | on_surface_deleted}. Indexes of deleted surfaces can be reused.
16771
+ * This surface's index in {@link LuaGameScript::surfaces | LuaGameScript::surfaces} (unique ID). It is assigned when a surface is created, and remains so until it is {@link deleted | on_surface_deleted}. Indexes of deleted surfaces can be reused.
16649
16772
  */
16650
16773
  readonly index: number
16651
16774
 
16652
16775
  /**
16653
- * The generation settings for this surface. These can be modified to after surface generation, but note that this will not retroactively update the surface. To manually adjust it, {@link LuaSurface::regenerate_entity | LuaSurface::regenerate_entity}, {@link LuaSurface::regenerate_decorative | LuaSurface::regenerate_decorative} and {@link LuaSurface::delete_chunk | LuaSurface::delete_chunk} can be used.
16776
+ * The generation settings for this surface. These can be modified after surface generation, but note that this will not retroactively update the surface. To manually regenerate it, {@link LuaSurface::regenerate_entity | LuaSurface::regenerate_entity}, {@link LuaSurface::regenerate_decorative | LuaSurface::regenerate_decorative}, and {@link LuaSurface::delete_chunk | LuaSurface::delete_chunk} can be used.
16654
16777
  */
16655
16778
  map_gen_settings: MapGenSettings
16656
16779
 
@@ -16719,7 +16842,7 @@ interface LuaSurface {
16719
16842
  wind_orientation_change: number
16720
16843
 
16721
16844
  /**
16722
- * Current wind speed.
16845
+ * Current wind speed in tiles per tick.
16723
16846
  */
16724
16847
  wind_speed: number
16725
16848
 
@@ -16800,7 +16923,7 @@ interface LuaTechnology {
16800
16923
  readonly research_unit_count: number
16801
16924
 
16802
16925
  /**
16803
- * The count formula used for this infinite research. `nil` if this research isn't infinite.
16926
+ * The count formula, if this research has any. See the {@link wiki | https://wiki.factorio.com/Prototype/Technology#Technology_data} for details.
16804
16927
  */
16805
16928
  readonly research_unit_count_formula?: string
16806
16929
 
@@ -16914,7 +17037,7 @@ interface LuaTechnologyPrototype {
16914
17037
  readonly research_unit_count: number
16915
17038
 
16916
17039
  /**
16917
- * The count formula used for this infinite research. `nil` if this research isn't infinite.
17040
+ * The count formula, if this research has any. See the {@link wiki | https://wiki.factorio.com/Prototype/Technology#Technology_data} for details.
16918
17041
  */
16919
17042
  readonly research_unit_count_formula?: string
16920
17043
 
@@ -17085,9 +17208,9 @@ interface LuaTilePrototype {
17085
17208
  readonly emissions_per_second: number
17086
17209
 
17087
17210
  /**
17088
- * Items that when placed will produce this tile. It is a dictionary indexed by the item prototype name. `nil` (instead of an empty table) if no items can place this tile.
17211
+ * Items that when placed will produce this tile, if any. Construction bots will choose the first item in the list to build this tile.
17089
17212
  */
17090
- readonly items_to_place_this: SimpleItemStack[]
17213
+ readonly items_to_place_this?: ItemStackDefinition[]
17091
17214
 
17092
17215
  readonly layer: number
17093
17216
 
@@ -17978,6 +18101,11 @@ interface LuaGuiElementAddParams {
17978
18101
  */
17979
18102
  'enabled'?: boolean
17980
18103
 
18104
+ /**
18105
+ * How the element should interact with game controllers. Defaults to {@link defines.game_controller_interaction.normal | defines.game_controller_interaction.normal}.
18106
+ */
18107
+ 'game_controller_interaction'?: defines.game_controller_interaction
18108
+
17981
18109
  /**
17982
18110
  * Whether the child element is ignored by interaction. Defaults to `false`.
17983
18111
  */
@@ -17993,6 +18121,11 @@ interface LuaGuiElementAddParams {
17993
18121
  */
17994
18122
  'name'?: string
17995
18123
 
18124
+ /**
18125
+ * Whether this element will raise {@link on_gui_hover | on_gui_hover} and {@link on_gui_leave | on_gui_leave}. Defaults to `false`.
18126
+ */
18127
+ 'raise_hover_events'?: boolean
18128
+
17996
18129
  /**
17997
18130
  * The name of the style prototype to apply to the new element.
17998
18131
  */
@@ -18026,11 +18159,21 @@ interface LuaGuiElementAddParams {
18026
18159
  *
18027
18160
  */
18028
18161
  interface LuaGuiElementAddParamsButton extends LuaGuiElementAddParams {
18162
+ /**
18163
+ * Whether the button will automatically toggle when clicked. Defaults to `false`.
18164
+ */
18165
+ 'auto_toggle'?: boolean
18166
+
18029
18167
  /**
18030
18168
  * Which mouse buttons the button responds to. Defaults to `"left-and-right"`.
18031
18169
  */
18032
18170
  'mouse_button_filter'?: MouseButtonFlags
18033
18171
 
18172
+ /**
18173
+ * The initial toggled state of the button. Defaults to `false`.
18174
+ */
18175
+ 'toggled'?: boolean
18176
+
18034
18177
  }
18035
18178
 
18036
18179
  /**
@@ -18356,6 +18499,11 @@ interface LuaGuiElementAddParamsSprite extends LuaGuiElementAddParams {
18356
18499
  *
18357
18500
  */
18358
18501
  interface LuaGuiElementAddParamsSpriteButton extends LuaGuiElementAddParams {
18502
+ /**
18503
+ * Whether the button will automatically toggle when clicked. Defaults to `false`.
18504
+ */
18505
+ 'auto_toggle'?: boolean
18506
+
18359
18507
  /**
18360
18508
  * Path to the image to display on the button when it is clicked.
18361
18509
  */
@@ -18386,6 +18534,11 @@ interface LuaGuiElementAddParamsSpriteButton extends LuaGuiElementAddParams {
18386
18534
  */
18387
18535
  'sprite'?: SpritePath
18388
18536
 
18537
+ /**
18538
+ * The initial toggled state of the button. Defaults to `false`.
18539
+ */
18540
+ 'toggled'?: boolean
18541
+
18389
18542
  }
18390
18543
 
18391
18544
  /**
@@ -18583,7 +18736,7 @@ interface LuaSurfaceCreateEntityParams {
18583
18736
  'raise_built'?: boolean
18584
18737
 
18585
18738
  /**
18586
- * Source entity. Used for beams and highlight-boxes.
18739
+ * Source entity. Used for beams, projectiles, and highlight-boxes.
18587
18740
  */
18588
18741
  'source'?: LuaEntity | MapPosition
18589
18742
 
@@ -2,7 +2,7 @@
2
2
  // Factorio API reference https://lua-api.factorio.com/latest/index.html
3
3
  // Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 1.1.78
5
+ // Factorio version 1.1.84
6
6
  // API version 3
7
7
 
8
8
  /**
@@ -309,19 +309,6 @@ interface BlueprintEntity {
309
309
  tags?: Tags
310
310
  }
311
311
 
312
- interface BlueprintItemIcon {
313
-
314
- /**
315
- * Index of the icon in the blueprint icons slots. Has to be an integer in the range [1, 4].
316
- */
317
- index: number,
318
-
319
- /**
320
- * Name of the item prototype whose icon should be used.
321
- */
322
- name: string
323
- }
324
-
325
312
  interface BlueprintSignalIcon {
326
313
 
327
314
  /**
@@ -336,7 +323,7 @@ interface BlueprintSignalIcon {
336
323
  }
337
324
 
338
325
  /**
339
- * Two positions, specifying the top-left and bottom-right corner of the box respectively. Like with {@link MapPosition | MapPosition}, the names of the members may be omitted. When read from the game, the third member `orientation` is present if it is non-zero, however it is ignored when provided to the game.
326
+ * Two positions, specifying the top-left and bottom-right corner of the box respectively. Like with {@link MapPosition | MapPosition}, the names of the members may be omitted. When read from the game, the third member `orientation` is present if it is non-zero.
340
327
  * @example
341
328
  * Explicit definition:
342
329
  * ```
@@ -851,7 +838,7 @@ interface EnemyExpansionMapSettings {
851
838
  max_colliding_tiles_coefficient: number,
852
839
 
853
840
  /**
854
- * 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.
841
+ * 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.
855
842
  */
856
843
  max_expansion_cooldown: number,
857
844
 
@@ -861,7 +848,7 @@ interface EnemyExpansionMapSettings {
861
848
  max_expansion_distance: number,
862
849
 
863
850
  /**
864
- * 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.
851
+ * 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.
865
852
  */
866
853
  min_expansion_cooldown: number,
867
854
 
@@ -1343,7 +1330,7 @@ interface ItemStackLocation {
1343
1330
  *
1344
1331
  * The template can contain placeholders such as `__1__` or `__2__`. These will be replaced by the respective parameter in the LocalisedString. The parameters themselves can be other localised strings, which will be processed recursively in the same fashion. Localised strings can not be recursed deeper than 20 levels and can not have more than 20 parameters.
1345
1332
  *
1346
- * As a special case, when the key is just the empty string, all the parameters will be concatenated (after processing, if any are localised strings). If there is only one parameter, it will be used as is.
1333
+ * There are two special flags for the localised string, indicated by the key being a particular string. First, if the key is the empty string (`""`), then all parameters will be concatenated (after processing, if any are localised strings themselves). Second, if the key is a question mark (`"?"`), then the first valid parameter will be used. A parameter can be invalid if its name doesn't match any string template. If no parameters are valid, the last one is returned. This is useful to implement a fallback for missing locale templates.
1347
1334
  *
1348
1335
  * Furthermore, when an API function expects a localised string, it will also accept a regular string (i.e. not a table) which will not be translated, as well as a number, boolean or `nil`, which will be converted to their textual representation.
1349
1336
  * @example
@@ -1371,6 +1358,13 @@ interface ItemStackLocation {
1371
1358
  * game.print({"", {"item-name.iron-plate"}, ": ", 60})
1372
1359
  * ```
1373
1360
  *
1361
+ * @example
1362
+ * As an example of a localised string with fallback, consider this:
1363
+ * ```
1364
+ * {"?", {"", {"entity-description.furnace"}, "\n"}, {"item-description.furnace"}, "optional fallback"}
1365
+ * ```
1366
+ * If `entity-description.furnace` exists, it is concatenated with `"\n"` and returned. Otherwise, if `item-description.furnace` exists, it is returned as-is. Otherwise, `"optional fallback"` is returned. If this value wasn't specified, the translation result would be `"Unknown key: 'item-description.furnace'"`.
1367
+ *
1374
1368
  */
1375
1369
  type LocalisedString = string | number | boolean | object | null | Array<string | LocalisedString>
1376
1370
 
@@ -1828,11 +1822,6 @@ interface ModChangeData {
1828
1822
  old_version: string
1829
1823
  }
1830
1824
 
1831
- /**
1832
- * @remarks
1833
- * Runtime settings can be changed through console commands and by the mod that owns the settings by writing a new table to the ModSetting.
1834
- *
1835
- */
1836
1825
  interface ModSetting {
1837
1826
 
1838
1827
  /**
@@ -2015,12 +2004,12 @@ interface PathFinderMapSettings {
2015
2004
  max_clients_to_accept_short_new_request: number,
2016
2005
 
2017
2006
  /**
2018
- * The maximum number of nodes that are expanded per tick. Defaults to `1,000`.
2007
+ * The maximum number of nodes that are expanded per tick. Defaults to `1'000`.
2019
2008
  */
2020
2009
  max_steps_worked_per_tick: number,
2021
2010
 
2022
2011
  /**
2023
- * The maximum amount of work each pathfinding job is allowed to do per tick. Defaults to `8,000`.
2012
+ * The maximum amount of work each pathfinding job is allowed to do per tick. Defaults to `8'000`.
2024
2013
  */
2025
2014
  max_work_done_per_tick: number,
2026
2015
 
@@ -2734,7 +2723,7 @@ interface UnitGroupMapSettings {
2734
2723
  max_gathering_unit_groups: number,
2735
2724
 
2736
2725
  /**
2737
- * 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.
2726
+ * 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.
2738
2727
  */
2739
2728
  max_group_gathering_time: number,
2740
2729
 
@@ -2769,7 +2758,7 @@ interface UnitGroupMapSettings {
2769
2758
  max_unit_group_size: number,
2770
2759
 
2771
2760
  /**
2772
- * 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.
2761
+ * 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.
2773
2762
  */
2774
2763
  max_wait_time_for_late_members: number,
2775
2764
 
@@ -2779,7 +2768,7 @@ interface UnitGroupMapSettings {
2779
2768
  member_disown_distance: number,
2780
2769
 
2781
2770
  /**
2782
- * 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.
2771
+ * 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.
2783
2772
  */
2784
2773
  min_group_gathering_time: number,
2785
2774
 
@@ -2885,7 +2874,7 @@ interface WireConnectionDefinition {
2885
2874
  target_wire_id?: defines.wire_connection_id,
2886
2875
 
2887
2876
  /**
2888
- * Wire color, either {@link defines.wire_type.red | defines.wire_type.red} or {@link defines.wire_type.green | defines.wire_type.green}.
2877
+ * The type of wire used.
2889
2878
  */
2890
2879
  wire: defines.wire_type
2891
2880
  }
package/dist/defines.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  // Factorio API reference https://lua-api.factorio.com/latest/index.html
3
3
  // Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 1.1.78
5
+ // Factorio version 1.1.84
6
6
  // API version 3
7
7
 
8
8
  declare namespace defines {
@@ -515,9 +515,12 @@ declare namespace defines {
515
515
  on_console_chat,
516
516
  on_console_command,
517
517
  on_cutscene_cancelled,
518
+ on_cutscene_finished,
519
+ on_cutscene_started,
518
520
  on_cutscene_waypoint_reached,
519
521
  on_difficulty_settings_changed,
520
522
  on_entity_cloned,
523
+ on_entity_color_changed,
521
524
  on_entity_damaged,
522
525
  on_entity_destroyed,
523
526
  on_entity_died,
@@ -539,6 +542,8 @@ declare namespace defines {
539
542
  on_gui_closed,
540
543
  on_gui_confirmed,
541
544
  on_gui_elem_changed,
545
+ on_gui_hover,
546
+ on_gui_leave,
542
547
  on_gui_location_changed,
543
548
  on_gui_opened,
544
549
  on_gui_selected_tab_changed,
@@ -585,6 +590,7 @@ declare namespace defines {
585
590
  on_player_fast_transferred,
586
591
  on_player_flushed_fluid,
587
592
  on_player_gun_inventory_changed,
593
+ on_player_input_method_changed,
588
594
  on_player_joined_game,
589
595
  on_player_kicked,
590
596
  on_player_left_game,
@@ -685,6 +691,20 @@ declare namespace defines {
685
691
  ten_minutes,
686
692
  two_hundred_fifty_hours,
687
693
  }
694
+ enum game_controller_interaction {
695
+ /**
696
+ * Game controller will always hover this element regardless of type or state.
697
+ */
698
+ always,
699
+ /**
700
+ * Hover according to the element type and implementation.
701
+ */
702
+ never,
703
+ /**
704
+ * Never hover this element with a game controller.
705
+ */
706
+ normal,
707
+ }
688
708
  enum group_state {
689
709
  attacking_distraction,
690
710
  attacking_target,
@@ -794,6 +814,8 @@ declare namespace defines {
794
814
  gui_click,
795
815
  gui_confirmed,
796
816
  gui_elem_changed,
817
+ gui_hover,
818
+ gui_leave,
797
819
  gui_location_changed,
798
820
  gui_selected_tab_changed,
799
821
  gui_selection_state_changed,
package/dist/events.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  // Factorio API reference https://lua-api.factorio.com/latest/index.html
3
3
  // Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 1.1.78
5
+ // Factorio version 1.1.84
6
6
  // API version 3
7
7
 
8
8
  /**
@@ -25,6 +25,10 @@ interface event {
25
25
  * Called when a {@link CustomInput | https://wiki.factorio.com/Prototype/CustomInput} is activated.
26
26
  */
27
27
  interface CustomInputEvent extends event {
28
+ /**
29
+ * The mouse cursor display location when the custom input was activated.
30
+ */
31
+ cursor_display_location: GuiLocation
28
32
  /**
29
33
  * The mouse cursor position when the custom input was activated.
30
34
  */
@@ -274,6 +278,24 @@ interface on_cutscene_cancelled extends event {
274
278
  */
275
279
  player_index: number
276
280
  }
281
+ /**
282
+ * Called when a cutscene finishes naturally (was not cancelled).
283
+ */
284
+ interface on_cutscene_finished extends event {
285
+ /**
286
+ * The player the cutscene was shown to.
287
+ */
288
+ player_index: number
289
+ }
290
+ /**
291
+ * Called when a cutscene starts.
292
+ */
293
+ interface on_cutscene_started extends event {
294
+ /**
295
+ * The player the cutscene is being shown to.
296
+ */
297
+ player_index: number
298
+ }
277
299
  /**
278
300
  * Called when a cutscene is playing, each time it reaches a waypoint in that cutscene.
279
301
  *
@@ -309,6 +331,15 @@ interface on_entity_cloned extends event {
309
331
  destination: LuaEntity
310
332
  source: LuaEntity
311
333
  }
334
+ /**
335
+ * Called after an entity has been recolored either by the player or through script.
336
+ */
337
+ interface on_entity_color_changed extends event {
338
+ /**
339
+ * The entity that was recolored.
340
+ */
341
+ entity: LuaEntity
342
+ }
312
343
  /**
313
344
  * Called when an entity is damaged. Can be filtered using {@link LuaEntityDamagedEventFilter | LuaEntityDamagedEventFilter}.
314
345
  * @remarks
@@ -585,6 +616,10 @@ interface on_gui_click extends event {
585
616
  * If control was pressed.
586
617
  */
587
618
  control: boolean
619
+ /**
620
+ * The display location of the player's cursor.
621
+ */
622
+ cursor_display_location: GuiLocation
588
623
  /**
589
624
  * The clicked element.
590
625
  */
@@ -686,6 +721,32 @@ interface on_gui_elem_changed extends event {
686
721
  */
687
722
  player_index: number
688
723
  }
724
+ /**
725
+ * Called when {@link LuaGuiElement | LuaGuiElement} is hovered by the mouse.
726
+ */
727
+ interface on_gui_hover extends event {
728
+ /**
729
+ * The element that is being hovered over.
730
+ */
731
+ element: LuaGuiElement
732
+ /**
733
+ * The player whose cursor is hovering.
734
+ */
735
+ player_index: number
736
+ }
737
+ /**
738
+ * Called when the player's cursor leaves a {@link LuaGuiElement | LuaGuiElement} that was previously hovered.
739
+ */
740
+ interface on_gui_leave extends event {
741
+ /**
742
+ * The element that was being hovered.
743
+ */
744
+ element: LuaGuiElement
745
+ /**
746
+ * The player whose cursor was hovering.
747
+ */
748
+ player_index: number
749
+ }
689
750
  /**
690
751
  * Called when {@link LuaGuiElement | LuaGuiElement} element location is changed (related to frames in `player.gui.screen`).
691
752
  */
@@ -1210,7 +1271,7 @@ interface on_player_created extends event {
1210
1271
  player_index: number
1211
1272
  }
1212
1273
  /**
1213
- * Called after a players cursorstack changed in some way.
1274
+ * Called after a player's {@link cursor stack | LuaControl::cursor_stack} changed in some way.
1214
1275
  */
1215
1276
  interface on_player_cursor_stack_changed extends event {
1216
1277
  player_index: number
@@ -1357,6 +1418,18 @@ interface on_player_flushed_fluid extends event {
1357
1418
  interface on_player_gun_inventory_changed extends event {
1358
1419
  player_index: number
1359
1420
  }
1421
+ /**
1422
+ * Called when a player's input method changes.
1423
+ * @remarks
1424
+ * See {@link LuaPlayer::input_method | LuaPlayer::input_method}.
1425
+ *
1426
+ */
1427
+ interface on_player_input_method_changed extends event {
1428
+ /**
1429
+ * The player whose input method changed.
1430
+ */
1431
+ player_index: number
1432
+ }
1360
1433
  /**
1361
1434
  * 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.
1362
1435
  */
package/dist/global.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  // Factorio API reference https://lua-api.factorio.com/latest/index.html
3
3
  // Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 1.1.78
5
+ // Factorio version 1.1.84
6
6
  // API version 3
7
7
 
8
8
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "factorio-types",
3
- "version": "0.0.34",
3
+ "version": "0.0.36",
4
4
  "description": "Typescript declarations for the factorio mod API",
5
5
  "main": "index.d.ts",
6
6
  "repository": "https://github.com/sguest/factorio-types.git",