typed-factorio 1.16.0 → 1.17.0

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typed-factorio",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "description": "Featureful typescript definitions for the the Factorio modding lua api.",
5
5
  "keywords": [
6
6
  "factorio",
@@ -4020,7 +4020,7 @@ interface LuaEntity extends LuaControl {
4020
4020
  * The storage filter for this logistic storage container.
4021
4021
  * @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.storage_filter Online documentation}
4022
4022
  */
4023
- storage_filter: LuaItemPrototype
4023
+ storage_filter?: LuaItemPrototype
4024
4024
  /**
4025
4025
  * Whether this requester chest is set to also request from buffer chests.
4026
4026
  * @remarks Useable only on entities that have requester slots.
@@ -5165,7 +5165,7 @@ interface BaseEntity extends LuaControl {
5165
5165
  * The storage filter for this logistic storage container.
5166
5166
  * @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.storage_filter Online documentation}
5167
5167
  */
5168
- storage_filter: LuaItemPrototype
5168
+ storage_filter?: LuaItemPrototype
5169
5169
  /**
5170
5170
  * Whether this requester chest is set to also request from buffer chests.
5171
5171
  * @remarks Useable only on entities that have requester slots.
@@ -10831,6 +10831,11 @@ interface LuaFluidBox extends Array<Fluid | nil> {
10831
10831
  * @see {@link https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_connections Online documentation}
10832
10832
  */
10833
10833
  get_connections(index: uint): LuaFluidBox[]
10834
+ /**
10835
+ * Get the fluid box's connections and associated data.
10836
+ * @see {@link https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_pipe_connections Online documentation}
10837
+ */
10838
+ get_pipe_connections(index: uint): PipeConnection[]
10834
10839
  /**
10835
10840
  * Get a fluid box filter
10836
10841
  * @param index The index of the filter to get.
@@ -10864,6 +10869,12 @@ interface LuaFluidBox extends Array<Fluid | nil> {
10864
10869
  * @see {@link https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_fluid_system_id Online documentation}
10865
10870
  */
10866
10871
  get_fluid_system_id(index: uint): uint | nil
10872
+ /**
10873
+ * Gets counts of all fluids in the fluid system. May return `nil` for fluid wagon, fluid turret's internal buffer, or a fluidbox which does not belong to a fluid system.
10874
+ * @returns The counts, indexed by fluid name.
10875
+ * @see {@link https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_fluid_system_contents Online documentation}
10876
+ */
10877
+ get_fluid_system_contents(index: uint): Record<string, uint> | nil
10867
10878
  /**
10868
10879
  * Flushes all fluid from this fluidbox and its fluid system.
10869
10880
  * @param fluid If provided, only this fluid is flushed.
@@ -20263,6 +20274,10 @@ interface LuaRendering {
20263
20274
  * Length of the dashes that this line has. Used only if gap_length > 0. Default is 0.
20264
20275
  */
20265
20276
  readonly dash_length?: double
20277
+ /**
20278
+ * Starting offset to apply to dashes. Cannot be greater than dash_length + gap_length. Default is 0.
20279
+ */
20280
+ readonly dash_offset?: double
20266
20281
  readonly from: (MapPosition | MapPositionArray) | LuaEntity
20267
20282
  /**
20268
20283
  * Only used if `from` is a LuaEntity.
@@ -20610,6 +20625,9 @@ interface LuaRendering {
20610
20625
  */
20611
20626
  readonly y_scale?: double
20612
20627
  readonly tint?: Color | ColorArray
20628
+ /**
20629
+ * Render layer of the sprite. Defaults to `"arrow"`.
20630
+ */
20613
20631
  readonly render_layer?: RenderLayer
20614
20632
  /**
20615
20633
  * If given, the sprite rotates so that it faces this target. Note that `orientation` is still applied to the sprite.
@@ -20742,6 +20760,9 @@ interface LuaRendering {
20742
20760
  */
20743
20761
  readonly y_scale?: double
20744
20762
  readonly tint?: Color | ColorArray
20763
+ /**
20764
+ * Render layer of the animation. Defaults to `"arrow"`.
20765
+ */
20745
20766
  readonly render_layer?: RenderLayer
20746
20767
  /**
20747
20768
  * How many frames the animation goes forward per tick. Default is 1.
@@ -627,6 +627,11 @@ interface GameViewSettings {
627
627
  * @see {@link https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings#GameViewSettings.show_map_view_options Online documentation}
628
628
  */
629
629
  show_map_view_options: boolean
630
+ /**
631
+ * Shows or hides the tooltip that is displayed when selecting an entity.
632
+ * @see {@link https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings#GameViewSettings.show_entity_tooltip Online documentation}
633
+ */
634
+ show_entity_tooltip: boolean
630
635
  /**
631
636
  * Shows or hides quickbar of shortcuts.
632
637
  * @see {@link https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings#GameViewSettings.show_quickbar Online documentation}
@@ -637,6 +642,21 @@ interface GameViewSettings {
637
642
  * @see {@link https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings#GameViewSettings.show_shortcut_bar Online documentation}
638
643
  */
639
644
  show_shortcut_bar: boolean
645
+ /**
646
+ * Shows or hides the crafting queue.
647
+ * @see {@link https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings#GameViewSettings.show_crafting_queue Online documentation}
648
+ */
649
+ show_crafting_queue: boolean
650
+ /**
651
+ * Shows or hides the tool window with the weapons and armor.
652
+ * @see {@link https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings#GameViewSettings.show_tool_bar Online documentation}
653
+ */
654
+ show_tool_bar: boolean
655
+ /**
656
+ * Shows or hides the mouse and keyboard/controller button hints in the bottom left corner if they are enabled in the interface settings.
657
+ * @see {@link https://lua-api.factorio.com/latest/Concepts.html#GameViewSettings#GameViewSettings.show_hotkey_suggestions Online documentation}
658
+ */
659
+ show_hotkey_suggestions: boolean
640
660
  }
