typed-factorio 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -226,10 +226,11 @@ interface OldTileAndPosition {
226
226
  type Tags = Record<string, AnyBasic | undefined>
227
227
 
228
228
  /**
229
+ * **Note**
229
230
  *
231
+ * The vectors for all 5 position attributes are a table with `x` and `y` keys instead of an array.
230
232
  *
231
233
  * {@link https://lua-api.factorio.com/latest/Concepts.html#SmokeSource View documentation}
232
- * @remarks The vectors for all 5 position attributes are a table with `x` and `y` keys instead of an array.
233
234
  */
234
235
  interface SmokeSource {
235
236
  readonly name: string
@@ -472,10 +473,11 @@ interface DecorativeResult {
472
473
  }
473
474
 
474
475
  /**
476
+ * **Note**
475
477
  *
478
+ * Either `icon`, `text`, or both must be provided.
476
479
  *
477
480
  * {@link https://lua-api.factorio.com/latest/Concepts.html#ChartTagSpec View documentation}
478
- * @remarks Either `icon`, `text`, or both must be provided.
479
481
  */
480
482
  interface ChartTagSpec {
481
483
  readonly position: MapPosition
@@ -1593,8 +1595,11 @@ interface Resistance {
1593
1595
  * - `"high"`, `"big"`, `"good"` - equivalent to `sqrt(2)`
1594
1596
  * - `"very-high"`, `"very-big"`, `"very-good"` - equivalent to `2`
1595
1597
  *
1598
+ * **Note**
1599
+ *
1600
+ * The map generation algorithm officially supports the range of values the in-game map generation screen shows (specifically `0` and values from `1/6` to `6`). Values outside this range are not guaranteed to work as expected.
1601
+ *
1596
1602
  * {@link https://lua-api.factorio.com/latest/Concepts.html#MapGenSize View documentation}
1597
- * @remarks The map generation algorithm officially supports the range of values the in-game map generation screen shows (specifically `0` and values from `1/6` to `6`). Values outside this range are not guaranteed to work as expected.
1598
1603
  */
1599
1604
  type MapGenSize =
1600
1605
  | number
@@ -1980,10 +1985,11 @@ interface ConstantCombinatorParameters {
1980
1985
  }
1981
1986
 
1982
1987
  /**
1988
+ * **Note**
1983
1989
  *
1990
+ * While the API accepts both versions for `"less/greater than or equal to"` and `"not equal"`, it'll always return `"≥"`, `"≤"` or `"≠"` respectively when reading them back.
1984
1991
  *
1985
1992
  * {@link https://lua-api.factorio.com/latest/Concepts.html#ComparatorString View documentation}
1986
- * @remarks While the API accepts both versions for `"less/greater than or equal to"` and `"not equal"`, it'll always return `"≥"`, `"≤"` or `"≠"` respectively when reading them back.
1987
1993
  */
1988
1994
  type ComparatorString
1989
1995
  /**
@@ -2808,8 +2814,11 @@ interface ModuleEffects {
2808
2814
  /**
2809
2815
  * This is a set of flags given as a dictionary[{@link string} &rarr; {@link boolean}]. When a flag is set, it is present in the dictionary with the value `true`. Unset flags aren't present in the dictionary at all. So, the boolean value is meaningless and exists just for easy table lookup if a flag is set.
2810
2816
  *
2817
+ * **Note**
2818
+ *
2819
+ * By default, none of these flags are set.
2820
+ *
2811
2821
  * {@link https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags View documentation}
2812
- * @remarks By default, none of these flags are set.
2813
2822
  */
2814
2823
  interface EntityPrototypeFlags {
2815
2824
  /**
@@ -2914,8 +2923,11 @@ interface EntityPrototypeFlags {
2914
2923
  /**
2915
2924
  * This is a set of flags given as dictionary[{@link string} &rarr; {@link boolean}]. When a flag is set, it is present in the dictionary with the value `true`. Unset flags aren't present in the dictionary at all. So, the boolean value is meaningless and exists just for easy table lookup if a flag is set.
2916
2925
  *
2926
+ * **Note**
2927
+ *
2928
+ * By default, none of these flags are set.
2929
+ *
2917
2930
  * {@link https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags View documentation}
2918
- * @remarks By default, none of these flags are set.
2919
2931
  */
2920
2932
  interface ItemPrototypeFlags {
2921
2933
  /**
@@ -3309,10 +3321,11 @@ interface LogisticFilter {
3309
3321
  }
3310
3322
 
3311
3323
  /**
3324
+ * **Note**
3312
3325
  *
3326
+ * Runtime settings can be changed through console commands and by the mod that owns the settings by writing a new table to the ModSetting.
3313
3327
  *
3314
3328
  * {@link https://lua-api.factorio.com/latest/Concepts.html#ModSetting View documentation}
3315
- * @remarks Runtime settings can be changed through console commands and by the mod that owns the settings by writing a new table to the ModSetting.
3316
3329
  */
3317
3330
  interface ModSetting {
3318
3331
  /**
@@ -3742,8 +3755,11 @@ type SoundType = "game-effect" | "gui-effect" | "ambient" | "environment" | "wal
3742
3755
  * - {@link EquipmentPrototypeFilter} for type `"equipment"`
3743
3756
  * - {@link TechnologyPrototypeFilter} for type `"technology"`
3744
3757
  *
3758
+ * **Note**
3759
+ *
3760
+ * Filters are always used as an array of filters of a specific type. Every filter can only be used with its corresponding event, and different types of event filters can not be mixed.
3761
+ *
3745
3762
  * {@link https://lua-api.factorio.com/latest/Concepts.html#PrototypeFilter View documentation}
3746
- * @remarks Filters are always used as an array of filters of a specific type. Every filter can only be used with its corresponding event, and different types of event filters can not be mixed.
3747
3763
  */
3748
3764
  type PrototypeFilter =
3749
3765
  | ItemPrototypeFilter
@@ -88,8 +88,11 @@ interface OnAreaClonedEvent extends EventData {
88
88
  /**
89
89
  * Called when a biter migration builds a base.
90
90
  *
91
+ * **Note**
92
+ *
93
+ * This will be called multiple times for each migration, once for every biter that is sacrificed to build part of the new base.
94
+ *
91
95
  * {@link https://lua-api.factorio.com/latest/events.html#on_biter_base_built View documentation}
92
- * @remarks This will be called multiple times for each migration, once for every biter that is sacrificed to build part of the new base.
93
96
  */
94
97
  interface OnBiterBaseBuiltEvent extends EventData {
95
98
  /**
@@ -223,8 +226,11 @@ interface OnCancelledUpgradeEvent extends EventData {
223
226
  /**
224
227
  * Called when a character corpse expires due to timeout or all of the items being removed from it.
225
228
  *
229
+ * **Note**
230
+ *
231
+ * this is not called if the corpse is mined. See {@link defines.events.on_pre_player_mined_item} to detect that.
232
+ *
226
233
  * {@link https://lua-api.factorio.com/latest/events.html#on_character_corpse_expired View documentation}
227
- * @remarks this is not called if the corpse is mined. See {@link defines.events.on_pre_player_mined_item} to detect that.
228
234
  */
229
235
  interface OnCharacterCorpseExpiredEvent extends EventData {
230
236
  /**
@@ -397,8 +403,11 @@ interface OnCombatRobotExpiredEvent extends EventData {
397
403
  /**
398
404
  * Called when a message is sent to the in-game console, either by a player or through the server interface.
399
405
  *
406
+ * **Note**
407
+ *
408
+ * This event only fires for plain messages, not for any commands (including `/shout` or `/whisper`).
409
+ *
400
410
  * {@link https://lua-api.factorio.com/latest/events.html#on_console_chat View documentation}
401
- * @remarks This event only fires for plain messages, not for any commands (including `/shout` or `/whisper`).
402
411
  */
403
412
  interface OnConsoleChatEvent extends EventData {
404
413
  /**
@@ -472,8 +481,11 @@ interface OnCutsceneCancelledEvent extends EventData {
472
481
  *
473
482
  * This refers to an index in the table previously passed to set_controller which started the cutscene.
474
483
  *
484
+ * **Note**
485
+ *
486
+ * Due to implementation omission, waypoint_index is 0-based.
487
+ *
475
488
  * {@link https://lua-api.factorio.com/latest/events.html#on_cutscene_waypoint_reached View documentation}
476
- * @remarks Due to implementation omission, waypoint_index is 0-based.
477
489
  */
478
490
  interface OnCutsceneWaypointReachedEvent extends EventData {
479
491
  /**
@@ -497,8 +509,11 @@ interface OnCutsceneWaypointReachedEvent extends EventData {
497
509
  /**
498
510
  * Called when the map difficulty settings are changed.
499
511
  *
512
+ * **Note**
513
+ *
514
+ * It's not guaranteed that both settings are changed - just that at least one has been changed.
515
+ *
500
516
  * {@link https://lua-api.factorio.com/latest/events.html#on_difficulty_settings_changed View documentation}
501
- * @remarks It's not guaranteed that both settings are changed - just that at least one has been changed.
502
517
  */
503
518
  interface OnDifficultySettingsChangedEvent extends EventData {
504
519
  readonly old_recipe_difficulty: uint
@@ -534,8 +549,11 @@ interface OnEntityClonedEvent extends EventData {
534
549
  /**
535
550
  * Called when an entity is damaged. Can be filtered using {@link LuaEntityDamagedEventFilter}.
536
551
  *
552
+ * **Note**
553
+ *
554
+ * This is not called when an entities health is set directly by another mod.
555
+ *
537
556
  * {@link https://lua-api.factorio.com/latest/events.html#on_entity_damaged View documentation}
538
- * @remarks This is not called when an entities health is set directly by another mod.
539
557
  */
540
558
  interface OnEntityDamagedEvent extends EventData {
541
559
  readonly entity: LuaEntity
@@ -573,8 +591,11 @@ interface OnEntityDamagedEvent extends EventData {
573
591
  /**
574
592
  * Called after an entity is destroyed that has been registered with {@link LuaBootstrap#register_on_entity_destroyed LuaBootstrap::register_on_entity_destroyed}.
575
593
  *
594
+ * **Note**
595
+ *
596
+ * Depending on when a given entity is destroyed, this event will be fired at the end of the current tick or at the end of the next tick.
597
+ *
576
598
  * {@link https://lua-api.factorio.com/latest/events.html#on_entity_destroyed View documentation}
577
- * @remarks Depending on when a given entity is destroyed, this event will be fired at the end of the current tick or at the end of the next tick.
578
599
  */
579
600
  interface OnEntityDestroyedEvent extends EventData {
580
601
  /**
@@ -634,8 +655,11 @@ interface OnEntityDiedEvent extends EventData {
634
655
  /**
635
656
  * Called when one of an entity's personal logistic slots changes.
636
657
  *
658
+ * **Note**
659
+ *
660
+ * "Personal logistic slot" refers to a character or vehicle's personal request / auto-trash slots, not the request slots on logistic chests.
661
+ *
637
662
  * {@link https://lua-api.factorio.com/latest/events.html#on_entity_logistic_slot_changed View documentation}
638
- * @remarks "Personal logistic slot" refers to a character or vehicle's personal request / auto-trash slots, not the request slots on logistic chests.
639
663
  */
640
664
  interface OnEntityLogisticSlotChangedEvent extends EventData {
641
665
  /**
@@ -809,8 +833,11 @@ interface OnForceCeaseFireChangedEvent extends EventData {
809
833
  /**
810
834
  * Called when a new force is created using `game.create_force()`
811
835
  *
836
+ * **Note**
837
+ *
838
+ * This is not called when the default forces (`'player'`, `'enemy'`, `'neutral'`) are created as they will always exist.
839
+ *
812
840
  * {@link https://lua-api.factorio.com/latest/events.html#on_force_created View documentation}
813
- * @remarks This is not called when the default forces (`'player'`, `'enemy'`, `'neutral'`) are created as they will always exist.
814
841
  */
815
842
  interface OnForceCreatedEvent extends EventData {
816
843
  /**
@@ -875,8 +902,11 @@ interface OnForceResetEvent extends EventData {
875
902
  /**
876
903
  * Called after two forces have been merged using `game.merge_forces()`.
877
904
  *
905
+ * **Note**
906
+ *
907
+ * The source force is invalidated before this event is called and the name can be re-used in this event if desired.
908
+ *
878
909
  * {@link https://lua-api.factorio.com/latest/events.html#on_forces_merged View documentation}
879
- * @remarks The source force is invalidated before this event is called and the name can be re-used in this event if desired.
880
910
  */
881
911
  interface OnForcesMergedEvent extends EventData {
882
912
  /**
@@ -928,8 +958,11 @@ interface OnForcesMergingEvent extends EventData {
928
958
  /**
929
959
  * 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.
930
960
  *
961
+ * **Note**
962
+ *
963
+ * This event is not fired when the scenario is loaded via the map editor.
964
+ *
931
965
  * {@link https://lua-api.factorio.com/latest/events.html#on_game_created_from_scenario View documentation}
932
- * @remarks This event is not fired when the scenario is loaded via the map editor.
933
966
  */
934
967
  interface OnGameCreatedFromScenarioEvent extends EventData {
935
968
  /**
@@ -1011,8 +1044,11 @@ interface OnGuiClickEvent extends EventData {
1011
1044
  *
1012
1045
  * 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.
1013
1046
  *
1047
+ * **Note**
1048
+ *
1049
+ * 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.
1050
+ *
1014
1051
  * {@link https://lua-api.factorio.com/latest/events.html#on_gui_closed View documentation}
1015
- * @remarks 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.
1016
1052
  */
1017
1053
  interface OnGuiClosedEvent extends EventData {
1018
1054
  /**
@@ -1811,8 +1847,11 @@ interface OnPlayerChangedPositionEvent extends EventData {
1811
1847
  /**
1812
1848
  * Called after a player changes surfaces.
1813
1849
  *
1850
+ * **Note**
1851
+ *
1852
+ * In the instance a player is moved off a surface due to it being deleted this is not called.
1853
+ *
1814
1854
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_changed_surface View documentation}
1815
- * @remarks In the instance a player is moved off a surface due to it being deleted this is not called.
1816
1855
  */
1817
1856
  interface OnPlayerChangedSurfaceEvent extends EventData {
1818
1857
  /**
@@ -2335,8 +2374,11 @@ interface OnPlayerMainInventoryChangedEvent extends EventData {
2335
2374
  /**
2336
2375
  * Called after the results of an entity being mined are collected just before the entity is destroyed. After this event any items in the buffer will be transferred into the player as if they came from mining the entity. Can be filtered using {@link LuaPlayerMinedEntityEventFilter}.
2337
2376
  *
2377
+ * **Note**
2378
+ *
2379
+ * 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.
2380
+ *
2338
2381
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_mined_entity View documentation}
2339
- * @remarks 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.
2340
2382
  */
2341
2383
  interface OnPlayerMinedEntityEvent extends EventData {
2342
2384
  /**
@@ -3565,8 +3607,11 @@ interface OnRobotMinedEvent extends EventData {
3565
3607
  /**
3566
3608
  * Called after the results of an entity being mined are collected just before the entity is destroyed. After this event any items in the buffer will be transferred into the robot as if they came from mining the entity. Can be filtered using {@link LuaRobotMinedEntityEventFilter}.
3567
3609
  *
3610
+ * **Note**
3611
+ *
3612
+ * 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.
3613
+ *
3568
3614
  * {@link https://lua-api.factorio.com/latest/events.html#on_robot_mined_entity View documentation}
3569
- * @remarks 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.
3570
3615
  */
3571
3616
  interface OnRobotMinedEntityEvent extends EventData {
3572
3617
  /**
@@ -3932,8 +3977,11 @@ interface OnSurfaceClearedEvent extends EventData {
3932
3977
  /**
3933
3978
  * Called when a surface is created.
3934
3979
  *
3980
+ * **Note**
3981
+ *
3982
+ * This is not called when the default surface is created as it will always exist.
3983
+ *
3935
3984
  * {@link https://lua-api.factorio.com/latest/events.html#on_surface_created View documentation}
3936
- * @remarks This is not called when the default surface is created as it will always exist.
3937
3985
  */
3938
3986
  interface OnSurfaceCreatedEvent extends EventData {
3939
3987
  readonly surface_index: SurfaceIndex
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typed-factorio",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Featureful typescript definitions for the the Factorio modding lua api.",
5
5
  "keywords": [
6
6
  "factorio",