typed-factorio 1.2.0 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- package/Changelog.md +9 -1
- package/README.md +25 -28
- package/generated/classes.d.ts +1192 -312
- package/generated/concepts.d.ts +53 -33
- package/generated/defines.d.ts +2 -2
- package/generated/events.d.ts +65 -17
- package/package.json +3 -2
package/generated/concepts.d.ts
CHANGED
@@ -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
|
@@ -385,6 +386,10 @@ interface CraftingQueueItem {
|
|
385
386
|
* The amount of items being crafted.
|
386
387
|
*/
|
387
388
|
readonly count: uint
|
389
|
+
/**
|
390
|
+
* The item is a prerequisite for another item in the queue.
|
391
|
+
*/
|
392
|
+
readonly prerequisite: boolean
|
388
393
|
}
|
389
394
|
|
390
395
|
interface Alert {
|
@@ -468,10 +473,11 @@ interface DecorativeResult {
|
|
468
473
|
}
|
469
474
|
|
470
475
|
/**
|
476
|
+
* **Note**
|
471
477
|
*
|
478
|
+
* Either `icon`, `text`, or both must be provided.
|
472
479
|
*
|
473
480
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#ChartTagSpec View documentation}
|
474
|
-
* @remarks Either `icon`, `text`, or both must be provided.
|
475
481
|
*/
|
476
482
|
interface ChartTagSpec {
|
477
483
|
readonly position: MapPosition
|
@@ -651,7 +657,7 @@ interface EnemyEvolutionMapSettings {
|
|
651
657
|
}
|
652
658
|
|
653
659
|
/**
|
654
|
-
* Candidate chunks are given scores to determine which one of them should be expanded into. This score takes into account various settings noted below. The iteration is over a square region centered around the chunk for which the calculation is done, and includes the central chunk as well. Distances are calculated as {@
|
660
|
+
* Candidate chunks are given scores to determine which one of them should be expanded into. This score takes into account various settings noted below. The iteration is over a square region centered around the chunk for which the calculation is done, and includes the central chunk as well. Distances are calculated as {@linkplain https://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance}.
|
655
661
|
*
|
656
662
|
* The pseudocode algorithm to determine a chunk's score is as follows:
|
657
663
|
*
|
@@ -1503,7 +1509,7 @@ interface AutoplaceSpecification {
|
|
1503
1509
|
}
|
1504
1510
|
|
1505
1511
|
/**
|
1506
|
-
* A fragment of a functional program used to generate coherent noise, probably for purposes related to terrain generation. These can only be meaningfully written/modified during the data load phase. More detailed information is found on the {@
|
1512
|
+
* A fragment of a functional program used to generate coherent noise, probably for purposes related to terrain generation. These can only be meaningfully written/modified during the data load phase. More detailed information is found on the {@linkplain https://wiki.factorio.com/Types/NoiseExpression wiki}.
|
1507
1513
|
*
|
1508
1514
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#NoiseExpression View documentation}
|
1509
1515
|
*/
|
@@ -1589,8 +1595,11 @@ interface Resistance {
|
|
1589
1595
|
* - `"high"`, `"big"`, `"good"` - equivalent to `sqrt(2)`
|
1590
1596
|
* - `"very-high"`, `"very-big"`, `"very-good"` - equivalent to `2`
|
1591
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
|
+
*
|
1592
1602
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#MapGenSize View documentation}
|
1593
|
-
* @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.
|
1594
1603
|
*/
|
1595
1604
|
type MapGenSize =
|
1596
1605
|
| number
|
@@ -1976,10 +1985,11 @@ interface ConstantCombinatorParameters {
|
|
1976
1985
|
}
|
1977
1986
|
|
1978
1987
|
/**
|
1988
|
+
* **Note**
|
1979
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.
|
1980
1991
|
*
|
1981
1992
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#ComparatorString View documentation}
|
1982
|
-
* @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.
|
1983
1993
|
*/
|
1984
1994
|
type ComparatorString
|
1985
1995
|
/**
|
@@ -2719,7 +2729,7 @@ type SpriteType =
|
|
2719
2729
|
| "utility"
|
2720
2730
|
|
2721
2731
|
/**
|
2722
|
-
* It is specified by {@link string}. It can be either the name of a {@
|
2732
|
+
* It is specified by {@link string}. It can be either the name of a {@linkplain https://wiki.factorio.com/Prototype/Sprite sprite prototype} defined in the data stage or a path in form "type/name".
|
2723
2733
|
*
|
2724
2734
|
* The validity of a SpritePath can be verified at runtime using {@link LuaGameScript#is_valid_sprite_path LuaGameScript::is_valid_sprite_path}.
|
2725
2735
|
*
|
@@ -2742,33 +2752,33 @@ type SpriteType =
|
|
2742
2752
|
type SpritePath = string | `${SpriteType}/${string}`
|
2743
2753
|
|
2744
2754
|
/**
|
2745
|
-
* A sound defined by a {@link string}. It can be either the name of a {@
|
2755
|
+
* A sound defined by a {@link string}. It can be either the name of a {@linkplain https://wiki.factorio.com/Prototype/Sound sound prototype} defined in the data stage or a path in the form `"type/name"`. The latter option can be sorted into three categories.
|
2746
2756
|
*
|
2747
2757
|
* The validity of a SoundPath can be verified at runtime using {@link LuaGameScript#is_valid_sound_path LuaGameScript::is_valid_sound_path}.
|
2748
2758
|
*
|
2749
2759
|
* The utility and ambient types each contain general use sound prototypes defined by the game itself.
|
2750
|
-
* - `"utility"` - Uses the {@
|
2751
|
-
* - `"ambient"` - Uses {@
|
2760
|
+
* - `"utility"` - Uses the {@linkplain https://wiki.factorio.com/Prototype/UtilitySounds UtilitySounds} prototype. Example: `"utility/wire_connect_pole"`
|
2761
|
+
* - `"ambient"` - Uses {@linkplain https://wiki.factorio.com/Prototype/AmbientSound AmbientSound} prototypes. Example: `"ambient/resource-deficiency"`
|
2752
2762
|
*
|
2753
2763
|
* The following types can be combined with any tile name as long as its prototype defines the
|
2754
2764
|
*
|
2755
2765
|
* corresponding sound.
|
2756
|
-
* - `"tile-walking"` - Uses {@
|
2757
|
-
* - `"tile-mined"` - Uses {@
|
2758
|
-
* - `"tile-build-small"` - Uses {@
|
2759
|
-
* - `"tile-build-medium"` - Uses {@
|
2760
|
-
* - `"tile-build-large"` - Uses {@
|
2766
|
+
* - `"tile-walking"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#walking_sound Tile::walking_sound}. Example: `"tile-walking/concrete"`
|
2767
|
+
* - `"tile-mined"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#mined_sound Tile::mined_sound}
|
2768
|
+
* - `"tile-build-small"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound}. Example: `"tile-build-small/concrete"`
|
2769
|
+
* - `"tile-build-medium"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound}
|
2770
|
+
* - `"tile-build-large"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound}
|
2761
2771
|
*
|
2762
2772
|
* The following types can be combined with any entity name as long as its prototype defines the
|
2763
2773
|
*
|
2764
2774
|
* corresponding sound.
|
2765
|
-
* - `"entity-build"` - Uses {@
|
2766
|
-
* - `"entity-mined"` - Uses {@
|
2767
|
-
* - `"entity-mining"` - Uses {@
|
2768
|
-
* - `"entity-vehicle_impact"` - Uses {@
|
2769
|
-
* - `"entity-rotated"` - Uses {@
|
2770
|
-
* - `"entity-open"` - Uses {@
|
2771
|
-
* - `"entity-close"` - Uses {@
|
2775
|
+
* - `"entity-build"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#build_sound Entity::build_sound}. Example: `"entity-build/wooden-chest"`
|
2776
|
+
* - `"entity-mined"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#mined_sound Entity::mined_sound}
|
2777
|
+
* - `"entity-mining"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#mining_sound Entity::mining_sound}
|
2778
|
+
* - `"entity-vehicle_impact"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#vehicle_impact_sound Entity::vehicle_impact_sound}
|
2779
|
+
* - `"entity-rotated"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#rotated_sound Entity::rotated_sound}
|
2780
|
+
* - `"entity-open"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#open_sound Entity::open_sound}
|
2781
|
+
* - `"entity-close"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#close_sound Entity::close_sound}
|
2772
2782
|
*
|
2773
2783
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#SoundPath View documentation}
|
2774
2784
|
*/
|
@@ -2804,8 +2814,11 @@ interface ModuleEffects {
|
|
2804
2814
|
/**
|
2805
2815
|
* This is a set of flags given as a dictionary[{@link string} → {@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.
|
2806
2816
|
*
|
2817
|
+
* **Note**
|
2818
|
+
*
|
2819
|
+
* By default, none of these flags are set.
|
2820
|
+
*
|
2807
2821
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags View documentation}
|
2808
|
-
* @remarks By default, none of these flags are set.
|
2809
2822
|
*/
|
2810
2823
|
interface EntityPrototypeFlags {
|
2811
2824
|
/**
|
@@ -2910,8 +2923,11 @@ interface EntityPrototypeFlags {
|
|
2910
2923
|
/**
|
2911
2924
|
* This is a set of flags given as dictionary[{@link string} → {@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.
|
2912
2925
|
*
|
2926
|
+
* **Note**
|
2927
|
+
*
|
2928
|
+
* By default, none of these flags are set.
|
2929
|
+
*
|
2913
2930
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags View documentation}
|
2914
|
-
* @remarks By default, none of these flags are set.
|
2915
2931
|
*/
|
2916
2932
|
interface ItemPrototypeFlags {
|
2917
2933
|
/**
|
@@ -3305,10 +3321,11 @@ interface LogisticFilter {
|
|
3305
3321
|
}
|
3306
3322
|
|
3307
3323
|
/**
|
3324
|
+
* **Note**
|
3308
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.
|
3309
3327
|
*
|
3310
3328
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#ModSetting View documentation}
|
3311
|
-
* @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.
|
3312
3329
|
*/
|
3313
3330
|
interface ModSetting {
|
3314
3331
|
/**
|
@@ -3383,7 +3400,7 @@ type Alignment =
|
|
3383
3400
|
| "bottom-right"
|
3384
3401
|
|
3385
3402
|
/**
|
3386
|
-
* Information about the event that has been raised. The table can also contain other fields depending on the type of event. See {@
|
3403
|
+
* Information about the event that has been raised. The table can also contain other fields depending on the type of event. See {@linkplain https://lua-api.factorio.com/latest/events.html the list of Factorio events} for more information on these.
|
3387
3404
|
*
|
3388
3405
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#EventData View documentation}
|
3389
3406
|
*/
|
@@ -3738,8 +3755,11 @@ type SoundType = "game-effect" | "gui-effect" | "ambient" | "environment" | "wal
|
|
3738
3755
|
* - {@link EquipmentPrototypeFilter} for type `"equipment"`
|
3739
3756
|
* - {@link TechnologyPrototypeFilter} for type `"technology"`
|
3740
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
|
+
*
|
3741
3762
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#PrototypeFilter View documentation}
|
3742
|
-
* @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.
|
3743
3763
|
*/
|
3744
3764
|
type PrototypeFilter =
|
3745
3765
|
| ItemPrototypeFilter
|
@@ -4169,9 +4189,9 @@ interface CollisionMaskDecorativePrototypeFilter extends BaseDecorativePrototype
|
|
4169
4189
|
readonly filter: "collision-mask"
|
4170
4190
|
readonly mask: CollisionMask | CollisionMaskWithFlags
|
4171
4191
|
/**
|
4172
|
-
* How to filter: `"collides"` or `"
|
4192
|
+
* How to filter: `"collides"`, `"layers-equals"`, `"contains-any"` or `"contains-all"`
|
4173
4193
|
*/
|
4174
|
-
readonly mask_mode: "collides" | "layers-equals"
|
4194
|
+
readonly mask_mode: "collides" | "layers-equals" | "contains-any" | "contains-all"
|
4175
4195
|
}
|
4176
4196
|
|
4177
4197
|
interface DecalDecorativePrototypeFilter extends BaseDecorativePrototypeFilter {
|
@@ -4405,9 +4425,9 @@ interface CollisionMaskTilePrototypeFilter extends BaseTilePrototypeFilter {
|
|
4405
4425
|
readonly filter: "collision-mask"
|
4406
4426
|
readonly mask: CollisionMask | CollisionMaskWithFlags
|
4407
4427
|
/**
|
4408
|
-
* How to filter: `"collides"` or `"
|
4428
|
+
* How to filter: `"collides"`, `"layers-equals"`, `"contains-any"` or `"contains-all"`
|
4409
4429
|
*/
|
4410
|
-
readonly mask_mode: "collides" | "layers-equals"
|
4430
|
+
readonly mask_mode: "collides" | "layers-equals" | "contains-any" | "contains-all"
|
4411
4431
|
}
|
4412
4432
|
|
4413
4433
|
interface WalkingSpeedModifierTilePrototypeFilter extends BaseTilePrototypeFilter {
|
@@ -4781,9 +4801,9 @@ interface CollisionMaskEntityPrototypeFilter extends BaseEntityPrototypeFilter {
|
|
4781
4801
|
readonly filter: "collision-mask"
|
4782
4802
|
readonly mask: CollisionMask | CollisionMaskWithFlags
|
4783
4803
|
/**
|
4784
|
-
* How to filter: `"collides"` or `"
|
4804
|
+
* How to filter: `"collides"`, `"layers-equals"`, `"contains-any"` or `"contains-all"`
|
4785
4805
|
*/
|
4786
|
-
readonly mask_mode: "collides" | "layers-equals"
|
4806
|
+
readonly mask_mode: "collides" | "layers-equals" | "contains-any" | "contains-all"
|
4787
4807
|
}
|
4788
4808
|
|
4789
4809
|
/**
|
package/generated/defines.d.ts
CHANGED
@@ -643,7 +643,7 @@ declare namespace defines {
|
|
643
643
|
cant_divide_segments,
|
644
644
|
}
|
645
645
|
/**
|
646
|
-
* See the {@
|
646
|
+
* See the {@linkplain https://lua-api.factorio.com/latest/events.html events page} for more info on what events contain and when they get raised.
|
647
647
|
*
|
648
648
|
* {@link https://lua-api.factorio.com/latest/defines.html#defines.events View documentation}
|
649
649
|
*/
|
@@ -1396,7 +1396,7 @@ declare namespace defines {
|
|
1396
1396
|
const on_player_reverse_selected_area: EventId<OnPlayerReverseSelectedAreaEvent>
|
1397
1397
|
}
|
1398
1398
|
/**
|
1399
|
-
* See the {@
|
1399
|
+
* See the {@linkplain https://lua-api.factorio.com/latest/events.html events page} for more info on what events contain and when they get raised.
|
1400
1400
|
*
|
1401
1401
|
* {@link https://lua-api.factorio.com/latest/defines.html#defines.events View documentation}
|
1402
1402
|
*/
|
package/generated/events.d.ts
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
/** @noSelfInFile */
|
4
4
|
|
5
5
|
/**
|
6
|
-
* Called when a {@
|
6
|
+
* Called when a {@linkplain https://wiki.factorio.com/Prototype/CustomInput CustomInput} is activated.
|
7
7
|
*
|
8
8
|
* {@link https://lua-api.factorio.com/latest/events.html#CustomInputEvent View documentation}
|
9
9
|
*/
|
@@ -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.2
|
3
|
+
"version": "1.3.2",
|
4
4
|
"description": "Featureful typescript definitions for the the Factorio modding lua api.",
|
5
5
|
"keywords": [
|
6
6
|
"factorio",
|
@@ -22,7 +22,8 @@
|
|
22
22
|
"lint": "eslint .",
|
23
23
|
"check": "yarn run lint && yarn run test",
|
24
24
|
"prepublishOnly": "yarn run check",
|
25
|
-
"download-latest-runtime-api": "ts-node ./scripts/downloadLatest.ts"
|
25
|
+
"download-latest-runtime-api": "ts-node ./scripts/downloadLatest.ts",
|
26
|
+
"next-version": "yarn run download-latest-runtime-api && yarn run clean && yarn test && yarn version --minor"
|
26
27
|
},
|
27
28
|
"peerDependencies": {
|
28
29
|
"lua-types": "^2.11.0",
|