factorio-types 1.2.8 → 1.2.10

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.14
5
+ // Factorio version 2.0.16
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -5809,6 +5809,10 @@ interface LuaEntity extends LuaControl {
5809
5809
  * @param index If provided, only returns the `LuaLogisticPoint` specified by this index.
5810
5810
  */
5811
5811
  get_logistic_point(this: void, index?: defines.logistic_member_index): (LuaLogisticPoint | Record<defines.logistic_member_index, LuaLogisticPoint>) | null;
5812
+ /**
5813
+ * Gives logistic sections of this entity if it uses logistic sections.
5814
+ */
5815
+ get_logistic_sections(this: void): LuaLogisticSections | null;
5812
5816
  /**
5813
5817
  * Get all offers in a market as an array.
5814
5818
  */
@@ -6753,7 +6757,7 @@ interface LuaEntity extends LuaControl {
6753
6757
  */
6754
6758
  logistic_network: LuaLogisticNetwork;
6755
6759
  /**
6756
- * Max health of this entity. Quality of entity is taken into account.
6760
+ * Max health of this entity.
6757
6761
  */
6758
6762
  readonly max_health: float;
6759
6763
  /**
@@ -7898,7 +7902,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7898
7902
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
7899
7903
  */
7900
7904
  readonly object_name: string;
7901
- readonly per_lane_filters?: bool;
7905
+ readonly per_lane_filters?: boolean;
7902
7906
  /**
7903
7907
  * The beacon profile: extra multiplier applied to the effects received from beacon by the effect receiver based on amount of beacons that reach that effect receiver
7904
7908
  */
@@ -8947,7 +8951,7 @@ interface LuaForce {
8947
8951
  create_space_platform(this: void, table: {
8948
8952
  name?: string;
8949
8953
  planet: SpaceLocationID;
8950
- starter_pack: ItemID;
8954
+ starter_pack: ItemWithQualityID;
8951
8955
  }): LuaSpacePlatform | null;
8952
8956
  /**
8953
8957
  * Disable all recipes and technologies. Only recipes and technologies enabled explicitly will be useable from this point.
@@ -9529,10 +9533,6 @@ interface LuaGameScript {
9529
9533
  * Disables replay saving for the current save file. Once done there's no way to re-enable replay saving for the save file without loading an old save.
9530
9534
  */
9531
9535
  disable_replay(this: void): void;
9532
- /**
9533
- * Enables tip triggers in custom scenarios, that unlock new tips and show notices about unlocked tips.
9534
- */
9535
- enable_tip_triggers_in_custom_scenarios(this: void): void;
9536
9536
  /**
9537
9537
  * 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.
9538
9538
  */
@@ -9752,6 +9752,8 @@ interface LuaGameScript {
9752
9752
  * @param table.show_entity_info Whether to include entity info ("Alt mode") or not. Defaults to `false`.
9753
9753
  * @param table.show_cursor_building_preview When `true` and when `player` is specified, the building preview for the item in the player's cursor will also be rendered. Defaults to `false`.
9754
9754
  * @param table.anti_alias Whether to render in double resolution and downscale the result (including GUI). Defaults to `false`.
9755
+ * @param table.hide_clouds If `true` cloud shadows on ground won't be rendered. Defaults to `false`.
9756
+ * @param table.hide_fog If `true` fog effect and foreground space dust effect won't be rendered. Defaults to `false`.
9755
9757
  * @param table.quality The `.jpg` render quality as a percentage (from 0% to 100% inclusive), if used. A lower value means a more compressed image. Defaults to `80`.
9756
9758
  * @param table.allow_in_replay Whether to save the screenshot even during replay playback. Defaults to `false`.
9757
9759
  * @param table.daytime Overrides the current surface daytime for the duration of screenshot rendering.
@@ -9770,6 +9772,8 @@ interface LuaGameScript {
9770
9772
  show_entity_info?: boolean;
9771
9773
  show_cursor_building_preview?: boolean;
9772
9774
  anti_alias?: boolean;
9775
+ hide_clouds?: boolean;
9776
+ hide_fog?: boolean;
9773
9777
  quality?: int;
9774
9778
  allow_in_replay?: boolean;
9775
9779
  daytime?: double;
@@ -9801,6 +9805,12 @@ interface LuaGameScript {
9801
9805
  * @param player The player to unmute.
9802
9806
  */
9803
9807
  unmute_player(this: void, player: PlayerIdentification): void;
9808
+ /**
9809
+ * If the tips are allowed to be activated in this scenario, it is false by default.
9810
+ *
9811
+ * Can't be modified in a simulation (menu screen, tips and tricks simulation, factoriopedia simulation etc.)
9812
+ */
9813
+ allow_tip_activation: boolean;
9804
9814
  /**
9805
9815
  * True by default. Can be used to disable autosaving. Make sure to turn it back on soon after.
9806
9816
  */
@@ -11615,7 +11625,7 @@ interface LuaItemCommon {
11615
11625
  * @param table.surface Surface to create from
11616
11626
  * @param table.force Force to use for the creation
11617
11627
  * @param table.area The bounding box
11618
- * @param table.always_include_tiles When true, blueprintable tiles are always included in the blueprint. When false they're only included if no entities exist in the setup area.
11628
+ * @param table.always_include_tiles When true, blueprintable tiles are always included in the blueprint. When false they're only included if no entities exist in the setup area. Defaults to false.
11619
11629
  * @param table.include_entities When true, entities are included in the blueprint. Defaults to true.
11620
11630
  * @param table.include_modules When true, modules are included in the blueprint. Defaults to true.
11621
11631
  * @param table.include_station_names When true, station names are included in the blueprint. Defaults to false.
@@ -11916,7 +11926,7 @@ interface LuaItemCommon {
11916
11926
  trees_and_rocks_only: boolean;
11917
11927
  }
11918
11928
  /**
11919
- * Prototype of an item. For example, an item prototype can be obtained from {@link LuaGameScript::item_prototypes | runtime:LuaGameScript::item_prototypes} by its name: `prototypes.item["iron-plate"]`.
11929
+ * Prototype of an item. For example, an item prototype can be obtained from {@link LuaPrototypes::item | runtime:LuaPrototypes::item} by its name: `prototypes.item["iron-plate"]`.
11920
11930
  */
11921
11931
  interface LuaItemPrototype extends LuaPrototypeBase {
11922
11932
  /**
@@ -12032,6 +12042,10 @@ interface LuaItemPrototype extends LuaPrototypeBase {
12032
12042
  * The prototype of this armor's equipment grid, if any.
12033
12043
  */
12034
12044
  readonly equipment_grid?: LuaEquipmentGridPrototype;
12045
+ /**
12046
+ * The durability message key used when displaying the durability of this tool in Factoriopedia.
12047
+ */
12048
+ readonly factoriopedia_durability_description_key?: string;
12035
12049
  /**
12036
12050
  * The filter mode used by this item with inventory.
12037
12051
  */
@@ -12821,6 +12835,44 @@ interface LuaLogisticSection {
12821
12835
  */
12822
12836
  readonly valid: boolean;
12823
12837
  }
12838
+ /**
12839
+ * Logistic sections of an entity.
12840
+ */
12841
+ interface LuaLogisticSections {
12842
+ /**
12843
+ * Adds a new logistic section if possible.
12844
+ * @param group The group to assign this section to.
12845
+ * @returns Logistic section if added.
12846
+ */
12847
+ add_section(this: void, group?: string): LuaLogisticSection | null;
12848
+ /**
12849
+ * Gets section on the selected index, if it exists.
12850
+ * @param section_index Index of the section.
12851
+ */
12852
+ get_section(this: void, section_index: uint): LuaLogisticSection | null;
12853
+ /**
12854
+ * Removes the given logistic section if possible. Removal may fail if the section index is out of range or the section is not {@link manual | runtime:LuaLogisticSection::is_manual}.
12855
+ * @param section_index Index of the section.
12856
+ * @returns Whether section was removed.
12857
+ */
12858
+ remove_section(this: void, section_index: uint): boolean;
12859
+ /**
12860
+ * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
12861
+ */
12862
+ readonly object_name: string;
12863
+ /**
12864
+ * All logistic sections of this entity.
12865
+ */
12866
+ readonly sections: LuaLogisticSection[];
12867
+ /**
12868
+ * Amount of logistic sections this entity has.
12869
+ */
12870
+ readonly sections_count: uint;
12871
+ /**
12872
+ * 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.
12873
+ */
12874
+ readonly valid: boolean;
12875
+ }
12824
12876
  /**
12825
12877
  * Control behavior for mining drills.
12826
12878
  */
@@ -14666,7 +14718,7 @@ interface LuaRecord {
14666
14718
  * @param table.surface Surface to create from
14667
14719
  * @param table.force Force to use for the creation
14668
14720
  * @param table.area The bounding box
14669
- * @param table.always_include_tiles When true, blueprintable tiles are always included in the blueprint. When false they're only included if no entities exist in the setup area.
14721
+ * @param table.always_include_tiles When true, blueprintable tiles are always included in the blueprint. When false they're only included if no entities exist in the setup area. Defaults to false.
14670
14722
  * @param table.include_entities When true, entities are included in the blueprint. Defaults to true.
14671
14723
  * @param table.include_modules When true, modules are included in the blueprint. Defaults to true.
14672
14724
  * @param table.include_station_names When true, station names are included in the blueprint. Defaults to false.
@@ -15723,6 +15775,7 @@ interface LuaSimulation {
15723
15775
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
15724
15776
  */
15725
15777
  readonly object_name: string;
15778
+ smart_belt_building?: boolean;
15726
15779
  /**
15727
15780
  * 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.
15728
15781
  */
@@ -15883,7 +15936,7 @@ interface LuaSpacePlatform {
15883
15936
  /**
15884
15937
  * The starter pack used to create this space platform.
15885
15938
  */
15886
- readonly starter_pack: LuaItemPrototype;
15939
+ readonly starter_pack: ItemIDAndQualityIDPair;
15887
15940
  /**
15888
15941
  * The current state of this space platform.
15889
15942
  */
@@ -16794,8 +16847,9 @@ interface LuaSurface {
16794
16847
  * Spawn pollution at the given position.
16795
16848
  * @param source Where to spawn the pollution.
16796
16849
  * @param amount How much pollution to add.
16850
+ * @param prototype The entity prototype to attribute the pollution change to in statistics. If not defined, the pollution change will not show up in statistics.
16797
16851
  */
16798
- pollute(this: void, source: MapPosition, amount: double): void;
16852
+ pollute(this: void, source: MapPosition, amount: double, prototype?: EntityID): void;
16799
16853
  /**
16800
16854
  * Print text to the chat console of all players on this surface.
16801
16855
  *
@@ -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.14
5
+ // Factorio version 2.0.16
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -1483,7 +1483,7 @@ interface EntityPrototypeFilterFlag extends BaseEntityPrototypeFilter {
1483
1483
  /**
1484
1484
  * For use within nested filters such as the `place-result` filter of array{@link [ItemPrototypeFilter | runtime:ItemPrototypeFilter}].
1485
1485
  *
1486
- * To get a specific prototype by name, see {@link LuaGameScript::entity_prototypes | runtime:LuaGameScript::entity_prototypes}.
1486
+ * To get a specific prototype by name, see {@link LuaPrototypes::entity | runtime:LuaPrototypes::entity}.
1487
1487
  * Applies to variant case `name`
1488
1488
  */
1489
1489
  interface EntityPrototypeFilterName extends BaseEntityPrototypeFilter {
@@ -1999,7 +1999,7 @@ interface FluidPrototypeFilterMaxTemperature extends BaseFluidPrototypeFilter {
1999
1999
  /**
2000
2000
  * For use within nested filters such as the `has-product-fluid` filter of array{@link [RecipePrototypeFilter | runtime:RecipePrototypeFilter}].
2001
2001
  *
2002
- * To get a specific prototype by name, see {@link LuaGameScript::fluid_prototypes | runtime:LuaGameScript::fluid_prototypes}.
2002
+ * To get a specific prototype by name, see {@link LuaPrototypes::fluid | runtime:LuaPrototypes::fluid}.
2003
2003
  * Applies to variant case `name`
2004
2004
  */
2005
2005
  interface FluidPrototypeFilterName extends BaseFluidPrototypeFilter {
@@ -2705,7 +2705,7 @@ interface ItemPrototypeFilterFuelValue extends BaseItemPrototypeFilter {
2705
2705
  /**
2706
2706
  * For use within nested filters such as the `has-product-item` filter of array{@link [RecipePrototypeFilter | runtime:RecipePrototypeFilter}].
2707
2707
  *
2708
- * To get a specific prototype by name, see {@link LuaGameScript::item_prototypes | runtime:LuaGameScript::item_prototypes}.
2708
+ * To get a specific prototype by name, see {@link LuaPrototypes::item | runtime:LuaPrototypes::item}.
2709
2709
  * Applies to variant case `name`
2710
2710
  */
2711
2711
  interface ItemPrototypeFilterName extends BaseItemPrototypeFilter {
@@ -5527,6 +5527,7 @@ interface PipeConnection {
5527
5527
  target_pipe_connection_index?: uint;
5528
5528
  }
5529
5529
  interface PipeConnectionDefinition {
5530
+ connection_type: 'normal' | 'underground' | 'linked';
5530
5531
  /**
5531
5532
  * The 4 cardinal direction connection points for this pipe.
5532
5533
  */
@@ -5537,6 +5538,10 @@ interface PipeConnectionDefinition {
5537
5538
  max_underground_distance?: uint;
5538
5539
  flow_direction: 'input-output' | 'input' | 'output';
5539
5540
  direction: defines.direction;
5541
+ /**
5542
+ * Only supplied if `connection_type` is `"linked"`.
5543
+ */
5544
+ linked_connection_id?: uint32;
5540
5545
  }
5541
5546
  interface PlaceAsTileResult {
5542
5547
  /**
@@ -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.14
5
+ // Factorio version 2.0.16
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.14
5
+ // Factorio version 2.0.16
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.14
5
+ // Factorio version 2.0.16
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.14
5
+ // Factorio version 2.0.16
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.14
5
+ // Factorio version 2.0.16
6
6
  // API version 6
7
7
 
8
8
  declare namespace prototype {
@@ -10221,6 +10221,7 @@ interface UtilitySprites extends PrototypeBase {
10221
10221
  mod_downloads_count: Sprite;
10222
10222
  mod_last_updated: Sprite;
10223
10223
  mouse_cursor: Sprite;
10224
+ mouse_cursor_macos: Sprite;
10224
10225
  move_tag: Sprite;
10225
10226
  multiplayer_waiting_icon: Sprite;
10226
10227
  nature_icon: Sprite;
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.14
5
+ // Factorio version 2.0.16
6
6
  // API version 6
7
7
 
8
8
  declare namespace prototype {
@@ -2424,6 +2424,7 @@ interface ChartUtilityConstants {
2424
2424
  artillery_range_color: Color;
2425
2425
  blue_signal_color: Color;
2426
2426
  chart_construction_robot_color: Color;
2427
+ chart_deconstruct_active_color: Color;
2427
2428
  chart_deconstruct_tint: Color;
2428
2429
  chart_delivery_to_me_logistic_robot_color: Color;
2429
2430
  chart_logistic_robot_color: Color;
@@ -12526,6 +12527,10 @@ interface WorkingVisualisation {
12526
12527
  */
12527
12528
  draw_when_state_filter_matches?: bool;
12528
12529
  east_animation?: Animation;
12530
+ /**
12531
+ * If defined, animation in this visualisation layer will be used only as mask for fog effect and will not render in world.
12532
+ */
12533
+ east_fog_mask?: FogMaskShapeDefinition;
12529
12534
  east_position?: Vector;
12530
12535
  east_secondary_draw_order?: int8;
12531
12536
  effect?: 'flicker' | 'uranium-glow' | 'none';
@@ -12533,11 +12538,21 @@ interface WorkingVisualisation {
12533
12538
  enabled_in_animated_shift_during_transition?: bool;
12534
12539
  enabled_in_animated_shift_during_waypoint_stop?: bool;
12535
12540
  fadeout?: bool;
12541
+ /**
12542
+ * Loaded only if at least one of north_fog_mask, east_fog_mask, south_fog_mask, west_fog_mask is not specified.
12543
+ *
12544
+ * If defined, animation in this visualisation layer will be used only as mask for fog effect and will not render in world.
12545
+ */
12546
+ fog_mask?: FogMaskShapeDefinition;
12536
12547
  frame_based_on_shift_animation_progress?: bool;
12537
12548
  light?: LightDefinition;
12538
12549
  mining_drill_scorch_mark?: bool;
12539
12550
  name?: string;
12540
12551
  north_animation?: Animation;
12552
+ /**
12553
+ * If defined, animation in this visualisation layer will be used only as mask for fog effect and will not render in world.
12554
+ */
12555
+ north_fog_mask?: FogMaskShapeDefinition;
12541
12556
  north_position?: Vector;
12542
12557
  north_secondary_draw_order?: int8;
12543
12558
  render_layer?: RenderLayer;
@@ -12558,10 +12573,18 @@ interface WorkingVisualisation {
12558
12573
  */
12559
12574
  secondary_draw_order?: int8;
12560
12575
  south_animation?: Animation;
12576
+ /**
12577
+ * If defined, animation in this visualisation layer will be used only as mask for fog effect and will not render in world.
12578
+ */
12579
+ south_fog_mask?: FogMaskShapeDefinition;
12561
12580
  south_position?: Vector;
12562
12581
  south_secondary_draw_order?: int8;
12563
12582
  synced_fadeout?: bool;
12564
12583
  west_animation?: Animation;
12584
+ /**
12585
+ * If defined, animation in this visualisation layer will be used only as mask for fog effect and will not render in world.
12586
+ */
12587
+ west_fog_mask?: FogMaskShapeDefinition;
12565
12588
  west_position?: Vector;
12566
12589
  west_secondary_draw_order?: int8;
12567
12590
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "factorio-types",
3
- "version": "1.2.8",
3
+ "version": "1.2.10",
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.14",
26
+ "factorioVersion": "2.0.16",
27
27
  "dependencies": {
28
28
  "lua-types": "^2.13.1"
29
29
  },
package/src/core.d.ts CHANGED
@@ -30,8 +30,9 @@ declare const serpent: Serpent;
30
30
  // can eventually fix these on a per-case basis
31
31
  type Table = any;
32
32
 
33
+ // These ones seem to be strangely missing from concepts and therefore not available in the runtime namespace
33
34
  type uint = number;
34
-
35
+ type uint32 = number;
35
36
  type bool = boolean;
36
37
 
37
38
  /*