typed-factorio 1.0.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/Changelog.md +13 -1
- package/generated/classes.d.ts +363 -141
- package/generated/concepts.d.ts +192 -90
- package/generated/defines.d.ts +9 -0
- package/generated/events.d.ts +64 -0
- package/package.json +3 -2
package/generated/concepts.d.ts
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
*
|
12
12
|
* As a special case, when the key is just the empty string, all the parameters will be concatenated (after processing, if any are localised strings). If there is only one parameter, it will be used as is.
|
13
13
|
*
|
14
|
-
* Furthermore, when an API function expects a localised string, it will also accept a regular string (i.e. not a table) which will not be translated, as well as a number or
|
14
|
+
* Furthermore, when an API function expects a localised string, it will also accept a regular string (i.e. not a table) which will not be translated, as well as a number, boolean or `nil`, which will be converted to their textual representation.
|
15
15
|
*
|
16
16
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#LocalisedString View documentation}
|
17
17
|
* @example In the English translation, this will print `"No ammo"`; in the Czech translation, it will print `"Bez munice"`:
|
@@ -280,7 +280,7 @@ type BoundingBoxArray = readonly [left_top: MapPosition, right_bottom: MapPositi
|
|
280
280
|
* @example Explicit definition:
|
281
281
|
*
|
282
282
|
* ```
|
283
|
-
* {left_top = {-2, -3}, right_bottom = {5, 8}}
|
283
|
+
* {left_top = {x = -2, y = -3}, right_bottom = {x = 5, y = 8}}
|
284
284
|
* ```
|
285
285
|
* @example Shorthand:
|
286
286
|
*
|
@@ -385,6 +385,10 @@ interface CraftingQueueItem {
|
|
385
385
|
* The amount of items being crafted.
|
386
386
|
*/
|
387
387
|
readonly count: uint
|
388
|
+
/**
|
389
|
+
* The item is a prerequisite for another item in the queue.
|
390
|
+
*/
|
391
|
+
readonly prerequisite: boolean
|
388
392
|
}
|
389
393
|
|
390
394
|
interface Alert {
|
@@ -1611,20 +1615,6 @@ type MapGenSize =
|
|
1611
1615
|
| "very-big"
|
1612
1616
|
| "very-good"
|
1613
1617
|
|
1614
|
-
interface AutoplaceSetting {
|
1615
|
-
readonly frequency: MapGenSize
|
1616
|
-
readonly size: MapGenSize
|
1617
|
-
readonly richness: MapGenSize
|
1618
|
-
}
|
1619
|
-
|
1620
|
-
interface AutoplaceSettings {
|
1621
|
-
/**
|
1622
|
-
* Whether missing autoplace names for this type should be default enabled.
|
1623
|
-
*/
|
1624
|
-
readonly treat_missing_as_default: boolean
|
1625
|
-
readonly settings: Record<string, AutoplaceSetting>
|
1626
|
-
}
|
1627
|
-
|
1628
1618
|
interface AutoplaceControl {
|
1629
1619
|
/**
|
1630
1620
|
* For things that are placed as spots such as ores and enemy bases, frequency is generally proportional to number of spots placed per unit area. For continuous features such as forests, frequency is how compressed the probability function is over distance, i.e. the inverse of 'scale' (similar to terrain_segmentation). When the {@link LuaAutoplaceControlPrototype} is of the category `"terrain"`, then scale is shown in the map generator GUI instead of frequency.
|
@@ -1640,6 +1630,14 @@ interface AutoplaceControl {
|
|
1640
1630
|
readonly richness: MapGenSize
|
1641
1631
|
}
|
1642
1632
|
|
1633
|
+
interface AutoplaceSettings {
|
1634
|
+
/**
|
1635
|
+
* Whether missing autoplace names for this type should be default enabled.
|
1636
|
+
*/
|
1637
|
+
readonly treat_missing_as_default: boolean
|
1638
|
+
readonly settings: Record<string, AutoplaceControl>
|
1639
|
+
}
|
1640
|
+
|
1643
1641
|
interface CliffPlacementSettings {
|
1644
1642
|
/**
|
1645
1643
|
* Name of the cliff prototype.
|
@@ -1758,6 +1756,26 @@ interface MapGenSettingsRead extends MapGenSettings {
|
|
1758
1756
|
readonly starting_points: MapPositionTable[]
|
1759
1757
|
}
|
1760
1758
|
|
1759
|
+
interface AdvancedMapGenSettings {
|
1760
|
+
readonly pollution: PollutionMapSettings
|
1761
|
+
readonly enemy_evolution: EnemyEvolutionMapSettings
|
1762
|
+
readonly enemy_expansion: EnemyExpansionMapSettings
|
1763
|
+
readonly difficulty_settings: DifficultySettings
|
1764
|
+
}
|
1765
|
+
|
1766
|
+
interface MapGenPreset {
|
1767
|
+
/**
|
1768
|
+
* The string used to alphabetically sort the presets. It is a simple string that has no additional semantic meaning.
|
1769
|
+
*/
|
1770
|
+
readonly order: string
|
1771
|
+
/**
|
1772
|
+
* Whether this is the preset that is selected by default.
|
1773
|
+
*/
|
1774
|
+
readonly default?: boolean
|
1775
|
+
readonly basic_settings?: MapGenSettingsRead
|
1776
|
+
readonly advanced_settings?: AdvancedMapGenSettings
|
1777
|
+
}
|
1778
|
+
|
1761
1779
|
interface SignalID {
|
1762
1780
|
/**
|
1763
1781
|
* `"item"`, `"fluid"`, or `"virtual"`.
|
@@ -2707,6 +2725,8 @@ type SpriteType =
|
|
2707
2725
|
/**
|
2708
2726
|
* It is specified by {@link string}. It can be either the name of a {@link https://wiki.factorio.com/Prototype/Sprite sprite prototype} defined in the data stage or a path in form "type/name".
|
2709
2727
|
*
|
2728
|
+
* The validity of a SpritePath can be verified at runtime using {@link LuaGameScript#is_valid_sprite_path LuaGameScript::is_valid_sprite_path}.
|
2729
|
+
*
|
2710
2730
|
* The supported types are:
|
2711
2731
|
* - `"item"` - for example "item/iron-plate" is the icon sprite of iron plate
|
2712
2732
|
* - `"entity"` - for example "entity/small-biter" is the icon sprite of the small biter
|
@@ -2728,6 +2748,8 @@ type SpritePath = string | `${SpriteType}/${string}`
|
|
2728
2748
|
/**
|
2729
2749
|
* A sound defined by a {@link string}. It can be either the name of a {@link 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.
|
2730
2750
|
*
|
2751
|
+
* The validity of a SoundPath can be verified at runtime using {@link LuaGameScript#is_valid_sound_path LuaGameScript::is_valid_sound_path}.
|
2752
|
+
*
|
2731
2753
|
* The utility and ambient types each contain general use sound prototypes defined by the game itself.
|
2732
2754
|
* - `"utility"` - Uses the {@link https://wiki.factorio.com/Prototype/UtilitySounds UtilitySounds} prototype. Example: `"utility/wire_connect_pole"`
|
2733
2755
|
* - `"ambient"` - Uses {@link https://wiki.factorio.com/Prototype/AmbientSound AmbientSound} prototypes. Example: `"ambient/resource-deficiency"`
|
@@ -2787,32 +2809,105 @@ interface ModuleEffects {
|
|
2787
2809
|
* 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.
|
2788
2810
|
*
|
2789
2811
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags View documentation}
|
2812
|
+
* @remarks By default, none of these flags are set.
|
2790
2813
|
*/
|
2791
2814
|
interface EntityPrototypeFlags {
|
2815
|
+
/**
|
2816
|
+
* Prevents the entity from being rotated before or after placement.
|
2817
|
+
*/
|
2792
2818
|
readonly "not-rotatable"?: boolean
|
2819
|
+
/**
|
2820
|
+
* Determines the default force when placing entities in the map editor and using the "AUTO" option for the force.
|
2821
|
+
*/
|
2793
2822
|
readonly "placeable-neutral"?: boolean
|
2823
|
+
/**
|
2824
|
+
* Determines the default force when placing entities in the map editor and using the "AUTO" option for the force.
|
2825
|
+
*/
|
2794
2826
|
readonly "placeable-player"?: boolean
|
2827
|
+
/**
|
2828
|
+
* Determines the default force when placing entities in the map editor and using the "AUTO" option for the force.
|
2829
|
+
*/
|
2795
2830
|
readonly "placeable-enemy"?: boolean
|
2831
|
+
/**
|
2832
|
+
* Determines whether the entity needs to be aligned with the invisible grid within the world. Most entities are confined in this way, with a few exceptions such as trees and land mines.
|
2833
|
+
*/
|
2796
2834
|
readonly "placeable-off-grid"?: boolean
|
2835
|
+
/**
|
2836
|
+
* Makes it possible to blueprint, deconstruct, and repair the entity (which can be turned off again using the specific flags). Makes it possible for the biter AI to target the entity as a distraction. Enables dust to automatically be created when building the entity. If the entity does not have a `map_color` set, this flag makes the entity appear on the map with the default color specified by the UtilityConstants.
|
2837
|
+
*/
|
2797
2838
|
readonly "player-creation"?: boolean
|
2839
|
+
/**
|
2840
|
+
* Uses 45 degree angle increments when selecting direction.
|
2841
|
+
*/
|
2798
2842
|
readonly "building-direction-8-way"?: boolean
|
2843
|
+
/**
|
2844
|
+
* Used to automatically detect the proper direction of the entity if possible. Used by the pump, train stop, and train signal by default.
|
2845
|
+
*/
|
2799
2846
|
readonly "filter-directions"?: boolean
|
2847
|
+
/**
|
2848
|
+
* Fast replace will not apply when building while moving.
|
2849
|
+
*/
|
2800
2850
|
readonly "fast-replaceable-no-build-while-moving"?: boolean
|
2851
|
+
/**
|
2852
|
+
* Used to specify that the entity breathes air, and is thus affected by poison.
|
2853
|
+
*/
|
2801
2854
|
readonly "breaths-air"?: boolean
|
2855
|
+
/**
|
2856
|
+
* Used to specify that the entity can not be 'healed' by repair packs.
|
2857
|
+
*/
|
2802
2858
|
readonly "not-repairable"?: boolean
|
2859
|
+
/**
|
2860
|
+
* Prevents the entity from being drawn on the map.
|
2861
|
+
*/
|
2803
2862
|
readonly "not-on-map"?: boolean
|
2863
|
+
/**
|
2864
|
+
* Prevents the entity from being deconstructed.
|
2865
|
+
*/
|
2804
2866
|
readonly "not-deconstructable"?: boolean
|
2867
|
+
/**
|
2868
|
+
* Prevents the entity from being part of a blueprint.
|
2869
|
+
*/
|
2805
2870
|
readonly "not-blueprintable"?: boolean
|
2871
|
+
/**
|
2872
|
+
* Hides the entity from the bonus GUI and from the "made in"-property of recipe tooltips.
|
2873
|
+
*/
|
2806
2874
|
readonly hidden?: boolean
|
2875
|
+
/**
|
2876
|
+
* Hides the alt-info of this entity when in alt-mode.
|
2877
|
+
*/
|
2807
2878
|
readonly "hide-alt-info"?: boolean
|
2879
|
+
/**
|
2880
|
+
* Does not fast replace this entity over other entity types when building while moving.
|
2881
|
+
*/
|
2808
2882
|
readonly "fast-replaceable-no-cross-type-while-moving"?: boolean
|
2809
2883
|
readonly "no-gap-fill-while-building"?: boolean
|
2884
|
+
/**
|
2885
|
+
* Does not apply fire stickers to the entity.
|
2886
|
+
*/
|
2810
2887
|
readonly "not-flammable"?: boolean
|
2888
|
+
/**
|
2889
|
+
* Prevents inserters and loaders from taking items from this entity.
|
2890
|
+
*/
|
2811
2891
|
readonly "no-automated-item-removal"?: boolean
|
2892
|
+
/**
|
2893
|
+
* Prevents inserters and loaders from inserting items into this entity.
|
2894
|
+
*/
|
2812
2895
|
readonly "no-automated-item-insertion"?: boolean
|
2896
|
+
/**
|
2897
|
+
* Prevents the entity from being copy-pasted.
|
2898
|
+
*/
|
2813
2899
|
readonly "no-copy-paste"?: boolean
|
2900
|
+
/**
|
2901
|
+
* Disallows selection of the entity even when a selection box is specified for other reasons. For example, selection boxes are used to determine the size of outlines to be shown when highlighting entities inside electric pole ranges.
|
2902
|
+
*/
|
2814
2903
|
readonly "not-selectable-in-game"?: boolean
|
2904
|
+
/**
|
2905
|
+
* Prevents the entity from being selected by the upgrade planner.
|
2906
|
+
*/
|
2815
2907
|
readonly "not-upgradable"?: boolean
|
2908
|
+
/**
|
2909
|
+
* Prevents the entity from being shown in the kill statistics.
|
2910
|
+
*/
|
2816
2911
|
readonly "not-in-kill-statistics"?: boolean
|
2817
2912
|
}
|
2818
2913
|
|
@@ -2820,18 +2915,52 @@ interface EntityPrototypeFlags {
|
|
2820
2915
|
* 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.
|
2821
2916
|
*
|
2822
2917
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#ItemPrototypeFlags View documentation}
|
2918
|
+
* @remarks By default, none of these flags are set.
|
2823
2919
|
*/
|
2824
2920
|
interface ItemPrototypeFlags {
|
2921
|
+
/**
|
2922
|
+
* Determines whether the logistics areas of roboports should be drawn when holding this item. Used by the deconstruction planner by default.
|
2923
|
+
*/
|
2825
2924
|
readonly "draw-logistic-overlay"?: boolean
|
2925
|
+
/**
|
2926
|
+
* Hides the item in the logistic requests and filters GUIs (among others).
|
2927
|
+
*/
|
2826
2928
|
readonly hidden?: boolean
|
2929
|
+
/**
|
2930
|
+
* Always shows the item in the logistic requests and filters GUIs (among others) even when the recipe for that item is locked.
|
2931
|
+
*/
|
2827
2932
|
readonly "always-show"?: boolean
|
2933
|
+
/**
|
2934
|
+
* Hides the item from the bonus GUI.
|
2935
|
+
*/
|
2828
2936
|
readonly "hide-from-bonus-gui"?: boolean
|
2937
|
+
/**
|
2938
|
+
* Hides the item from the tooltip that's shown when hovering over a burner inventory.
|
2939
|
+
*/
|
2829
2940
|
readonly "hide-from-fuel-tooltip"?: boolean
|
2941
|
+
/**
|
2942
|
+
* Prevents the item from being stacked. It also prevents the item from stacking in assembling machine input slots, which can otherwise exceed the item stack size if required by the recipe. Additionally, the item does not show an item count when in the cursor.
|
2943
|
+
*/
|
2830
2944
|
readonly "not-stackable"?: boolean
|
2945
|
+
/**
|
2946
|
+
* Makes the item act as an extension to the inventory that it is placed in. Only has an effect for items with inventory.
|
2947
|
+
*/
|
2831
2948
|
readonly "can-extend-inventory"?: boolean
|
2949
|
+
/**
|
2950
|
+
* Makes construction bots prefer this item when building the entity specified by its `place_result`.
|
2951
|
+
*/
|
2832
2952
|
readonly "primary-place-result"?: boolean
|
2953
|
+
/**
|
2954
|
+
* Allows the item to be opened by the player, firing the `on_mod_item_opened` event. Only has an effect for selection tool items.
|
2955
|
+
*/
|
2833
2956
|
readonly "mod-openable"?: boolean
|
2957
|
+
/**
|
2958
|
+
* Makes it so the item is deleted when clearing the cursor, instead of being put into the player's inventory. The copy-paste tools use this by default, for example.
|
2959
|
+
*/
|
2834
2960
|
readonly "only-in-cursor"?: boolean
|
2961
|
+
/**
|
2962
|
+
* Allows the item to be spawned by a quickbar shortcut or custom input.
|
2963
|
+
*/
|
2835
2964
|
readonly spawnable?: boolean
|
2836
2965
|
}
|
2837
2966
|
|
@@ -3231,7 +3360,7 @@ interface ProgrammableSpeakerInstrument {
|
|
3231
3360
|
}
|
3232
3361
|
|
3233
3362
|
/**
|
3234
|
-
* A {@link string} that specifies where a
|
3363
|
+
* A {@link string} that specifies where a GUI element should be.
|
3235
3364
|
*
|
3236
3365
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#Alignment View documentation}
|
3237
3366
|
*/
|
@@ -3599,6 +3728,34 @@ interface VehicleAutomaticTargetingParameters {
|
|
3599
3728
|
*/
|
3600
3729
|
type SoundType = "game-effect" | "gui-effect" | "ambient" | "environment" | "walking" | "alert" | "wind"
|
3601
3730
|
|
3731
|
+
/**
|
3732
|
+
* Types `"signal"` and `"item-group"` do not support filters.
|
3733
|
+
*
|
3734
|
+
* Available filters:
|
3735
|
+
* - {@link ItemPrototypeFilter} for type `"item"`
|
3736
|
+
* - {@link TilePrototypeFilter} for type `"tile"`
|
3737
|
+
* - {@link EntityPrototypeFilter} for type `"entity"`
|
3738
|
+
* - {@link FluidPrototypeFilter} for type `"fluid"`
|
3739
|
+
* - {@link RecipePrototypeFilter} for type `"recipe"`
|
3740
|
+
* - {@link DecorativePrototypeFilter} for type `"decorative"`
|
3741
|
+
* - {@link AchievementPrototypeFilter} for type `"achievement"`
|
3742
|
+
* - {@link EquipmentPrototypeFilter} for type `"equipment"`
|
3743
|
+
* - {@link TechnologyPrototypeFilter} for type `"technology"`
|
3744
|
+
*
|
3745
|
+
* {@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
|
+
*/
|
3748
|
+
type PrototypeFilter =
|
3749
|
+
| ItemPrototypeFilter
|
3750
|
+
| TilePrototypeFilter
|
3751
|
+
| EntityPrototypeFilter
|
3752
|
+
| FluidPrototypeFilter
|
3753
|
+
| RecipePrototypeFilter
|
3754
|
+
| DecorativePrototypeFilter
|
3755
|
+
| AchievementPrototypeFilter
|
3756
|
+
| EquipmentPrototypeFilter
|
3757
|
+
| TechnologyPrototypeFilter
|
3758
|
+
|
3602
3759
|
interface BaseItemPrototypeFilter {
|
3603
3760
|
/**
|
3604
3761
|
* The condition to filter on. One of `"tool"`, `"mergeable"`, `"item-with-inventory"`, `"selection-tool"`, `"item-with-label"`, `"has-rocket-launch-products"`, `"fuel"`, `"place-result"`, `"burnt-result"`, `"place-as-tile"`, `"placed-as-equipment-result"`, `"name"`, `"type"`, `"flag"`, `"subgroup"`, `"fuel-category"`, `"stack-size"`, `"default-request-amount"`, `"wire-count"`, `"fuel-value"`, `"fuel-acceleration-multiplier"`, `"fuel-top-speed-multiplier"`, `"fuel-emissions-multiplier"`.
|
@@ -3690,9 +3847,9 @@ interface NameItemPrototypeFilter extends BaseItemPrototypeFilter {
|
|
3690
3847
|
interface TypeItemPrototypeFilter extends BaseItemPrototypeFilter {
|
3691
3848
|
readonly filter: "type"
|
3692
3849
|
/**
|
3693
|
-
* The prototype type
|
3850
|
+
* The prototype type, or a list of acceptable types.
|
3694
3851
|
*/
|
3695
|
-
readonly type: string
|
3852
|
+
readonly type: string | string[]
|
3696
3853
|
}
|
3697
3854
|
|
3698
3855
|
interface FlagItemPrototypeFilter extends BaseItemPrototypeFilter {
|
@@ -3865,9 +4022,9 @@ interface BaseModSettingPrototypeFilter {
|
|
3865
4022
|
interface TypeModSettingPrototypeFilter extends BaseModSettingPrototypeFilter {
|
3866
4023
|
readonly filter: "type"
|
3867
4024
|
/**
|
3868
|
-
* The prototype type
|
4025
|
+
* The prototype type, or a list of acceptable types.
|
3869
4026
|
*/
|
3870
|
-
readonly type: string
|
4027
|
+
readonly type: string | string[]
|
3871
4028
|
}
|
3872
4029
|
|
3873
4030
|
interface ModModSettingPrototypeFilter extends BaseModSettingPrototypeFilter {
|
@@ -3881,9 +4038,9 @@ interface ModModSettingPrototypeFilter extends BaseModSettingPrototypeFilter {
|
|
3881
4038
|
interface SettingTypeModSettingPrototypeFilter extends BaseModSettingPrototypeFilter {
|
3882
4039
|
readonly filter: "setting-type"
|
3883
4040
|
/**
|
3884
|
-
* The setting scope type (startup
|
4041
|
+
* The setting scope type (`"startup"`, `"runtime-global"`, or `"runtime-per-user"`)
|
3885
4042
|
*/
|
3886
|
-
readonly type:
|
4043
|
+
readonly type: "startup" | "runtime-global" | "runtime-per-user"
|
3887
4044
|
}
|
3888
4045
|
|
3889
4046
|
/**
|
@@ -4016,9 +4173,9 @@ interface CollisionMaskDecorativePrototypeFilter extends BaseDecorativePrototype
|
|
4016
4173
|
readonly filter: "collision-mask"
|
4017
4174
|
readonly mask: CollisionMask | CollisionMaskWithFlags
|
4018
4175
|
/**
|
4019
|
-
* How to filter: `"collides"` or `"
|
4176
|
+
* How to filter: `"collides"`, `"layers-equals"`, `"contains-any"` or `"contains-all"`
|
4020
4177
|
*/
|
4021
|
-
readonly mask_mode: "collides" | "layers-equals"
|
4178
|
+
readonly mask_mode: "collides" | "layers-equals" | "contains-any" | "contains-all"
|
4022
4179
|
}
|
4023
4180
|
|
4024
4181
|
interface DecalDecorativePrototypeFilter extends BaseDecorativePrototypeFilter {
|
@@ -4057,9 +4214,9 @@ interface BaseAchievementPrototypeFilter {
|
|
4057
4214
|
interface TypeAchievementPrototypeFilter extends BaseAchievementPrototypeFilter {
|
4058
4215
|
readonly filter: "type"
|
4059
4216
|
/**
|
4060
|
-
* The prototype type
|
4217
|
+
* The prototype type, or a list of acceptable types.
|
4061
4218
|
*/
|
4062
|
-
readonly type: string
|
4219
|
+
readonly type: string | string[]
|
4063
4220
|
}
|
4064
4221
|
|
4065
4222
|
interface AllowedWithoutFightAchievementPrototypeFilter extends BaseAchievementPrototypeFilter {
|
@@ -4208,9 +4365,9 @@ interface BaseEquipmentPrototypeFilter {
|
|
4208
4365
|
interface TypeEquipmentPrototypeFilter extends BaseEquipmentPrototypeFilter {
|
4209
4366
|
readonly filter: "type"
|
4210
4367
|
/**
|
4211
|
-
* The prototype type
|
4368
|
+
* The prototype type, or a list of acceptable types.
|
4212
4369
|
*/
|
4213
|
-
readonly type: string
|
4370
|
+
readonly type: string | string[]
|
4214
4371
|
}
|
4215
4372
|
|
4216
4373
|
interface ItemToPlaceEquipmentPrototypeFilter extends BaseEquipmentPrototypeFilter {
|
@@ -4252,9 +4409,9 @@ interface CollisionMaskTilePrototypeFilter extends BaseTilePrototypeFilter {
|
|
4252
4409
|
readonly filter: "collision-mask"
|
4253
4410
|
readonly mask: CollisionMask | CollisionMaskWithFlags
|
4254
4411
|
/**
|
4255
|
-
* How to filter: `"collides"` or `"
|
4412
|
+
* How to filter: `"collides"`, `"layers-equals"`, `"contains-any"` or `"contains-all"`
|
4256
4413
|
*/
|
4257
|
-
readonly mask_mode: "collides" | "layers-equals"
|
4414
|
+
readonly mask_mode: "collides" | "layers-equals" | "contains-any" | "contains-all"
|
4258
4415
|
}
|
4259
4416
|
|
4260
4417
|
interface WalkingSpeedModifierTilePrototypeFilter extends BaseTilePrototypeFilter {
|
@@ -4612,9 +4769,9 @@ interface NameEntityPrototypeFilter extends BaseEntityPrototypeFilter {
|
|
4612
4769
|
interface TypeEntityPrototypeFilter extends BaseEntityPrototypeFilter {
|
4613
4770
|
readonly filter: "type"
|
4614
4771
|
/**
|
4615
|
-
* The prototype type
|
4772
|
+
* The prototype type, or a list of acceptable types.
|
4616
4773
|
*/
|
4617
|
-
readonly type: string
|
4774
|
+
readonly type: string | string[]
|
4618
4775
|
}
|
4619
4776
|
|
4620
4777
|
/**
|
@@ -4628,9 +4785,9 @@ interface CollisionMaskEntityPrototypeFilter extends BaseEntityPrototypeFilter {
|
|
4628
4785
|
readonly filter: "collision-mask"
|
4629
4786
|
readonly mask: CollisionMask | CollisionMaskWithFlags
|
4630
4787
|
/**
|
4631
|
-
* How to filter: `"collides"` or `"
|
4788
|
+
* How to filter: `"collides"`, `"layers-equals"`, `"contains-any"` or `"contains-all"`
|
4632
4789
|
*/
|
4633
|
-
readonly mask_mode: "collides" | "layers-equals"
|
4790
|
+
readonly mask_mode: "collides" | "layers-equals" | "contains-any" | "contains-all"
|
4634
4791
|
}
|
4635
4792
|
|
4636
4793
|
/**
|
@@ -7371,61 +7528,6 @@ type RaiseableEvents =
|
|
7371
7528
|
| typeof defines.events.script_raised_revive
|
7372
7529
|
| typeof defines.events.script_raised_set_tiles
|
7373
7530
|
|
7374
|
-
/**
|
7375
|
-
* A map gen preset. Used in {@link https://wiki.factorio.com/Prototype/MapGenPresets Prototype/MapGenPresets}.
|
7376
|
-
*
|
7377
|
-
* {@link https://wiki.factorio.com/Types/MapGenPreset View Documentation}
|
7378
|
-
*/
|
7379
|
-
interface MapGenPreset {
|
7380
|
-
/** Specifies the ordering the map generator gui. */
|
7381
|
-
order: string
|
7382
|
-
/** Whether this is the default preset. If set to boolean, this preset may not have any other properties besides this and order. */
|
7383
|
-
default?: boolean
|
7384
|
-
/**
|
7385
|
-
* This is a table with the below key/value pairs. All key/value pairs are optional. If not set they will just use the
|
7386
|
-
* default values.
|
7387
|
-
*/
|
7388
|
-
basic_settings: Partial<MapGenSettings>
|
7389
|
-
/**
|
7390
|
-
* This is a table with the below key/value pairs. All key/value pairs are optional, if not set they will just use the
|
7391
|
-
* existing values.
|
7392
|
-
*/
|
7393
|
-
readonly advanced_settings: {
|
7394
|
-
readonly pollution?: {
|
7395
|
-
enabled?: boolean
|
7396
|
-
/** Must be <= 0.25. */
|
7397
|
-
diffusion_ratio?: double
|
7398
|
-
/** Also known as dissipation rate. Must be >= 0.5. */
|
7399
|
-
ageing?: double
|
7400
|
-
enemy_attack_pollution_consumption_modifier?: double
|
7401
|
-
min_pollution_to_damage_trees?: double
|
7402
|
-
pollution_restored_per_tree_damage?: double
|
7403
|
-
}
|
7404
|
-
readonly enemy_evolution?: {
|
7405
|
-
enabled?: boolean
|
7406
|
-
time_factor?: double
|
7407
|
-
destroy_factor?: double
|
7408
|
-
pollution_factor?: double
|
7409
|
-
}
|
7410
|
-
readonly enemy_expansion?: {
|
7411
|
-
enabled?: boolean
|
7412
|
-
max_expansion_distance?: double
|
7413
|
-
settler_group_min_size?: double
|
7414
|
-
settler_group_max_size?: double
|
7415
|
-
/** In ticks. */
|
7416
|
-
min_expansion_cooldown?: double
|
7417
|
-
/** In ticks. */
|
7418
|
-
max_expansion_cooldown?: double
|
7419
|
-
}
|
7420
|
-
readonly difficulty_settings?: {
|
7421
|
-
recipe_difficulty?: defines.difficulty_settings.recipe_difficulty
|
7422
|
-
technology_difficulty?: defines.difficulty_settings.technology_difficulty
|
7423
|
-
technology_price_multiplier?: double
|
7424
|
-
research_queue_setting?: "after-victory" | "always" | "never"
|
7425
|
-
}
|
7426
|
-
}
|
7427
|
-
}
|
7428
|
-
|
7429
7531
|
interface BlueprintControlBehavior {
|
7430
7532
|
readonly condition?: CircuitCondition
|
7431
7533
|
readonly circuit_condition?: CircuitCondition
|
package/generated/defines.d.ts
CHANGED
@@ -756,6 +756,10 @@ declare namespace defines {
|
|
756
756
|
* Event type: {@link OnResearchReversedEvent}
|
757
757
|
*/
|
758
758
|
const on_research_reversed: EventId<OnResearchReversedEvent>
|
759
|
+
/**
|
760
|
+
* Event type: {@link OnResearchCancelledEvent}
|
761
|
+
*/
|
762
|
+
const on_research_cancelled: EventId<OnResearchCancelledEvent>
|
759
763
|
/**
|
760
764
|
* Event type: {@link OnPlayerRotatedEntityEvent}
|
761
765
|
*/
|
@@ -1386,6 +1390,10 @@ declare namespace defines {
|
|
1386
1390
|
* Event type: {@link OnEquipmentRemovedEvent}
|
1387
1391
|
*/
|
1388
1392
|
const on_equipment_removed: EventId<OnEquipmentRemovedEvent>
|
1393
|
+
/**
|
1394
|
+
* Event type: {@link OnPlayerReverseSelectedAreaEvent}
|
1395
|
+
*/
|
1396
|
+
const on_player_reverse_selected_area: EventId<OnPlayerReverseSelectedAreaEvent>
|
1389
1397
|
}
|
1390
1398
|
/**
|
1391
1399
|
* See the {@link https://lua-api.factorio.com/latest/events.html events page} for more info on what events contain and when they get raised.
|
@@ -1555,6 +1563,7 @@ declare namespace defines {
|
|
1555
1563
|
remove_train_station,
|
1556
1564
|
reset_assembling_machine,
|
1557
1565
|
reset_item,
|
1566
|
+
reverse_select_area,
|
1558
1567
|
rotate_entity,
|
1559
1568
|
select_area,
|
1560
1569
|
select_blueprint_entities,
|
package/generated/events.d.ts
CHANGED
@@ -2588,6 +2588,46 @@ interface OnPlayerRespawnedEvent extends EventData {
|
|
2588
2588
|
readonly tick: uint
|
2589
2589
|
}
|
2590
2590
|
|
2591
|
+
/**
|
2592
|
+
* Called after a player reverse-selects an area with a selection-tool item.
|
2593
|
+
*
|
2594
|
+
* {@link https://lua-api.factorio.com/latest/events.html#on_player_reverse_selected_area View documentation}
|
2595
|
+
*/
|
2596
|
+
interface OnPlayerReverseSelectedAreaEvent extends EventData {
|
2597
|
+
/**
|
2598
|
+
* The player doing the selection.
|
2599
|
+
*/
|
2600
|
+
readonly player_index: PlayerIndex
|
2601
|
+
/**
|
2602
|
+
* The surface selected.
|
2603
|
+
*/
|
2604
|
+
readonly surface: LuaSurface
|
2605
|
+
/**
|
2606
|
+
* The area selected.
|
2607
|
+
*/
|
2608
|
+
readonly area: BoundingBoxRead
|
2609
|
+
/**
|
2610
|
+
* The item used to select the area.
|
2611
|
+
*/
|
2612
|
+
readonly item: string
|
2613
|
+
/**
|
2614
|
+
* The entities selected.
|
2615
|
+
*/
|
2616
|
+
readonly entities: LuaEntity[]
|
2617
|
+
/**
|
2618
|
+
* The tiles selected.
|
2619
|
+
*/
|
2620
|
+
readonly tiles: LuaTile[]
|
2621
|
+
/**
|
2622
|
+
* Identifier of the event
|
2623
|
+
*/
|
2624
|
+
readonly name: typeof defines.events.on_player_reverse_selected_area
|
2625
|
+
/**
|
2626
|
+
* Tick the event was generated.
|
2627
|
+
*/
|
2628
|
+
readonly tick: uint
|
2629
|
+
}
|
2630
|
+
|
2591
2631
|
/**
|
2592
2632
|
* 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.
|
2593
2633
|
*
|
@@ -3295,6 +3335,30 @@ interface OnPreSurfaceDeletedEvent extends EventData {
|
|
3295
3335
|
readonly tick: uint
|
3296
3336
|
}
|
3297
3337
|
|
3338
|
+
/**
|
3339
|
+
* Called when research is cancelled.
|
3340
|
+
*
|
3341
|
+
* {@link https://lua-api.factorio.com/latest/events.html#on_research_cancelled View documentation}
|
3342
|
+
*/
|
3343
|
+
interface OnResearchCancelledEvent extends EventData {
|
3344
|
+
/**
|
3345
|
+
* A mapping of technology name to how many times it was cancelled.
|
3346
|
+
*/
|
3347
|
+
readonly research: Record<string, uint>
|
3348
|
+
/**
|
3349
|
+
* The force whose research was cancelled.
|
3350
|
+
*/
|
3351
|
+
readonly force: LuaForce
|
3352
|
+
/**
|
3353
|
+
* Identifier of the event
|
3354
|
+
*/
|
3355
|
+
readonly name: typeof defines.events.on_research_cancelled
|
3356
|
+
/**
|
3357
|
+
* Tick the event was generated.
|
3358
|
+
*/
|
3359
|
+
readonly tick: uint
|
3360
|
+
}
|
3361
|
+
|
3298
3362
|
/**
|
3299
3363
|
* Called when a research finishes.
|
3300
3364
|
*
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "typed-factorio",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.3.0",
|
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",
|