factorio-types 1.2.18 → 1.2.20

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.27
5
+ // Factorio version 2.0.29
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -4080,7 +4080,7 @@ interface LuaBootstrap {
4080
4080
  script.raise_event(defines.events.on_console_chat, data)
4081
4081
  ```
4082
4082
  */
4083
- raise_event(this: void, event: uint | string, data: table): void;
4083
+ raise_event(this: void, event: LuaEventType, data: table): void;
4084
4084
  /**
4085
4085
  * @param table.player_index The player who did the purchasing.
4086
4086
  * @param table.market The market entity.
@@ -4895,6 +4895,10 @@ interface LuaControl {
4895
4895
  * The build distance of this character or max uint when not a character or player connected to a character.
4896
4896
  */
4897
4897
  readonly build_distance: uint;
4898
+ /**
4899
+ * The cargo pod the player is currently sitting in or the cargo pod attached to this rocket silo.
4900
+ */
4901
+ readonly cargo_pod?: LuaEntity;
4898
4902
  /**
4899
4903
  * When called on a {@link LuaPlayer | runtime:LuaPlayer}, it must be associated with a character (see {@link LuaPlayer::character | runtime:LuaPlayer::character}).
4900
4904
  */
@@ -5030,6 +5034,10 @@ interface LuaControl {
5030
5034
  * Unique {@link index | runtime:LuaForce::index} (ID) associated with the force of this entity.
5031
5035
  */
5032
5036
  readonly force_index: uint;
5037
+ /**
5038
+ * The space platform hub the player is currently sitting in.
5039
+ */
5040
+ readonly hub?: LuaEntity;
5033
5041
  /**
5034
5042
  * Whether this character entity is in combat.
5035
5043
  */
@@ -5797,11 +5805,11 @@ interface LuaEntity extends LuaControl {
5797
5805
  */
5798
5806
  get_electric_output_flow_limit(this: void, quality?: QualityID): double | null;
5799
5807
  /**
5800
- * Get the filter for a slot in an inserter, loader, or logistic storage container. The entity must allow filters.
5808
+ * Get the filter for a slot in an inserter, loader, mining drill, asteroid collector, or logistic storage container. The entity must allow filters.
5801
5809
  * @param slot_index Index of the slot to get the filter for.
5802
5810
  * @returns The filter, or `nil` if the given slot has no filter.
5803
5811
  */
5804
- get_filter(this: void, slot_index: uint): ItemFilter | null;
5812
+ get_filter(this: void, slot_index: uint): (ItemFilter | EntityID | AsteroidChunkID) | null;
5805
5813
  /**
5806
5814
  * Gets fluid of the i-th fluid storage.
5807
5815
  * @param index Fluid storage index. Valid values are from 1 up to {@link LuaEntity::fluids_count | runtime:LuaEntity::fluids_count}.
@@ -5906,9 +5914,9 @@ interface LuaEntity extends LuaControl {
5906
5914
  */
5907
5915
  get_parent_signals(this: void): LuaEntity[];
5908
5916
  /**
5909
- * Gets the passenger of this car or spidertron if any.
5917
+ * Gets the passenger of this car, spidertron, or cargo pod if any.
5910
5918
  *
5911
- * This differs over {@link LuaEntity::get_driver | runtime:LuaEntity::get_driver} in that the passenger can't drive the car.
5919
+ * This differs over {@link LuaEntity::get_driver | runtime:LuaEntity::get_driver} in that for cars, the passenger can't drive the car.
5912
5920
  * @returns `nil` if the vehicle contains no passenger. To check if there's a driver see {@link LuaEntity::get_driver | runtime:LuaEntity::get_driver}.
5913
5921
  */
5914
5922
  get_passenger(this: void): (LuaEntity | LuaPlayer) | null;
@@ -6229,11 +6237,11 @@ interface LuaEntity extends LuaControl {
6229
6237
  */
6230
6238
  set_driver(this: void, driver?: LuaEntity | PlayerIdentification): void;
6231
6239
  /**
6232
- * Set the filter for a slot in an inserter (ItemFilter), loader (ItemFilter), mining drill (EntityID) or logistic storage container (ItemWithQualityID). The entity must allow filters.
6240
+ * Set the filter for a slot in an inserter (ItemFilter), loader (ItemFilter), mining drill (EntityID), asteroid collector (AsteroidChunkID) or logistic storage container (ItemWithQualityID). The entity must allow filters.
6233
6241
  * @param index Index of the slot to set the filter for.
6234
6242
  * @param filter The item or entity to filter, or `nil` to clear the filter.
6235
6243
  */
6236
- set_filter(this: void, index: uint, filter?: ItemFilter | ItemWithQualityID | EntityID): void;
6244
+ set_filter(this: void, index: uint, filter?: ItemFilter | ItemWithQualityID | EntityID | AsteroidChunkID): void;
6237
6245
  /**
6238
6246
  * Sets fluid to the i-th fluid storage.
6239
6247
  *
@@ -6430,10 +6438,6 @@ interface LuaEntity extends LuaControl {
6430
6438
  * The burner energy source for this entity, if any.
6431
6439
  */
6432
6440
  readonly burner?: LuaBurner;
6433
- /**
6434
- * Gets the cargo pod attached to this rocket silo rocket if one exists.
6435
- */
6436
- readonly cargo_pod?: LuaEntity;
6437
6441
  /**
6438
6442
  * The state of this chain signal.
6439
6443
  */
@@ -6633,7 +6637,7 @@ interface LuaEntity extends LuaControl {
6633
6637
  */
6634
6638
  entity_label?: string;
6635
6639
  /**
6636
- * The number of filter slots this inserter, loader, mining drill or logistic storage container has. 0 if not one of those entities.
6640
+ * The number of filter slots this inserter, loader, mining drill, asteroid collector or logistic storage container has. 0 if not one of those entities.
6637
6641
  */
6638
6642
  readonly filter_slot_count: uint;
6639
6643
  /**
@@ -7276,6 +7280,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7276
7280
  * The crafting speed of this crafting-machine.
7277
7281
  */
7278
7282
  get_crafting_speed(this: void, quality?: QualityID): double;
7283
+ /**
7284
+ * The fluid usage of this generator prototype.
7285
+ */
7286
+ get_fluid_usage_per_tick(this: void, quality?: QualityID): LuaQualityPrototype | null;
7279
7287
  /**
7280
7288
  * The extension speed of this inserter.
7281
7289
  */
@@ -7316,6 +7324,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7316
7324
  * Max health of this entity. Will be `0` if this is not an entity with health.
7317
7325
  */
7318
7326
  get_max_health(this: void, quality?: QualityID): float;
7327
+ /**
7328
+ * The maximum power output of this burner generator or generator prototype.
7329
+ */
7330
+ get_max_power_output(this: void, quality?: QualityID): double | null;
7319
7331
  /**
7320
7332
  * The maximum wire distance for this entity. 0 if the entity doesn't support wires.
7321
7333
  */
@@ -7689,7 +7701,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7689
7701
  */
7690
7702
  readonly fluid_energy_source_prototype?: LuaFluidEnergySourcePrototype;
7691
7703
  /**
7692
- * The fluid usage of this generator prototype.
7704
+ * The fluid usage of this generator prototype. This property is deprecated in favor of {@link LuaEntityPrototype::get_fluid_usage_per_tick | runtime:LuaEntityPrototype::get_fluid_usage_per_tick} and should not be used.
7693
7705
  */
7694
7706
  readonly fluid_usage_per_tick?: double;
7695
7707
  /**
@@ -7942,7 +7954,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7942
7954
  */
7943
7955
  readonly max_polyphony?: uint;
7944
7956
  /**
7945
- * The default maximum power output of this generator prototype.
7957
+ * The default maximum power output of this generator prototype. This property is deprecated in favor of {@link LuaEntityPrototype::get_max_power_output | runtime:LuaEntityPrototype::get_max_power_output} and should not be used.
7946
7958
  */
7947
7959
  readonly max_power_output?: double;
7948
7960
  /**
@@ -8105,6 +8117,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8105
8117
  * Whether this generator prototype scales fluid usage.
8106
8118
  */
8107
8119
  readonly scale_fluid_usage?: boolean;
8120
+ /**
8121
+ * How much science pack durability is required to research one science point.
8122
+ */
8123
+ readonly science_pack_drain_rate_percent: uint8;
8108
8124
  /**
8109
8125
  * The secondary bounding box used for collision checking, if any. This is only used in rails and rail remnants.
8110
8126
  */
@@ -13373,6 +13389,11 @@ interface LuaPlayer extends LuaControl {
13373
13389
  * Clear any active flying texts for this player.
13374
13390
  */
13375
13391
  clear_local_flying_texts(this: void): void;
13392
+ /**
13393
+ * Clears the given recipe from the list of recipe notifications for this player.
13394
+ * @param recipe Recipe to clear.
13395
+ */
13396
+ clear_recipe_notification(this: void, recipe: RecipeID): void;
13376
13397
  /**
13377
13398
  * Clears all recipe notifications for this player.
13378
13399
  */
@@ -13917,7 +13938,7 @@ interface LuaPlayer extends LuaControl {
13917
13938
  */
13918
13939
  readonly valid: boolean;
13919
13940
  /**
13920
- * The player's zoom-level.
13941
+ * The player's zoom-level. Must be positive.
13921
13942
  */
13922
13943
  zoom: double;
13923
13944
  }
@@ -14894,6 +14915,10 @@ interface LuaRecord {
14894
14915
  by_player?: PlayerIdentification;
14895
14916
  super_forced?: boolean;
14896
14917
  }): void;
14918
+ /**
14919
+ * The active index of this BlueprintBookRecord. For records in "my blueprints", the result will be the same regardless of the player, but records in "game blueprints" may have different active indices per player.
14920
+ */
14921
+ get_active_index(this: void, player: PlayerIdentification): uint;
14897
14922
  /**
14898
14923
  * The entities in this blueprint.
14899
14924
  */
@@ -17215,7 +17240,7 @@ interface LuaSurface {
17215
17240
  /**
17216
17241
  * If surface condition checks should not be performed on this surface.
17217
17242
  */
17218
- ignore_surface_conditions: bool;
17243
+ ignore_surface_conditions: boolean;
17219
17244
  /**
17220
17245
  * This surface's index in {@link LuaGameScript::surfaces | runtime:LuaGameScript::surfaces} (unique ID). It is assigned when a surface is created, and remains so until it is {@link deleted | runtime:on_surface_deleted}. Indexes of deleted surfaces can be reused.
17221
17246
  */
@@ -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.27
5
+ // Factorio version 2.0.29
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -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.27
5
+ // Factorio version 2.0.29
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.27
5
+ // Factorio version 2.0.29
6
6
  // API version 6
7
7
 
8
8
  declare namespace defines {
@@ -1183,23 +1183,24 @@ enum input_method {
1183
1183
  keyboard_and_mouse = 0
1184
1184
  }
1185
1185
  enum inventory {
1186
- artillery_turret_ammo = 42,
1187
- artillery_wagon_ammo = 43,
1186
+ artillery_turret_ammo = 43,
1187
+ artillery_wagon_ammo = 44,
1188
1188
  assembling_machine_dump = 25,
1189
1189
  assembling_machine_input = 22,
1190
1190
  assembling_machine_modules = 24,
1191
1191
  assembling_machine_output = 23,
1192
- beacon_modules = 40,
1192
+ beacon_modules = 41,
1193
1193
  burnt_result = 1,
1194
1194
  car_ammo = 37,
1195
+ car_trash = 38,
1195
1196
  car_trunk = 36,
1196
- cargo_landing_pad_main = 49,
1197
- cargo_landing_pad_trash = 50,
1197
+ cargo_landing_pad_main = 50,
1198
+ cargo_landing_pad_trash = 51,
1198
1199
  cargo_unit = 35,
1199
- cargo_wagon = 38,
1200
+ cargo_wagon = 39,
1200
1201
  character_ammo = 9,
1201
1202
  character_armor = 10,
1202
- character_corpse = 41,
1203
+ character_corpse = 42,
1203
1204
  character_guns = 8,
1204
1205
  character_main = 7,
1205
1206
  character_trash = 12,
@@ -1214,8 +1215,8 @@ enum inventory {
1214
1215
  furnace_result = 5,
1215
1216
  furnace_source = 4,
1216
1217
  god_main = 13,
1217
- hub_main = 47,
1218
- hub_trash = 48,
1218
+ hub_main = 48,
1219
+ hub_trash = 49,
1219
1220
  item_main = 29,
1220
1221
  lab_input = 26,
1221
1222
  lab_modules = 27,
@@ -1230,10 +1231,10 @@ enum inventory {
1230
1231
  rocket_silo_output = 33,
1231
1232
  rocket_silo_rocket = 30,
1232
1233
  rocket_silo_trash = 31,
1233
- spider_ammo = 45,
1234
- spider_trash = 46,
1235
- spider_trunk = 44,
1236
- turret_ammo = 39
1234
+ spider_ammo = 46,
1235
+ spider_trash = 47,
1236
+ spider_trunk = 45,
1237
+ turret_ammo = 40
1237
1238
  }
1238
1239
  enum logistic_member_index {
1239
1240
  character_provider = 4,
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.27
5
+ // Factorio version 2.0.29
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
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.27
5
+ // Factorio version 2.0.29
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.27
5
+ // Factorio version 2.0.29
6
6
  // API version 6
7
7
 
8
8
  declare namespace prototype {
@@ -1381,6 +1381,7 @@ interface CargoWagonPrototype extends RollingStockPrototype {
1381
1381
  * Size of the inventory of the wagon. The inventory can be limited using the red bar and filtered. This functionality cannot be turned off.
1382
1382
  */
1383
1383
  inventory_size: ItemStackIndex;
1384
+ quality_affects_inventory_size?: bool;
1384
1385
  }
1385
1386
  /**
1386
1387
  * Jumps between targets and applies a {@link Trigger | prototype:Trigger} to them.
@@ -3805,6 +3806,7 @@ interface FluidTurretPrototype extends TurretPrototype {
3805
3806
  */
3806
3807
  interface FluidWagonPrototype extends RollingStockPrototype {
3807
3808
  capacity: FluidAmount;
3809
+ quality_affects_capacity?: bool;
3808
3810
  /**
3809
3811
  * Must be 1, 2 or 3.
3810
3812
  */
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.27
5
+ // Factorio version 2.0.29
6
6
  // API version 6
7
7
 
8
8
  declare namespace prototype {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "factorio-types",
3
- "version": "1.2.18",
3
+ "version": "1.2.20",
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.27",
26
+ "factorioVersion": "2.0.29",
27
27
  "dependencies": {
28
28
  "lua-types": "^2.13.1"
29
29
  },