factorio-types 1.2.21 → 1.2.23

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.30
5
+ // Factorio version 2.0.32
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<[
@@ -10531,11 +10531,11 @@ interface LuaGuiElement {
10531
10531
  *
10532
10532
  * The `"signal"` type operates with {@link SignalID | runtime:SignalID}.
10533
10533
  *
10534
- * The `"with-quality"` types operate with `"name"` and optional `"quality"`
10534
+ * The `"with-quality"` types operate with {@link PrototypeWithQuality | runtime:PrototypeWithQuality}.
10535
10535
  *
10536
10536
  * The remaining types use strings.
10537
10537
  */
10538
- elem_value?: string | SignalID | table;
10538
+ elem_value?: string | SignalID | PrototypeWithQuality;
10539
10539
  /**
10540
10540
  * Whether this GUI element is enabled. Disabled GUI elements don't trigger events when clicked.
10541
10541
  */
@@ -10911,7 +10911,7 @@ interface LuaGuiElementAddParamsChooseElemButton extends BaseLuaGuiElementAddPar
10911
10911
  /**
10912
10912
  * If type is `"entity-with-quality"` - the default value for the button.
10913
10913
  */
10914
- 'entity-with-quality'?: string;
10914
+ 'entity-with-quality'?: PrototypeWithQuality;
10915
10915
  /**
10916
10916
  * If type is `"equipment"` - the default value for the button.
10917
10917
  */
@@ -10919,7 +10919,7 @@ interface LuaGuiElementAddParamsChooseElemButton extends BaseLuaGuiElementAddPar
10919
10919
  /**
10920
10920
  * If type is `"equipment-with-quality"` - the default value for the button.
10921
10921
  */
10922
- 'equipment-with-quality'?: string;
10922
+ 'equipment-with-quality'?: PrototypeWithQuality;
10923
10923
  /**
10924
10924
  * If type is `"fluid"` - the default value for the button.
10925
10925
  */
@@ -10935,7 +10935,7 @@ interface LuaGuiElementAddParamsChooseElemButton extends BaseLuaGuiElementAddPar
10935
10935
  /**
10936
10936
  * If type is `"item-with-quality"` - the default value for the button.
10937
10937
  */
10938
- 'item-with-quality'?: string;
10938
+ 'item-with-quality'?: PrototypeWithQuality;
10939
10939
  /**
10940
10940
  * If type is `"recipe"` - the default value for the button.
10941
10941
  */
@@ -10943,7 +10943,7 @@ interface LuaGuiElementAddParamsChooseElemButton extends BaseLuaGuiElementAddPar
10943
10943
  /**
10944
10944
  * If type is `"recipe-with-quality"` - the default value for the button.
10945
10945
  */
10946
- 'recipe-with-quality'?: string;
10946
+ 'recipe-with-quality'?: PrototypeWithQuality;
10947
10947
  /**
10948
10948
  * If type is `"signal"` - the default value for the button.
10949
10949
  */
@@ -13403,7 +13403,7 @@ interface LuaPlayer extends LuaControl {
13403
13403
  */
13404
13404
  clear_recipe_notifications(this: void): void;
13405
13405
  /**
13406
- * Clears the players selection tool selection position.
13406
+ * Clears the player's selection tool selection position.
13407
13407
  */
13408
13408
  clear_selection(this: void): void;
13409
13409
  /**
@@ -13431,7 +13431,7 @@ interface LuaPlayer extends LuaControl {
13431
13431
  /**
13432
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.
13433
13433
  *
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 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.
13435
13435
  *
13436
13436
  * Local flying text is not saved, which means it will disappear after a save/load-cycle.
13437
13437
  * @param table.text The flying text to show.
@@ -13610,7 +13610,7 @@ interface LuaPlayer extends LuaControl {
13610
13610
  */
13611
13611
  print_lua_object_statistics(this: void): void;
13612
13612
  /**
13613
- * Print construction robot job counts to the players console.
13613
+ * Print construction robot job counts to the player's console.
13614
13614
  */
13615
13615
  print_robot_jobs(this: void): void;
13616
13616
  /**
@@ -13653,7 +13653,7 @@ interface LuaPlayer extends LuaControl {
13653
13653
  * @param table.character Entity to control. Mandatory when `type` is {@link defines.controllers.character | runtime:defines.controllers.character}, ignored otherwise.
13654
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}.
13655
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.
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 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.
13657
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.
13658
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.
13659
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.
@@ -13705,7 +13705,7 @@ interface LuaPlayer extends LuaControl {
13705
13705
  */
13706
13706
  set_shortcut_toggled(this: void, prototype_name: string, toggled: boolean): void;
13707
13707
  /**
13708
- * 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.
13709
13709
  * @param position The position to start selection from.
13710
13710
  * @param selection_mode The type of selection to start.
13711
13711
  */
@@ -13882,21 +13882,21 @@ interface LuaPlayer extends LuaControl {
13882
13882
  */
13883
13883
  readonly physical_controller_type: defines.controllers;
13884
13884
  /**
13885
- * The current position of this players physical controller.
13885
+ * The current position of this player's physical controller.
13886
13886
  */
13887
13887
  readonly physical_position: MapPosition;
13888
13888
  /**
13889
- * The surface this players physical controller is on.
13889
+ * The surface this player's physical controller is on.
13890
13890
  */
13891
13891
  readonly physical_surface: LuaSurface;
13892
13892
  /**
13893
- * 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.
13894
13894
  */
13895
13895
  readonly physical_surface_index: uint;
13896
13896
  /**
13897
- * The current vehicle of this players physical controller.
13897
+ * The current vehicle of this player's physical controller.
13898
13898
  */
13899
- readonly physical_vehicle: MapPosition;
13899
+ readonly physical_vehicle?: LuaEntity;
13900
13900
  /**
13901
13901
  * If items not included in this map editor infinity inventory filters should be removed.
13902
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.30
5
+ // Factorio version 2.0.32
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -5587,6 +5587,7 @@ interface PipeConnectionDefinition {
5587
5587
  max_underground_distance?: uint;
5588
5588
  flow_direction: 'input-output' | 'input' | 'output';
5589
5589
  direction: defines.direction;
5590
+ connection_category: string[];
5590
5591
  /**
5591
5592
  * Only supplied if `connection_type` is `"linked"`.
5592
5593
  */
@@ -5797,6 +5798,16 @@ interface PrototypeHistory {
5797
5798
  */
5798
5799
  changed: string[];
5799
5800
  }
5801
+ interface PrototypeWithQuality {
5802
+ /**
5803
+ * Name of a prototype.
5804
+ */
5805
+ name: string;
5806
+ /**
5807
+ * Name of a quality prototype. Always defined when reading, defaults to "normal" when writing.
5808
+ */
5809
+ quality?: string;
5810
+ }
5800
5811
  /**
5801
5812
  * An item filter may be specified in two ways, either as a string which is a quality prototype name or as a table.
5802
5813
  */
@@ -6105,7 +6116,7 @@ LuaLogisticCell | /**
6105
6116
  * Target type {@link logistic_network | runtime:defines.target_type.logistic_network}; `useful_id` {@link LuaLogisticNetwork::network_id | runtime:LuaLogisticNetwork::network_id}
6106
6117
  */
6107
6118
  LuaLogisticNetwork | /**
6108
- * Target type {@link logistic_section | runtime:defines.target_type.logistic_section};
6119
+ * Target type {@link logistic_section | runtime:defines.target_type.logistic_section}
6109
6120
  */
6110
6121
  LuaLogisticSection | /**
6111
6122
  * Target type {@link permission_group | runtime:defines.target_type.permission_group}; `useful_id` {@link LuaPermissionGroup::group_id | runtime:LuaPermissionGroup::group_id}
@@ -6117,7 +6128,7 @@ LuaPlanet | /**
6117
6128
  * Target type {@link player | runtime:defines.target_type.player}; `useful_id` {@link LuaPlayer::index | runtime:LuaPlayer::index}
6118
6129
  */
6119
6130
  LuaPlayer | /**
6120
- * Target type {@link rail_path | runtime:defines.target_type.rail_path};
6131
+ * Target type {@link rail_path | runtime:defines.target_type.rail_path}
6121
6132
  */
6122
6133
  LuaRailPath | /**
6123
6134
  * 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.30
5
+ // Factorio version 2.0.32
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.30
5
+ // Factorio version 2.0.32
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.30
5
+ // Factorio version 2.0.32
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.30
5
+ // Factorio version 2.0.32
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.30
5
+ // Factorio version 2.0.32
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
  }
@@ -1728,7 +1728,7 @@ interface ConstantCombinatorPrototype extends EntityWithOwnerPrototype {
1728
1728
  /**
1729
1729
  * When not zero, toggle entity will enable constant combinator for that amount of ticks and then turn it off.
1730
1730
  */
1731
- pulse_duration?: uint;
1731
+ pulse_duration?: uint32;
1732
1732
  sprites?: Sprite4Way;
1733
1733
  }
1734
1734
  /**
@@ -3765,6 +3765,7 @@ interface FluidStreamPrototype extends EntityPrototype {
3765
3765
  special_neutral_target_damage?: DamageParameters;
3766
3766
  spine_animation?: Animation;
3767
3767
  stream_light?: LightDefinition;
3768
+ target_initial_position_only?: bool;
3768
3769
  target_position_deviation?: double;
3769
3770
  width?: float;
3770
3771
  }
@@ -3971,7 +3972,7 @@ interface FusionGeneratorPrototype extends EntityWithOwnerPrototype {
3971
3972
  */
3972
3973
  output_fluid_box: FluidBox;
3973
3974
  /**
3974
- * Affects animation speed.
3975
+ * Affects animation speed and working sound.
3975
3976
  */
3976
3977
  perceived_performance?: PerceivedPerformance;
3977
3978
  }
@@ -4012,7 +4013,7 @@ interface FusionReactorPrototype extends EntityWithOwnerPrototype {
4012
4013
  */
4013
4014
  output_fluid_box: FluidBox;
4014
4015
  /**
4015
- * Affects animation speed.
4016
+ * Affects working sound.
4016
4017
  */
4017
4018
  perceived_performance?: PerceivedPerformance;
4018
4019
  /**
@@ -4118,7 +4119,7 @@ interface GeneratorPrototype extends EntityWithOwnerPrototype {
4118
4119
  */
4119
4120
  maximum_temperature: float;
4120
4121
  /**
4121
- * Affects animation speed.
4122
+ * Affects animation speed and working sound.
4122
4123
  */
4123
4124
  perceived_performance?: PerceivedPerformance;
4124
4125
  /**
@@ -4583,9 +4584,6 @@ interface ItemPrototype extends Prototype {
4583
4584
  spoil_level?: uint8;
4584
4585
  spoil_result?: ItemID;
4585
4586
  spoil_ticks?: uint32;
4586
- /**
4587
- * Only loaded if `spoil_result` is not defined.
4588
- */
4589
4587
  spoil_to_trigger_result?: SpoilToTriggerResult;
4590
4588
  /**
4591
4589
  * 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.
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.30
5
+ // Factorio version 2.0.32
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 {
@@ -6932,12 +6942,23 @@ interface PathFinderSettings {
6932
6942
  start_to_goal_cost_multiplier_to_terminate_path_find: double;
6933
6943
  use_path_cache: bool;
6934
6944
  }
6945
+ /**
6946
+ * Not all prototypes that use this type are affected by all properties.
6947
+ */
6935
6948
  interface PerceivedPerformance {
6949
+ /**
6950
+ * Affects animation speed.
6951
+ */
6936
6952
  maximum?: double;
6937
6953
  /**
6954
+ * Affects animation speed.
6955
+ *
6938
6956
  * Must be less than or equal to `maximum`.
6939
6957
  */
6940
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
+ */
6941
6962
  performance_to_activity_rate?: double;
6942
6963
  }
6943
6964
  type PersistentWorldAmbientSoundDefinition = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "factorio-types",
3
- "version": "1.2.21",
3
+ "version": "1.2.23",
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.30",
26
+ "factorioVersion": "2.0.32",
27
27
  "dependencies": {
28
28
  "lua-types": "^2.13.1"
29
29
  },