typed-factorio 4.0.1 → 4.6.0

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.
@@ -13,7 +13,7 @@ declare module "factorio:runtime" {
13
13
  * script.on_event("my-potato-control", function(event)
14
14
  * game.print("Keyboard shortcut pressed on tick: " ..tostring(event.tick))
15
15
  * end)
16
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#CustomInputEvent Online documentation}
16
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#CustomInputEvent Online documentation}
17
17
  */
18
18
  interface CustomInputEvent extends EventData {
19
19
  /**
@@ -57,9 +57,55 @@ declare module "factorio:runtime" {
57
57
  */
58
58
  readonly tick: MapTick
59
59
  }
60
+ /**
61
+ * Called when a recipe with {@link import("factorio:prototype").RecipePrototype#raise_on_crafted RecipePrototype::raise_on_crafted} is crafted.
62
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#RecipeCraftedEvent Online documentation}
63
+ */
64
+ interface RecipeCraftedEvent extends EventData {
65
+ /**
66
+ * Entity that crafted recipe.
67
+ */
68
+ readonly entity: LuaEntity
69
+ /**
70
+ * Name of recipe that was crafted.
71
+ */
72
+ readonly recipe: string
73
+ /**
74
+ * Quality of the recipe crafted.
75
+ */
76
+ readonly recipe_quality: string
77
+ /**
78
+ * Quality effect used when giving products. Not provided if value is 0. May be different than value obtained from {@link LuaEntity#effects LuaEntity::effects} when quality modules were changed between craft starting and products being given.
79
+ */
80
+ readonly quality_effect?: EffectValue
81
+ /**
82
+ * Random value in range [0, 1) that was used when selecting product quality. Only provided when quality_effect is provided.
83
+ */
84
+ readonly quality_seed?: double
85
+ /**
86
+ * Quality of products given. May be different than recipe quality if quality modules are present. Always provided even if quality_effect is zero because {@link LuaEntity#result_quality LuaEntity::result_quality} may have been used. Only used by products without quality control.
87
+ */
88
+ readonly product_quality: string
89
+ /**
90
+ * If crafted as part of bonus products.
91
+ */
92
+ readonly bonus: boolean
93
+ /**
94
+ * Random value in range {@link import("factorio:prototype").ProductPrototypeBase#shared_probability 0, 1) used as part of shared roll when giving products. Related to [ProductPrototypeBase::shared_probability}.
95
+ */
96
+ readonly shared_roll: double
97
+ /**
98
+ * Identifier of the event.
99
+ */
100
+ readonly name: defines.events
101
+ /**
102
+ * Tick the event was generated.
103
+ */
104
+ readonly tick: MapTick
105
+ }
60
106
  /**
61
107
  * Called when an achievement is gained.
62
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_achievement_gained Online documentation}
108
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_achievement_gained Online documentation}
63
109
  */
64
110
  interface OnAchievementGainedEvent extends EventData {
65
111
  /**
@@ -78,7 +124,7 @@ declare module "factorio:runtime" {
78
124
  }
79
125
  /**
80
126
  * Called when a unit/group completes a command.
81
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_ai_command_completed Online documentation}
127
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_ai_command_completed Online documentation}
82
128
  */
83
129
  interface OnAiCommandCompletedEvent extends EventData {
84
130
  /**
@@ -101,7 +147,7 @@ declare module "factorio:runtime" {
101
147
  }
102
148
  /**
103
149
  * Called when an area of the map is cloned.
104
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_area_cloned Online documentation}
150
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_area_cloned Online documentation}
105
151
  */
106
152
  interface OnAreaClonedEvent extends EventData {
107
153
  readonly source_surface: LuaSurface
@@ -127,7 +173,7 @@ declare module "factorio:runtime" {
127
173
  * Called when a biter migration builds a base.
128
174
  *
129
175
  * This will be called multiple times for each migration, once for every biter that is sacrificed to build part of the new base.
130
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_biter_base_built Online documentation}
176
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_biter_base_built Online documentation}
131
177
  */
132
178
  interface OnBiterBaseBuiltEvent extends EventData {
133
179
  /**
@@ -149,7 +195,7 @@ declare module "factorio:runtime" {
149
195
  * The entity's settings, rotation, mirroring, wire connections, etc. may have been updated. This event is raised even if no settings actually changed.
150
196
  *
151
197
  * Note this event is not raised when an entity is upgraded or marked for upgrade, when a new entity is created, or when an entity ghost is instantly revived. {@link OnBuiltEntityEvent on_built_entity} is raised instead in those cases.
152
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_blueprint_settings_pasted Online documentation}
198
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_blueprint_settings_pasted Online documentation}
153
199
  */
154
200
  interface OnBlueprintSettingsPastedEvent extends EventData {
155
201
  /**
@@ -183,7 +229,7 @@ declare module "factorio:runtime" {
183
229
  }
184
230
  /**
185
231
  * Called when a set of positions on the map is cloned.
186
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_brush_cloned Online documentation}
232
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_brush_cloned Online documentation}
187
233
  */
188
234
  interface OnBrushClonedEvent extends EventData {
189
235
  readonly source_offset: TilePosition
@@ -208,7 +254,7 @@ declare module "factorio:runtime" {
208
254
  }
209
255
  /**
210
256
  * Called when a {@link defines.command.build_base} command reaches its destination, and before building starts.
211
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_build_base_arrived Online documentation}
257
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_build_base_arrived Online documentation}
212
258
  */
213
259
  interface OnBuildBaseArrivedEvent extends EventData {
214
260
  /**
@@ -232,7 +278,7 @@ declare module "factorio:runtime" {
232
278
  * Called when player builds something.
233
279
  *
234
280
  * Event filter: [LuaPlayerBuiltEntityEventFilter](LuaPlayerBuiltEntityEventFilter]
235
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_built_entity Online documentation}
281
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_built_entity Online documentation}
236
282
  */
237
283
  interface OnBuiltEntityEvent extends EventData {
238
284
  /**
@@ -264,7 +310,7 @@ declare module "factorio:runtime" {
264
310
  * Called when the deconstruction of an entity is canceled.
265
311
  *
266
312
  * Event filter: [LuaEntityDeconstructionCancelledEventFilter](LuaEntityDeconstructionCancelledEventFilter]
267
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_cancelled_deconstruction Online documentation}
313
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_cancelled_deconstruction Online documentation}
268
314
  */
269
315
  interface OnCancelledDeconstructionEvent extends EventData {
270
316
  readonly entity: LuaEntity
@@ -282,7 +328,7 @@ declare module "factorio:runtime" {
282
328
  * Called when the upgrade of an entity is canceled.
283
329
  *
284
330
  * Event filter: [LuaUpgradeCancelledEventFilter](LuaUpgradeCancelledEventFilter]
285
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_cancelled_upgrade Online documentation}
331
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_cancelled_upgrade Online documentation}
286
332
  */
287
333
  interface OnCancelledUpgradeEvent extends EventData {
288
334
  readonly entity: LuaEntity
@@ -300,7 +346,7 @@ declare module "factorio:runtime" {
300
346
  }
301
347
  /**
302
348
  * Called after a cargo pod has delivered its cargo.
303
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_cargo_pod_delivered_cargo Online documentation}
349
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_cargo_pod_delivered_cargo Online documentation}
304
350
  */
305
351
  interface OnCargoPodDeliveredCargoEvent extends EventData {
306
352
  readonly cargo_pod: LuaEntity
@@ -319,7 +365,7 @@ declare module "factorio:runtime" {
319
365
  }
320
366
  /**
321
367
  * Called when a cargo pod departs a surface.
322
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_cargo_pod_finished_ascending Online documentation}
368
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_cargo_pod_finished_ascending Online documentation}
323
369
  */
324
370
  interface OnCargoPodFinishedAscendingEvent extends EventData {
325
371
  readonly cargo_pod: LuaEntity
@@ -342,7 +388,7 @@ declare module "factorio:runtime" {
342
388
  }
343
389
  /**
344
390
  * Called when a cargo pods lands on a surface, either at a station or on the ground.
345
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_cargo_pod_finished_descending Online documentation}
391
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_cargo_pod_finished_descending Online documentation}
346
392
  */
347
393
  interface OnCargoPodFinishedDescendingEvent extends EventData {
348
394
  readonly cargo_pod: LuaEntity
@@ -365,7 +411,7 @@ declare module "factorio:runtime" {
365
411
  }
366
412
  /**
367
413
  * Called when a cargo pod departs from a space platform hub or by another method not attached to a rocket.
368
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_cargo_pod_started_ascending Online documentation}
414
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_cargo_pod_started_ascending Online documentation}
369
415
  */
370
416
  interface OnCargoPodStartedAscendingEvent extends EventData {
371
417
  readonly cargo_pod: LuaEntity
@@ -386,7 +432,7 @@ declare module "factorio:runtime" {
386
432
  * Called when a character corpse expires due to timeout or all of the items being removed from it.
387
433
  *
388
434
  * this is not called if the corpse is mined. See {@link defines.events.on_pre_player_mined_item} to detect that.
389
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_character_corpse_expired Online documentation}
435
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_character_corpse_expired Online documentation}
390
436
  */
391
437
  interface OnCharacterCorpseExpiredEvent extends EventData {
392
438
  /**
@@ -404,7 +450,7 @@ declare module "factorio:runtime" {
404
450
  }
405
451
  /**
406
452
  * Called when a chart tag is created.
407
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_chart_tag_added Online documentation}
453
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_chart_tag_added Online documentation}
408
454
  */
409
455
  interface OnChartTagAddedEvent extends EventData {
410
456
  readonly tag: LuaCustomChartTag
@@ -421,7 +467,7 @@ declare module "factorio:runtime" {
421
467
  }
422
468
  /**
423
469
  * Called when a chart tag is modified by a player or by script.
424
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_chart_tag_modified Online documentation}
470
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_chart_tag_modified Online documentation}
425
471
  */
426
472
  interface OnChartTagModifiedEvent extends EventData {
427
473
  readonly tag: LuaCustomChartTag
@@ -443,7 +489,7 @@ declare module "factorio:runtime" {
443
489
  }
444
490
  /**
445
491
  * Called just before a chart tag is deleted.
446
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_chart_tag_removed Online documentation}
492
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_chart_tag_removed Online documentation}
447
493
  */
448
494
  interface OnChartTagRemovedEvent extends EventData {
449
495
  readonly tag: LuaCustomChartTag
@@ -460,7 +506,7 @@ declare module "factorio:runtime" {
460
506
  }
461
507
  /**
462
508
  * Called when a chunk is charted or re-charted.
463
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_chunk_charted Online documentation}
509
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_chunk_charted Online documentation}
464
510
  */
465
511
  interface OnChunkChartedEvent extends EventData {
466
512
  readonly surface_index: SurfaceIndex
@@ -481,7 +527,7 @@ declare module "factorio:runtime" {
481
527
  }
482
528
  /**
483
529
  * Called when one or more chunks are deleted using {@link LuaSurface#delete_chunk LuaSurface::delete_chunk}.
484
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_chunk_deleted Online documentation}
530
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_chunk_deleted Online documentation}
485
531
  */
486
532
  interface OnChunkDeletedEvent extends EventData {
487
533
  readonly surface_index: SurfaceIndex
@@ -500,7 +546,7 @@ declare module "factorio:runtime" {
500
546
  }
501
547
  /**
502
548
  * Called when a chunk is generated.
503
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_chunk_generated Online documentation}
549
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_chunk_generated Online documentation}
504
550
  */
505
551
  interface OnChunkGeneratedEvent extends EventData {
506
552
  /**
@@ -526,7 +572,7 @@ declare module "factorio:runtime" {
526
572
  }
527
573
  /**
528
574
  * Called when a combat robot expires through a lack of energy, or timeout.
529
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_combat_robot_expired Online documentation}
575
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_combat_robot_expired Online documentation}
530
576
  */
531
577
  interface OnCombatRobotExpiredEvent extends EventData {
532
578
  readonly robot: LuaEntity
@@ -547,7 +593,7 @@ declare module "factorio:runtime" {
547
593
  * Called when a message is sent to the in-game console, either by a player or through the server interface.
548
594
  *
549
595
  * This event only fires for plain messages, not for any commands (including `/shout` or `/whisper`).
550
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_console_chat Online documentation}
596
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_console_chat Online documentation}
551
597
  */
552
598
  interface OnConsoleChatEvent extends EventData {
553
599
  /**
@@ -569,7 +615,7 @@ declare module "factorio:runtime" {
569
615
  }
570
616
  /**
571
617
  * Called when someone enters a command-like message regardless of it being a valid command.
572
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_console_command Online documentation}
618
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_console_command Online documentation}
573
619
  */
574
620
  interface OnConsoleCommandEvent extends EventData {
575
621
  /**
@@ -595,7 +641,7 @@ declare module "factorio:runtime" {
595
641
  }
596
642
  /**
597
643
  * Called when a cutscene is cancelled by the player or by script.
598
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_cutscene_cancelled Online documentation}
644
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_cutscene_cancelled Online documentation}
599
645
  */
600
646
  interface OnCutsceneCancelledEvent extends EventData {
601
647
  /**
@@ -613,7 +659,7 @@ declare module "factorio:runtime" {
613
659
  }
614
660
  /**
615
661
  * Called when a cutscene finishes naturally (was not cancelled).
616
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_cutscene_finished Online documentation}
662
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_cutscene_finished Online documentation}
617
663
  */
618
664
  interface OnCutsceneFinishedEvent extends EventData {
619
665
  /**
@@ -631,7 +677,7 @@ declare module "factorio:runtime" {
631
677
  }
632
678
  /**
633
679
  * Called when a cutscene starts.
634
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_cutscene_started Online documentation}
680
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_cutscene_started Online documentation}
635
681
  */
636
682
  interface OnCutsceneStartedEvent extends EventData {
637
683
  /**
@@ -651,7 +697,7 @@ declare module "factorio:runtime" {
651
697
  * Called when a cutscene is playing, each time it reaches a waypoint in that cutscene.
652
698
  *
653
699
  * This refers to an index in the table previously passed to set_controller which started the cutscene.
654
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_cutscene_waypoint_reached Online documentation}
700
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_cutscene_waypoint_reached Online documentation}
655
701
  */
656
702
  interface OnCutsceneWaypointReachedEvent extends EventData {
657
703
  /**
@@ -675,7 +721,7 @@ declare module "factorio:runtime" {
675
721
  * Called when an entity is cloned. The filter applies to the source entity.
676
722
  *
677
723
  * Event filter: [LuaEntityClonedEventFilter](LuaEntityClonedEventFilter]
678
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_entity_cloned Online documentation}
724
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_entity_cloned Online documentation}
679
725
  */
680
726
  interface OnEntityClonedEvent extends EventData {
681
727
  readonly source: LuaEntity
@@ -693,7 +739,7 @@ declare module "factorio:runtime" {
693
739
  * Called after an entity has been recolored either by the player or through script.
694
740
  *
695
741
  * Automatic recoloring due to {@link LuaPlayer#color LuaPlayer::color} will not raise events, as that is a separate mechanism.
696
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_entity_color_changed Online documentation}
742
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_entity_color_changed Online documentation}
697
743
  */
698
744
  interface OnEntityColorChangedEvent extends EventData {
699
745
  /**
@@ -713,7 +759,7 @@ declare module "factorio:runtime" {
713
759
  * Called when an entity is damaged. This is not called when an entities health is set directly by another mod.
714
760
  *
715
761
  * Event filter: [LuaEntityDamagedEventFilter](LuaEntityDamagedEventFilter]
716
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_entity_damaged Online documentation}
762
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_entity_damaged Online documentation}
717
763
  */
718
764
  interface OnEntityDamagedEvent extends EventData {
719
765
  readonly entity: LuaEntity
@@ -755,7 +801,7 @@ declare module "factorio:runtime" {
755
801
  * Called when an entity dies.
756
802
  *
757
803
  * Event filter: [LuaEntityDiedEventFilter](LuaEntityDiedEventFilter]
758
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_entity_died Online documentation}
804
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_entity_died Online documentation}
759
805
  */
760
806
  interface OnEntityDiedEvent extends EventData {
761
807
  /**
@@ -789,7 +835,7 @@ declare module "factorio:runtime" {
789
835
  }
790
836
  /**
791
837
  * Called when one of an entity's logistic slots changes.
792
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_entity_logistic_slot_changed Online documentation}
838
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_entity_logistic_slot_changed Online documentation}
793
839
  */
794
840
  interface OnEntityLogisticSlotChangedEvent extends EventData {
795
841
  /**
@@ -819,7 +865,7 @@ declare module "factorio:runtime" {
819
865
  }
820
866
  /**
821
867
  * Called after an entity has been renamed either by the player or through script.
822
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_entity_renamed Online documentation}
868
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_entity_renamed Online documentation}
823
869
  */
824
870
  interface OnEntityRenamedEvent extends EventData {
825
871
  /**
@@ -840,7 +886,7 @@ declare module "factorio:runtime" {
840
886
  }
841
887
  /**
842
888
  * Called after entity copy-paste is done.
843
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_entity_settings_pasted Online documentation}
889
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_entity_settings_pasted Online documentation}
844
890
  */
845
891
  interface OnEntitySettingsPastedEvent extends EventData {
846
892
  readonly player_index: PlayerIndex
@@ -863,7 +909,7 @@ declare module "factorio:runtime" {
863
909
  }
864
910
  /**
865
911
  * Called when an entity is spawned by a EnemySpawner
866
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_entity_spawned Online documentation}
912
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_entity_spawned Online documentation}
867
913
  */
868
914
  interface OnEntitySpawnedEvent extends EventData {
869
915
  readonly spawner: LuaEntity
@@ -879,7 +925,7 @@ declare module "factorio:runtime" {
879
925
  }
880
926
  /**
881
927
  * Called after equipment is inserted into an equipment grid.
882
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_equipment_inserted Online documentation}
928
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_equipment_inserted Online documentation}
883
929
  */
884
930
  interface OnEquipmentInsertedEvent extends EventData {
885
931
  /**
@@ -901,7 +947,7 @@ declare module "factorio:runtime" {
901
947
  }
902
948
  /**
903
949
  * Called after equipment is removed from an equipment grid.
904
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_equipment_removed Online documentation}
950
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_equipment_removed Online documentation}
905
951
  */
906
952
  interface OnEquipmentRemovedEvent extends EventData {
907
953
  /**
@@ -931,7 +977,7 @@ declare module "factorio:runtime" {
931
977
  }
932
978
  /**
933
979
  * Called when the a forces cease fire values change.
934
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_force_cease_fire_changed Online documentation}
980
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_force_cease_fire_changed Online documentation}
935
981
  */
936
982
  interface OnForceCeaseFireChangedEvent extends EventData {
937
983
  /**
@@ -959,7 +1005,7 @@ declare module "factorio:runtime" {
959
1005
  * Called when a new force is created using `game.create_force()`
960
1006
  *
961
1007
  * This is not called when the default forces (`'player'`, `'enemy'`, `'neutral'`) are created as they will always exist.
962
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_force_created Online documentation}
1008
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_force_created Online documentation}
963
1009
  */
964
1010
  interface OnForceCreatedEvent extends EventData {
965
1011
  /**
@@ -977,7 +1023,7 @@ declare module "factorio:runtime" {
977
1023
  }
978
1024
  /**
979
1025
  * Called when the a forces friends change.
980
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_force_friends_changed Online documentation}
1026
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_force_friends_changed Online documentation}
981
1027
  */
982
1028
  interface OnForceFriendsChangedEvent extends EventData {
983
1029
  /**
@@ -1003,7 +1049,7 @@ declare module "factorio:runtime" {
1003
1049
  }
1004
1050
  /**
1005
1051
  * Called when {@link LuaForce#reset LuaForce::reset} is finished.
1006
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_force_reset Online documentation}
1052
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_force_reset Online documentation}
1007
1053
  */
1008
1054
  interface OnForceResetEvent extends EventData {
1009
1055
  readonly force: LuaForce
@@ -1020,7 +1066,7 @@ declare module "factorio:runtime" {
1020
1066
  * Called after two forces have been merged using `game.merge_forces()`.
1021
1067
  *
1022
1068
  * The source force is invalidated before this event is called and the name can be re-used in this event if desired.
1023
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_forces_merged Online documentation}
1069
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_forces_merged Online documentation}
1024
1070
  */
1025
1071
  interface OnForcesMergedEvent extends EventData {
1026
1072
  /**
@@ -1046,7 +1092,7 @@ declare module "factorio:runtime" {
1046
1092
  }
1047
1093
  /**
1048
1094
  * Called when two forces are about to be merged using `game.merge_forces()`.
1049
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_forces_merging Online documentation}
1095
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_forces_merging Online documentation}
1050
1096
  */
1051
1097
  interface OnForcesMergingEvent extends EventData {
1052
1098
  /**
@@ -1070,7 +1116,7 @@ declare module "factorio:runtime" {
1070
1116
  * Called when a game is created from a scenario. This is fired for every mod, even when the scenario's save data already includes it. In those cases however, {@link LuaBootstrap#on_init LuaBootstrap::on_init} is not fired.
1071
1117
  *
1072
1118
  * This event is not fired when the scenario is loaded via the map editor.
1073
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_game_created_from_scenario Online documentation}
1119
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_game_created_from_scenario Online documentation}
1074
1120
  */
1075
1121
  interface OnGameCreatedFromScenarioEvent extends EventData {
1076
1122
  /**
@@ -1084,7 +1130,7 @@ declare module "factorio:runtime" {
1084
1130
  }
1085
1131
  /**
1086
1132
  * Called when {@link LuaGuiElement} checked state is changed (related to checkboxes and radio buttons).
1087
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_checked_state_changed Online documentation}
1133
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_checked_state_changed Online documentation}
1088
1134
  */
1089
1135
  interface OnGuiCheckedStateChangedEvent extends EventData {
1090
1136
  /**
@@ -1106,7 +1152,7 @@ declare module "factorio:runtime" {
1106
1152
  }
1107
1153
  /**
1108
1154
  * Called when {@link LuaGuiElement} is clicked.
1109
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_click Online documentation}
1155
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_click Online documentation}
1110
1156
  */
1111
1157
  interface OnGuiClickEvent extends EventData {
1112
1158
  /**
@@ -1152,7 +1198,7 @@ declare module "factorio:runtime" {
1152
1198
  * This can only be raised when the GUI's player controller is still valid. If a GUI is thus closed due to the player disconnecting, dying, or becoming a spectator in other ways, it won't cause this event to be raised.
1153
1199
  *
1154
1200
  * It's not advised to open any other GUI during this event because if this is run as a request to open a different GUI the game will force close the new opened GUI without notice to ensure the original requested GUI is opened.
1155
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_closed Online documentation}
1201
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_closed Online documentation}
1156
1202
  */
1157
1203
  interface OnGuiClosedEvent extends EventData {
1158
1204
  /**
@@ -1206,7 +1252,7 @@ declare module "factorio:runtime" {
1206
1252
  }
1207
1253
  /**
1208
1254
  * Called when a {@link LuaGuiElement} is confirmed, for example by pressing Enter in a textfield.
1209
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_confirmed Online documentation}
1255
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_confirmed Online documentation}
1210
1256
  */
1211
1257
  interface OnGuiConfirmedEvent extends EventData {
1212
1258
  /**
@@ -1240,7 +1286,7 @@ declare module "factorio:runtime" {
1240
1286
  }
1241
1287
  /**
1242
1288
  * Called when {@link LuaGuiElement} element value is changed (related to choose element buttons).
1243
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_elem_changed Online documentation}
1289
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_elem_changed Online documentation}
1244
1290
  */
1245
1291
  interface OnGuiElemChangedEvent extends EventData {
1246
1292
  /**
@@ -1264,7 +1310,7 @@ declare module "factorio:runtime" {
1264
1310
  * Called when {@link LuaGuiElement} is hovered by the mouse.
1265
1311
  *
1266
1312
  * Only fired for events whose {@link LuaGuiElement#raise_hover_events LuaGuiElement::raise_hover_events} is `true`.
1267
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_hover Online documentation}
1313
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_hover Online documentation}
1268
1314
  */
1269
1315
  interface OnGuiHoverEvent extends EventData {
1270
1316
  /**
@@ -1286,7 +1332,7 @@ declare module "factorio:runtime" {
1286
1332
  }
1287
1333
  /**
1288
1334
  * Called when a player interacts with a custom inventory GUI.
1289
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_inventory_action Online documentation}
1335
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_inventory_action Online documentation}
1290
1336
  */
1291
1337
  interface OnGuiInventoryActionEvent extends EventData {
1292
1338
  /**
@@ -1346,7 +1392,7 @@ declare module "factorio:runtime" {
1346
1392
  * Called when the player's cursor leaves a {@link LuaGuiElement} that was previously hovered.
1347
1393
  *
1348
1394
  * Only fired for events whose {@link LuaGuiElement#raise_hover_events LuaGuiElement::raise_hover_events} is `true`.
1349
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_leave Online documentation}
1395
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_leave Online documentation}
1350
1396
  */
1351
1397
  interface OnGuiLeaveEvent extends EventData {
1352
1398
  /**
@@ -1368,7 +1414,7 @@ declare module "factorio:runtime" {
1368
1414
  }
1369
1415
  /**
1370
1416
  * Called when {@link LuaGuiElement} element location is changed (related to frames in `player.gui.screen`).
1371
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_location_changed Online documentation}
1417
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_location_changed Online documentation}
1372
1418
  */
1373
1419
  interface OnGuiLocationChangedEvent extends EventData {
1374
1420
  /**
@@ -1390,7 +1436,7 @@ declare module "factorio:runtime" {
1390
1436
  }
1391
1437
  /**
1392
1438
  * Called when the player opens a GUI.
1393
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_opened Online documentation}
1439
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_opened Online documentation}
1394
1440
  */
1395
1441
  interface OnGuiOpenedEvent extends EventData {
1396
1442
  /**
@@ -1444,7 +1490,7 @@ declare module "factorio:runtime" {
1444
1490
  }
1445
1491
  /**
1446
1492
  * Called when {@link LuaGuiElement} selected tab is changed (related to tabbed-panes).
1447
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_selected_tab_changed Online documentation}
1493
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_selected_tab_changed Online documentation}
1448
1494
  */
1449
1495
  interface OnGuiSelectedTabChangedEvent extends EventData {
1450
1496
  /**
@@ -1466,7 +1512,7 @@ declare module "factorio:runtime" {
1466
1512
  }
1467
1513
  /**
1468
1514
  * Called when {@link LuaGuiElement} selection state is changed (related to drop-downs and listboxes).
1469
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_selection_state_changed Online documentation}
1515
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_selection_state_changed Online documentation}
1470
1516
  */
1471
1517
  interface OnGuiSelectionStateChangedEvent extends EventData {
1472
1518
  /**
@@ -1488,7 +1534,7 @@ declare module "factorio:runtime" {
1488
1534
  }
1489
1535
  /**
1490
1536
  * Called when {@link LuaGuiElement} switch state is changed (related to switches).
1491
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_switch_state_changed Online documentation}
1537
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_switch_state_changed Online documentation}
1492
1538
  */
1493
1539
  interface OnGuiSwitchStateChangedEvent extends EventData {
1494
1540
  /**
@@ -1510,7 +1556,7 @@ declare module "factorio:runtime" {
1510
1556
  }
1511
1557
  /**
1512
1558
  * Called when {@link LuaGuiElement} text is changed by the player.
1513
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_text_changed Online documentation}
1559
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_text_changed Online documentation}
1514
1560
  */
1515
1561
  interface OnGuiTextChangedEvent extends EventData {
1516
1562
  /**
@@ -1536,7 +1582,7 @@ declare module "factorio:runtime" {
1536
1582
  }
1537
1583
  /**
1538
1584
  * Called when {@link LuaGuiElement} slider value is changed (related to the slider element).
1539
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_gui_value_changed Online documentation}
1585
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_gui_value_changed Online documentation}
1540
1586
  */
1541
1587
  interface OnGuiValueChangedEvent extends EventData {
1542
1588
  /**
@@ -1558,7 +1604,7 @@ declare module "factorio:runtime" {
1558
1604
  }
1559
1605
  /**
1560
1606
  * Called when a land mine is armed.
1561
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_land_mine_armed Online documentation}
1607
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_land_mine_armed Online documentation}
1562
1608
  */
1563
1609
  interface OnLandMineArmedEvent extends EventData {
1564
1610
  readonly mine: LuaEntity
@@ -1573,7 +1619,7 @@ declare module "factorio:runtime" {
1573
1619
  }
1574
1620
  /**
1575
1621
  * Called when a custom {@link import("factorio:prototype").ShortcutPrototype Lua shortcut} is pressed.
1576
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_lua_shortcut Online documentation}
1622
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_lua_shortcut Online documentation}
1577
1623
  */
1578
1624
  interface OnLuaShortcutEvent extends EventData {
1579
1625
  readonly player_index: PlayerIndex
@@ -1594,7 +1640,7 @@ declare module "factorio:runtime" {
1594
1640
  * Called when an entity is marked for deconstruction with the Deconstruction planner or via script.
1595
1641
  *
1596
1642
  * Event filter: [LuaEntityMarkedForDeconstructionEventFilter](LuaEntityMarkedForDeconstructionEventFilter]
1597
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_marked_for_deconstruction Online documentation}
1643
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_marked_for_deconstruction Online documentation}
1598
1644
  */
1599
1645
  interface OnMarkedForDeconstructionEvent extends EventData {
1600
1646
  readonly entity: LuaEntity
@@ -1612,7 +1658,7 @@ declare module "factorio:runtime" {
1612
1658
  * Called when an entity is marked for upgrade with the upgrade planner or via script.
1613
1659
  *
1614
1660
  * Event filter: [LuaEntityMarkedForUpgradeEventFilter](LuaEntityMarkedForUpgradeEventFilter]
1615
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_marked_for_upgrade Online documentation}
1661
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_marked_for_upgrade Online documentation}
1616
1662
  */
1617
1663
  interface OnMarkedForUpgradeEvent extends EventData {
1618
1664
  readonly player_index?: PlayerIndex
@@ -1641,7 +1687,7 @@ declare module "factorio:runtime" {
1641
1687
  }
1642
1688
  /**
1643
1689
  * Called after a player purchases some offer from a `market` entity.
1644
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_market_item_purchased Online documentation}
1690
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_market_item_purchased Online documentation}
1645
1691
  */
1646
1692
  interface OnMarketItemPurchasedEvent extends EventData {
1647
1693
  /**
@@ -1671,7 +1717,7 @@ declare module "factorio:runtime" {
1671
1717
  }
1672
1718
  /**
1673
1719
  * Called when the player uses the 'Open item GUI' control on an item defined with the 'mod-openable' flag
1674
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_mod_item_opened Online documentation}
1720
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_mod_item_opened Online documentation}
1675
1721
  */
1676
1722
  interface OnModItemOpenedEvent extends EventData {
1677
1723
  /**
@@ -1697,7 +1743,7 @@ declare module "factorio:runtime" {
1697
1743
  }
1698
1744
  /**
1699
1745
  * Called when {@link LuaGameScript#is_multiplayer LuaGameScript::is_multiplayer} changes to true. May also be raised when it was already true but a game was loaded from a save file and with hosting.
1700
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_multiplayer_init Online documentation}
1746
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_multiplayer_init Online documentation}
1701
1747
  */
1702
1748
  interface OnMultiplayerInitEvent extends EventData {
1703
1749
  /**
@@ -1709,11 +1755,26 @@ declare module "factorio:runtime" {
1709
1755
  */
1710
1756
  readonly tick: MapTick
1711
1757
  }
1758
+ /**
1759
+ * Called when value of {@link LuaSurface#daytime LuaSurface::daytime} wraps around to be in `[0, 1)` range.
1760
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_next_day_started Online documentation}
1761
+ */
1762
+ interface OnNextDayStartedEvent extends EventData {
1763
+ readonly surface: LuaSurface
1764
+ /**
1765
+ * Identifier of the event.
1766
+ */
1767
+ readonly name: typeof defines.events.on_next_day_started
1768
+ /**
1769
+ * Tick the event was generated.
1770
+ */
1771
+ readonly tick: MapTick
1772
+ }
1712
1773
  /**
1713
1774
  * Called after an object is destroyed which was registered with {@link LuaBootstrap#register_on_object_destroyed LuaBootstrap::register_on_object_destroyed} previously.
1714
1775
  *
1715
1776
  * Depending on when a given object is destroyed, this event will be fired at the end of the current tick or at the end of the next tick. The event's timing is independent of the in-world object being destroyed.
1716
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_object_destroyed Online documentation}
1777
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_object_destroyed Online documentation}
1717
1778
  */
1718
1779
  interface OnObjectDestroyedEvent extends EventData {
1719
1780
  /**
@@ -1739,7 +1800,7 @@ declare module "factorio:runtime" {
1739
1800
  }
1740
1801
  /**
1741
1802
  * Called directly after a permission group is added.
1742
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_permission_group_added Online documentation}
1803
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_permission_group_added Online documentation}
1743
1804
  */
1744
1805
  interface OnPermissionGroupAddedEvent extends EventData {
1745
1806
  /**
@@ -1761,7 +1822,7 @@ declare module "factorio:runtime" {
1761
1822
  }
1762
1823
  /**
1763
1824
  * Called directly after a permission group is deleted.
1764
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_permission_group_deleted Online documentation}
1825
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_permission_group_deleted Online documentation}
1765
1826
  */
1766
1827
  interface OnPermissionGroupDeletedEvent extends EventData {
1767
1828
  /**
@@ -1787,7 +1848,7 @@ declare module "factorio:runtime" {
1787
1848
  }
1788
1849
  /**
1789
1850
  * Called directly after a permission group is edited in some way.
1790
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_permission_group_edited Online documentation}
1851
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_permission_group_edited Online documentation}
1791
1852
  */
1792
1853
  interface OnPermissionGroupEditedEvent extends EventData {
1793
1854
  /**
@@ -1802,13 +1863,7 @@ declare module "factorio:runtime" {
1802
1863
  * The edit type.
1803
1864
  */
1804
1865
  readonly type:
1805
- | "add-permission"
1806
- | "remove-permission"
1807
- | "enable-all"
1808
- | "disable-all"
1809
- | "add-player"
1810
- | "remove-player"
1811
- | "rename"
1866
+ "add-permission" | "remove-permission" | "enable-all" | "disable-all" | "add-player" | "remove-player" | "rename"
1812
1867
  /**
1813
1868
  * The action when the `type` is `"add-permission"` or `"remove-permission"`.
1814
1869
  */
@@ -1836,7 +1891,7 @@ declare module "factorio:runtime" {
1836
1891
  }
1837
1892
  /**
1838
1893
  * Called directly after a permission string is imported.
1839
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_permission_string_imported Online documentation}
1894
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_permission_string_imported Online documentation}
1840
1895
  */
1841
1896
  interface OnPermissionStringImportedEvent extends EventData {
1842
1897
  /**
@@ -1854,7 +1909,7 @@ declare module "factorio:runtime" {
1854
1909
  }
1855
1910
  /**
1856
1911
  * Called when a player picks up an item.
1857
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_picked_up_item Online documentation}
1912
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_picked_up_item Online documentation}
1858
1913
  */
1859
1914
  interface OnPickedUpItemEvent extends EventData {
1860
1915
  readonly item_stack: ItemWithQualityCount
@@ -1870,7 +1925,7 @@ declare module "factorio:runtime" {
1870
1925
  }
1871
1926
  /**
1872
1927
  * Called after a player alt-reverse-selects an area with a selection-tool item.
1873
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_alt_reverse_selected_area Online documentation}
1928
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_alt_reverse_selected_area Online documentation}
1874
1929
  */
1875
1930
  interface OnPlayerAltReverseSelectedAreaEvent extends EventData {
1876
1931
  /**
@@ -1908,7 +1963,7 @@ declare module "factorio:runtime" {
1908
1963
  }
1909
1964
  /**
1910
1965
  * Called after a player alt-selects an area with a selection-tool item.
1911
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_alt_selected_area Online documentation}
1966
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_alt_selected_area Online documentation}
1912
1967
  */
1913
1968
  interface OnPlayerAltSelectedAreaEvent extends EventData {
1914
1969
  /**
@@ -1950,7 +2005,7 @@ declare module "factorio:runtime" {
1950
2005
  }
1951
2006
  /**
1952
2007
  * Called after a players ammo inventory changed in some way.
1953
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_ammo_inventory_changed Online documentation}
2008
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_ammo_inventory_changed Online documentation}
1954
2009
  */
1955
2010
  interface OnPlayerAmmoInventoryChangedEvent extends EventData {
1956
2011
  readonly player_index: PlayerIndex
@@ -1965,7 +2020,7 @@ declare module "factorio:runtime" {
1965
2020
  }
1966
2021
  /**
1967
2022
  * Called after a players armor inventory changed in some way.
1968
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_armor_inventory_changed Online documentation}
2023
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_armor_inventory_changed Online documentation}
1969
2024
  */
1970
2025
  interface OnPlayerArmorInventoryChangedEvent extends EventData {
1971
2026
  readonly player_index: PlayerIndex
@@ -1980,7 +2035,7 @@ declare module "factorio:runtime" {
1980
2035
  }
1981
2036
  /**
1982
2037
  * Called when a player is banned.
1983
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_banned Online documentation}
2038
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_banned Online documentation}
1984
2039
  */
1985
2040
  interface OnPlayerBannedEvent extends EventData {
1986
2041
  /**
@@ -2010,7 +2065,7 @@ declare module "factorio:runtime" {
2010
2065
  }
2011
2066
  /**
2012
2067
  * Called after a player builds tiles.
2013
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_built_tile Online documentation}
2068
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_built_tile Online documentation}
2014
2069
  */
2015
2070
  interface OnPlayerBuiltTileEvent extends EventData {
2016
2071
  readonly player_index: PlayerIndex
@@ -2049,7 +2104,7 @@ declare module "factorio:runtime" {
2049
2104
  }
2050
2105
  /**
2051
2106
  * Called when a player cancels crafting.
2052
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_cancelled_crafting Online documentation}
2107
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_cancelled_crafting Online documentation}
2053
2108
  */
2054
2109
  interface OnPlayerCancelledCraftingEvent extends EventData {
2055
2110
  /**
@@ -2079,7 +2134,7 @@ declare module "factorio:runtime" {
2079
2134
  }
2080
2135
  /**
2081
2136
  * Called after a player changes forces.
2082
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_changed_force Online documentation}
2137
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_changed_force Online documentation}
2083
2138
  */
2084
2139
  interface OnPlayerChangedForceEvent extends EventData {
2085
2140
  /**
@@ -2101,7 +2156,7 @@ declare module "factorio:runtime" {
2101
2156
  }
2102
2157
  /**
2103
2158
  * Called when the tile position a player is located at changes.
2104
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_changed_position Online documentation}
2159
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_changed_position Online documentation}
2105
2160
  */
2106
2161
  interface OnPlayerChangedPositionEvent extends EventData {
2107
2162
  /**
@@ -2119,7 +2174,7 @@ declare module "factorio:runtime" {
2119
2174
  }
2120
2175
  /**
2121
2176
  * Called after a player changes surfaces.
2122
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_changed_surface Online documentation}
2177
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_changed_surface Online documentation}
2123
2178
  */
2124
2179
  interface OnPlayerChangedSurfaceEvent extends EventData {
2125
2180
  /**
@@ -2141,7 +2196,7 @@ declare module "factorio:runtime" {
2141
2196
  }
2142
2197
  /**
2143
2198
  * Called when cheat mode is disabled on a player.
2144
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_cheat_mode_disabled Online documentation}
2199
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_cheat_mode_disabled Online documentation}
2145
2200
  */
2146
2201
  interface OnPlayerCheatModeDisabledEvent extends EventData {
2147
2202
  /**
@@ -2159,7 +2214,7 @@ declare module "factorio:runtime" {
2159
2214
  }
2160
2215
  /**
2161
2216
  * Called when cheat mode is enabled on a player.
2162
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_cheat_mode_enabled Online documentation}
2217
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_cheat_mode_enabled Online documentation}
2163
2218
  */
2164
2219
  interface OnPlayerCheatModeEnabledEvent extends EventData {
2165
2220
  /**
@@ -2177,7 +2232,7 @@ declare module "factorio:runtime" {
2177
2232
  }
2178
2233
  /**
2179
2234
  * Called when a player clicks a gps tag
2180
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_clicked_gps_tag Online documentation}
2235
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_clicked_gps_tag Online documentation}
2181
2236
  */
2182
2237
  interface OnPlayerClickedGpsTagEvent extends EventData {
2183
2238
  /**
@@ -2203,7 +2258,7 @@ declare module "factorio:runtime" {
2203
2258
  }
2204
2259
  /**
2205
2260
  * Called after a player's color changes.
2206
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_color_changed Online documentation}
2261
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_color_changed Online documentation}
2207
2262
  */
2208
2263
  interface OnPlayerColorChangedEvent extends EventData {
2209
2264
  /**
@@ -2233,7 +2288,7 @@ declare module "factorio:runtime" {
2233
2288
  }
2234
2289
  /**
2235
2290
  * Called when a player clicks the "confirm" button in the configure Blueprint GUI.
2236
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_configured_blueprint Online documentation}
2291
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_configured_blueprint Online documentation}
2237
2292
  */
2238
2293
  interface OnPlayerConfiguredBlueprintEvent extends EventData {
2239
2294
  /**
@@ -2251,7 +2306,7 @@ declare module "factorio:runtime" {
2251
2306
  }
2252
2307
  /**
2253
2308
  * Called after a player changes controller types.
2254
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_controller_changed Online documentation}
2309
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_controller_changed Online documentation}
2255
2310
  */
2256
2311
  interface OnPlayerControllerChangedEvent extends EventData {
2257
2312
  /**
@@ -2273,7 +2328,7 @@ declare module "factorio:runtime" {
2273
2328
  }
2274
2329
  /**
2275
2330
  * Called when the player finishes crafting an item. This event fires just before the results are inserted into the player's inventory, not when the crafting is queued (see {@link OnPrePlayerCraftedItemEvent on_pre_player_crafted_item}).
2276
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_crafted_item Online documentation}
2331
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_crafted_item Online documentation}
2277
2332
  */
2278
2333
  interface OnPlayerCraftedItemEvent extends EventData {
2279
2334
  /**
@@ -2299,7 +2354,7 @@ declare module "factorio:runtime" {
2299
2354
  }
2300
2355
  /**
2301
2356
  * Called after the player was created.
2302
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_created Online documentation}
2357
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_created Online documentation}
2303
2358
  */
2304
2359
  interface OnPlayerCreatedEvent extends EventData {
2305
2360
  readonly player_index: PlayerIndex
@@ -2316,7 +2371,7 @@ declare module "factorio:runtime" {
2316
2371
  * Called after a player's {@link LuaControl#cursor_stack cursor stack} changed in some way.
2317
2372
  *
2318
2373
  * This is fired in the same tick that the change happens, but not instantly.
2319
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_cursor_stack_changed Online documentation}
2374
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_cursor_stack_changed Online documentation}
2320
2375
  */
2321
2376
  interface OnPlayerCursorStackChangedEvent extends EventData {
2322
2377
  readonly player_index: PlayerIndex
@@ -2331,7 +2386,7 @@ declare module "factorio:runtime" {
2331
2386
  }
2332
2387
  /**
2333
2388
  * Called when a player selects an area with a deconstruction planner.
2334
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_deconstructed_area Online documentation}
2389
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_deconstructed_area Online documentation}
2335
2390
  */
2336
2391
  interface OnPlayerDeconstructedAreaEvent extends EventData {
2337
2392
  /**
@@ -2366,6 +2421,7 @@ declare module "factorio:runtime" {
2366
2421
  * If normal selection or alt selection was used.
2367
2422
  */
2368
2423
  readonly alt: boolean
2424
+ readonly selection_mode: defines.selection_mode
2369
2425
  /**
2370
2426
  * Identifier of the event.
2371
2427
  */
@@ -2377,7 +2433,7 @@ declare module "factorio:runtime" {
2377
2433
  }
2378
2434
  /**
2379
2435
  * Called when a player is demoted.
2380
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_demoted Online documentation}
2436
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_demoted Online documentation}
2381
2437
  */
2382
2438
  interface OnPlayerDemotedEvent extends EventData {
2383
2439
  /**
@@ -2395,7 +2451,7 @@ declare module "factorio:runtime" {
2395
2451
  }
2396
2452
  /**
2397
2453
  * Called after a player dies.
2398
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_died Online documentation}
2454
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_died Online documentation}
2399
2455
  */
2400
2456
  interface OnPlayerDiedEvent extends EventData {
2401
2457
  readonly player_index: PlayerIndex
@@ -2411,7 +2467,7 @@ declare module "factorio:runtime" {
2411
2467
  }
2412
2468
  /**
2413
2469
  * Called when the display density scale changes for a given player. The display density scale is the scale value automatically applied based on the player's display DPI. This is only relevant on platforms that support high-density displays.
2414
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_display_density_scale_changed Online documentation}
2470
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_display_density_scale_changed Online documentation}
2415
2471
  */
2416
2472
  interface OnPlayerDisplayDensityScaleChangedEvent extends EventData {
2417
2473
  /**
@@ -2433,7 +2489,7 @@ declare module "factorio:runtime" {
2433
2489
  }
2434
2490
  /**
2435
2491
  * Called when the display resolution changes for a given player.
2436
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_display_resolution_changed Online documentation}
2492
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_display_resolution_changed Online documentation}
2437
2493
  */
2438
2494
  interface OnPlayerDisplayResolutionChangedEvent extends EventData {
2439
2495
  /**
@@ -2455,7 +2511,7 @@ declare module "factorio:runtime" {
2455
2511
  }
2456
2512
  /**
2457
2513
  * Called when the display scale changes for a given player.
2458
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_display_scale_changed Online documentation}
2514
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_display_scale_changed Online documentation}
2459
2515
  */
2460
2516
  interface OnPlayerDisplayScaleChangedEvent extends EventData {
2461
2517
  /**
@@ -2479,7 +2535,7 @@ declare module "factorio:runtime" {
2479
2535
  * Called when the player's driving state has changed, meaning a player has either entered or left a vehicle.
2480
2536
  *
2481
2537
  * This event is not raised when the player is ejected from a vehicle due to it being destroyed.
2482
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_driving_changed_state Online documentation}
2538
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_driving_changed_state Online documentation}
2483
2539
  */
2484
2540
  interface OnPlayerDrivingChangedStateEvent extends EventData {
2485
2541
  readonly player_index: PlayerIndex
@@ -2498,7 +2554,7 @@ declare module "factorio:runtime" {
2498
2554
  }
2499
2555
  /**
2500
2556
  * Called when a player drops an item on the ground.
2501
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_dropped_item Online documentation}
2557
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_dropped_item Online documentation}
2502
2558
  */
2503
2559
  interface OnPlayerDroppedItemEvent extends EventData {
2504
2560
  readonly player_index: PlayerIndex
@@ -2517,7 +2573,7 @@ declare module "factorio:runtime" {
2517
2573
  }
2518
2574
  /**
2519
2575
  * Called when a player drops a single item into an entity.
2520
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_dropped_item_into_entity Online documentation}
2576
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_dropped_item_into_entity Online documentation}
2521
2577
  */
2522
2578
  interface OnPlayerDroppedItemIntoEntityEvent extends EventData {
2523
2579
  readonly player_index: PlayerIndex
@@ -2536,7 +2592,7 @@ declare module "factorio:runtime" {
2536
2592
  }
2537
2593
  /**
2538
2594
  * Called when a player fast-transfers something to or from an entity.
2539
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_fast_transferred Online documentation}
2595
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_fast_transferred Online documentation}
2540
2596
  */
2541
2597
  interface OnPlayerFastTransferredEvent extends EventData {
2542
2598
  /**
@@ -2568,7 +2624,7 @@ declare module "factorio:runtime" {
2568
2624
  * Called when the player flips an entity. This event is only fired when the entity actually changes its orientation or mirroring, so it won't be triggered when pressing the flip keys on an entity that can't be flipped.
2569
2625
  *
2570
2626
  * This event reflects a change in the {@link LuaEntity#mirroring LuaEntity::mirroring} property.
2571
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_flipped_entity Online documentation}
2627
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_flipped_entity Online documentation}
2572
2628
  */
2573
2629
  interface OnPlayerFlippedEntityEvent extends EventData {
2574
2630
  /**
@@ -2591,7 +2647,7 @@ declare module "factorio:runtime" {
2591
2647
  }
2592
2648
  /**
2593
2649
  * Called after player flushed fluid
2594
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_flushed_fluid Online documentation}
2650
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_flushed_fluid Online documentation}
2595
2651
  */
2596
2652
  interface OnPlayerFlushedFluidEvent extends EventData {
2597
2653
  /**
@@ -2625,7 +2681,7 @@ declare module "factorio:runtime" {
2625
2681
  }
2626
2682
  /**
2627
2683
  * Called after a players gun inventory changed in some way.
2628
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_gun_inventory_changed Online documentation}
2684
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_gun_inventory_changed Online documentation}
2629
2685
  */
2630
2686
  interface OnPlayerGunInventoryChangedEvent extends EventData {
2631
2687
  readonly player_index: PlayerIndex
@@ -2640,7 +2696,7 @@ declare module "factorio:runtime" {
2640
2696
  }
2641
2697
  /**
2642
2698
  * Called when a player's input method changes. See {@link LuaPlayer#input_method LuaPlayer::input_method}.
2643
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_input_method_changed Online documentation}
2699
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_input_method_changed Online documentation}
2644
2700
  */
2645
2701
  interface OnPlayerInputMethodChangedEvent extends EventData {
2646
2702
  /**
@@ -2658,7 +2714,7 @@ declare module "factorio:runtime" {
2658
2714
  }
2659
2715
  /**
2660
2716
  * Called after a player joins the game. This is not called when loading a save file in singleplayer, as the player doesn't actually leave the game, and the save is just on pause until they rejoin.
2661
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_joined_game Online documentation}
2717
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_joined_game Online documentation}
2662
2718
  */
2663
2719
  interface OnPlayerJoinedGameEvent extends EventData {
2664
2720
  readonly player_index: PlayerIndex
@@ -2673,7 +2729,7 @@ declare module "factorio:runtime" {
2673
2729
  }
2674
2730
  /**
2675
2731
  * Called when a player is kicked.
2676
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_kicked Online documentation}
2732
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_kicked Online documentation}
2677
2733
  */
2678
2734
  interface OnPlayerKickedEvent extends EventData {
2679
2735
  /**
@@ -2699,7 +2755,7 @@ declare module "factorio:runtime" {
2699
2755
  }
2700
2756
  /**
2701
2757
  * Called after a player leaves the game. This is not called when closing a save file in singleplayer, as the player doesn't actually leave the game, and the save is just on pause until they rejoin.
2702
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_left_game Online documentation}
2758
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_left_game Online documentation}
2703
2759
  */
2704
2760
  interface OnPlayerLeftGameEvent extends EventData {
2705
2761
  readonly player_index: PlayerIndex
@@ -2715,7 +2771,7 @@ declare module "factorio:runtime" {
2715
2771
  }
2716
2772
  /**
2717
2773
  * Called when a player's active locale changes. See {@link LuaPlayer#locale LuaPlayer::locale}.
2718
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_locale_changed Online documentation}
2774
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_locale_changed Online documentation}
2719
2775
  */
2720
2776
  interface OnPlayerLocaleChangedEvent extends EventData {
2721
2777
  /**
@@ -2737,7 +2793,7 @@ declare module "factorio:runtime" {
2737
2793
  }
2738
2794
  /**
2739
2795
  * Called after a players main inventory changed in some way.
2740
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_main_inventory_changed Online documentation}
2796
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_main_inventory_changed Online documentation}
2741
2797
  */
2742
2798
  interface OnPlayerMainInventoryChangedEvent extends EventData {
2743
2799
  readonly player_index: PlayerIndex
@@ -2758,7 +2814,7 @@ declare module "factorio:runtime" {
2758
2814
  * The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding as more items are transferred into it.
2759
2815
  *
2760
2816
  * Event filter: [LuaPlayerMinedEntityEventFilter](LuaPlayerMinedEntityEventFilter]
2761
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_mined_entity Online documentation}
2817
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_mined_entity Online documentation}
2762
2818
  */
2763
2819
  interface OnPlayerMinedEntityEvent extends EventData {
2764
2820
  /**
@@ -2784,7 +2840,7 @@ declare module "factorio:runtime" {
2784
2840
  }
2785
2841
  /**
2786
2842
  * Called when the player mines something.
2787
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_mined_item Online documentation}
2843
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_mined_item Online documentation}
2788
2844
  */
2789
2845
  interface OnPlayerMinedItemEvent extends EventData {
2790
2846
  /**
@@ -2803,7 +2859,7 @@ declare module "factorio:runtime" {
2803
2859
  }
2804
2860
  /**
2805
2861
  * Called after a player mines tiles.
2806
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_mined_tile Online documentation}
2862
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_mined_tile Online documentation}
2807
2863
  */
2808
2864
  interface OnPlayerMinedTileEvent extends EventData {
2809
2865
  readonly player_index: PlayerIndex
@@ -2826,7 +2882,7 @@ declare module "factorio:runtime" {
2826
2882
  }
2827
2883
  /**
2828
2884
  * Called when a player's current music track (ambient sound) changes. This includes when the music track finishes playing.
2829
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_music_changed Online documentation}
2885
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_music_changed Online documentation}
2830
2886
  */
2831
2887
  interface OnPlayerMusicChangedEvent extends EventData {
2832
2888
  /**
@@ -2844,7 +2900,7 @@ declare module "factorio:runtime" {
2844
2900
  }
2845
2901
  /**
2846
2902
  * Called when a player is muted.
2847
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_muted Online documentation}
2903
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_muted Online documentation}
2848
2904
  */
2849
2905
  interface OnPlayerMutedEvent extends EventData {
2850
2906
  /**
@@ -2862,7 +2918,7 @@ declare module "factorio:runtime" {
2862
2918
  }
2863
2919
  /**
2864
2920
  * Called when a player invokes the "smart pipette" over an entity.
2865
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_pipette Online documentation}
2921
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_pipette Online documentation}
2866
2922
  */
2867
2923
  interface OnPlayerPipetteEvent extends EventData {
2868
2924
  /**
@@ -2892,7 +2948,7 @@ declare module "factorio:runtime" {
2892
2948
  }
2893
2949
  /**
2894
2950
  * Called after the player puts equipment in an equipment grid
2895
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_placed_equipment Online documentation}
2951
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_placed_equipment Online documentation}
2896
2952
  */
2897
2953
  interface OnPlayerPlacedEquipmentEvent extends EventData {
2898
2954
  readonly player_index: PlayerIndex
@@ -2915,7 +2971,7 @@ declare module "factorio:runtime" {
2915
2971
  }
2916
2972
  /**
2917
2973
  * Called when a player is promoted.
2918
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_promoted Online documentation}
2974
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_promoted Online documentation}
2919
2975
  */
2920
2976
  interface OnPlayerPromotedEvent extends EventData {
2921
2977
  /**
@@ -2933,7 +2989,7 @@ declare module "factorio:runtime" {
2933
2989
  }
2934
2990
  /**
2935
2991
  * Called when a player is removed (deleted) from the game. This is markedly different from a player temporarily {@link OnPlayerLeftGameEvent leaving} the game, and instead behaves like the player never existed in the save file.
2936
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_removed Online documentation}
2992
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_removed Online documentation}
2937
2993
  */
2938
2994
  interface OnPlayerRemovedEvent extends EventData {
2939
2995
  /**
@@ -2951,7 +3007,7 @@ declare module "factorio:runtime" {
2951
3007
  }
2952
3008
  /**
2953
3009
  * Called after the player removes equipment from an equipment grid
2954
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_removed_equipment Online documentation}
3010
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_removed_equipment Online documentation}
2955
3011
  */
2956
3012
  interface OnPlayerRemovedEquipmentEvent extends EventData {
2957
3013
  readonly player_index: PlayerIndex
@@ -2984,7 +3040,7 @@ declare module "factorio:runtime" {
2984
3040
  * Called when a player repairs an entity.
2985
3041
  *
2986
3042
  * Event filter: [LuaPlayerRepairedEntityEventFilter](LuaPlayerRepairedEntityEventFilter]
2987
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_repaired_entity Online documentation}
3043
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_repaired_entity Online documentation}
2988
3044
  */
2989
3045
  interface OnPlayerRepairedEntityEvent extends EventData {
2990
3046
  readonly player_index: PlayerIndex
@@ -3000,7 +3056,7 @@ declare module "factorio:runtime" {
3000
3056
  }
3001
3057
  /**
3002
3058
  * Called after a player respawns.
3003
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_respawned Online documentation}
3059
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_respawned Online documentation}
3004
3060
  */
3005
3061
  interface OnPlayerRespawnedEvent extends EventData {
3006
3062
  readonly player_index: PlayerIndex
@@ -3019,7 +3075,7 @@ declare module "factorio:runtime" {
3019
3075
  }
3020
3076
  /**
3021
3077
  * Called after a player reverse-selects an area with a selection-tool item.
3022
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_reverse_selected_area Online documentation}
3078
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_reverse_selected_area Online documentation}
3023
3079
  */
3024
3080
  interface OnPlayerReverseSelectedAreaEvent extends EventData {
3025
3081
  /**
@@ -3059,7 +3115,7 @@ declare module "factorio:runtime" {
3059
3115
  * Called when the player rotates an entity. This event is only fired when the entity actually changes its orientation -- pressing the rotate key on an entity that can't be rotated won't fire this event.
3060
3116
  *
3061
3117
  * Entities being flipped will not fire this event, even if the flip involves rotating. See {@link OnPlayerFlippedEntityEvent on_player_flipped_entity}.
3062
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_rotated_entity Online documentation}
3118
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_rotated_entity Online documentation}
3063
3119
  */
3064
3120
  interface OnPlayerRotatedEntityEvent extends EventData {
3065
3121
  /**
@@ -3083,7 +3139,7 @@ declare module "factorio:runtime" {
3083
3139
  }
3084
3140
  /**
3085
3141
  * Called after a player selects an area with a selection-tool item.
3086
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_selected_area Online documentation}
3142
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_selected_area Online documentation}
3087
3143
  */
3088
3144
  interface OnPlayerSelectedAreaEvent extends EventData {
3089
3145
  /**
@@ -3125,7 +3181,7 @@ declare module "factorio:runtime" {
3125
3181
  }
3126
3182
  /**
3127
3183
  * Called when a player sets a quickbar slot to anything (new value, or set to empty).
3128
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_set_quick_bar_slot Online documentation}
3184
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_set_quick_bar_slot Online documentation}
3129
3185
  */
3130
3186
  interface OnPlayerSetQuickBarSlotEvent extends EventData {
3131
3187
  readonly player_index: PlayerIndex
@@ -3140,7 +3196,7 @@ declare module "factorio:runtime" {
3140
3196
  }
3141
3197
  /**
3142
3198
  * Called when a player selects an area with a blueprint.
3143
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_setup_blueprint Online documentation}
3199
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_setup_blueprint Online documentation}
3144
3200
  */
3145
3201
  interface OnPlayerSetupBlueprintEvent extends EventData {
3146
3202
  /**
@@ -3188,9 +3244,51 @@ declare module "factorio:runtime" {
3188
3244
  */
3189
3245
  readonly tick: MapTick
3190
3246
  }
3247
+ /**
3248
+ * Called after a player super-forced-selects an area with a selection-tool item.
3249
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_super_forced_selected_area Online documentation}
3250
+ */
3251
+ interface OnPlayerSuperForcedSelectedAreaEvent extends EventData {
3252
+ /**
3253
+ * The player doing the selection.
3254
+ */
3255
+ readonly player_index: PlayerIndex
3256
+ /**
3257
+ * The surface selected.
3258
+ */
3259
+ readonly surface: LuaSurface
3260
+ /**
3261
+ * The area selected.
3262
+ */
3263
+ readonly area: BoundingBox
3264
+ /**
3265
+ * The item used to select the area.
3266
+ */
3267
+ readonly item: string
3268
+ /**
3269
+ * The item quality used to select the area.
3270
+ */
3271
+ readonly quality: string
3272
+ /**
3273
+ * The entities selected.
3274
+ */
3275
+ readonly entities: LuaEntity[]
3276
+ /**
3277
+ * The tiles selected.
3278
+ */
3279
+ readonly tiles: LuaTile[]
3280
+ /**
3281
+ * Identifier of the event.
3282
+ */
3283
+ readonly name: typeof defines.events.on_player_super_forced_selected_area
3284
+ /**
3285
+ * Tick the event was generated.
3286
+ */
3287
+ readonly tick: MapTick
3288
+ }
3191
3289
  /**
3192
3290
  * Called when a player toggles alt mode, also known as "show entity info".
3193
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_toggled_alt_mode Online documentation}
3291
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_toggled_alt_mode Online documentation}
3194
3292
  */
3195
3293
  interface OnPlayerToggledAltModeEvent extends EventData {
3196
3294
  readonly player_index: PlayerIndex
@@ -3209,7 +3307,7 @@ declare module "factorio:runtime" {
3209
3307
  }
3210
3308
  /**
3211
3309
  * Called when a player toggles the map editor on or off.
3212
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_toggled_map_editor Online documentation}
3310
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_toggled_map_editor Online documentation}
3213
3311
  */
3214
3312
  interface OnPlayerToggledMapEditorEvent extends EventData {
3215
3313
  readonly player_index: PlayerIndex
@@ -3224,7 +3322,7 @@ declare module "factorio:runtime" {
3224
3322
  }
3225
3323
  /**
3226
3324
  * Called after a players trash inventory changed in some way.
3227
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_trash_inventory_changed Online documentation}
3325
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_trash_inventory_changed Online documentation}
3228
3326
  */
3229
3327
  interface OnPlayerTrashInventoryChangedEvent extends EventData {
3230
3328
  readonly player_index: PlayerIndex
@@ -3239,7 +3337,7 @@ declare module "factorio:runtime" {
3239
3337
  }
3240
3338
  /**
3241
3339
  * Called when a player is un-banned.
3242
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_unbanned Online documentation}
3340
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_unbanned Online documentation}
3243
3341
  */
3244
3342
  interface OnPlayerUnbannedEvent extends EventData {
3245
3343
  /**
@@ -3269,7 +3367,7 @@ declare module "factorio:runtime" {
3269
3367
  }
3270
3368
  /**
3271
3369
  * Called when a player is unmuted.
3272
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_unmuted Online documentation}
3370
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_unmuted Online documentation}
3273
3371
  */
3274
3372
  interface OnPlayerUnmutedEvent extends EventData {
3275
3373
  /**
@@ -3287,7 +3385,7 @@ declare module "factorio:runtime" {
3287
3385
  }
3288
3386
  /**
3289
3387
  * Called when a player uses a capsule that results in some game action.
3290
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_used_capsule Online documentation}
3388
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_used_capsule Online documentation}
3291
3389
  */
3292
3390
  interface OnPlayerUsedCapsuleEvent extends EventData {
3293
3391
  /**
@@ -3317,7 +3415,7 @@ declare module "factorio:runtime" {
3317
3415
  }
3318
3416
  /**
3319
3417
  * Called when a player uses spidertron remote to send all selected units to a given position
3320
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_player_used_spidertron_remote Online documentation}
3418
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_player_used_spidertron_remote Online documentation}
3321
3419
  */
3322
3420
  interface OnPlayerUsedSpidertronRemoteEvent extends EventData {
3323
3421
  /**
@@ -3341,7 +3439,7 @@ declare module "factorio:runtime" {
3341
3439
  * Called after an entity dies.
3342
3440
  *
3343
3441
  * Event filter: [LuaPostEntityDiedEventFilter](LuaPostEntityDiedEventFilter]
3344
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_post_entity_died Online documentation}
3442
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_post_entity_died Online documentation}
3345
3443
  */
3346
3444
  interface OnPostEntityDiedEvent extends EventData {
3347
3445
  /**
@@ -3393,7 +3491,7 @@ declare module "factorio:runtime" {
3393
3491
  * Called after a segmented unit dies.
3394
3492
  *
3395
3493
  * Event filter: [LuaPostSegmentedUnitDiedEventFilter](LuaPostSegmentedUnitDiedEventFilter]
3396
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_post_segmented_unit_died Online documentation}
3494
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_post_segmented_unit_died Online documentation}
3397
3495
  */
3398
3496
  interface OnPostSegmentedUnitDiedEvent extends EventData {
3399
3497
  /**
@@ -3435,7 +3533,7 @@ declare module "factorio:runtime" {
3435
3533
  }
3436
3534
  /**
3437
3535
  * Called when players uses an item to build something. Called before {@link OnBuiltEntityEvent on_built_entity}.
3438
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_build Online documentation}
3536
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_build Online documentation}
3439
3537
  */
3440
3538
  interface OnPreBuildEvent extends EventData {
3441
3539
  /**
@@ -3481,7 +3579,7 @@ declare module "factorio:runtime" {
3481
3579
  }
3482
3580
  /**
3483
3581
  * Called before one or more chunks are deleted using {@link LuaSurface#delete_chunk LuaSurface::delete_chunk}.
3484
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_chunk_deleted Online documentation}
3582
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_chunk_deleted Online documentation}
3485
3583
  */
3486
3584
  interface OnPreChunkDeletedEvent extends EventData {
3487
3585
  readonly surface_index: SurfaceIndex
@@ -3500,7 +3598,7 @@ declare module "factorio:runtime" {
3500
3598
  }
3501
3599
  /**
3502
3600
  * Called before entity copy-paste is done.
3503
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_entity_settings_pasted Online documentation}
3601
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_entity_settings_pasted Online documentation}
3504
3602
  */
3505
3603
  interface OnPreEntitySettingsPastedEvent extends EventData {
3506
3604
  readonly player_index: PlayerIndex
@@ -3527,7 +3625,7 @@ declare module "factorio:runtime" {
3527
3625
  * Also called for item request proxies before they are destroyed as a result of being marked for deconstruction.
3528
3626
  *
3529
3627
  * Event filter: [LuaPreGhostDeconstructedEventFilter](LuaPreGhostDeconstructedEventFilter]
3530
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_ghost_deconstructed Online documentation}
3628
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_ghost_deconstructed Online documentation}
3531
3629
  */
3532
3630
  interface OnPreGhostDeconstructedEvent extends EventData {
3533
3631
  /**
@@ -3548,7 +3646,7 @@ declare module "factorio:runtime" {
3548
3646
  * Called before a ghost entity is upgraded.
3549
3647
  *
3550
3648
  * Event filter: [LuaPreGhostUpgradedEventFilter](LuaPreGhostUpgradedEventFilter]
3551
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_ghost_upgraded Online documentation}
3649
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_ghost_upgraded Online documentation}
3552
3650
  */
3553
3651
  interface OnPreGhostUpgradedEvent extends EventData {
3554
3652
  /**
@@ -3569,7 +3667,7 @@ declare module "factorio:runtime" {
3569
3667
  }
3570
3668
  /**
3571
3669
  * Called directly before a permission group is deleted.
3572
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_permission_group_deleted Online documentation}
3670
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_permission_group_deleted Online documentation}
3573
3671
  */
3574
3672
  interface OnPrePermissionGroupDeletedEvent extends EventData {
3575
3673
  /**
@@ -3591,7 +3689,7 @@ declare module "factorio:runtime" {
3591
3689
  }
3592
3690
  /**
3593
3691
  * Called directly before a permission string is imported.
3594
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_permission_string_imported Online documentation}
3692
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_permission_string_imported Online documentation}
3595
3693
  */
3596
3694
  interface OnPrePermissionStringImportedEvent extends EventData {
3597
3695
  /**
@@ -3609,7 +3707,7 @@ declare module "factorio:runtime" {
3609
3707
  }
3610
3708
  /**
3611
3709
  * Called when a player queues something to be crafted.
3612
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_player_crafted_item Online documentation}
3710
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_player_crafted_item Online documentation}
3613
3711
  */
3614
3712
  interface OnPrePlayerCraftedItemEvent extends EventData {
3615
3713
  /**
@@ -3639,7 +3737,7 @@ declare module "factorio:runtime" {
3639
3737
  }
3640
3738
  /**
3641
3739
  * Called before a players dies.
3642
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_player_died Online documentation}
3740
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_player_died Online documentation}
3643
3741
  */
3644
3742
  interface OnPrePlayerDiedEvent extends EventData {
3645
3743
  readonly player_index: PlayerIndex
@@ -3655,7 +3753,7 @@ declare module "factorio:runtime" {
3655
3753
  }
3656
3754
  /**
3657
3755
  * Called before a player leaves the game.
3658
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_player_left_game Online documentation}
3756
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_player_left_game Online documentation}
3659
3757
  */
3660
3758
  interface OnPrePlayerLeftGameEvent extends EventData {
3661
3759
  readonly player_index: PlayerIndex
@@ -3673,7 +3771,7 @@ declare module "factorio:runtime" {
3673
3771
  * Called when the player completes a mining action, but before the entity is potentially removed from the map. This is called even if the entity does not end up being removed.
3674
3772
  *
3675
3773
  * Event filter: [LuaPrePlayerMinedEntityEventFilter](LuaPrePlayerMinedEntityEventFilter]
3676
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_player_mined_item Online documentation}
3774
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_player_mined_item Online documentation}
3677
3775
  */
3678
3776
  interface OnPrePlayerMinedItemEvent extends EventData {
3679
3777
  /**
@@ -3692,7 +3790,7 @@ declare module "factorio:runtime" {
3692
3790
  }
3693
3791
  /**
3694
3792
  * Called before a player is removed (deleted) from the game. This is markedly different from a player temporarily {@link OnPlayerLeftGameEvent leaving} the game, and instead behaves like the player never existed in the save file.
3695
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_player_removed Online documentation}
3793
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_player_removed Online documentation}
3696
3794
  */
3697
3795
  interface OnPrePlayerRemovedEvent extends EventData {
3698
3796
  /**
@@ -3710,7 +3808,7 @@ declare module "factorio:runtime" {
3710
3808
  }
3711
3809
  /**
3712
3810
  * Called before a player toggles the map editor on or off.
3713
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_player_toggled_map_editor Online documentation}
3811
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_player_toggled_map_editor Online documentation}
3714
3812
  */
3715
3813
  interface OnPrePlayerToggledMapEditorEvent extends EventData {
3716
3814
  readonly player_index: PlayerIndex
@@ -3725,7 +3823,7 @@ declare module "factorio:runtime" {
3725
3823
  }
3726
3824
  /**
3727
3825
  * Called directly before a robot explodes cliffs.
3728
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_robot_exploded_cliff Online documentation}
3826
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_robot_exploded_cliff Online documentation}
3729
3827
  */
3730
3828
  interface OnPreRobotExplodedCliffEvent extends EventData {
3731
3829
  readonly robot: LuaEntity
@@ -3749,7 +3847,7 @@ declare module "factorio:runtime" {
3749
3847
  }
3750
3848
  /**
3751
3849
  * Called just before the scenario finishes.
3752
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_scenario_finished Online documentation}
3850
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_scenario_finished Online documentation}
3753
3851
  */
3754
3852
  interface OnPreScenarioFinishedEvent extends EventData {
3755
3853
  /**
@@ -3767,7 +3865,7 @@ declare module "factorio:runtime" {
3767
3865
  }
3768
3866
  /**
3769
3867
  * Called just before a script inventory is resized.
3770
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_script_inventory_resized Online documentation}
3868
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_script_inventory_resized Online documentation}
3771
3869
  */
3772
3870
  interface OnPreScriptInventoryResizedEvent extends EventData {
3773
3871
  /**
@@ -3798,7 +3896,7 @@ declare module "factorio:runtime" {
3798
3896
  }
3799
3897
  /**
3800
3898
  * Called just before a surface is cleared (all entities removed and all chunks deleted).
3801
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_surface_cleared Online documentation}
3899
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_surface_cleared Online documentation}
3802
3900
  */
3803
3901
  interface OnPreSurfaceClearedEvent extends EventData {
3804
3902
  readonly surface_index: SurfaceIndex
@@ -3813,7 +3911,7 @@ declare module "factorio:runtime" {
3813
3911
  }
3814
3912
  /**
3815
3913
  * Called just before a surface is deleted.
3816
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_pre_surface_deleted Online documentation}
3914
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_pre_surface_deleted Online documentation}
3817
3915
  */
3818
3916
  interface OnPreSurfaceDeletedEvent extends EventData {
3819
3917
  readonly surface_index: SurfaceIndex
@@ -3828,7 +3926,7 @@ declare module "factorio:runtime" {
3828
3926
  }
3829
3927
  /**
3830
3928
  * Called when the player triggers "redo".
3831
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_redo_applied Online documentation}
3929
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_redo_applied Online documentation}
3832
3930
  */
3833
3931
  interface OnRedoAppliedEvent extends EventData {
3834
3932
  /**
@@ -3850,7 +3948,7 @@ declare module "factorio:runtime" {
3850
3948
  }
3851
3949
  /**
3852
3950
  * Called when research is cancelled.
3853
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_research_cancelled Online documentation}
3951
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_research_cancelled Online documentation}
3854
3952
  */
3855
3953
  interface OnResearchCancelledEvent extends EventData {
3856
3954
  /**
@@ -3876,7 +3974,7 @@ declare module "factorio:runtime" {
3876
3974
  }
3877
3975
  /**
3878
3976
  * Called when a research finishes.
3879
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_research_finished Online documentation}
3977
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_research_finished Online documentation}
3880
3978
  */
3881
3979
  interface OnResearchFinishedEvent extends EventData {
3882
3980
  /**
@@ -3898,7 +3996,7 @@ declare module "factorio:runtime" {
3898
3996
  }
3899
3997
  /**
3900
3998
  * Called when research is moved forwards or backwards in the research queue.
3901
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_research_moved Online documentation}
3999
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_research_moved Online documentation}
3902
4000
  */
3903
4001
  interface OnResearchMovedEvent extends EventData {
3904
4002
  /**
@@ -3920,7 +4018,7 @@ declare module "factorio:runtime" {
3920
4018
  }
3921
4019
  /**
3922
4020
  * Called when research is queued.
3923
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_research_queued Online documentation}
4021
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_research_queued Online documentation}
3924
4022
  */
3925
4023
  interface OnResearchQueuedEvent extends EventData {
3926
4024
  /**
@@ -3946,7 +4044,7 @@ declare module "factorio:runtime" {
3946
4044
  }
3947
4045
  /**
3948
4046
  * Called when a research is reversed (unresearched).
3949
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_research_reversed Online documentation}
4047
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_research_reversed Online documentation}
3950
4048
  */
3951
4049
  interface OnResearchReversedEvent extends EventData {
3952
4050
  /**
@@ -3968,7 +4066,7 @@ declare module "factorio:runtime" {
3968
4066
  }
3969
4067
  /**
3970
4068
  * Called when a technology research starts.
3971
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_research_started Online documentation}
4069
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_research_started Online documentation}
3972
4070
  */
3973
4071
  interface OnResearchStartedEvent extends EventData {
3974
4072
  /**
@@ -3987,7 +4085,7 @@ declare module "factorio:runtime" {
3987
4085
  }
3988
4086
  /**
3989
4087
  * Called when a resource entity reaches 0 or its minimum yield for infinite resources.
3990
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_resource_depleted Online documentation}
4088
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_resource_depleted Online documentation}
3991
4089
  */
3992
4090
  interface OnResourceDepletedEvent extends EventData {
3993
4091
  readonly entity: LuaEntity
@@ -4004,7 +4102,7 @@ declare module "factorio:runtime" {
4004
4102
  * Called when a construction robot builds an entity.
4005
4103
  *
4006
4104
  * Event filter: [LuaRobotBuiltEntityEventFilter](LuaRobotBuiltEntityEventFilter]
4007
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_robot_built_entity Online documentation}
4105
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_robot_built_entity Online documentation}
4008
4106
  */
4009
4107
  interface OnRobotBuiltEntityEvent extends EventData {
4010
4108
  /**
@@ -4034,7 +4132,7 @@ declare module "factorio:runtime" {
4034
4132
  }
4035
4133
  /**
4036
4134
  * Called after a robot builds tiles.
4037
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_robot_built_tile Online documentation}
4135
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_robot_built_tile Online documentation}
4038
4136
  */
4039
4137
  interface OnRobotBuiltTileEvent extends EventData {
4040
4138
  /**
@@ -4076,7 +4174,7 @@ declare module "factorio:runtime" {
4076
4174
  }
4077
4175
  /**
4078
4176
  * Called directly after a robot explodes cliffs.
4079
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_robot_exploded_cliff Online documentation}
4177
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_robot_exploded_cliff Online documentation}
4080
4178
  */
4081
4179
  interface OnRobotExplodedCliffEvent extends EventData {
4082
4180
  readonly robot: LuaEntity
@@ -4099,7 +4197,7 @@ declare module "factorio:runtime" {
4099
4197
  }
4100
4198
  /**
4101
4199
  * Called when a robot mines an entity.
4102
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_robot_mined Online documentation}
4200
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_robot_mined Online documentation}
4103
4201
  */
4104
4202
  interface OnRobotMinedEvent extends EventData {
4105
4203
  /**
@@ -4127,7 +4225,7 @@ declare module "factorio:runtime" {
4127
4225
  * The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding as more items are transferred into it.
4128
4226
  *
4129
4227
  * Event filter: [LuaRobotMinedEntityEventFilter](LuaRobotMinedEntityEventFilter]
4130
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_robot_mined_entity Online documentation}
4228
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_robot_mined_entity Online documentation}
4131
4229
  */
4132
4230
  interface OnRobotMinedEntityEvent extends EventData {
4133
4231
  /**
@@ -4153,7 +4251,7 @@ declare module "factorio:runtime" {
4153
4251
  }
4154
4252
  /**
4155
4253
  * Called after a robot mines tiles.
4156
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_robot_mined_tile Online documentation}
4254
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_robot_mined_tile Online documentation}
4157
4255
  */
4158
4256
  interface OnRobotMinedTileEvent extends EventData {
4159
4257
  /**
@@ -4181,7 +4279,7 @@ declare module "factorio:runtime" {
4181
4279
  * Called before a robot mines an entity.
4182
4280
  *
4183
4281
  * Event filter: [LuaPreRobotMinedEntityEventFilter](LuaPreRobotMinedEntityEventFilter]
4184
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_robot_pre_mined Online documentation}
4282
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_robot_pre_mined Online documentation}
4185
4283
  */
4186
4284
  interface OnRobotPreMinedEvent extends EventData {
4187
4285
  /**
@@ -4203,7 +4301,7 @@ declare module "factorio:runtime" {
4203
4301
  }
4204
4302
  /**
4205
4303
  * Called when a rocket silo is ordered to be launched.
4206
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_rocket_launch_ordered Online documentation}
4304
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_rocket_launch_ordered Online documentation}
4207
4305
  */
4208
4306
  interface OnRocketLaunchOrderedEvent extends EventData {
4209
4307
  readonly rocket: LuaEntity
@@ -4223,7 +4321,7 @@ declare module "factorio:runtime" {
4223
4321
  }
4224
4322
  /**
4225
4323
  * Called when a rocket finishes ascending. (Triggers listening for finished rocket launch past 2.0 have been moved to 'on_cargo_pod_finished_ascending' as rocket and cargo pod are two separate entities)
4226
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_rocket_launched Online documentation}
4324
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_rocket_launched Online documentation}
4227
4325
  */
4228
4326
  interface OnRocketLaunchedEvent extends EventData {
4229
4327
  readonly rocket: LuaEntity
@@ -4239,7 +4337,7 @@ declare module "factorio:runtime" {
4239
4337
  }
4240
4338
  /**
4241
4339
  * Called when a runtime mod setting is changed by a player.
4242
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_runtime_mod_setting_changed Online documentation}
4340
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_runtime_mod_setting_changed Online documentation}
4243
4341
  */
4244
4342
  interface OnRuntimeModSettingChangedEvent extends EventData {
4245
4343
  /**
@@ -4262,7 +4360,7 @@ declare module "factorio:runtime" {
4262
4360
  }
4263
4361
  /**
4264
4362
  * Called just after a script inventory is resized.
4265
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_script_inventory_resized Online documentation}
4363
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_script_inventory_resized Online documentation}
4266
4364
  */
4267
4365
  interface OnScriptInventoryResizedEvent extends EventData {
4268
4366
  /**
@@ -4297,7 +4395,7 @@ declare module "factorio:runtime" {
4297
4395
  }
4298
4396
  /**
4299
4397
  * Called when a {@link LuaSurface#request_path LuaSurface::request_path} call completes.
4300
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_script_path_request_finished Online documentation}
4398
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_script_path_request_finished Online documentation}
4301
4399
  */
4302
4400
  interface OnScriptPathRequestFinishedEvent extends EventData {
4303
4401
  /**
@@ -4323,7 +4421,7 @@ declare module "factorio:runtime" {
4323
4421
  }
4324
4422
  /**
4325
4423
  * Called when a script trigger effect is triggered.
4326
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_script_trigger_effect Online documentation}
4424
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_script_trigger_effect Online documentation}
4327
4425
  */
4328
4426
  interface OnScriptTriggerEffectEvent extends EventData {
4329
4427
  /**
@@ -4356,7 +4454,7 @@ declare module "factorio:runtime" {
4356
4454
  * Called when an entity of type `radar` finishes scanning a sector.
4357
4455
  *
4358
4456
  * Event filter: [LuaSectorScannedEventFilter](LuaSectorScannedEventFilter]
4359
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_sector_scanned Online documentation}
4457
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_sector_scanned Online documentation}
4360
4458
  */
4361
4459
  interface OnSectorScannedEvent extends EventData {
4362
4460
  /**
@@ -4382,7 +4480,7 @@ declare module "factorio:runtime" {
4382
4480
  }
4383
4481
  /**
4384
4482
  * Called when an individual segment of a SegmentedUnit is created.
4385
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_segment_entity_created Online documentation}
4483
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_segment_entity_created Online documentation}
4386
4484
  */
4387
4485
  interface OnSegmentEntityCreatedEvent extends EventData {
4388
4486
  readonly entity: LuaEntity
@@ -4399,7 +4497,7 @@ declare module "factorio:runtime" {
4399
4497
  * Called when a segmented unit is created for any reason.
4400
4498
  *
4401
4499
  * Event filter: [LuaSegmentedUnitCreatedEventFilter](LuaSegmentedUnitCreatedEventFilter]
4402
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_segmented_unit_created Online documentation}
4500
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_segmented_unit_created Online documentation}
4403
4501
  */
4404
4502
  interface OnSegmentedUnitCreatedEvent extends EventData {
4405
4503
  /**
@@ -4427,7 +4525,7 @@ declare module "factorio:runtime" {
4427
4525
  * Called when a segmented unit is damaged. This is not called when a segmented unit's health is set directly by another mod.
4428
4526
  *
4429
4527
  * Event filter: [LuaSegmentedUnitDamagedEventFilter](LuaSegmentedUnitDamagedEventFilter]
4430
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_segmented_unit_damaged Online documentation}
4528
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_segmented_unit_damaged Online documentation}
4431
4529
  */
4432
4530
  interface OnSegmentedUnitDamagedEvent extends EventData {
4433
4531
  readonly segmented_unit: LuaSegmentedUnit
@@ -4469,7 +4567,7 @@ declare module "factorio:runtime" {
4469
4567
  * Called when a segmented unit dies.
4470
4568
  *
4471
4569
  * Event filter: [LuaSegmentedUnitDiedEventFilter](LuaSegmentedUnitDiedEventFilter]
4472
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_segmented_unit_died Online documentation}
4570
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_segmented_unit_died Online documentation}
4473
4571
  */
4474
4572
  interface OnSegmentedUnitDiedEvent extends EventData {
4475
4573
  /**
@@ -4499,7 +4597,7 @@ declare module "factorio:runtime" {
4499
4597
  }
4500
4598
  /**
4501
4599
  * Called after the selected entity changes for a given player.
4502
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_selected_entity_changed Online documentation}
4600
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_selected_entity_changed Online documentation}
4503
4601
  */
4504
4602
  interface OnSelectedEntityChangedEvent extends EventData {
4505
4603
  /**
@@ -4521,7 +4619,7 @@ declare module "factorio:runtime" {
4521
4619
  }
4522
4620
  /**
4523
4621
  * Called when {@link LuaGameScript#is_multiplayer LuaGameScript::is_multiplayer} changes to false. May also be raised when it was already false but a game was loaded from a save file without hosting.
4524
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_singleplayer_init Online documentation}
4622
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_singleplayer_init Online documentation}
4525
4623
  */
4526
4624
  interface OnSingleplayerInitEvent extends EventData {
4527
4625
  /**
@@ -4537,7 +4635,7 @@ declare module "factorio:runtime" {
4537
4635
  * Called when a space platform builds an entity.
4538
4636
  *
4539
4637
  * Event filter: [LuaPlatformBuiltEntityEventFilter](LuaPlatformBuiltEntityEventFilter]
4540
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_space_platform_built_entity Online documentation}
4638
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_space_platform_built_entity Online documentation}
4541
4639
  */
4542
4640
  interface OnSpacePlatformBuiltEntityEvent extends EventData {
4543
4641
  /**
@@ -4567,7 +4665,7 @@ declare module "factorio:runtime" {
4567
4665
  }
4568
4666
  /**
4569
4667
  * Called after a space platform builds tiles.
4570
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_space_platform_built_tile Online documentation}
4668
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_space_platform_built_tile Online documentation}
4571
4669
  */
4572
4670
  interface OnSpacePlatformBuiltTileEvent extends EventData {
4573
4671
  /**
@@ -4609,7 +4707,7 @@ declare module "factorio:runtime" {
4609
4707
  }
4610
4708
  /**
4611
4709
  * Called when a space platform changes state
4612
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_space_platform_changed_state Online documentation}
4710
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_space_platform_changed_state Online documentation}
4613
4711
  */
4614
4712
  interface OnSpacePlatformChangedStateEvent extends EventData {
4615
4713
  readonly platform: LuaSpacePlatform
@@ -4631,7 +4729,7 @@ declare module "factorio:runtime" {
4631
4729
  * The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding as more items are transferred into it.
4632
4730
  *
4633
4731
  * Event filter: [LuaPlatformMinedEntityEventFilter](LuaPlatformMinedEntityEventFilter]
4634
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_space_platform_mined_entity Online documentation}
4732
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_space_platform_mined_entity Online documentation}
4635
4733
  */
4636
4734
  interface OnSpacePlatformMinedEntityEvent extends EventData {
4637
4735
  /**
@@ -4657,7 +4755,7 @@ declare module "factorio:runtime" {
4657
4755
  }
4658
4756
  /**
4659
4757
  * Called when a platform mines an entity.
4660
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_space_platform_mined_item Online documentation}
4758
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_space_platform_mined_item Online documentation}
4661
4759
  */
4662
4760
  interface OnSpacePlatformMinedItemEvent extends EventData {
4663
4761
  /**
@@ -4679,7 +4777,7 @@ declare module "factorio:runtime" {
4679
4777
  }
4680
4778
  /**
4681
4779
  * Called after a platform mines tiles.
4682
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_space_platform_mined_tile Online documentation}
4780
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_space_platform_mined_tile Online documentation}
4683
4781
  */
4684
4782
  interface OnSpacePlatformMinedTileEvent extends EventData {
4685
4783
  /**
@@ -4707,7 +4805,7 @@ declare module "factorio:runtime" {
4707
4805
  * Called before a platform mines an entity.
4708
4806
  *
4709
4807
  * Event filter: [LuaPrePlatformMinedEntityEventFilter](LuaPrePlatformMinedEntityEventFilter]
4710
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_space_platform_pre_mined Online documentation}
4808
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_space_platform_pre_mined Online documentation}
4711
4809
  */
4712
4810
  interface OnSpacePlatformPreMinedEvent extends EventData {
4713
4811
  /**
@@ -4729,7 +4827,7 @@ declare module "factorio:runtime" {
4729
4827
  }
4730
4828
  /**
4731
4829
  * Called when a spider finishes moving to its autopilot position.
4732
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_spider_command_completed Online documentation}
4830
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_spider_command_completed Online documentation}
4733
4831
  */
4734
4832
  interface OnSpiderCommandCompletedEvent extends EventData {
4735
4833
  /**
@@ -4747,7 +4845,7 @@ declare module "factorio:runtime" {
4747
4845
  }
4748
4846
  /**
4749
4847
  * Called when a translation request generated through {@link LuaPlayer#request_translation LuaPlayer::request_translation} or {@link LuaPlayer#request_translations LuaPlayer::request_translations} has been completed.
4750
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_string_translated Online documentation}
4848
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_string_translated Online documentation}
4751
4849
  */
4752
4850
  interface OnStringTranslatedEvent extends EventData {
4753
4851
  /**
@@ -4781,7 +4879,7 @@ declare module "factorio:runtime" {
4781
4879
  }
4782
4880
  /**
4783
4881
  * Called just after a surface is cleared (all entities removed and all chunks deleted).
4784
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_surface_cleared Online documentation}
4882
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_surface_cleared Online documentation}
4785
4883
  */
4786
4884
  interface OnSurfaceClearedEvent extends EventData {
4787
4885
  readonly surface_index: SurfaceIndex
@@ -4798,7 +4896,7 @@ declare module "factorio:runtime" {
4798
4896
  * Called when a surface is created.
4799
4897
  *
4800
4898
  * This is not called when the default surface is created as it will always exist.
4801
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_surface_created Online documentation}
4899
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_surface_created Online documentation}
4802
4900
  */
4803
4901
  interface OnSurfaceCreatedEvent extends EventData {
4804
4902
  readonly surface_index: SurfaceIndex
@@ -4813,7 +4911,7 @@ declare module "factorio:runtime" {
4813
4911
  }
4814
4912
  /**
4815
4913
  * Called after a surface is deleted.
4816
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_surface_deleted Online documentation}
4914
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_surface_deleted Online documentation}
4817
4915
  */
4818
4916
  interface OnSurfaceDeletedEvent extends EventData {
4819
4917
  readonly surface_index: SurfaceIndex
@@ -4828,7 +4926,7 @@ declare module "factorio:runtime" {
4828
4926
  }
4829
4927
  /**
4830
4928
  * Called after a surface is imported via the map editor.
4831
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_surface_imported Online documentation}
4929
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_surface_imported Online documentation}
4832
4930
  */
4833
4931
  interface OnSurfaceImportedEvent extends EventData {
4834
4932
  readonly surface_index: SurfaceIndex
@@ -4847,7 +4945,7 @@ declare module "factorio:runtime" {
4847
4945
  }
4848
4946
  /**
4849
4947
  * Called when a surface is renamed.
4850
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_surface_renamed Online documentation}
4948
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_surface_renamed Online documentation}
4851
4949
  */
4852
4950
  interface OnSurfaceRenamedEvent extends EventData {
4853
4951
  readonly surface_index: SurfaceIndex
@@ -4864,7 +4962,7 @@ declare module "factorio:runtime" {
4864
4962
  }
4865
4963
  /**
4866
4964
  * Called when {@link LuaForce#reset_technology_effects LuaForce::reset_technology_effects} is finished.
4867
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_technology_effects_reset Online documentation}
4965
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_technology_effects_reset Online documentation}
4868
4966
  */
4869
4967
  interface OnTechnologyEffectsResetEvent extends EventData {
4870
4968
  readonly force: LuaForce
@@ -4879,7 +4977,7 @@ declare module "factorio:runtime" {
4879
4977
  }
4880
4978
  /**
4881
4979
  * Called when a territory is created for any reason.
4882
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_territory_created Online documentation}
4980
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_territory_created Online documentation}
4883
4981
  */
4884
4982
  interface OnTerritoryCreatedEvent extends EventData {
4885
4983
  /**
@@ -4901,7 +4999,7 @@ declare module "factorio:runtime" {
4901
4999
  }
4902
5000
  /**
4903
5001
  * Called when a territory is destroyed from a surface.
4904
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_territory_destroyed Online documentation}
5002
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_territory_destroyed Online documentation}
4905
5003
  */
4906
5004
  interface OnTerritoryDestroyedEvent extends EventData {
4907
5005
  /**
@@ -4919,7 +5017,7 @@ declare module "factorio:runtime" {
4919
5017
  }
4920
5018
  /**
4921
5019
  * It is fired once every tick. Since this event is fired every tick, its handler shouldn't include performance heavy code.
4922
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_tick Online documentation}
5020
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_tick Online documentation}
4923
5021
  */
4924
5022
  interface OnTickEvent extends EventData {
4925
5023
  /**
@@ -4937,7 +5035,7 @@ declare module "factorio:runtime" {
4937
5035
  * After this event any items in the buffer will be transferred into the tower as if they came from mining the entity.
4938
5036
  *
4939
5037
  * The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding as more items are transferred into it.
4940
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_tower_mined_plant Online documentation}
5038
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_tower_mined_plant Online documentation}
4941
5039
  */
4942
5040
  interface OnTowerMinedPlantEvent extends EventData {
4943
5041
  /**
@@ -4963,7 +5061,7 @@ declare module "factorio:runtime" {
4963
5061
  }
4964
5062
  /**
4965
5063
  * Called before an agricultural tower plants a seed.
4966
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_tower_planted_seed Online documentation}
5064
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_tower_planted_seed Online documentation}
4967
5065
  */
4968
5066
  interface OnTowerPlantedSeedEvent extends EventData {
4969
5067
  /**
@@ -4989,7 +5087,7 @@ declare module "factorio:runtime" {
4989
5087
  }
4990
5088
  /**
4991
5089
  * Called before an agricultural tower mines a plant.
4992
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_tower_pre_mined_plant Online documentation}
5090
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_tower_pre_mined_plant Online documentation}
4993
5091
  */
4994
5092
  interface OnTowerPreMinedPlantEvent extends EventData {
4995
5093
  /**
@@ -5011,7 +5109,7 @@ declare module "factorio:runtime" {
5011
5109
  }
5012
5110
  /**
5013
5111
  * Called when a train changes state (started to stopped and vice versa)
5014
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_train_changed_state Online documentation}
5112
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_train_changed_state Online documentation}
5015
5113
  */
5016
5114
  interface OnTrainChangedStateEvent extends EventData {
5017
5115
  readonly train: LuaTrain
@@ -5027,7 +5125,7 @@ declare module "factorio:runtime" {
5027
5125
  }
5028
5126
  /**
5029
5127
  * Called when a new train is created either through disconnecting/connecting an existing one or building a new one.
5030
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_train_created Online documentation}
5128
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_train_created Online documentation}
5031
5129
  */
5032
5130
  interface OnTrainCreatedEvent extends EventData {
5033
5131
  readonly train: LuaTrain
@@ -5050,7 +5148,7 @@ declare module "factorio:runtime" {
5050
5148
  }
5051
5149
  /**
5052
5150
  * Called when a trains schedule is changed either by the player or through script.
5053
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_train_schedule_changed Online documentation}
5151
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_train_schedule_changed Online documentation}
5054
5152
  */
5055
5153
  interface OnTrainScheduleChangedEvent extends EventData {
5056
5154
  readonly train: LuaTrain
@@ -5069,7 +5167,7 @@ declare module "factorio:runtime" {
5069
5167
  }
5070
5168
  /**
5071
5169
  * Called when an entity with a trigger prototype (such as capsules) create an entity AND that trigger prototype defined `trigger_created_entity=true`.
5072
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_trigger_created_entity Online documentation}
5170
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_trigger_created_entity Online documentation}
5073
5171
  */
5074
5172
  interface OnTriggerCreatedEntityEvent extends EventData {
5075
5173
  readonly entity: LuaEntity
@@ -5085,7 +5183,7 @@ declare module "factorio:runtime" {
5085
5183
  }
5086
5184
  /**
5087
5185
  * Called when an entity with a trigger prototype (such as capsules) fire an artillery projectile AND that trigger prototype defined `trigger_fired_artillery=true`.
5088
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_trigger_fired_artillery Online documentation}
5186
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_trigger_fired_artillery Online documentation}
5089
5187
  */
5090
5188
  interface OnTriggerFiredArtilleryEvent extends EventData {
5091
5189
  readonly entity: LuaEntity
@@ -5101,7 +5199,7 @@ declare module "factorio:runtime" {
5101
5199
  }
5102
5200
  /**
5103
5201
  * Called when new packets are processed by {@link LuaHelpers#recv_udp LuaHelpers::recv_udp}.
5104
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_udp_packet_received Online documentation}
5202
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_udp_packet_received Online documentation}
5105
5203
  */
5106
5204
  interface OnUdpPacketReceivedEvent extends EventData {
5107
5205
  /**
@@ -5127,7 +5225,7 @@ declare module "factorio:runtime" {
5127
5225
  }
5128
5226
  /**
5129
5227
  * Called when the player triggers "undo".
5130
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_undo_applied Online documentation}
5228
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_undo_applied Online documentation}
5131
5229
  */
5132
5230
  interface OnUndoAppliedEvent extends EventData {
5133
5231
  /**
@@ -5149,7 +5247,7 @@ declare module "factorio:runtime" {
5149
5247
  }
5150
5248
  /**
5151
5249
  * Called when a unit is added to a unit group.
5152
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_unit_added_to_group Online documentation}
5250
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_unit_added_to_group Online documentation}
5153
5251
  */
5154
5252
  interface OnUnitAddedToGroupEvent extends EventData {
5155
5253
  readonly unit: LuaEntity
@@ -5165,7 +5263,7 @@ declare module "factorio:runtime" {
5165
5263
  }
5166
5264
  /**
5167
5265
  * Called when a new unit group is created, before any members are added to it.
5168
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_unit_group_created Online documentation}
5266
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_unit_group_created Online documentation}
5169
5267
  */
5170
5268
  interface OnUnitGroupCreatedEvent extends EventData {
5171
5269
  readonly group: LuaCommandable
@@ -5180,7 +5278,7 @@ declare module "factorio:runtime" {
5180
5278
  }
5181
5279
  /**
5182
5280
  * Called when a unit group finishes gathering and starts executing its command.
5183
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_unit_group_finished_gathering Online documentation}
5281
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_unit_group_finished_gathering Online documentation}
5184
5282
  */
5185
5283
  interface OnUnitGroupFinishedGatheringEvent extends EventData {
5186
5284
  readonly group: LuaCommandable
@@ -5195,7 +5293,7 @@ declare module "factorio:runtime" {
5195
5293
  }
5196
5294
  /**
5197
5295
  * Called when a unit is removed from a unit group.
5198
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_unit_removed_from_group Online documentation}
5296
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_unit_removed_from_group Online documentation}
5199
5297
  */
5200
5298
  interface OnUnitRemovedFromGroupEvent extends EventData {
5201
5299
  readonly unit: LuaEntity
@@ -5211,7 +5309,7 @@ declare module "factorio:runtime" {
5211
5309
  }
5212
5310
  /**
5213
5311
  * Called when a worker (construction or logistic) robot expires through a lack of energy.
5214
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#on_worker_robot_expired Online documentation}
5312
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#on_worker_robot_expired Online documentation}
5215
5313
  */
5216
5314
  interface OnWorkerRobotExpiredEvent extends EventData {
5217
5315
  readonly robot: LuaEntity
@@ -5228,7 +5326,7 @@ declare module "factorio:runtime" {
5228
5326
  * A static event mods can use to tell other mods they built something by script. This event is only raised if a mod does so with {@link LuaBootstrap#raise_event LuaBootstrap::raise_event} or {@link LuaBootstrap#raise_script_built LuaBootstrap::raise_script_built}, or when `raise_built` is passed to {@link LuaSurface#create_entity LuaSurface::create_entity}.
5229
5327
  *
5230
5328
  * Event filter: [LuaScriptRaisedBuiltEventFilter](LuaScriptRaisedBuiltEventFilter]
5231
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#script_raised_built Online documentation}
5329
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#script_raised_built Online documentation}
5232
5330
  */
5233
5331
  interface ScriptRaisedBuiltEvent extends EventData {
5234
5332
  /**
@@ -5248,7 +5346,7 @@ declare module "factorio:runtime" {
5248
5346
  * A static event mods can use to tell other mods they destroyed something by script. This event is only raised if a mod does so with {@link LuaBootstrap#raise_event LuaBootstrap::raise_event} or {@link LuaBootstrap#raise_script_destroy LuaBootstrap::raise_script_destroy}, or when `raise_destroy` is passed to {@link LuaEntity#destroy LuaEntity::destroy}.
5249
5347
  *
5250
5348
  * Event filter: [LuaScriptRaisedDestroyEventFilter](LuaScriptRaisedDestroyEventFilter]
5251
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#script_raised_destroy Online documentation}
5349
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#script_raised_destroy Online documentation}
5252
5350
  */
5253
5351
  interface ScriptRaisedDestroyEvent extends EventData {
5254
5352
  /**
@@ -5268,7 +5366,7 @@ declare module "factorio:runtime" {
5268
5366
  * A static event that mods can use to tell other mods they destroyed a segmented unit by script. This event is only raised if a mod does so with {@link LuaBootstrap#raise_event LuaBootstrap::raise_event}, or {@link LuaBootstrap#raise_script_destroy_segmented_unit LuaBootstrap::raise_script_destroy_segmented_unit}, or when `raise_destroy` is passed to {@link LuaSegmentedUnit#destroy LuaSegmentedUnit::destroy}.
5269
5367
  *
5270
5368
  * Event filter: [LuaScriptRaisedDestroySegmentedUnitEventFilter](LuaScriptRaisedDestroySegmentedUnitEventFilter]
5271
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#script_raised_destroy_segmented_unit Online documentation}
5369
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#script_raised_destroy_segmented_unit Online documentation}
5272
5370
  */
5273
5371
  interface ScriptRaisedDestroySegmentedUnitEvent extends EventData {
5274
5372
  /**
@@ -5288,7 +5386,7 @@ declare module "factorio:runtime" {
5288
5386
  * A static event mods can use to tell other mods they revived something by script. This event is only raised if a mod does so with {@link LuaBootstrap#raise_event LuaBootstrap::raise_event} or {@link LuaBootstrap#raise_script_revive LuaBootstrap::raise_script_revive}, or when `raise_revive` is passed to {@link LuaEntity#revive LuaEntity::revive}.
5289
5387
  *
5290
5388
  * Event filter: [LuaScriptRaisedReviveEventFilter](LuaScriptRaisedReviveEventFilter]
5291
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#script_raised_revive Online documentation}
5389
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#script_raised_revive Online documentation}
5292
5390
  */
5293
5391
  interface ScriptRaisedReviveEvent extends EventData {
5294
5392
  /**
@@ -5310,7 +5408,7 @@ declare module "factorio:runtime" {
5310
5408
  }
5311
5409
  /**
5312
5410
  * A static event mods can use to tell other mods they changed tiles on a surface by script. This event is only raised if a mod does so with {@link LuaBootstrap#raise_event LuaBootstrap::raise_event} or {@link LuaBootstrap#raise_script_set_tiles LuaBootstrap::raise_script_set_tiles}, or when `raise_event` is passed to {@link LuaSurface#set_tiles LuaSurface::set_tiles}.
5313
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#script_raised_set_tiles Online documentation}
5411
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#script_raised_set_tiles Online documentation}
5314
5412
  */
5315
5413
  interface ScriptRaisedSetTilesEvent extends EventData {
5316
5414
  /**
@@ -5334,7 +5432,7 @@ declare module "factorio:runtime" {
5334
5432
  * A static event mods can use to tell other mods they teleported something by script. This event is only raised if a mod does so with {@link LuaBootstrap#raise_event LuaBootstrap::raise_event} or {@link LuaBootstrap#raise_script_teleported LuaBootstrap::raise_script_teleported}, or when `raise_teleported` is passed to {@link LuaControl#teleport LuaControl::teleport}.
5335
5433
  *
5336
5434
  * Event filter: [LuaScriptRaisedTeleportedEventFilter](LuaScriptRaisedTeleportedEventFilter]
5337
- * @see {@link https://lua-api.factorio.com/2.1.7/events.html#script_raised_teleported Online documentation}
5435
+ * @see {@link https://lua-api.factorio.com/2.1.21/events.html#script_raised_teleported Online documentation}
5338
5436
  */
5339
5437
  interface ScriptRaisedTeleportedEvent extends EventData {
5340
5438
  /**