factorio-types 1.2.20 → 1.2.22

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 2.0.29
5
+ // Factorio version 2.0.31
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -4189,7 +4189,7 @@ interface LuaBootstrap {
4189
4189
  * Depending on when a given object is destroyed, {@link on_object_destroyed | runtime:on_object_destroyed} will either be fired at the end of the current tick or at the end of the next tick.
4190
4190
  * @param object The object to register.
4191
4191
  * @returns [0] - The registration number. It is used to identify the object in the {@link on_object_destroyed | runtime:on_object_destroyed} event.
4192
- * @returns [1] - Useful identifier of the object if it has one. This identifier is specific to the object type, for example for trains it is the value {@link LuaTrain::id | runtime:LuaTrain::id}.
4192
+ * @returns [1] - The {@link useful identifier | runtime:RegistrationTarget} of the object if it has one. This identifier is specific to the object type, for example for trains it is the value {@link LuaTrain::id | runtime:LuaTrain::id}.
4193
4193
  * @returns [2] - Type of the target object.
4194
4194
  */
4195
4195
  register_on_object_destroyed(this: void, object: RegistrationTarget): LuaMultiReturn<[
@@ -6752,6 +6752,10 @@ interface LuaEntity extends LuaControl {
6752
6752
  * The filter mode for this filter inserter. `nil` if this inserter doesn't use filters.
6753
6753
  */
6754
6754
  inserter_filter_mode?: 'whitelist' | 'blacklist';
6755
+ /**
6756
+ * The spoil priority for this inserter.
6757
+ */
6758
+ inserter_spoil_priority: 'fresh_first' | 'none' | 'spoiled_first';
6755
6759
  /**
6756
6760
  * Sets the stack size limit on this inserter.
6757
6761
  *
@@ -7283,7 +7287,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7283
7287
  /**
7284
7288
  * The fluid usage of this generator prototype.
7285
7289
  */
7286
- get_fluid_usage_per_tick(this: void, quality?: QualityID): LuaQualityPrototype | null;
7290
+ get_fluid_usage_per_tick(this: void, quality?: QualityID): double | null;
7287
7291
  /**
7288
7292
  * The extension speed of this inserter.
7289
7293
  */
@@ -10527,11 +10531,11 @@ interface LuaGuiElement {
10527
10531
  *
10528
10532
  * The `"signal"` type operates with {@link SignalID | runtime:SignalID}.
10529
10533
  *
10530
- * The `"with-quality"` types operate with `"name"` and optional `"quality"`
10534
+ * The `"with-quality"` types operate with {@link PrototypeWithQuality | runtime:PrototypeWithQuality}.
10531
10535
  *
10532
10536
  * The remaining types use strings.
10533
10537
  */
10534
- elem_value?: string | SignalID | table;
10538
+ elem_value?: string | SignalID | PrototypeWithQuality;
10535
10539
  /**
10536
10540
  * Whether this GUI element is enabled. Disabled GUI elements don't trigger events when clicked.
10537
10541
  */
@@ -10907,7 +10911,7 @@ interface LuaGuiElementAddParamsChooseElemButton extends BaseLuaGuiElementAddPar
10907
10911
  /**
10908
10912
  * If type is `"entity-with-quality"` - the default value for the button.
10909
10913
  */
10910
- 'entity-with-quality'?: string;
10914
+ 'entity-with-quality'?: PrototypeWithQuality;
10911
10915
  /**
10912
10916
  * If type is `"equipment"` - the default value for the button.
10913
10917
  */
@@ -10915,7 +10919,7 @@ interface LuaGuiElementAddParamsChooseElemButton extends BaseLuaGuiElementAddPar
10915
10919
  /**
10916
10920
  * If type is `"equipment-with-quality"` - the default value for the button.
10917
10921
  */
10918
- 'equipment-with-quality'?: string;
10922
+ 'equipment-with-quality'?: PrototypeWithQuality;
10919
10923
  /**
10920
10924
  * If type is `"fluid"` - the default value for the button.
10921
10925
  */
@@ -10931,7 +10935,7 @@ interface LuaGuiElementAddParamsChooseElemButton extends BaseLuaGuiElementAddPar
10931
10935
  /**
10932
10936
  * If type is `"item-with-quality"` - the default value for the button.
10933
10937
  */
10934
- 'item-with-quality'?: string;
10938
+ 'item-with-quality'?: PrototypeWithQuality;
10935
10939
  /**
10936
10940
  * If type is `"recipe"` - the default value for the button.
10937
10941
  */
@@ -10939,7 +10943,7 @@ interface LuaGuiElementAddParamsChooseElemButton extends BaseLuaGuiElementAddPar
10939
10943
  /**
10940
10944
  * If type is `"recipe-with-quality"` - the default value for the button.
10941
10945
  */
10942
- 'recipe-with-quality'?: string;
10946
+ 'recipe-with-quality'?: PrototypeWithQuality;
10943
10947
  /**
10944
10948
  * If type is `"signal"` - the default value for the button.
10945
10949
  */
@@ -13399,7 +13403,7 @@ interface LuaPlayer extends LuaControl {
13399
13403
  */
13400
13404
  clear_recipe_notifications(this: void): void;
13401
13405
  /**
13402
- * Clears the players selection tool selection position.
13406
+ * Clears the player's selection tool selection position.
13403
13407
  */
13404
13408
  clear_selection(this: void): void;
13405
13409
  /**
@@ -13427,7 +13431,7 @@ interface LuaPlayer extends LuaControl {
13427
13431
  /**
13428
13432
  * Spawn flying text that is only visible to this player. Either `position` or `create_at_cursor` are required. When `create_at_cursor` is `true`, all parameters other than `text` are ignored.
13429
13433
  *
13430
- * If no custom `speed` is set and the text is longer than 25 characters, its `time_to_live` and `speed` are dynamically adjusted to give players more time to read it.
13434
+ * If no custom `speed` is set and the text is longer than 25 characters, its `time_to_live` and `speed` are dynamically adjusted to give the player more time to read it.
13431
13435
  *
13432
13436
  * Local flying text is not saved, which means it will disappear after a save/load-cycle.
13433
13437
  * @param table.text The flying text to show.
@@ -13606,7 +13610,7 @@ interface LuaPlayer extends LuaControl {
13606
13610
  */
13607
13611
  print_lua_object_statistics(this: void): void;
13608
13612
  /**
13609
- * Print construction robot job counts to the players console.
13613
+ * Print construction robot job counts to the player's console.
13610
13614
  */
13611
13615
  print_robot_jobs(this: void): void;
13612
13616
  /**
@@ -13649,7 +13653,7 @@ interface LuaPlayer extends LuaControl {
13649
13653
  * @param table.character Entity to control. Mandatory when `type` is {@link defines.controllers.character | runtime:defines.controllers.character}, ignored otherwise.
13650
13654
  * @param table.waypoints List of waypoints for the cutscene controller. This parameter is mandatory when `type` is {@link defines.controllers.cutscene | runtime:defines.controllers.cutscene}.
13651
13655
  * @param table.start_position If specified and `type` is {@link defines.controllers.cutscene | runtime:defines.controllers.cutscene}, the cutscene will start at this position. If not given the start position will be the player position.
13652
- * @param table.start_zoom If specified and `type` is {@link defines.controllers.cutscene | runtime:defines.controllers.cutscene}, the cutscene will start at this zoom level. If not given the start zoom will be the players zoom.
13656
+ * @param table.start_zoom If specified and `type` is {@link defines.controllers.cutscene | runtime:defines.controllers.cutscene}, the cutscene will start at this zoom level. If not given the start zoom will be the player's zoom.
13653
13657
  * @param table.final_transition_time If specified and `type` is {@link defines.controllers.cutscene | runtime:defines.controllers.cutscene}, it is the time in ticks it will take for the camera to pan from the final waypoint back to the starting position. If not given the camera will not pan back to the start position/zoom.
13654
13658
  * @param table.chart_mode_cutoff If specified and `type` is {@link defines.controllers.cutscene | runtime:defines.controllers.cutscene}, the game will switch to chart-mode (map zoomed out) rendering when the zoom level is less than this value.
13655
13659
  * @param table.position If specified and `type` is {@link defines.controllers.remote | runtime:defines.controllers.remote}, the position the remote controller will be centered on.
@@ -13701,7 +13705,7 @@ interface LuaPlayer extends LuaControl {
13701
13705
  */
13702
13706
  set_shortcut_toggled(this: void, prototype_name: string, toggled: boolean): void;
13703
13707
  /**
13704
- * Starts selection with selection tool from the specified position. Does nothing if the players cursor is not a selection tool.
13708
+ * Starts selection with selection tool from the specified position. Does nothing if the player's cursor is not a selection tool.
13705
13709
  * @param position The position to start selection from.
13706
13710
  * @param selection_mode The type of selection to start.
13707
13711
  */
@@ -13878,21 +13882,21 @@ interface LuaPlayer extends LuaControl {
13878
13882
  */
13879
13883
  readonly physical_controller_type: defines.controllers;
13880
13884
  /**
13881
- * The current position of this players physical controller.
13885
+ * The current position of this player's physical controller.
13882
13886
  */
13883
13887
  readonly physical_position: MapPosition;
13884
13888
  /**
13885
- * The surface this players physical controller is on.
13889
+ * The surface this player's physical controller is on.
13886
13890
  */
13887
13891
  readonly physical_surface: LuaSurface;
13888
13892
  /**
13889
- * Unique ID associated with the surface this players physical controller is currently on.
13893
+ * Unique ID associated with the surface this player's physical controller is currently on.
13890
13894
  */
13891
13895
  readonly physical_surface_index: uint;
13892
13896
  /**
13893
- * The current vehicle of this players physical controller.
13897
+ * The current vehicle of this player's physical controller.
13894
13898
  */
13895
- readonly physical_vehicle: MapPosition;
13899
+ readonly physical_vehicle?: LuaEntity;
13896
13900
  /**
13897
13901
  * If items not included in this map editor infinity inventory filters should be removed.
13898
13902
  */
@@ -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 2.0.29
5
+ // Factorio version 2.0.31
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -5797,6 +5797,16 @@ interface PrototypeHistory {
5797
5797
  */
5798
5798
  changed: string[];
5799
5799
  }
5800
+ interface PrototypeWithQuality {
5801
+ /**
5802
+ * Name of a prototype.
5803
+ */
5804
+ name: string;
5805
+ /**
5806
+ * Name of a quality prototype. Always defined when reading, defaults to "normal" when writing.
5807
+ */
5808
+ quality?: string;
5809
+ }
5800
5810
  /**
5801
5811
  * An item filter may be specified in two ways, either as a string which is a quality prototype name or as a table.
5802
5812
  */
@@ -6105,7 +6115,7 @@ LuaLogisticCell | /**
6105
6115
  * Target type {@link logistic_network | runtime:defines.target_type.logistic_network}; `useful_id` {@link LuaLogisticNetwork::network_id | runtime:LuaLogisticNetwork::network_id}
6106
6116
  */
6107
6117
  LuaLogisticNetwork | /**
6108
- * Target type {@link logistic_section | runtime:defines.target_type.logistic_section};
6118
+ * Target type {@link logistic_section | runtime:defines.target_type.logistic_section}
6109
6119
  */
6110
6120
  LuaLogisticSection | /**
6111
6121
  * Target type {@link permission_group | runtime:defines.target_type.permission_group}; `useful_id` {@link LuaPermissionGroup::group_id | runtime:LuaPermissionGroup::group_id}
@@ -6117,7 +6127,7 @@ LuaPlanet | /**
6117
6127
  * Target type {@link player | runtime:defines.target_type.player}; `useful_id` {@link LuaPlayer::index | runtime:LuaPlayer::index}
6118
6128
  */
6119
6129
  LuaPlayer | /**
6120
- * Target type {@link rail_path | runtime:defines.target_type.rail_path};
6130
+ * Target type {@link rail_path | runtime:defines.target_type.rail_path}
6121
6131
  */
6122
6132
  LuaRailPath | /**
6123
6133
  * Target type {@link render_object | runtime:defines.target_type.render_object}; `useful_id` {@link LuaRenderObject::id | runtime:LuaRenderObject::id}
@@ -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/prototype-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 2.0.29
5
+ // Factorio version 2.0.31
6
6
  // API version 6
7
7
 
8
8
  declare namespace prototype {
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 2.0.29
5
+ // Factorio version 2.0.31
6
6
  // API version 6
7
7
 
8
8
  declare namespace defines {
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 2.0.29
5
+ // Factorio version 2.0.31
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -1444,7 +1444,7 @@ interface on_object_destroyed {
1444
1444
  */
1445
1445
  type: defines.target_type;
1446
1446
  /**
1447
- * Useful identifier of the object. Same as second value returned by {@link LuaBootstrap::register_on_object_destroyed | runtime:LuaBootstrap::register_on_object_destroyed}
1447
+ * The {@link useful identifier | runtime:RegistrationTarget} of the object. Same as second value returned by {@link LuaBootstrap::register_on_object_destroyed | runtime:LuaBootstrap::register_on_object_destroyed}
1448
1448
  */
1449
1449
  useful_id: uint64;
1450
1450
  }
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 2.0.29
5
+ // Factorio version 2.0.31
6
6
  // API version 6
7
7
 
8
8
  /**
@@ -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/prototype-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 2.0.29
5
+ // Factorio version 2.0.31
6
6
  // API version 6
7
7
 
8
8
  declare namespace prototype {
@@ -1206,7 +1206,7 @@ interface BurnerGeneratorPrototype extends EntityWithOwnerPrototype {
1206
1206
  */
1207
1207
  max_power_output: Energy;
1208
1208
  /**
1209
- * Affects animation speed.
1209
+ * Affects animation speed and working sound.
1210
1210
  */
1211
1211
  perceived_performance?: PerceivedPerformance;
1212
1212
  }
@@ -1725,6 +1725,10 @@ interface ConstantCombinatorPrototype extends EntityWithOwnerPrototype {
1725
1725
  circuit_wire_max_distance?: double;
1726
1726
  draw_circuit_wires?: bool;
1727
1727
  draw_copper_wires?: bool;
1728
+ /**
1729
+ * When not zero, toggle entity will enable constant combinator for that amount of ticks and then turn it off.
1730
+ */
1731
+ pulse_duration?: uint32;
1728
1732
  sprites?: Sprite4Way;
1729
1733
  }
1730
1734
  /**
@@ -3967,7 +3971,7 @@ interface FusionGeneratorPrototype extends EntityWithOwnerPrototype {
3967
3971
  */
3968
3972
  output_fluid_box: FluidBox;
3969
3973
  /**
3970
- * Affects animation speed.
3974
+ * Affects animation speed and working sound.
3971
3975
  */
3972
3976
  perceived_performance?: PerceivedPerformance;
3973
3977
  }
@@ -4008,7 +4012,7 @@ interface FusionReactorPrototype extends EntityWithOwnerPrototype {
4008
4012
  */
4009
4013
  output_fluid_box: FluidBox;
4010
4014
  /**
4011
- * Affects animation speed.
4015
+ * Affects working sound.
4012
4016
  */
4013
4017
  perceived_performance?: PerceivedPerformance;
4014
4018
  /**
@@ -4114,7 +4118,7 @@ interface GeneratorPrototype extends EntityWithOwnerPrototype {
4114
4118
  */
4115
4119
  maximum_temperature: float;
4116
4120
  /**
4117
- * Affects animation speed.
4121
+ * Affects animation speed and working sound.
4118
4122
  */
4119
4123
  perceived_performance?: PerceivedPerformance;
4120
4124
  /**
@@ -4579,9 +4583,6 @@ interface ItemPrototype extends Prototype {
4579
4583
  spoil_level?: uint8;
4580
4584
  spoil_result?: ItemID;
4581
4585
  spoil_ticks?: uint32;
4582
- /**
4583
- * Only loaded if `spoil_result` is not defined.
4584
- */
4585
4586
  spoil_to_trigger_result?: SpoilToTriggerResult;
4586
4587
  /**
4587
4588
  * Count of items of the same name that can be stored in one inventory slot. Must be 1 when the `"not-stackable"` flag is set.
@@ -9755,6 +9756,8 @@ interface UtilityConstants extends PrototypeBase {
9755
9756
  show_chunk_components_collision_mask: CollisionMaskConnector;
9756
9757
  small_area_size: float;
9757
9758
  small_blueprint_area_size: float;
9759
+ space_LPF_max_cutoff_frequency: float;
9760
+ space_LPF_min_cutoff_frequency: float;
9758
9761
  /**
9759
9762
  * Variables: speed, thrust, weight, width, height
9760
9763
  */
package/dist/types.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/prototype-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 2.0.29
5
+ // Factorio version 2.0.31
6
6
  // API version 6
7
7
 
8
8
  declare namespace prototype {
@@ -88,11 +88,21 @@ interface AdvancedMapGenSettings {
88
88
  pollution?: MapGenPresetPollutionSettings;
89
89
  }
90
90
  interface AdvancedVolumeControl {
91
+ /**
92
+ * Volume reduction (fade-out) controlled by distance (fraction of audible distance).
93
+ */
91
94
  attenuation?: Fade;
92
95
  /**
93
- * Has to be in the range (-1.0, 1.0).
96
+ * Has to be in the range [-1.0, 1.0].
97
+ *
98
+ * Positive values are used for night sounds, the volume of the sound is 1.0 when darkness = threshold, 0.0 when darkness = 0.0 and linearly interpolated in between.
99
+ *
100
+ * Negative values are used for day sounds, the sound of the sound is 0.0 when darkness = -threshold, 1.0 when darkness = 1.0 and linearly interpolated in between.
94
101
  */
95
102
  darkness_threshold?: float;
103
+ /**
104
+ * Volume reduction (fade-out) or increase (fade-in) controlled by zoom level.
105
+ */
96
106
  fades?: Fades;
97
107
  }
98
108
  interface AggregationSpecification {
@@ -6327,9 +6337,10 @@ interface MinableProperties {
6327
6337
  */
6328
6338
  result?: ItemID;
6329
6339
  /**
6330
- * The items that are returned when this object is mined.
6340
+ * The items or fluids that are returned when this object is mined.
6331
6341
  */
6332
6342
  results?: ProductPrototype[];
6343
+ transfer_entity_health_to_products?: bool;
6333
6344
  }
6334
6345
  interface MineEntityTechnologyTrigger {
6335
6346
  entity: EntityID;
@@ -6931,12 +6942,23 @@ interface PathFinderSettings {
6931
6942
  start_to_goal_cost_multiplier_to_terminate_path_find: double;
6932
6943
  use_path_cache: bool;
6933
6944
  }
6945
+ /**
6946
+ * Not all prototypes that use this type are affected by all properties.
6947
+ */
6934
6948
  interface PerceivedPerformance {
6949
+ /**
6950
+ * Affects animation speed.
6951
+ */
6935
6952
  maximum?: double;
6936
6953
  /**
6954
+ * Affects animation speed.
6955
+ *
6937
6956
  * Must be less than or equal to `maximum`.
6938
6957
  */
6939
6958
  minimum?: double;
6959
+ /**
6960
+ * Affects {@link MainSound | prototype:MainSound} if {@link MainSound::match_progress_to_activity | prototype:MainSound::match_progress_to_activity}, {@link MainSound::match_volume_to_activity | prototype:MainSound::match_volume_to_activity} or {@link MainSound::match_speed_to_activity | prototype:MainSound::match_speed_to_activity} is `true`.
6961
+ */
6940
6962
  performance_to_activity_rate?: double;
6941
6963
  }
6942
6964
  type PersistentWorldAmbientSoundDefinition = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "factorio-types",
3
- "version": "1.2.20",
3
+ "version": "1.2.22",
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",
@@ -23,7 +23,7 @@
23
23
  "src/**/*.d.ts",
24
24
  "dist/**/*.d.ts"
25
25
  ],
26
- "factorioVersion": "2.0.29",
26
+ "factorioVersion": "2.0.31",
27
27
  "dependencies": {
28
28
  "lua-types": "^2.13.1"
29
29
  },