typed-factorio 1.6.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- package/Changelog.md +19 -10
- package/generated/classes.d.ts +68 -54
- package/generated/concepts.d.ts +5 -2
- package/package.json +21 -18
- package/generator/typescript-internal.d.ts +0 -9
package/Changelog.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
# v1.7.1
|
2
|
+
|
3
|
+
- Added proper nullablity to members with different read/write types
|
4
|
+
- Deduped union types
|
5
|
+
|
6
|
+
# v1.7.0
|
7
|
+
|
8
|
+
- Updated to factorio version 1.1.67
|
9
|
+
|
1
10
|
# v1.6.1
|
2
11
|
|
3
12
|
- Fixed write type for `BoundingBox`.
|
@@ -17,8 +26,8 @@
|
|
17
26
|
|
18
27
|
- Read-only forms of concepts (the most common form used) is now specified with just the name; forms with a `Read` or `Table` suffix have been removed.
|
19
28
|
- Write forms are now specified as either a union of table and array forms, or with a `Write` suffix for concepts.
|
20
|
-
|
21
|
-
|
29
|
+
- For table-or-array concepts: `MapPositionRead` -> `MapPosition`, `MapPosition` -> `MapPosition | PositionArray`
|
30
|
+
- For table concepts: `ScriptAreaRead` -> `ScriptArea`, `ScriptArea` -> `ScriptAreaWrite`
|
22
31
|
- The minimum TSTL version has been increased to v1.6.1 (A bug with documentation comments was fixed in that version).
|
23
32
|
|
24
33
|
### Other
|
@@ -105,8 +114,8 @@
|
|
105
114
|
# v0.15.0
|
106
115
|
|
107
116
|
- Table or array concepts are now declared in table form wherever it is an "read" position.
|
108
|
-
|
109
|
-
|
117
|
+
- This works with setter overloading for applicable properties: `player.color.x; player.color = [1, 1, 1]` is now valid!
|
118
|
+
- This also applies to concepts/complex types which contain table_or_array properties.
|
110
119
|
- Some concepts now also have a special form where it is known to be in a "read" position, where all table_or_array concepts are declared in table form. These concepts are suffixed with "Read", e.g. `ScriptAreaRead`.
|
111
120
|
- Arrays which are known to be in a "write" only form (e.g. method parameters) now are marked readonly. This means you can now pass readonly arrays to these methods.
|
112
121
|
- `MapPosition` is now a table or array concept.
|
@@ -122,17 +131,17 @@
|
|
122
131
|
- LuaStyle size, margin/padding setters now have more specific array types. These array types are `SizeArray` and `StyleValuesArray` for size and margin/padding, respectively.
|
123
132
|
- `@noSelf` annotation is now only present when necessary.
|
124
133
|
- For classes with subclasses:
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
134
|
+
- The original class name (e.g. `LuaItemStack`) still contains attributes of all subclasses (same as before).
|
135
|
+
- There is now a `Base` type (e.g. `BaseItemStack`) which only includes attributes common to all subclasses.
|
136
|
+
- There is a separate type definition for each subclass, e.g. `BlueprintItem`. Note that one instance may still belong to multiple subclasses (the subclasses are not mutually exclusive).
|
137
|
+
- The above two can be optionally used for stricter types.
|
129
138
|
|
130
139
|
# v0.13.2
|
131
140
|
|
132
141
|
- Fix: resize_to_sprite property should not be on subclass sprite-button
|
133
142
|
- Fix: ChooseElemButtonSpec filters should be named elem_filters
|
134
143
|
- Switch back to `/latest` api docs link
|
135
|
-
|
144
|
+
- New version of web api docs is now active
|
136
145
|
|
137
146
|
# v0.13.0
|
138
147
|
|
@@ -168,7 +177,7 @@
|
|
168
177
|
# v0.7.3
|
169
178
|
|
170
179
|
- Update to factorio version 1.1.42
|
171
|
-
|
180
|
+
- No api changes, but improvements to descriptions
|
172
181
|
|
173
182
|
# v0.7.2
|
174
183
|
|
package/generated/classes.d.ts
CHANGED
@@ -1407,8 +1407,8 @@ interface LuaControl {
|
|
1407
1407
|
* @remarks Items in the cursor stack will take priority over the cursor ghost.
|
1408
1408
|
* @see {@link https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.cursor_ghost Online documentation}
|
1409
1409
|
*/
|
1410
|
-
get cursor_ghost(): LuaItemPrototype
|
1411
|
-
set cursor_ghost(value: ItemPrototypeIdentification)
|
1410
|
+
get cursor_ghost(): LuaItemPrototype | nil
|
1411
|
+
set cursor_ghost(value: ItemPrototypeIdentification | nil)
|
1412
1412
|
/**
|
1413
1413
|
* `true` if the player is in a vehicle. Writing to this attribute puts the player in or out of a vehicle.
|
1414
1414
|
*
|
@@ -2941,6 +2941,13 @@ interface LuaEntity extends LuaControl {
|
|
2941
2941
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_spider_legs Online documentation}
|
2942
2942
|
*/
|
2943
2943
|
get_spider_legs(): LuaEntity[]
|
2944
|
+
/**
|
2945
|
+
* Stops the given SpiderVehicle.
|
2946
|
+
*
|
2947
|
+
* _Can only be used if this is SpiderVehicle_
|
2948
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.stop_spider Online documentation}
|
2949
|
+
*/
|
2950
|
+
stop_spider(): void
|
2944
2951
|
/**
|
2945
2952
|
* Name of the entity prototype. E.g. "inserter" or "filter-inserter".
|
2946
2953
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.name Online documentation}
|
@@ -3261,8 +3268,8 @@ interface LuaEntity extends LuaControl {
|
|
3261
3268
|
* @remarks Car color is overridden by the color of the current driver/passenger, if there is one.
|
3262
3269
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.color Online documentation}
|
3263
3270
|
*/
|
3264
|
-
get color(): Color
|
3265
|
-
set color(value: Color | ColorArray)
|
3271
|
+
get color(): Color | nil
|
3272
|
+
set color(value: Color | ColorArray | nil)
|
3266
3273
|
/**
|
3267
3274
|
* The text of this flying-text entity.
|
3268
3275
|
*
|
@@ -3406,8 +3413,8 @@ interface LuaEntity extends LuaControl {
|
|
3406
3413
|
* _Can only be used if this is EntityWithOwner_
|
3407
3414
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.last_user Online documentation}
|
3408
3415
|
*/
|
3409
|
-
get last_user(): LuaPlayer |
|
3410
|
-
set last_user(value: LuaPlayer | PlayerIdentification)
|
3416
|
+
get last_user(): LuaPlayer | nil
|
3417
|
+
set last_user(value: LuaPlayer | PlayerIdentification | nil)
|
3411
3418
|
/**
|
3412
3419
|
* The buffer size for the electric energy source. `nil` if the entity doesn't have an electric energy source.
|
3413
3420
|
* @remarks Write access is limited to the ElectricEnergyInterface type
|
@@ -3695,8 +3702,8 @@ interface LuaEntity extends LuaControl {
|
|
3695
3702
|
* @remarks A character associated with a player is not directly controlled by any player.
|
3696
3703
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.associated_player Online documentation}
|
3697
3704
|
*/
|
3698
|
-
get associated_player(): LuaPlayer |
|
3699
|
-
set associated_player(value: LuaPlayer | PlayerIdentification)
|
3705
|
+
get associated_player(): LuaPlayer | nil
|
3706
|
+
set associated_player(value: LuaPlayer | PlayerIdentification | nil)
|
3700
3707
|
/**
|
3701
3708
|
* The last tick this character entity was attacked.
|
3702
3709
|
*
|
@@ -3827,15 +3834,15 @@ interface LuaEntity extends LuaControl {
|
|
3827
3834
|
* Reading this property will return a {@link LuaPlayer}, while {@link PlayerIdentification} can be used when writing.
|
3828
3835
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.render_player Online documentation}
|
3829
3836
|
*/
|
3830
|
-
get render_player(): LuaPlayer |
|
3831
|
-
set render_player(value: LuaPlayer | PlayerIdentification)
|
3837
|
+
get render_player(): LuaPlayer | nil
|
3838
|
+
set render_player(value: LuaPlayer | PlayerIdentification | nil)
|
3832
3839
|
/**
|
3833
3840
|
* The forces that this `simple-entity-with-owner`, `simple-entity-with-force`, or `flying-text` is visible to. `nil` or an empty array when this entity is rendered for all forces.
|
3834
3841
|
* @remarks Reading will always give an array of {@link LuaForce}
|
3835
3842
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.render_to_forces Online documentation}
|
3836
3843
|
*/
|
3837
|
-
get render_to_forces(): LuaForce[]
|
3838
|
-
set render_to_forces(value: readonly ForceIdentification[])
|
3844
|
+
get render_to_forces(): LuaForce[] | nil
|
3845
|
+
set render_to_forces(value: readonly ForceIdentification[] | nil)
|
3839
3846
|
/**
|
3840
3847
|
* The rail target of this pump, if any.
|
3841
3848
|
*
|
@@ -3931,8 +3938,8 @@ interface LuaEntity extends LuaControl {
|
|
3931
3938
|
* _Can only be used if this is SpiderVehicle_
|
3932
3939
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.autopilot_destination Online documentation}
|
3933
3940
|
*/
|
3934
|
-
get autopilot_destination(): MapPosition
|
3935
|
-
set autopilot_destination(value: MapPosition | MapPositionArray)
|
3941
|
+
get autopilot_destination(): MapPosition | nil
|
3942
|
+
set autopilot_destination(value: MapPosition | MapPositionArray | nil)
|
3936
3943
|
/**
|
3937
3944
|
* The queued destination positions of spidertron's autopilot.
|
3938
3945
|
*
|
@@ -3941,21 +3948,21 @@ interface LuaEntity extends LuaControl {
|
|
3941
3948
|
*/
|
3942
3949
|
readonly autopilot_destinations: MapPosition[]
|
3943
3950
|
/**
|
3944
|
-
* Amount of trains related to this particular train stop. Includes train stopped at this train stop (until it finds a path to next target) and trains having this train stop as goal or waypoint.
|
3951
|
+
* Amount of trains related to this particular train stop. Includes train stopped at this train stop (until it finds a path to next target) and trains having this train stop as goal or waypoint.
|
3945
3952
|
*
|
3946
3953
|
* _Can only be used if this is TrainStop_
|
3947
3954
|
* @remarks Train may be included multiple times when braking distance covers this train stop multiple times<br>Value may be read even when train stop has no control behavior
|
3948
3955
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.trains_count Online documentation}
|
3949
3956
|
*/
|
3950
|
-
readonly trains_count: uint
|
3957
|
+
readonly trains_count: uint
|
3951
3958
|
/**
|
3952
|
-
* Amount of trains above which no new trains will be sent to this train stop.
|
3959
|
+
* Amount of trains above which no new trains will be sent to this train stop. Writing nil will disable the limit (will set a maximum possible value).
|
3953
3960
|
*
|
3954
3961
|
* _Can only be used if this is TrainStop_
|
3955
3962
|
* @remarks When a train stop has a control behavior with wire connected and set_trains_limit enabled, this value will be overwritten by it
|
3956
3963
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.trains_limit Online documentation}
|
3957
3964
|
*/
|
3958
|
-
trains_limit: uint
|
3965
|
+
trains_limit: uint | nil
|
3959
3966
|
/**
|
3960
3967
|
* (deprecated by 1.1.51) If this entity is a MilitaryTarget. Returns same value as LuaEntity::is_military_target
|
3961
3968
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_entity_with_force Online documentation}
|
@@ -4760,8 +4767,8 @@ interface BaseEntity extends LuaControl {
|
|
4760
4767
|
* @remarks Car color is overridden by the color of the current driver/passenger, if there is one.
|
4761
4768
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.color Online documentation}
|
4762
4769
|
*/
|
4763
|
-
get color(): Color
|
4764
|
-
set color(value: Color | ColorArray)
|
4770
|
+
get color(): Color | nil
|
4771
|
+
set color(value: Color | ColorArray | nil)
|
4765
4772
|
/**
|
4766
4773
|
* The productivity bonus of this entity.
|
4767
4774
|
* @remarks This includes force based bonuses as well as beacon/module bonuses.
|
@@ -4991,15 +4998,15 @@ interface BaseEntity extends LuaControl {
|
|
4991
4998
|
* Reading this property will return a {@link LuaPlayer}, while {@link PlayerIdentification} can be used when writing.
|
4992
4999
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.render_player Online documentation}
|
4993
5000
|
*/
|
4994
|
-
get render_player(): LuaPlayer |
|
4995
|
-
set render_player(value: LuaPlayer | PlayerIdentification)
|
5001
|
+
get render_player(): LuaPlayer | nil
|
5002
|
+
set render_player(value: LuaPlayer | PlayerIdentification | nil)
|
4996
5003
|
/**
|
4997
5004
|
* The forces that this `simple-entity-with-owner`, `simple-entity-with-force`, or `flying-text` is visible to. `nil` or an empty array when this entity is rendered for all forces.
|
4998
5005
|
* @remarks Reading will always give an array of {@link LuaForce}
|
4999
5006
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.render_to_forces Online documentation}
|
5000
5007
|
*/
|
5001
|
-
get render_to_forces(): LuaForce[]
|
5002
|
-
set render_to_forces(value: readonly ForceIdentification[])
|
5008
|
+
get render_to_forces(): LuaForce[] | nil
|
5009
|
+
set render_to_forces(value: readonly ForceIdentification[] | nil)
|
5003
5010
|
/**
|
5004
5011
|
* Returns the id of the electric network that this entity is connected to, if any.
|
5005
5012
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_network_id Online documentation}
|
@@ -5784,21 +5791,21 @@ interface TrainStopEntity extends BaseEntity {
|
|
5784
5791
|
*/
|
5785
5792
|
readonly connected_rail_direction: defines.rail_direction
|
5786
5793
|
/**
|
5787
|
-
* Amount of trains related to this particular train stop. Includes train stopped at this train stop (until it finds a path to next target) and trains having this train stop as goal or waypoint.
|
5794
|
+
* Amount of trains related to this particular train stop. Includes train stopped at this train stop (until it finds a path to next target) and trains having this train stop as goal or waypoint.
|
5788
5795
|
*
|
5789
5796
|
* _Can only be used if this is TrainStop_
|
5790
5797
|
* @remarks Train may be included multiple times when braking distance covers this train stop multiple times<br>Value may be read even when train stop has no control behavior
|
5791
5798
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.trains_count Online documentation}
|
5792
5799
|
*/
|
5793
|
-
readonly trains_count: uint
|
5800
|
+
readonly trains_count: uint
|
5794
5801
|
/**
|
5795
|
-
* Amount of trains above which no new trains will be sent to this train stop.
|
5802
|
+
* Amount of trains above which no new trains will be sent to this train stop. Writing nil will disable the limit (will set a maximum possible value).
|
5796
5803
|
*
|
5797
5804
|
* _Can only be used if this is TrainStop_
|
5798
5805
|
* @remarks When a train stop has a control behavior with wire connected and set_trains_limit enabled, this value will be overwritten by it
|
5799
5806
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.trains_limit Online documentation}
|
5800
5807
|
*/
|
5801
|
-
trains_limit: uint
|
5808
|
+
trains_limit: uint | nil
|
5802
5809
|
}
|
5803
5810
|
|
5804
5811
|
/**
|
@@ -5885,6 +5892,13 @@ interface SpiderVehicleEntity extends BaseEntity {
|
|
5885
5892
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_spider_legs Online documentation}
|
5886
5893
|
*/
|
5887
5894
|
get_spider_legs(): LuaEntity[]
|
5895
|
+
/**
|
5896
|
+
* Stops the given SpiderVehicle.
|
5897
|
+
*
|
5898
|
+
* _Can only be used if this is SpiderVehicle_
|
5899
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.stop_spider Online documentation}
|
5900
|
+
*/
|
5901
|
+
stop_spider(): void
|
5888
5902
|
/**
|
5889
5903
|
* The torso orientation of this spider vehicle.
|
5890
5904
|
*
|
@@ -5905,8 +5919,8 @@ interface SpiderVehicleEntity extends BaseEntity {
|
|
5905
5919
|
* _Can only be used if this is SpiderVehicle_
|
5906
5920
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.autopilot_destination Online documentation}
|
5907
5921
|
*/
|
5908
|
-
get autopilot_destination(): MapPosition
|
5909
|
-
set autopilot_destination(value: MapPosition | MapPositionArray)
|
5922
|
+
get autopilot_destination(): MapPosition | nil
|
5923
|
+
set autopilot_destination(value: MapPosition | MapPositionArray | nil)
|
5910
5924
|
/**
|
5911
5925
|
* The queued destination positions of spidertron's autopilot.
|
5912
5926
|
*
|
@@ -6124,8 +6138,8 @@ interface CharacterEntity extends BaseEntity {
|
|
6124
6138
|
* @remarks A character associated with a player is not directly controlled by any player.
|
6125
6139
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.associated_player Online documentation}
|
6126
6140
|
*/
|
6127
|
-
get associated_player(): LuaPlayer |
|
6128
|
-
set associated_player(value: LuaPlayer | PlayerIdentification)
|
6141
|
+
get associated_player(): LuaPlayer | nil
|
6142
|
+
set associated_player(value: LuaPlayer | PlayerIdentification | nil)
|
6129
6143
|
/**
|
6130
6144
|
* The last tick this character entity was attacked.
|
6131
6145
|
*
|
@@ -6222,8 +6236,8 @@ interface EntityWithOwnerEntity extends BaseEntity {
|
|
6222
6236
|
* _Can only be used if this is EntityWithOwner_
|
6223
6237
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.last_user Online documentation}
|
6224
6238
|
*/
|
6225
|
-
get last_user(): LuaPlayer |
|
6226
|
-
set last_user(value: LuaPlayer | PlayerIdentification)
|
6239
|
+
get last_user(): LuaPlayer | nil
|
6240
|
+
set last_user(value: LuaPlayer | PlayerIdentification | nil)
|
6227
6241
|
}
|
6228
6242
|
|
6229
6243
|
interface ElectricEnergyInterfaceEntity extends BaseEntity {
|
@@ -11351,8 +11365,8 @@ interface LuaForce {
|
|
11351
11365
|
* Custom color for this force. If specified, will take priority over other sources of the force color. Writing nil clears custom color. Will return nil if it was not specified or if was set to {0,0,0,0}
|
11352
11366
|
* @see {@link https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.custom_color Online documentation}
|
11353
11367
|
*/
|
11354
|
-
get custom_color(): Color
|
11355
|
-
set custom_color(value: Color | ColorArray)
|
11368
|
+
get custom_color(): Color | nil
|
11369
|
+
set custom_color(value: Color | ColorArray | nil)
|
11356
11370
|
/**
|
11357
11371
|
* Effective color of this force.
|
11358
11372
|
* @see {@link https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.color Online documentation}
|
@@ -13278,8 +13292,8 @@ interface BaseGuiElement {
|
|
13278
13292
|
* The location of this widget when stored in {@link LuaGui#screen LuaGui::screen}. `nil` if not set or not in {@link LuaGui#screen LuaGui::screen}.
|
13279
13293
|
* @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.location Online documentation}
|
13280
13294
|
*/
|
13281
|
-
get location(): GuiLocation
|
13282
|
-
set location(value: GuiLocation | GuiLocationArray)
|
13295
|
+
get location(): GuiLocation | nil
|
13296
|
+
set location(value: GuiLocation | GuiLocationArray | nil)
|
13283
13297
|
/**
|
13284
13298
|
* Whether this GUI element is enabled. Disabled GUI elements don't trigger events when clicked.
|
13285
13299
|
* @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.enabled Online documentation}
|
@@ -16322,16 +16336,16 @@ interface LuaItemStack {
|
|
16322
16336
|
* _Can only be used if this is BlueprintItem_
|
16323
16337
|
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.blueprint_snap_to_grid Online documentation}
|
16324
16338
|
*/
|
16325
|
-
get blueprint_snap_to_grid(): TilePosition
|
16326
|
-
set blueprint_snap_to_grid(value: TilePosition | TilePositionArray)
|
16339
|
+
get blueprint_snap_to_grid(): TilePosition | nil
|
16340
|
+
set blueprint_snap_to_grid(value: TilePosition | TilePositionArray | nil)
|
16327
16341
|
/**
|
16328
16342
|
* The offset from the absolute grid. `nil` if absolute snapping is not enabled.
|
16329
16343
|
*
|
16330
16344
|
* _Can only be used if this is BlueprintItem_
|
16331
16345
|
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.blueprint_position_relative_to_grid Online documentation}
|
16332
16346
|
*/
|
16333
|
-
get blueprint_position_relative_to_grid(): TilePosition
|
16334
|
-
set blueprint_position_relative_to_grid(value: TilePosition | TilePositionArray)
|
16347
|
+
get blueprint_position_relative_to_grid(): TilePosition | nil
|
16348
|
+
set blueprint_position_relative_to_grid(value: TilePosition | TilePositionArray | nil)
|
16335
16349
|
/**
|
16336
16350
|
* If absolute snapping is enabled on this blueprint item.
|
16337
16351
|
*
|
@@ -16352,8 +16366,8 @@ interface LuaItemStack {
|
|
16352
16366
|
* _Can only be used if this is ItemWithLabel_
|
16353
16367
|
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.label_color Online documentation}
|
16354
16368
|
*/
|
16355
|
-
get label_color(): Color
|
16356
|
-
set label_color(value: Color | ColorArray)
|
16369
|
+
get label_color(): Color | nil
|
16370
|
+
set label_color(value: Color | ColorArray | nil)
|
16357
16371
|
/**
|
16358
16372
|
* Whether the label for this item can be manually changed. When false the label can only be changed through the API.
|
16359
16373
|
*
|
@@ -17007,16 +17021,16 @@ interface BlueprintItemStack extends BaseItemStack {
|
|
17007
17021
|
* _Can only be used if this is BlueprintItem_
|
17008
17022
|
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.blueprint_snap_to_grid Online documentation}
|
17009
17023
|
*/
|
17010
|
-
get blueprint_snap_to_grid(): TilePosition
|
17011
|
-
set blueprint_snap_to_grid(value: TilePosition | TilePositionArray)
|
17024
|
+
get blueprint_snap_to_grid(): TilePosition | nil
|
17025
|
+
set blueprint_snap_to_grid(value: TilePosition | TilePositionArray | nil)
|
17012
17026
|
/**
|
17013
17027
|
* The offset from the absolute grid. `nil` if absolute snapping is not enabled.
|
17014
17028
|
*
|
17015
17029
|
* _Can only be used if this is BlueprintItem_
|
17016
17030
|
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.blueprint_position_relative_to_grid Online documentation}
|
17017
17031
|
*/
|
17018
|
-
get blueprint_position_relative_to_grid(): TilePosition
|
17019
|
-
set blueprint_position_relative_to_grid(value: TilePosition | TilePositionArray)
|
17032
|
+
get blueprint_position_relative_to_grid(): TilePosition | nil
|
17033
|
+
set blueprint_position_relative_to_grid(value: TilePosition | TilePositionArray | nil)
|
17020
17034
|
/**
|
17021
17035
|
* If absolute snapping is enabled on this blueprint item.
|
17022
17036
|
*
|
@@ -17277,8 +17291,8 @@ interface ItemWithLabelItemStack extends BaseItemStack {
|
|
17277
17291
|
* _Can only be used if this is ItemWithLabel_
|
17278
17292
|
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.label_color Online documentation}
|
17279
17293
|
*/
|
17280
|
-
get label_color(): Color
|
17281
|
-
set label_color(value: Color | ColorArray)
|
17294
|
+
get label_color(): Color | nil
|
17295
|
+
set label_color(value: Color | ColorArray | nil)
|
17282
17296
|
/**
|
17283
17297
|
* Whether the label for this item can be manually changed. When false the label can only be changed through the API.
|
17284
17298
|
*
|
@@ -18340,7 +18354,7 @@ interface LuaPlayer extends LuaControl {
|
|
18340
18354
|
*/
|
18341
18355
|
remove_alert(params: {
|
18342
18356
|
readonly entity?: LuaEntity
|
18343
|
-
readonly prototype?: LuaEntityPrototype
|
18357
|
+
readonly prototype?: LuaEntityPrototype | string
|
18344
18358
|
readonly position?: MapPosition | MapPositionArray
|
18345
18359
|
readonly type?: defines.alert_type
|
18346
18360
|
readonly surface?: SurfaceIdentification
|
@@ -23084,7 +23098,7 @@ interface LuaSurface {
|
|
23084
23098
|
*/
|
23085
23099
|
readonly can_open_gates?: boolean
|
23086
23100
|
/**
|
23087
|
-
* Defines how coarse the pathfinder's grid is. Smaller values mean a coarser grid (negative numbers allowed). Defaults to `0`.
|
23101
|
+
* Defines how coarse the pathfinder's grid is. Smaller values mean a coarser grid (negative numbers allowed). Allowed values are from -8 to 8. Defaults to `0`.
|
23088
23102
|
*/
|
23089
23103
|
readonly path_resolution_modifier?: int
|
23090
23104
|
/**
|
@@ -23887,8 +23901,8 @@ interface LuaTrain {
|
|
23887
23901
|
* @remarks The schedule can't be changed by modifying the returned table. Instead, changes must be made by assigning a new table to this attribute.
|
23888
23902
|
* @see {@link https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.schedule Online documentation}
|
23889
23903
|
*/
|
23890
|
-
get schedule(): TrainSchedule
|
23891
|
-
set schedule(value: TrainScheduleWrite)
|
23904
|
+
get schedule(): TrainSchedule | nil
|
23905
|
+
set schedule(value: TrainScheduleWrite | nil)
|
23892
23906
|
/**
|
23893
23907
|
* This train's current state.
|
23894
23908
|
* @see {@link https://lua-api.factorio.com/latest/LuaTrain.html#LuaTrain.state Online documentation}
|
package/generated/concepts.d.ts
CHANGED
@@ -3398,6 +3398,9 @@ interface AmmoType {
|
|
3398
3398
|
* Energy consumption of a single shot, if applicable. Defaults to `0`.
|
3399
3399
|
*/
|
3400
3400
|
readonly energy_consumption?: double
|
3401
|
+
readonly range_modifier?: double
|
3402
|
+
readonly cooldown_modifier?: double
|
3403
|
+
readonly consumption_modifier?: double
|
3401
3404
|
}
|
3402
3405
|
|
3403
3406
|
interface BeamTarget {
|
@@ -4119,9 +4122,9 @@ interface LogisticFilter {
|
|
4119
4122
|
*/
|
4120
4123
|
interface ModSetting {
|
4121
4124
|
/**
|
4122
|
-
* The value of the mod setting. The type depends on the setting.
|
4125
|
+
* The value of the mod setting. The type depends on the kind of setting.
|
4123
4126
|
*/
|
4124
|
-
readonly value:
|
4127
|
+
readonly value: int | double | boolean | string
|
4125
4128
|
}
|
4126
4129
|
|
4127
4130
|
/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "typed-factorio",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.7.2",
|
4
4
|
"description": "Featureful typescript definitions for the the Factorio modding lua api.",
|
5
5
|
"keywords": [
|
6
6
|
"factorio",
|
@@ -11,7 +11,9 @@
|
|
11
11
|
"repository": "https://github.com/GlassBricks/typed-factorio",
|
12
12
|
"license": "MIT",
|
13
13
|
"files": [
|
14
|
-
"**/*.d.ts"
|
14
|
+
"**/*.d.ts",
|
15
|
+
"*.d.ts",
|
16
|
+
"!generator/**/*"
|
15
17
|
],
|
16
18
|
"homepage": "https://github.com/GlassBricks/typed-factorio#readme",
|
17
19
|
"scripts": {
|
@@ -27,31 +29,32 @@
|
|
27
29
|
"next-version": "yarn run download-latest-runtime-api && yarn run clean && yarn run check && yarn run new-version-changelog && git add . && yarn version --minor"
|
28
30
|
},
|
29
31
|
"peerDependencies": {
|
30
|
-
"lua-types": "^2.
|
32
|
+
"lua-types": "^2.12.2",
|
31
33
|
"typescript-to-lua": "^1.6.1"
|
32
34
|
},
|
33
35
|
"devDependencies": {
|
34
|
-
"@types/jest": "^28.1.
|
35
|
-
"@types/node": "^18.
|
36
|
-
"@types/prettier": "^2.
|
37
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
38
|
-
"@typescript-eslint/parser": "^5.
|
36
|
+
"@types/jest": "^28.1.8",
|
37
|
+
"@types/node": "^18.7.14",
|
38
|
+
"@types/prettier": "^2.7.0",
|
39
|
+
"@typescript-eslint/eslint-plugin": "^5.36.1",
|
40
|
+
"@typescript-eslint/parser": "^5.36.1",
|
39
41
|
"chalk": "^4.1.2",
|
40
|
-
"eslint": "
|
42
|
+
"eslint": "~8.22.0",
|
41
43
|
"eslint-config-prettier": "^8.5.0",
|
42
44
|
"eslint-config-standard": "^17.0.0",
|
43
|
-
"eslint-import-resolver-typescript": "^3.
|
45
|
+
"eslint-import-resolver-typescript": "^3.5.0",
|
44
46
|
"eslint-plugin-import": "^2.26.0",
|
45
|
-
"eslint-plugin-n": "^15.2.
|
47
|
+
"eslint-plugin-n": "^15.2.5",
|
46
48
|
"eslint-plugin-node": "^11.1.0",
|
47
49
|
"eslint-plugin-prettier": "^4.2.1",
|
48
|
-
"eslint-plugin-promise": "^6.0.
|
50
|
+
"eslint-plugin-promise": "^6.0.1",
|
49
51
|
"jest": "^28.1.3",
|
50
|
-
"lua-types": "^2.
|
52
|
+
"lua-types": "^2.12.2",
|
51
53
|
"prettier": "^2.7.1",
|
52
|
-
"ts-jest": "^28.0.
|
54
|
+
"ts-jest": "^28.0.8",
|
53
55
|
"ts-node": "^10.9.1",
|
54
|
-
"typescript": "
|
55
|
-
"typescript-to-lua": "^1.
|
56
|
-
}
|
57
|
-
|
56
|
+
"typescript": "~4.7.4",
|
57
|
+
"typescript-to-lua": "^1.9.0"
|
58
|
+
},
|
59
|
+
"packageManager": "yarn@3.2.3"
|
60
|
+
}
|