641
661
 
642
662
  /**
@@ -2387,7 +2407,7 @@ interface HeatConnection {
2387
2407
  */
2388
2408
  interface FluidBoxConnection {
2389
2409
  /**
2390
- * The connection type: "input", "output", or "input-output".
2410
+ * One of "input", "output", or "input-output".
2391
2411
  */
2392
2412
  readonly type: "input" | "output" | "input-output"
2393
2413
  /**
@@ -2400,6 +2420,37 @@ interface FluidBoxConnection {
2400
2420
  readonly max_underground_distance?: uint
2401
2421
  }
2402
2422
 
2423
+ /**
2424
+ * A single pipe connection for a given fluidbox.
2425
+ * @see {@link https://lua-api.factorio.com/latest/Concepts.html#PipeConnection Online documentation}
2426
+ */
2427
+ interface PipeConnection {
2428
+ /**
2429
+ * One of "input", "output", or "input-output".
2430
+ */
2431
+ readonly flow_direction: "input" | "output" | "input-output"
2432
+ /**
2433
+ * One of "normal" or "underground".
2434
+ */
2435
+ readonly connection_type: "normal" | "underground"
2436
+ /**
2437
+ * The absolute position of this connection within the entity.
2438
+ */
2439
+ readonly position: MapPosition
2440
+ /**
2441
+ * The absolute position of the connection's intended target.
2442
+ */
2443
+ readonly target_position: MapPosition
2444
+ /**
2445
+ * The connected fluidbox, if any.
2446
+ */
2447
+ readonly target?: LuaFluidBox
2448
+ /**
2449
+ * The index of the connected fluidbox, if any.
2450
+ */
2451
+ readonly target_index?: uint
2452
+ }
2453
+
2403
2454
  interface ArithmeticCombinatorParameters {
2404
2455
  /**
2405
2456
  * First signal to use in an operation. If not specified, the second argument will be the value of `first_constant`.
@@ -554,6 +554,7 @@ interface OnEntityClonedEvent extends EventData {
554
554
 
555
555
  /**
556
556
  * Called after an entity has been recolored either by the player or through script.
557
+ * @remarks Automatic recoloring due to {@link LuaPlayer#color LuaPlayer::color} will not raise events, as that is a separate mechanism.
557
558
  * @see {@link https://lua-api.factorio.com/latest/events.html#on_entity_color_changed Online documentation}
558
559
  */
559
560
  interface OnEntityColorChangedEvent extends EventData {