typed-factorio 1.1.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- package/Changelog.md +13 -1
- package/README.md +25 -28
- package/generated/classes.d.ts +266 -63
- package/generated/concepts.d.ts +33 -25
- package/generated/defines.d.ts +2 -2
- package/generated/events.d.ts +1 -1
- package/package.json +3 -2
package/Changelog.md
CHANGED
@@ -1,10 +1,22 @@
|
|
1
|
+
# v1.3.1
|
2
|
+
|
3
|
+
- Use @linkplain instead of @link for web links. This works around issue #13
|
4
|
+
|
5
|
+
# v1.3.0
|
6
|
+
|
7
|
+
- Updated to factorio version 1.1.61
|
8
|
+
|
9
|
+
# v1.2.0
|
10
|
+
|
11
|
+
- Updated to factorio version 1.1.60
|
12
|
+
|
1
13
|
# v1.1.0
|
2
14
|
|
3
15
|
- Updated to factorio version 1.1.59
|
4
16
|
|
5
17
|
# v1.0.0
|
6
18
|
|
7
|
-
- This project now has all the features that was originally planned, and can now guarantee reasonable backwards compatibility for future releases.
|
19
|
+
- This project now has all the features that was originally planned, and can now guarantee reasonable backwards compatibility for future releases.
|
8
20
|
- Updated to factorio version 1.1.57
|
9
21
|
|
10
22
|
# v0.20.0
|
package/README.md
CHANGED
@@ -71,54 +71,52 @@ The `global` table is just a lua table which can have any shape the mod desires,
|
|
71
71
|
|
72
72
|
## Type features
|
73
73
|
|
74
|
-
|
74
|
+
Here is a quick overview of type features:
|
75
75
|
|
76
|
-
|
77
|
-
|
78
|
-
### Lua features
|
79
|
-
|
80
|
-
The types include [TypescriptToLua language extensions](https://typescripttolua.github.io/docs/advanced/language-extensions/)
|
81
|
-
and [lua-types](https://github.com/TypeScriptToLua/lua-types) (for v5.2) as dependencies.
|
82
|
-
|
83
|
-
### `nil`
|
76
|
+
### Nullability
|
84
77
|
|
85
78
|
The types consistently use `undefined` to represent `nil`.
|
86
|
-
`null` is not used, because `undefined` in typescript is much more similar to `nil` in lua, and optional parameters/properties already use `undefined`.
|
87
79
|
|
88
|
-
A class attribute is marked as possibly undefined only if the _read_ type is possibly `nil`. For properties where `nil` is not possible on _read_, but
|
80
|
+
A class attribute is marked as possibly undefined only if the _read_ type is possibly `nil`. For properties where `nil` is not possible on _read_, but possible on _write_, you can write `nil` by using `undefined!` or `myNullableValue!`, e.g. `controlBehavior.parameters = undefined!`.
|
89
81
|
|
90
|
-
###
|
82
|
+
### Parameter Variants
|
91
83
|
|
92
|
-
|
93
|
-
|
94
|
-
The type for a specific variant is prefixed with the variant name, or with "Other" for variants without additional fields (e.g. `AmmoDamageTechnologyModifier`, `OtherTechnologyModifier`).
|
84
|
+
Parameters with variants (with "additional fields can be specified depending on type ...") are defined as a union of all variants. The type for a specific variant is prefixed with the variant name, or "Other" types variants without extra properties (e.g. `AmmoDamageTechnologyModifier`, `OtherTechnologyModifier`).
|
95
85
|
|
96
86
|
### Events
|
97
87
|
|
98
|
-
|
99
|
-
|
100
|
-
You can pass a type parameter to `script.generate_event_name<T>()`, and it will return an `EventId` that holds type info of the event data. Event functions on `script` can then use the type data when the `EventId` is passed.
|
88
|
+
Event IDs (`defines.events`) carry information about their event type and possible filters, which is used by the various methods on `script`.
|
89
|
+
You can pass a type parameter to `script.generate_event_name<T>()`, and it will return an `EventId` that holds type info of the event data.
|
101
90
|
|
102
|
-
### Array-like
|
91
|
+
### Array-like classes
|
103
92
|
|
104
93
|
Classes that have an index operator, a length operator, and have an array-like structure, inherit from `(Readonly)Array`. These are `LuaInventory`, `LuaFluidBox`, `LuaTransportLine`. This allows you to use these classes like arrays, meaning having array methods, and `.length` translating to the lua length operator. However, this also means, like typescript arrays, they are **0-indexed, not 1-indexed**.
|
105
94
|
|
106
|
-
### Table
|
95
|
+
### Table-or-array concepts, and "Read" variants
|
107
96
|
|
108
97
|
For table-or-array types (e.g. Position), there also are types such as `PositionTable` and `PositionArray` that refer to the table or array form.
|
109
98
|
|
110
|
-
Table-or-array types will appear in
|
99
|
+
Table-or-array types will appear in Table form when known to be in a read position. This also applies to other concepts/types that have table-or-array attributes.
|
111
100
|
|
112
|
-
For some concepts, there is also a special form for when
|
101
|
+
For some concepts, there is also a special form for when it is used in a "read" position, where all table-or-array types are in Table form. These types are suffixed with `Read`, e.g. `ScriptPositionRead`, `BoundingBoxRead`.
|
113
102
|
|
114
|
-
###
|
103
|
+
### Classes with subclasses
|
115
104
|
|
116
|
-
Some classes have attributes that are documented to only work
|
105
|
+
Some classes have attributes that are documented to only work for particular subclasses. For these classes, e.g. `LuaEntity`, there are specific types that you can _optionally_ use:
|
117
106
|
|
118
107
|
- a "Base" type, e.g. `BaseEntity`, which only contains members usable by all subclasses
|
119
|
-
- individual subclass types, e.g. `CraftingMachineEntity`, which extends the base type with members specific to that subclass
|
108
|
+
- individual subclass types, e.g. `CraftingMachineEntity`, which extends the base type with members specific to that subclass.
|
120
109
|
|
121
|
-
The simple class name, `LuaEntity
|
110
|
+
The simple class name, e.g. `LuaEntity`, contains attributes for _all_ subclasses.
|
111
|
+
|
112
|
+
For stricter types, use the `Base` type generally, and the specific subclass type when needed.
|
113
|
+
You can also create your own type-narrowing functions, like so:
|
114
|
+
|
115
|
+
```ts
|
116
|
+
function isCraftingMachineEntity(entity: LuaEntity): entity is CraftingMachineEntity {
|
117
|
+
return entity.type === "crafting-machine"
|
118
|
+
}
|
119
|
+
```
|
122
120
|
|
123
121
|
### LuaGuiElement
|
124
122
|
|
@@ -132,7 +130,6 @@ This is done both to provide more accurate types, and for possible integration w
|
|
132
130
|
|
133
131
|
This is a recommended **opt-in** feature. To opt in, add `"typed-factorio/strict-index-types"` to `compilerOptions > types` in your tsconfig.json (in addition to `"typed-factorio/runtime"`).
|
134
132
|
|
135
|
-
Some `uint` types which represent indices, e.g. player_index, entity_number, can be "branded" numbers with their own type, e.g. `PlayerIndex` and `EntityNumber`.
|
136
|
-
These are indices that do not index into an array-like structure, and otherwise should usually not have arithmetic done to them.
|
133
|
+
Some `uint` types which represent unique indices, e.g. player_index, entity_number, can be "branded" numbers with their own type, e.g. `PlayerIndex` and `EntityNumber`. If opted-in, these index-types will be still assignable to `number`, but a plain `number` is not directly assignable to them. This helps ensure correctness.
|
137
134
|
You can use these types as keys in an index signature, e.g. `{ [index: PlayerIndex]: "foo" }`.
|
138
135
|
You can cast "plain" numbers to these types, e.g. `1 as PlayerIndex`, do this with caution.
|
package/generated/classes.d.ts
CHANGED
@@ -222,11 +222,11 @@ interface LuaAutoplaceControlPrototype {
|
|
222
222
|
*/
|
223
223
|
interface LuaBootstrap {
|
224
224
|
/**
|
225
|
-
* Register a function to be run on mod initialization. This is only called when a new save game is created or when a save file is loaded that previously didn't contain the mod. During it, the mod gets the chance to set up initial values that it will use for its lifetime. It has full access to {@link LuaGameScript} and the {@
|
225
|
+
* Register a function to be run on mod initialization. This is only called when a new save game is created or when a save file is loaded that previously didn't contain the mod. During it, the mod gets the chance to set up initial values that it will use for its lifetime. It has full access to {@link LuaGameScript} and the {@linkplain https://lua-api.factorio.com/latest/Global.html global} table and can change anything about them that it deems appropriate. No other events will be raised for the mod until it has finished this step.
|
226
226
|
*
|
227
227
|
* {@link https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_init View documentation}
|
228
228
|
* @param f The handler for this event. Passing `nil` will unregister it.
|
229
|
-
* @remarks For more context, refer to the {@
|
229
|
+
* @remarks For more context, refer to the {@linkplain https://lua-api.factorio.com/latest/Data-Lifecycle.html Data Lifecycle} page.
|
230
230
|
* @example Initialize a `players` table in `global` for later use.
|
231
231
|
*
|
232
232
|
* ```
|
@@ -237,26 +237,26 @@ interface LuaBootstrap {
|
|
237
237
|
*/
|
238
238
|
on_init(f: (() => void) | undefined): void
|
239
239
|
/**
|
240
|
-
* Register a function to be run on save load. This is only called for mods that have been part of the save previously, or for players connecting to a running multiplayer session. It gives the mod the opportunity to do some very specific actions, should it need to. Doing anything other than these three will lead to desyncs, which breaks multiplayer and replay functionality. Access to {@link LuaGameScript} is not available. The {@
|
240
|
+
* Register a function to be run on save load. This is only called for mods that have been part of the save previously, or for players connecting to a running multiplayer session. It gives the mod the opportunity to do some very specific actions, should it need to. Doing anything other than these three will lead to desyncs, which breaks multiplayer and replay functionality. Access to {@link LuaGameScript} is not available. The {@linkplain https://lua-api.factorio.com/latest/Global.html global} table can be accessed and is safe to read from, but not write to, as doing so will lead to an error.
|
241
241
|
*
|
242
242
|
* The only legitimate uses of this event are the following:
|
243
|
-
* - Re-setup {@
|
243
|
+
* - Re-setup {@linkplain https://www.lua.org/pil/13.html metatables} as they are not persisted through the save/load cycle.
|
244
244
|
* - Re-setup conditional event handlers, meaning subscribing to an event only when some condition is met to save processing time.
|
245
|
-
* - Create local references to data stored in the {@
|
245
|
+
* - Create local references to data stored in the {@linkplain https://lua-api.factorio.com/latest/Global.html global} table.
|
246
246
|
*
|
247
|
-
* For all other purposes, {@link LuaBootstrap#on_init LuaBootstrap::on_init}, {@link LuaBootstrap#on_configuration_changed LuaBootstrap::on_configuration_changed} or {@
|
247
|
+
* For all other purposes, {@link LuaBootstrap#on_init LuaBootstrap::on_init}, {@link LuaBootstrap#on_configuration_changed LuaBootstrap::on_configuration_changed} or {@linkplain https://lua-api.factorio.com/latest/Migrations.html migrations} should be used instead.
|
248
248
|
*
|
249
249
|
* {@link https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_load View documentation}
|
250
250
|
* @param f The handler for this event. Passing `nil` will unregister it.
|
251
|
-
* @remarks For more context, refer to the {@
|
251
|
+
* @remarks For more context, refer to the {@linkplain https://lua-api.factorio.com/latest/Data-Lifecycle.html Data Lifecycle} page.
|
252
252
|
*/
|
253
253
|
on_load(f: (() => void) | undefined): void
|
254
254
|
/**
|
255
|
-
* Register a function to be run when mod configuration changes. This is called when the major game version or any mod version changed, when any mod was added or removed, when a startup setting has changed, or when any prototypes have been added or removed. It allows the mod to make any changes it deems appropriate to both the data structures in its {@
|
255
|
+
* Register a function to be run when mod configuration changes. This is called when the major game version or any mod version changed, when any mod was added or removed, when a startup setting has changed, or when any prototypes have been added or removed. It allows the mod to make any changes it deems appropriate to both the data structures in its {@linkplain https://lua-api.factorio.com/latest/Global.html global} table or to the game state through {@link LuaGameScript}.
|
256
256
|
*
|
257
257
|
* {@link https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_configuration_changed View documentation}
|
258
258
|
* @param f The handler for this event. Passing `nil` will unregister it.
|
259
|
-
* @remarks For more context, refer to the {@
|
259
|
+
* @remarks For more context, refer to the {@linkplain https://lua-api.factorio.com/latest/Data-Lifecycle.html Data Lifecycle} page.
|
260
260
|
*/
|
261
261
|
on_configuration_changed(f: ((param1: ConfigurationChangedData) => void) | undefined): void
|
262
262
|
/**
|
@@ -887,7 +887,7 @@ interface LuaCommandProcessor {
|
|
887
887
|
*/
|
888
888
|
readonly commands: Record<string, LocalisedString>
|
889
889
|
/**
|
890
|
-
* Lists the built-in commands of the core game. The {@
|
890
|
+
* Lists the built-in commands of the core game. The {@linkplain https://wiki.factorio.com/Console wiki} has an overview of these.
|
891
891
|
*
|
892
892
|
* {@link https://lua-api.factorio.com/latest/LuaCommandProcessor.html#LuaCommandProcessor.game_commands View documentation}
|
893
893
|
*/
|
@@ -1423,7 +1423,7 @@ interface LuaControl {
|
|
1423
1423
|
*
|
1424
1424
|
* {@link https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.crafting_queue_progress View documentation}
|
1425
1425
|
*/
|
1426
|
-
|
1426
|
+
crafting_queue_progress: double
|
1427
1427
|
/**
|
1428
1428
|
* Current walking state.
|
1429
1429
|
*
|
@@ -1554,6 +1554,10 @@ interface LuaControl {
|
|
1554
1554
|
/**
|
1555
1555
|
* `true` if the player is in a vehicle. Writing to this attribute puts the player in or out of a vehicle.
|
1556
1556
|
*
|
1557
|
+
* **Raised events:**
|
1558
|
+
* - {@link OnPlayerDrivingChangedStateEvent on_player_driving_changed_state}? _instantly_ Raised if the driving state successfully changed.
|
1559
|
+
*
|
1560
|
+
*
|
1557
1561
|
* {@link https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.driving View documentation}
|
1558
1562
|
*/
|
1559
1563
|
driving: boolean
|
@@ -2885,6 +2889,9 @@ interface LuaEntity extends LuaControl {
|
|
2885
2889
|
/**
|
2886
2890
|
* Sets the driver of this vehicle.
|
2887
2891
|
*
|
2892
|
+
* **Raised events:**
|
2893
|
+
* - {@link OnPlayerDrivingChangedStateEvent on_player_driving_changed_state}? _instantly_
|
2894
|
+
*
|
2888
2895
|
* _Can only be used if this is Vehicle_
|
2889
2896
|
*
|
2890
2897
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_driver View documentation}
|
@@ -2905,6 +2912,9 @@ interface LuaEntity extends LuaControl {
|
|
2905
2912
|
/**
|
2906
2913
|
* Sets the passenger of this car or spidertron.
|
2907
2914
|
*
|
2915
|
+
* **Raised events:**
|
2916
|
+
* - {@link OnPlayerDrivingChangedStateEvent on_player_driving_changed_state}? _instantly_
|
2917
|
+
*
|
2908
2918
|
* _Can only be used if this is Vehicle_
|
2909
2919
|
*
|
2910
2920
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_passenger View documentation}
|
@@ -3800,13 +3810,13 @@ interface LuaEntity extends LuaControl {
|
|
3800
3810
|
*/
|
3801
3811
|
readonly electric_emissions: double | undefined
|
3802
3812
|
/**
|
3803
|
-
* A universally unique number identifying this entity for the lifetime of the save. Only entities inheriting from {@
|
3813
|
+
* A universally unique number identifying this entity for the lifetime of the save. Only entities inheriting from {@linkplain https://wiki.factorio.com/Prototype/EntityWithOwner EntityWithOwner}, as well as {@linkplain https://wiki.factorio.com/Prototype/ItemRequestProxy ItemRequestProxy} and {@linkplain https://wiki.factorio.com/Prototype/EntityGhost EntityGhost} entities, are assigned a unit number. This property is `nil` for entities without unit number.
|
3804
3814
|
*
|
3805
3815
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_number View documentation}
|
3806
3816
|
*/
|
3807
3817
|
readonly unit_number: UnitNumber | undefined
|
3808
3818
|
/**
|
3809
|
-
* The {@link LuaEntity#unit_number unit_number} of the entity contained in this ghost. It is the same as the unit number of the {@
|
3819
|
+
* The {@link LuaEntity#unit_number unit_number} of the entity contained in this ghost. It is the same as the unit number of the {@linkplain https://wiki.factorio.com/Prototype/EntityWithOwner EntityWithOwner} that was destroyed to create this ghost. If it was created by other means, or if the inner entity doesn not support unit numbers, this property is `nil`.
|
3810
3820
|
*
|
3811
3821
|
* _Can only be used if this is EntityGhost_
|
3812
3822
|
*
|
@@ -3848,7 +3858,7 @@ interface LuaEntity extends LuaControl {
|
|
3848
3858
|
*/
|
3849
3859
|
readonly bounding_box: BoundingBoxRead
|
3850
3860
|
/**
|
3851
|
-
* The secondary bounding box of this entity or `nil` if it doesn't have one.
|
3861
|
+
* The secondary bounding box of this entity or `nil` if it doesn't have one. This only exists for curved rails, and is automatically determined by the game.
|
3852
3862
|
*
|
3853
3863
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.secondary_bounding_box View documentation}
|
3854
3864
|
*/
|
@@ -3860,7 +3870,7 @@ interface LuaEntity extends LuaControl {
|
|
3860
3870
|
*/
|
3861
3871
|
readonly selection_box: BoundingBoxRead
|
3862
3872
|
/**
|
3863
|
-
* The secondary selection box of this entity or `nil` if it doesn't have one.
|
3873
|
+
* The secondary selection box of this entity or `nil` if it doesn't have one. This only exists for curved rails, and is automatically determined by the game.
|
3864
3874
|
*
|
3865
3875
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.secondary_selection_box View documentation}
|
3866
3876
|
*/
|
@@ -5378,7 +5388,7 @@ interface BaseEntity extends LuaControl {
|
|
5378
5388
|
*/
|
5379
5389
|
readonly electric_emissions: double | undefined
|
5380
5390
|
/**
|
5381
|
-
* A universally unique number identifying this entity for the lifetime of the save. Only entities inheriting from {@
|
5391
|
+
* A universally unique number identifying this entity for the lifetime of the save. Only entities inheriting from {@linkplain https://wiki.factorio.com/Prototype/EntityWithOwner EntityWithOwner}, as well as {@linkplain https://wiki.factorio.com/Prototype/ItemRequestProxy ItemRequestProxy} and {@linkplain https://wiki.factorio.com/Prototype/EntityGhost EntityGhost} entities, are assigned a unit number. This property is `nil` for entities without unit number.
|
5382
5392
|
*
|
5383
5393
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_number View documentation}
|
5384
5394
|
*/
|
@@ -5402,7 +5412,7 @@ interface BaseEntity extends LuaControl {
|
|
5402
5412
|
*/
|
5403
5413
|
readonly bounding_box: BoundingBoxRead
|
5404
5414
|
/**
|
5405
|
-
* The secondary bounding box of this entity or `nil` if it doesn't have one.
|
5415
|
+
* The secondary bounding box of this entity or `nil` if it doesn't have one. This only exists for curved rails, and is automatically determined by the game.
|
5406
5416
|
*
|
5407
5417
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.secondary_bounding_box View documentation}
|
5408
5418
|
*/
|
@@ -5414,7 +5424,7 @@ interface BaseEntity extends LuaControl {
|
|
5414
5424
|
*/
|
5415
5425
|
readonly selection_box: BoundingBoxRead
|
5416
5426
|
/**
|
5417
|
-
* The secondary selection box of this entity or `nil` if it doesn't have one.
|
5427
|
+
* The secondary selection box of this entity or `nil` if it doesn't have one. This only exists for curved rails, and is automatically determined by the game.
|
5418
5428
|
*
|
5419
5429
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.secondary_selection_box View documentation}
|
5420
5430
|
*/
|
@@ -5796,7 +5806,7 @@ interface EntityGhostEntity extends BaseEntity {
|
|
5796
5806
|
*/
|
5797
5807
|
ghost_has_flag(flag: keyof EntityPrototypeFlags): boolean
|
5798
5808
|
/**
|
5799
|
-
* The {@link LuaEntity#unit_number unit_number} of the entity contained in this ghost. It is the same as the unit number of the {@
|
5809
|
+
* The {@link LuaEntity#unit_number unit_number} of the entity contained in this ghost. It is the same as the unit number of the {@linkplain https://wiki.factorio.com/Prototype/EntityWithOwner EntityWithOwner} that was destroyed to create this ghost. If it was created by other means, or if the inner entity doesn not support unit numbers, this property is `nil`.
|
5800
5810
|
*
|
5801
5811
|
* _Can only be used if this is EntityGhost_
|
5802
5812
|
*
|
@@ -6293,6 +6303,9 @@ interface VehicleEntity extends BaseEntity {
|
|
6293
6303
|
/**
|
6294
6304
|
* Sets the driver of this vehicle.
|
6295
6305
|
*
|
6306
|
+
* **Raised events:**
|
6307
|
+
* - {@link OnPlayerDrivingChangedStateEvent on_player_driving_changed_state}? _instantly_
|
6308
|
+
*
|
6296
6309
|
* _Can only be used if this is Vehicle_
|
6297
6310
|
*
|
6298
6311
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_driver View documentation}
|
@@ -6313,6 +6326,9 @@ interface VehicleEntity extends BaseEntity {
|
|
6313
6326
|
/**
|
6314
6327
|
* Sets the passenger of this car or spidertron.
|
6315
6328
|
*
|
6329
|
+
* **Raised events:**
|
6330
|
+
* - {@link OnPlayerDrivingChangedStateEvent on_player_driving_changed_state}? _instantly_
|
6331
|
+
*
|
6316
6332
|
* _Can only be used if this is Vehicle_
|
6317
6333
|
*
|
6318
6334
|
* {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_passenger View documentation}
|
@@ -7595,6 +7611,12 @@ interface LuaEntityPrototype {
|
|
7595
7611
|
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.guns View documentation}
|
7596
7612
|
*/
|
7597
7613
|
readonly guns: Record<string, LuaItemPrototype> | undefined
|
7614
|
+
/**
|
7615
|
+
* A vector of the gun prototypes this prototype uses, or `nil`.
|
7616
|
+
*
|
7617
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.indexed_guns View documentation}
|
7618
|
+
*/
|
7619
|
+
readonly indexed_guns: LuaItemPrototype[] | undefined
|
7598
7620
|
/**
|
7599
7621
|
* The default speed of this flying robot, rolling stock or unit, `nil` if not one of these.
|
7600
7622
|
*
|
@@ -8334,6 +8356,58 @@ interface LuaEntityPrototype {
|
|
8334
8356
|
readonly robots_shrink_when_entering_and_exiting: boolean
|
8335
8357
|
}
|
8336
8358
|
| undefined
|
8359
|
+
/**
|
8360
|
+
* Gets the height of this prototype. `nil` if this is not a spider vechicle.
|
8361
|
+
*
|
8362
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.height View documentation}
|
8363
|
+
*/
|
8364
|
+
readonly height: double | undefined
|
8365
|
+
/**
|
8366
|
+
* Gets the torso rotation speed of this prototype. `nil` if this is not a spider vechicle.
|
8367
|
+
*
|
8368
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.torso_rotation_speed View documentation}
|
8369
|
+
*/
|
8370
|
+
readonly torso_rotation_speed: double | undefined
|
8371
|
+
/**
|
8372
|
+
* Does this prototoype automaticly cycle weapons. `nil` if this is not a spider vechicle.
|
8373
|
+
*
|
8374
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.automatic_weapon_cycling View documentation}
|
8375
|
+
*/
|
8376
|
+
readonly automatic_weapon_cycling: boolean | undefined
|
8377
|
+
/**
|
8378
|
+
* Gets the chain shooting cooldown modifier of this prototype. `nil` if this is not a spider vechicle.
|
8379
|
+
*
|
8380
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.chain_shooting_cooldown_modifier View documentation}
|
8381
|
+
*/
|
8382
|
+
readonly chain_shooting_cooldown_modifier: double | undefined
|
8383
|
+
/**
|
8384
|
+
* Gets the chunk exploration radius of this prototype. `nil` if this is not a spider vechicle.
|
8385
|
+
*
|
8386
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.chunk_exploration_radius View documentation}
|
8387
|
+
*/
|
8388
|
+
readonly chunk_exploration_radius: double | undefined
|
8389
|
+
/**
|
8390
|
+
* Gets the animation speed coefficient of this belt . `nil` if this is not transport belt connectable.
|
8391
|
+
*
|
8392
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.animation_speed_coefficient View documentation}
|
8393
|
+
*/
|
8394
|
+
readonly animation_speed_coefficient: double | undefined
|
8395
|
+
/**
|
8396
|
+
* Get the manual range modifier for artillery turret and artillery wagon prototypes. `nil` if not artillery type prototype
|
8397
|
+
*
|
8398
|
+
* subclass(ArtilleryWagon, ArtilleryTurret)
|
8399
|
+
*
|
8400
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.manual_range_modifier View documentation}
|
8401
|
+
*/
|
8402
|
+
readonly manual_range_modifier: double | undefined
|
8403
|
+
/**
|
8404
|
+
* The dying time of this corpse prototype. `nil` if not a corpse prototype.
|
8405
|
+
*
|
8406
|
+
* _Can only be used if this is Corpse_
|
8407
|
+
*
|
8408
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.dying_speed View documentation}
|
8409
|
+
*/
|
8410
|
+
readonly dying_speed: float | undefined
|
8337
8411
|
/**
|
8338
8412
|
* Gets the current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.
|
8339
8413
|
*
|
@@ -8984,6 +9058,12 @@ interface BaseEntityPrototype {
|
|
8984
9058
|
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.guns View documentation}
|
8985
9059
|
*/
|
8986
9060
|
readonly guns: Record<string, LuaItemPrototype> | undefined
|
9061
|
+
/**
|
9062
|
+
* A vector of the gun prototypes this prototype uses, or `nil`.
|
9063
|
+
*
|
9064
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.indexed_guns View documentation}
|
9065
|
+
*/
|
9066
|
+
readonly indexed_guns: LuaItemPrototype[] | undefined
|
8987
9067
|
/**
|
8988
9068
|
* The default speed of this flying robot, rolling stock or unit, `nil` if not one of these.
|
8989
9069
|
*
|
@@ -9645,6 +9725,50 @@ interface BaseEntityPrototype {
|
|
9645
9725
|
readonly robots_shrink_when_entering_and_exiting: boolean
|
9646
9726
|
}
|
9647
9727
|
| undefined
|
9728
|
+
/**
|
9729
|
+
* Gets the height of this prototype. `nil` if this is not a spider vechicle.
|
9730
|
+
*
|
9731
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.height View documentation}
|
9732
|
+
*/
|
9733
|
+
readonly height: double | undefined
|
9734
|
+
/**
|
9735
|
+
* Gets the torso rotation speed of this prototype. `nil` if this is not a spider vechicle.
|
9736
|
+
*
|
9737
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.torso_rotation_speed View documentation}
|
9738
|
+
*/
|
9739
|
+
readonly torso_rotation_speed: double | undefined
|
9740
|
+
/**
|
9741
|
+
* Does this prototoype automaticly cycle weapons. `nil` if this is not a spider vechicle.
|
9742
|
+
*
|
9743
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.automatic_weapon_cycling View documentation}
|
9744
|
+
*/
|
9745
|
+
readonly automatic_weapon_cycling: boolean | undefined
|
9746
|
+
/**
|
9747
|
+
* Gets the chain shooting cooldown modifier of this prototype. `nil` if this is not a spider vechicle.
|
9748
|
+
*
|
9749
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.chain_shooting_cooldown_modifier View documentation}
|
9750
|
+
*/
|
9751
|
+
readonly chain_shooting_cooldown_modifier: double | undefined
|
9752
|
+
/**
|
9753
|
+
* Gets the chunk exploration radius of this prototype. `nil` if this is not a spider vechicle.
|
9754
|
+
*
|
9755
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.chunk_exploration_radius View documentation}
|
9756
|
+
*/
|
9757
|
+
readonly chunk_exploration_radius: double | undefined
|
9758
|
+
/**
|
9759
|
+
* Gets the animation speed coefficient of this belt . `nil` if this is not transport belt connectable.
|
9760
|
+
*
|
9761
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.animation_speed_coefficient View documentation}
|
9762
|
+
*/
|
9763
|
+
readonly animation_speed_coefficient: double | undefined
|
9764
|
+
/**
|
9765
|
+
* Get the manual range modifier for artillery turret and artillery wagon prototypes. `nil` if not artillery type prototype
|
9766
|
+
*
|
9767
|
+
* subclass(ArtilleryWagon, ArtilleryTurret)
|
9768
|
+
*
|
9769
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.manual_range_modifier View documentation}
|
9770
|
+
*/
|
9771
|
+
readonly manual_range_modifier: double | undefined
|
9648
9772
|
/**
|
9649
9773
|
* Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
|
9650
9774
|
*/
|
@@ -9752,6 +9876,17 @@ interface EntityWithOwnerEntityPrototype extends BaseEntityPrototype {
|
|
9752
9876
|
readonly allow_run_time_change_of_is_military_target: boolean
|
9753
9877
|
}
|
9754
9878
|
|
9879
|
+
interface CorpseEntityPrototype extends BaseEntityPrototype {
|
9880
|
+
/**
|
9881
|
+
* The dying time of this corpse prototype. `nil` if not a corpse prototype.
|
9882
|
+
*
|
9883
|
+
* _Can only be used if this is Corpse_
|
9884
|
+
*
|
9885
|
+
* {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.dying_speed View documentation}
|
9886
|
+
*/
|
9887
|
+
readonly dying_speed: float | undefined
|
9888
|
+
}
|
9889
|
+
|
9755
9890
|
interface CharacterEntityPrototype extends BaseEntityPrototype {
|
9756
9891
|
/**
|
9757
9892
|
* Gets the current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.
|
@@ -10369,7 +10504,7 @@ interface LuaEquipmentPrototype {
|
|
10369
10504
|
*
|
10370
10505
|
* Examples:
|
10371
10506
|
* - The item production GUI shows "consumption" on the right, thus `output` describes the item consumption numbers. The same goes for fluid consumption.
|
10372
|
-
* - The kills
|
10507
|
+
* - The kills GUI shows "losses" on the right, so `output` describes how many of the force's entities were killed by enemies.
|
10373
10508
|
* - The electric network GUI shows "power consumption" on the left side, so in this case `input` describes the power consumption numbers.
|
10374
10509
|
*
|
10375
10510
|
* {@link https://lua-api.factorio.com/latest/LuaFlowStatistics.html View documentation}
|
@@ -10407,7 +10542,11 @@ interface LuaFlowStatistics {
|
|
10407
10542
|
*/
|
10408
10543
|
set_output_count(name: string, count: uint64 | double): void
|
10409
10544
|
/**
|
10410
|
-
* Gets the flow count value for the given time frame.
|
10545
|
+
* Gets the flow count value for the given time frame. If `sample_index` is not provided, then the value returned is the average across the provided precision time period. These are the values shown in the bottom section of the statistics GUIs.
|
10546
|
+
*
|
10547
|
+
* Use `sample_index` to access the data used to generate the statistics graphs. Each precision level contains 300 samples of data so at a precision of 1 minute, each sample contains data averaged across 60s / 300 = 0.2s = 12 ticks.
|
10548
|
+
*
|
10549
|
+
* All return values are normalized to be per-tick for electric networks and per-minute for all other types.
|
10411
10550
|
*
|
10412
10551
|
* {@link https://lua-api.factorio.com/latest/LuaFlowStatistics.html#LuaFlowStatistics.get_flow_count View documentation}
|
10413
10552
|
*/
|
@@ -10421,11 +10560,15 @@ interface LuaFlowStatistics {
|
|
10421
10560
|
*/
|
10422
10561
|
readonly input: boolean
|
10423
10562
|
/**
|
10424
|
-
* The precision to read.
|
10563
|
+
* The precision range to read.
|
10425
10564
|
*/
|
10426
10565
|
readonly precision_index: defines.flow_precision_index
|
10427
10566
|
/**
|
10428
|
-
* If
|
10567
|
+
* The sample index to read from within the precision range. If not provided, the entire precision range is read. Must be between 1 and 300 where 1 is the most recent sample and 300 is the oldest.
|
10568
|
+
*/
|
10569
|
+
readonly sample_index?: uint16
|
10570
|
+
/**
|
10571
|
+
* If true, the count of items/fluids/entities is returned instead of the per-time-frame value.
|
10429
10572
|
*/
|
10430
10573
|
readonly count?: boolean
|
10431
10574
|
}): double
|
@@ -10506,7 +10649,7 @@ interface LuaFluidBox extends Array<Fluid | undefined> {
|
|
10506
10649
|
*/
|
10507
10650
|
get_capacity(index: uint): double
|
10508
10651
|
/**
|
10509
|
-
* The
|
10652
|
+
* The fluidboxes to which the fluidbox at the given index is connected.
|
10510
10653
|
*
|
10511
10654
|
* {@link https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_connections View documentation}
|
10512
10655
|
*/
|
@@ -11689,7 +11832,7 @@ interface LuaGameScript {
|
|
11689
11832
|
*/
|
11690
11833
|
regenerate_entity(entities: string | readonly string[]): void
|
11691
11834
|
/**
|
11692
|
-
* Take a screenshot of the game and save it to the `script-output` folder, located in the game's {@
|
11835
|
+
* Take a screenshot of the game and save it to the `script-output` folder, located in the game's {@linkplain https://wiki.factorio.com/User_data_directory user data directory}. The name of the image file can be specified via the `path` parameter.
|
11693
11836
|
*
|
11694
11837
|
* {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot View documentation}
|
11695
11838
|
* @remarks If Factorio is running headless, this function will do nothing.
|
@@ -11767,7 +11910,7 @@ interface LuaGameScript {
|
|
11767
11910
|
*/
|
11768
11911
|
set_wait_for_screenshots_to_finish(): void
|
11769
11912
|
/**
|
11770
|
-
* Take a screenshot of the technology screen and save it to the `script-output` folder, located in the game's {@
|
11913
|
+
* Take a screenshot of the technology screen and save it to the `script-output` folder, located in the game's {@linkplain https://wiki.factorio.com/User_data_directory user data directory}. The name of the image file can be specified via the `path` parameter.
|
11771
11914
|
*
|
11772
11915
|
* {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_technology_screenshot View documentation}
|
11773
11916
|
*/
|
@@ -11812,7 +11955,7 @@ interface LuaGameScript {
|
|
11812
11955
|
*/
|
11813
11956
|
json_to_table(json: string): AnyBasic | undefined
|
11814
11957
|
/**
|
11815
|
-
* Write a file to the `script-output` folder, located in the game's {@
|
11958
|
+
* Write a file to the `script-output` folder, located in the game's {@linkplain https://wiki.factorio.com/User_data_directory user data directory}. The name and file extension of the file can be specified via the `filename` parameter.
|
11816
11959
|
*
|
11817
11960
|
* {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.write_file View documentation}
|
11818
11961
|
* @param filename The name of the file. Providing a directory path (ex. `"save/here/example.txt"`) will create the necessary folder structure in `script-output`.
|
@@ -11822,7 +11965,7 @@ interface LuaGameScript {
|
|
11822
11965
|
*/
|
11823
11966
|
write_file(filename: string, data: LocalisedString, append?: boolean, for_player?: uint): void
|
11824
11967
|
/**
|
11825
|
-
* Remove a file or directory in the `script-output` folder, located in the game's {@
|
11968
|
+
* Remove a file or directory in the `script-output` folder, located in the game's {@linkplain https://wiki.factorio.com/User_data_directory user data directory}. Can be used to remove files created by {@link LuaGameScript#write_file LuaGameScript::write_file}.
|
11826
11969
|
*
|
11827
11970
|
* {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.remove_path View documentation}
|
11828
11971
|
* @param path The path to the file or directory to remove, relative to `script-output`.
|
@@ -11984,11 +12127,10 @@ interface LuaGameScript {
|
|
11984
12127
|
*/
|
11985
12128
|
is_valid_sound_path(sound_path: SoundPath): boolean
|
11986
12129
|
/**
|
11987
|
-
* Checks if the given SpritePath is valid and contains a loaded sprite.
|
12130
|
+
* Checks if the given SpritePath is valid and contains a loaded sprite. The existence of the image is not checked for paths of type `file`.
|
11988
12131
|
*
|
11989
12132
|
* {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.is_valid_sprite_path View documentation}
|
11990
12133
|
* @param sprite_path Path to the image.
|
11991
|
-
* @remarks The existence of the image is not checked for paths of type `file`.
|
11992
12134
|
*/
|
11993
12135
|
is_valid_sprite_path(sprite_path: SpritePath): boolean
|
11994
12136
|
/**
|
@@ -12131,7 +12273,7 @@ interface LuaGameScript {
|
|
12131
12273
|
*/
|
12132
12274
|
create_profiler(stopped?: boolean): LuaProfiler
|
12133
12275
|
/**
|
12134
|
-
* Evaluate an expression, substituting variables as provided. For details on the formula, see the relevant page on the {@
|
12276
|
+
* Evaluate an expression, substituting variables as provided. For details on the formula, see the relevant page on the {@linkplain https://wiki.factorio.com/Prototype/Technology#unit Factorio wiki}.
|
12135
12277
|
*
|
12136
12278
|
* {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.evaluate_expression View documentation}
|
12137
12279
|
* @param expression The expression to evaluate.
|
@@ -12304,7 +12446,7 @@ interface LuaGameScript {
|
|
12304
12446
|
*/
|
12305
12447
|
decode_string(string: string): string | undefined
|
12306
12448
|
/**
|
12307
|
-
* This property is only populated inside {@link LuaCommandProcessor custom command} handlers and when writing {@
|
12449
|
+
* This property is only populated inside {@link LuaCommandProcessor custom command} handlers and when writing {@linkplain https://wiki.factorio.com/Console#Scripting_and_cheat_commands Lua console commands}. Returns the player that is typing the command, `nil` in all other instances.
|
12308
12450
|
*
|
12309
12451
|
* See {@link LuaGameScript#players LuaGameScript::players} for accessing all players.
|
12310
12452
|
*
|
@@ -12785,6 +12927,8 @@ interface LuaGui {
|
|
12785
12927
|
/**
|
12786
12928
|
* Returns `true` if sprite_path is valid and contains loaded sprite, otherwise `false`. Sprite path of type `file` doesn't validate if file exists.
|
12787
12929
|
*
|
12930
|
+
* If you want to avoid needing a LuaGui object, {@link LuaGameScript#is_valid_sprite_path LuaGameScript::is_valid_sprite_path} can be used instead.
|
12931
|
+
*
|
12788
12932
|
* {@link https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.is_valid_sprite_path View documentation}
|
12789
12933
|
* @param sprite_path Path to a image.
|
12790
12934
|
*/
|
@@ -12884,7 +13028,7 @@ interface BaseGuiSpec {
|
|
12884
13028
|
*/
|
12885
13029
|
readonly type: GuiElementType
|
12886
13030
|
/**
|
12887
|
-
* Name of the child element.
|
13031
|
+
* Name of the child element. It must be unique within the parent element.
|
12888
13032
|
*/
|
12889
13033
|
readonly name?: string
|
12890
13034
|
/**
|
@@ -13403,7 +13547,7 @@ interface BaseGuiElement {
|
|
13403
13547
|
* Other attributes may be specified depending on `type`:
|
13404
13548
|
*
|
13405
13549
|
* {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add View documentation}
|
13406
|
-
* @returns The
|
13550
|
+
* @returns The GUI element that was added.
|
13407
13551
|
*/
|
13408
13552
|
add<Type extends GuiElementType>(
|
13409
13553
|
element: GuiSpec & {
|
@@ -13492,7 +13636,7 @@ interface BaseGuiElement {
|
|
13492
13636
|
*/
|
13493
13637
|
readonly parent: LuaGuiElement | undefined
|
13494
13638
|
/**
|
13495
|
-
* The name of this element.
|
13639
|
+
* The name of this element. `""` if no name was set.
|
13496
13640
|
*
|
13497
13641
|
* {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.name View documentation}
|
13498
13642
|
* @example
|
@@ -19142,6 +19286,10 @@ interface LuaPlayer extends LuaControl {
|
|
19142
19286
|
/**
|
19143
19287
|
* Invokes the "clear cursor" action on the player as if the user pressed it.
|
19144
19288
|
*
|
19289
|
+
* **Raised events:**
|
19290
|
+
* - {@link OnPlayerCursorStackChangedEvent on_player_cursor_stack_changed}? _current_tick_ Raised when the cursor was successfully cleared.
|
19291
|
+
*
|
19292
|
+
*
|
19145
19293
|
* {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.clear_cursor View documentation}
|
19146
19294
|
* @returns Whether the cursor is now empty.
|
19147
19295
|
*/
|
@@ -20036,7 +20184,7 @@ interface LuaRailSignalControlBehavior extends LuaControlBehavior {
|
|
20036
20184
|
}
|
20037
20185
|
|
20038
20186
|
/**
|
20039
|
-
* A deterministic random generator independent from the core games random generator that can be seeded and re-seeded at will. This random generator can be saved and loaded and will maintain its state. Note this is entirely different from calling {@
|
20187
|
+
* A deterministic random generator independent from the core games random generator that can be seeded and re-seeded at will. This random generator can be saved and loaded and will maintain its state. Note this is entirely different from calling {@linkplain https://lua-api.factorio.com/latest/Libraries.html#math.random math.random}() and you should be sure you actually want to use this over calling `math.random()`. If you aren't sure if you need to use this over calling `math.random()` then you probably don't need to use this.
|
20040
20188
|
*
|
20041
20189
|
* {@link https://lua-api.factorio.com/latest/LuaRandomGenerator.html View documentation}
|
20042
20190
|
* @noSelf
|
@@ -20521,11 +20669,11 @@ interface LuaRendering {
|
|
20521
20669
|
*/
|
20522
20670
|
readonly time_to_live?: uint
|
20523
20671
|
/**
|
20524
|
-
* The forces that this object is rendered to.
|
20672
|
+
* The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
20525
20673
|
*/
|
20526
20674
|
readonly forces?: readonly ForceIdentification[]
|
20527
20675
|
/**
|
20528
|
-
* The players that this object is rendered to.
|
20676
|
+
* The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
20529
20677
|
*/
|
20530
20678
|
readonly players?: readonly PlayerIdentification[]
|
20531
20679
|
/**
|
@@ -20570,11 +20718,11 @@ interface LuaRendering {
|
|
20570
20718
|
*/
|
20571
20719
|
readonly time_to_live?: uint
|
20572
20720
|
/**
|
20573
|
-
* The forces that this object is rendered to.
|
20721
|
+
* The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
20574
20722
|
*/
|
20575
20723
|
readonly forces?: readonly ForceIdentification[]
|
20576
20724
|
/**
|
20577
|
-
* The players that this object is rendered to.
|
20725
|
+
* The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
20578
20726
|
*/
|
20579
20727
|
readonly players?: readonly PlayerIdentification[]
|
20580
20728
|
/**
|
@@ -20637,11 +20785,11 @@ interface LuaRendering {
|
|
20637
20785
|
*/
|
20638
20786
|
readonly time_to_live?: uint
|
20639
20787
|
/**
|
20640
|
-
* The forces that this object is rendered to.
|
20788
|
+
* The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
20641
20789
|
*/
|
20642
20790
|
readonly forces?: readonly ForceIdentification[]
|
20643
20791
|
/**
|
20644
|
-
* The players that this object is rendered to.
|
20792
|
+
* The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
20645
20793
|
*/
|
20646
20794
|
readonly players?: readonly PlayerIdentification[]
|
20647
20795
|
/**
|
@@ -20689,11 +20837,11 @@ interface LuaRendering {
|
|
20689
20837
|
*/
|
20690
20838
|
readonly time_to_live?: uint
|
20691
20839
|
/**
|
20692
|
-
* The forces that this object is rendered to.
|
20840
|
+
* The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
20693
20841
|
*/
|
20694
20842
|
readonly forces?: readonly ForceIdentification[]
|
20695
20843
|
/**
|
20696
|
-
* The players that this object is rendered to.
|
20844
|
+
* The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
20697
20845
|
*/
|
20698
20846
|
readonly players?: readonly PlayerIdentification[]
|
20699
20847
|
/**
|
@@ -20744,11 +20892,11 @@ interface LuaRendering {
|
|
20744
20892
|
*/
|
20745
20893
|
readonly time_to_live?: uint
|
20746
20894
|
/**
|
20747
|
-
* The forces that this object is rendered to.
|
20895
|
+
* The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
20748
20896
|
*/
|
20749
20897
|
readonly forces?: readonly ForceIdentification[]
|
20750
20898
|
/**
|
20751
|
-
* The players that this object is rendered to.
|
20899
|
+
* The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
20752
20900
|
*/
|
20753
20901
|
readonly players?: readonly PlayerIdentification[]
|
20754
20902
|
/**
|
@@ -20799,11 +20947,11 @@ interface LuaRendering {
|
|
20799
20947
|
*/
|
20800
20948
|
readonly time_to_live?: uint
|
20801
20949
|
/**
|
20802
|
-
* The forces that this object is rendered to.
|
20950
|
+
* The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
20803
20951
|
*/
|
20804
20952
|
readonly forces?: readonly ForceIdentification[]
|
20805
20953
|
/**
|
20806
|
-
* The players that this object is rendered to.
|
20954
|
+
* The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
20807
20955
|
*/
|
20808
20956
|
readonly players?: readonly PlayerIdentification[]
|
20809
20957
|
/**
|
@@ -20877,11 +21025,11 @@ interface LuaRendering {
|
|
20877
21025
|
*/
|
20878
21026
|
readonly time_to_live?: uint
|
20879
21027
|
/**
|
20880
|
-
* The forces that this object is rendered to.
|
21028
|
+
* The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
20881
21029
|
*/
|
20882
21030
|
readonly forces?: readonly ForceIdentification[]
|
20883
21031
|
/**
|
20884
|
-
* The players that this object is rendered to.
|
21032
|
+
* The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
20885
21033
|
*/
|
20886
21034
|
readonly players?: readonly PlayerIdentification[]
|
20887
21035
|
/**
|
@@ -20940,11 +21088,11 @@ interface LuaRendering {
|
|
20940
21088
|
*/
|
20941
21089
|
readonly time_to_live?: uint
|
20942
21090
|
/**
|
20943
|
-
* The forces that this object is rendered to.
|
21091
|
+
* The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
20944
21092
|
*/
|
20945
21093
|
readonly forces?: readonly ForceIdentification[]
|
20946
21094
|
/**
|
20947
|
-
* The players that this object is rendered to.
|
21095
|
+
* The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
20948
21096
|
*/
|
20949
21097
|
readonly players?: readonly PlayerIdentification[]
|
20950
21098
|
/**
|
@@ -20964,7 +21112,7 @@ interface LuaRendering {
|
|
20964
21112
|
*/
|
20965
21113
|
draw_animation(params: {
|
20966
21114
|
/**
|
20967
|
-
* Name of an {@
|
21115
|
+
* Name of an {@linkplain https://wiki.factorio.com/Prototype/Animation animation prototype}.
|
20968
21116
|
*/
|
20969
21117
|
readonly animation: string
|
20970
21118
|
/**
|
@@ -21015,11 +21163,11 @@ interface LuaRendering {
|
|
21015
21163
|
*/
|
21016
21164
|
readonly time_to_live?: uint
|
21017
21165
|
/**
|
21018
|
-
* The forces that this object is rendered to.
|
21166
|
+
* The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
21019
21167
|
*/
|
21020
21168
|
readonly forces?: readonly ForceIdentification[]
|
21021
21169
|
/**
|
21022
|
-
* The players that this object is rendered to.
|
21170
|
+
* The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
21023
21171
|
*/
|
21024
21172
|
readonly players?: readonly PlayerIdentification[]
|
21025
21173
|
/**
|
@@ -23118,7 +23266,7 @@ interface CharacterCorpseSurfaceCreateEntity extends BaseSurfaceCreateEntity {
|
|
23118
23266
|
|
23119
23267
|
interface HighlightBoxSurfaceCreateEntity extends BaseSurfaceCreateEntity {
|
23120
23268
|
/**
|
23121
|
-
* The bounding box defining the highlight box using absolute map coordinates. If specified, the `position` parameter
|
23269
|
+
* The bounding box defining the highlight box using absolute map coordinates. If specified, the general `position` parameter still needs to be present, but will be ignored. If not specified, the game falls back to the `source` parameter first, then the `target` parameter second. One of these three parameters need to be specified.
|
23122
23270
|
*/
|
23123
23271
|
readonly bounding_box?: BoundingBox
|
23124
23272
|
/**
|
@@ -23347,9 +23495,22 @@ interface LuaSurface {
|
|
23347
23495
|
*/
|
23348
23496
|
readonly radius?: double
|
23349
23497
|
readonly name?: string | readonly string[]
|
23498
|
+
readonly force?: ForceIdentification | readonly ForceIdentification[]
|
23350
23499
|
readonly limit?: uint
|
23351
23500
|
readonly has_hidden_tile?: boolean
|
23501
|
+
/**
|
23502
|
+
* Can be further filtered by supplying a `force` filter.
|
23503
|
+
*/
|
23504
|
+
readonly has_tile_ghost?: boolean
|
23505
|
+
/**
|
23506
|
+
* Can be further filtered by supplying a `force` filter.
|
23507
|
+
*/
|
23508
|
+
readonly to_be_deconstructed?: boolean
|
23352
23509
|
readonly collision_mask?: CollisionMaskLayer | readonly CollisionMaskLayer[]
|
23510
|
+
/**
|
23511
|
+
* Whether the filters should be inverted.
|
23512
|
+
*/
|
23513
|
+
readonly invert?: boolean
|
23353
23514
|
}): LuaTile[]
|
23354
23515
|
/**
|
23355
23516
|
* Count entities of given type or name in a given area. Works just like {@link LuaSurface#find_entities_filtered LuaSurface::find_entities_filtered}, except this only returns the count. As it doesn't construct all the wrapper objects, this is more efficient if one is only interested in the number of entities.
|
@@ -23377,7 +23538,7 @@ interface LuaSurface {
|
|
23377
23538
|
readonly limit?: uint
|
23378
23539
|
readonly is_military_target?: boolean
|
23379
23540
|
/**
|
23380
|
-
*
|
23541
|
+
* Whether the filters should be inverted.
|
23381
23542
|
*/
|
23382
23543
|
readonly invert?: boolean
|
23383
23544
|
}): uint
|
@@ -23399,9 +23560,22 @@ interface LuaSurface {
|
|
23399
23560
|
*/
|
23400
23561
|
readonly radius?: double
|
23401
23562
|
readonly name?: string | readonly string[]
|
23563
|
+
readonly force?: ForceIdentification | readonly ForceIdentification[]
|
23402
23564
|
readonly limit?: uint
|
23403
23565
|
readonly has_hidden_tile?: boolean
|
23566
|
+
/**
|
23567
|
+
* Can be further filtered by supplying a `force` filter.
|
23568
|
+
*/
|
23569
|
+
readonly has_tile_ghost?: boolean
|
23570
|
+
/**
|
23571
|
+
* Can be further filtered by supplying a `force` filter.
|
23572
|
+
*/
|
23573
|
+
readonly to_be_deconstructed?: boolean
|
23404
23574
|
readonly collision_mask?: CollisionMaskLayer | readonly CollisionMaskLayer[]
|
23575
|
+
/**
|
23576
|
+
* If the filters should be inverted.
|
23577
|
+
*/
|
23578
|
+
readonly invert?: boolean
|
23405
23579
|
}): uint
|
23406
23580
|
/**
|
23407
23581
|
* Find a non-colliding position within a given radius.
|
@@ -23502,7 +23676,7 @@ interface LuaSurface {
|
|
23502
23676
|
readonly condition: ForceCondition
|
23503
23677
|
}): LuaEntity[]
|
23504
23678
|
/**
|
23505
|
-
* Find the enemy military target ({@
|
23679
|
+
* Find the enemy military target ({@linkplain https://wiki.factorio.com/Military_units_and_structures military entity}) closest to the given position.
|
23506
23680
|
*
|
23507
23681
|
* {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_nearest_enemy View documentation}
|
23508
23682
|
* @returns The nearest enemy military target or `nil` if no enemy could be found within the given area.
|
@@ -23950,6 +24124,13 @@ interface LuaSurface {
|
|
23950
24124
|
readonly area?: BoundingBox
|
23951
24125
|
readonly position?: TilePosition
|
23952
24126
|
readonly name?: string | readonly string[] | LuaDecorativePrototype | readonly LuaDecorativePrototype[]
|
24127
|
+
readonly collision_mask?: CollisionMaskLayer | readonly CollisionMaskLayer[]
|
24128
|
+
readonly from_layer?: string
|
24129
|
+
readonly to_layer?: string
|
24130
|
+
/**
|
24131
|
+
* Soft decoratives can be drawn over rails.
|
24132
|
+
*/
|
24133
|
+
readonly exclude_soft?: boolean
|
23953
24134
|
readonly limit?: uint
|
23954
24135
|
/**
|
23955
24136
|
* If the filters should be inverted.
|
@@ -23986,6 +24167,13 @@ interface LuaSurface {
|
|
23986
24167
|
readonly area?: BoundingBox
|
23987
24168
|
readonly position?: TilePosition
|
23988
24169
|
readonly name?: string | readonly string[] | LuaDecorativePrototype | readonly LuaDecorativePrototype[]
|
24170
|
+
readonly collision_mask?: CollisionMaskLayer | readonly CollisionMaskLayer[]
|
24171
|
+
readonly from_layer?: string
|
24172
|
+
readonly to_layer?: string
|
24173
|
+
/**
|
24174
|
+
* Soft decoratives can be drawn over rails.
|
24175
|
+
*/
|
24176
|
+
readonly exclude_soft?: boolean
|
23989
24177
|
readonly limit?: uint
|
23990
24178
|
/**
|
23991
24179
|
* If the filters should be inverted.
|
@@ -24789,8 +24977,9 @@ interface LuaTile {
|
|
24789
24977
|
* Is this tile marked for deconstruction?
|
24790
24978
|
*
|
24791
24979
|
* {@link https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.to_be_deconstructed View documentation}
|
24980
|
+
* @param force The force who did the deconstruction order.
|
24792
24981
|
*/
|
24793
|
-
to_be_deconstructed(): boolean
|
24982
|
+
to_be_deconstructed(force?: ForceIdentification): boolean
|
24794
24983
|
/**
|
24795
24984
|
* Orders deconstruction of this tile by the given force.
|
24796
24985
|
*
|
@@ -24816,6 +25005,20 @@ interface LuaTile {
|
|
24816
25005
|
* @param player The player to set the last_user to if any.
|
24817
25006
|
*/
|
24818
25007
|
cancel_deconstruction(force: ForceIdentification, player?: PlayerIdentification): void
|
25008
|
+
/**
|
25009
|
+
* Does this tile have any tile ghosts on it.
|
25010
|
+
*
|
25011
|
+
* {@link https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.has_tile_ghost View documentation}
|
25012
|
+
* @param force Check for tile ghosts of this force.
|
25013
|
+
*/
|
25014
|
+
has_tile_ghost(force?: ForceIdentification): boolean
|
25015
|
+
/**
|
25016
|
+
* Gets all tile ghosts on this tile.
|
25017
|
+
*
|
25018
|
+
* {@link https://lua-api.factorio.com/latest/LuaTile.html#LuaTile.get_tile_ghosts View documentation}
|
25019
|
+
* @param force Get tile ghosts of this force.
|
25020
|
+
*/
|
25021
|
+
get_tile_ghosts(force?: ForceIdentification): LuaTile[]
|
24819
25022
|
/**
|
24820
25023
|
* Prototype name of this tile. E.g. `"sand-3"` or `"grass-2"`.
|
24821
25024
|
*
|
@@ -24915,11 +25118,11 @@ interface LuaTilePrototype {
|
|
24915
25118
|
/**
|
24916
25119
|
* Energy required to mine a tile.
|
24917
25120
|
*/
|
24918
|
-
readonly
|
25121
|
+
readonly mining_time: double
|
24919
25122
|
/**
|
24920
25123
|
* Prototype name of the particle produced when mining this tile. Will only be present if this tile produces any particle during mining.
|
24921
25124
|
*/
|
24922
|
-
readonly
|
25125
|
+
readonly mining_particle?: string
|
24923
25126
|
/**
|
24924
25127
|
* Products obtained by mining this tile.
|
24925
25128
|
*/
|
@@ -24932,11 +25135,11 @@ interface LuaTilePrototype {
|
|
24932
25135
|
*/
|
24933
25136
|
readonly next_direction: LuaTilePrototype | undefined
|
24934
25137
|
/**
|
24935
|
-
* Items that when placed will produce this tile. It is a dictionary indexed by the item prototype name.
|
25138
|
+
* Items that when placed will produce this tile. It is a dictionary indexed by the item prototype name. `nil` (instead of an empty table) if no items can place this tile.
|
24936
25139
|
*
|
24937
25140
|
* {@link https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.items_to_place_this View documentation}
|
24938
25141
|
*/
|
24939
|
-
readonly items_to_place_this: SimpleItemStack[]
|
25142
|
+
readonly items_to_place_this: SimpleItemStack[] | undefined
|
24940
25143
|
/**
|
24941
25144
|
* False if this tile is not allowed in blueprints regardless of the ability to build it.
|
24942
25145
|
*
|
package/generated/concepts.d.ts
CHANGED
@@ -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 {
|
@@ -651,7 +655,7 @@ interface EnemyEvolutionMapSettings {
|
|
651
655
|
}
|
652
656
|
|
653
657
|
/**
|
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 {@
|
658
|
+
* 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
659
|
*
|
656
660
|
* The pseudocode algorithm to determine a chunk's score is as follows:
|
657
661
|
*
|
@@ -1503,7 +1507,7 @@ interface AutoplaceSpecification {
|
|
1503
1507
|
}
|
1504
1508
|
|
1505
1509
|
/**
|
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 {@
|
1510
|
+
* 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
1511
|
*
|
1508
1512
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#NoiseExpression View documentation}
|
1509
1513
|
*/
|
@@ -2719,7 +2723,9 @@ type SpriteType =
|
|
2719
2723
|
| "utility"
|
2720
2724
|
|
2721
2725
|
/**
|
2722
|
-
* It is specified by {@link string}. It can be either the name of a {@
|
2726
|
+
* 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".
|
2727
|
+
*
|
2728
|
+
* The validity of a SpritePath can be verified at runtime using {@link LuaGameScript#is_valid_sprite_path LuaGameScript::is_valid_sprite_path}.
|
2723
2729
|
*
|
2724
2730
|
* The supported types are:
|
2725
2731
|
* - `"item"` - for example "item/iron-plate" is the icon sprite of iron plate
|
@@ -2740,31 +2746,33 @@ type SpriteType =
|
|
2740
2746
|
type SpritePath = string | `${SpriteType}/${string}`
|
2741
2747
|
|
2742
2748
|
/**
|
2743
|
-
* A sound defined by a {@link string}. It can be either the name of a {@
|
2749
|
+
* 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.
|
2750
|
+
*
|
2751
|
+
* The validity of a SoundPath can be verified at runtime using {@link LuaGameScript#is_valid_sound_path LuaGameScript::is_valid_sound_path}.
|
2744
2752
|
*
|
2745
2753
|
* The utility and ambient types each contain general use sound prototypes defined by the game itself.
|
2746
|
-
* - `"utility"` - Uses the {@
|
2747
|
-
* - `"ambient"` - Uses {@
|
2754
|
+
* - `"utility"` - Uses the {@linkplain https://wiki.factorio.com/Prototype/UtilitySounds UtilitySounds} prototype. Example: `"utility/wire_connect_pole"`
|
2755
|
+
* - `"ambient"` - Uses {@linkplain https://wiki.factorio.com/Prototype/AmbientSound AmbientSound} prototypes. Example: `"ambient/resource-deficiency"`
|
2748
2756
|
*
|
2749
2757
|
* The following types can be combined with any tile name as long as its prototype defines the
|
2750
2758
|
*
|
2751
2759
|
* corresponding sound.
|
2752
|
-
* - `"tile-walking"` - Uses {@
|
2753
|
-
* - `"tile-mined"` - Uses {@
|
2754
|
-
* - `"tile-build-small"` - Uses {@
|
2755
|
-
* - `"tile-build-medium"` - Uses {@
|
2756
|
-
* - `"tile-build-large"` - Uses {@
|
2760
|
+
* - `"tile-walking"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#walking_sound Tile::walking_sound}. Example: `"tile-walking/concrete"`
|
2761
|
+
* - `"tile-mined"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#mined_sound Tile::mined_sound}
|
2762
|
+
* - `"tile-build-small"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound}. Example: `"tile-build-small/concrete"`
|
2763
|
+
* - `"tile-build-medium"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound}
|
2764
|
+
* - `"tile-build-large"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Tile#build_sound Tile::build_sound}
|
2757
2765
|
*
|
2758
2766
|
* The following types can be combined with any entity name as long as its prototype defines the
|
2759
2767
|
*
|
2760
2768
|
* corresponding sound.
|
2761
|
-
* - `"entity-build"` - Uses {@
|
2762
|
-
* - `"entity-mined"` - Uses {@
|
2763
|
-
* - `"entity-mining"` - Uses {@
|
2764
|
-
* - `"entity-vehicle_impact"` - Uses {@
|
2765
|
-
* - `"entity-rotated"` - Uses {@
|
2766
|
-
* - `"entity-open"` - Uses {@
|
2767
|
-
* - `"entity-close"` - Uses {@
|
2769
|
+
* - `"entity-build"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#build_sound Entity::build_sound}. Example: `"entity-build/wooden-chest"`
|
2770
|
+
* - `"entity-mined"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#mined_sound Entity::mined_sound}
|
2771
|
+
* - `"entity-mining"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#mining_sound Entity::mining_sound}
|
2772
|
+
* - `"entity-vehicle_impact"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#vehicle_impact_sound Entity::vehicle_impact_sound}
|
2773
|
+
* - `"entity-rotated"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#rotated_sound Entity::rotated_sound}
|
2774
|
+
* - `"entity-open"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#open_sound Entity::open_sound}
|
2775
|
+
* - `"entity-close"` - Uses {@linkplain https://wiki.factorio.com/Prototype/Entity#close_sound Entity::close_sound}
|
2768
2776
|
*
|
2769
2777
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#SoundPath View documentation}
|
2770
2778
|
*/
|
@@ -3379,7 +3387,7 @@ type Alignment =
|
|
3379
3387
|
| "bottom-right"
|
3380
3388
|
|
3381
3389
|
/**
|
3382
|
-
* Information about the event that has been raised. The table can also contain other fields depending on the type of event. See {@
|
3390
|
+
* 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.
|
3383
3391
|
*
|
3384
3392
|
* {@link https://lua-api.factorio.com/latest/Concepts.html#EventData View documentation}
|
3385
3393
|
*/
|
@@ -4165,9 +4173,9 @@ interface CollisionMaskDecorativePrototypeFilter extends BaseDecorativePrototype
|
|
4165
4173
|
readonly filter: "collision-mask"
|
4166
4174
|
readonly mask: CollisionMask | CollisionMaskWithFlags
|
4167
4175
|
/**
|
4168
|
-
* How to filter: `"collides"` or `"
|
4176
|
+
* How to filter: `"collides"`, `"layers-equals"`, `"contains-any"` or `"contains-all"`
|
4169
4177
|
*/
|
4170
|
-
readonly mask_mode: "collides" | "layers-equals"
|
4178
|
+
readonly mask_mode: "collides" | "layers-equals" | "contains-any" | "contains-all"
|
4171
4179
|
}
|
4172
4180
|
|
4173
4181
|
interface DecalDecorativePrototypeFilter extends BaseDecorativePrototypeFilter {
|
@@ -4401,9 +4409,9 @@ interface CollisionMaskTilePrototypeFilter extends BaseTilePrototypeFilter {
|
|
4401
4409
|
readonly filter: "collision-mask"
|
4402
4410
|
readonly mask: CollisionMask | CollisionMaskWithFlags
|
4403
4411
|
/**
|
4404
|
-
* How to filter: `"collides"` or `"
|
4412
|
+
* How to filter: `"collides"`, `"layers-equals"`, `"contains-any"` or `"contains-all"`
|
4405
4413
|
*/
|
4406
|
-
readonly mask_mode: "collides" | "layers-equals"
|
4414
|
+
readonly mask_mode: "collides" | "layers-equals" | "contains-any" | "contains-all"
|
4407
4415
|
}
|
4408
4416
|
|
4409
4417
|
interface WalkingSpeedModifierTilePrototypeFilter extends BaseTilePrototypeFilter {
|
@@ -4777,9 +4785,9 @@ interface CollisionMaskEntityPrototypeFilter extends BaseEntityPrototypeFilter {
|
|
4777
4785
|
readonly filter: "collision-mask"
|
4778
4786
|
readonly mask: CollisionMask | CollisionMaskWithFlags
|
4779
4787
|
/**
|
4780
|
-
* How to filter: `"collides"` or `"
|
4788
|
+
* How to filter: `"collides"`, `"layers-equals"`, `"contains-any"` or `"contains-all"`
|
4781
4789
|
*/
|
4782
|
-
readonly mask_mode: "collides" | "layers-equals"
|
4790
|
+
readonly mask_mode: "collides" | "layers-equals" | "contains-any" | "contains-all"
|
4783
4791
|
}
|
4784
4792
|
|
4785
4793
|
/**
|
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
|
*/
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "typed-factorio",
|
3
|
-
"version": "1.1
|
3
|
+
"version": "1.3.1",
|
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",
|