factorio-types 0.0.14 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/classes.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  // Factorio API reference https://lua-api.factorio.com/latest/index.html
3
3
  // Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 1.1.42
5
+ // Factorio version 1.1.49
6
6
  // API version 1
7
7
 
8
8
  /**
@@ -299,10 +299,12 @@ interface LuaBootstrap {
299
299
 
300
300
  /**
301
301
  * 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 | LuaGameScript} and {@link LuaRendering | LuaRendering} is not available. The `global` table can be accessed and is safe to read from, but not write to.
302
+ *
302
303
  * The only legitimate uses of this event are these three:
303
304
  * - Re-setup {@link metatables | https://www.lua.org/pil/13.html} as they are not persisted through save-load.
304
305
  * - Re-setup conditional event handlers.
305
306
  * - Create local references to data stored in the {@link global | Global.html} table.
307
+ *
306
308
  * For all other purposes, {@link LuaBootstrap::on_init | LuaBootstrap::on_init}, {@link LuaBootstrap::on_configuration_changed | LuaBootstrap::on_configuration_changed} or migration scripts should be used instead.
307
309
  * @param f - The handler for this event. Passing `nil` will unregister it.
308
310
  */
@@ -340,6 +342,7 @@ interface LuaBootstrap {
340
342
 
341
343
  /**
342
344
  * Raise an event. Only events generated with {@link LuaBootstrap::generate_event_name | LuaBootstrap::generate_event_name} and the following can be raised:
345
+ *
343
346
  * - {@link on_console_chat | on_console_chat}
344
347
  * - {@link on_player_crafted_item | on_player_crafted_item}
345
348
  * - {@link on_player_fast_transferred | on_player_fast_transferred}
@@ -626,6 +629,7 @@ interface LuaBurnerPrototype {
626
629
 
627
630
  /**
628
631
  * A chunk iterator can be used for iterating chunks coordinates of a surface.
632
+ *
629
633
  * The returned type is a {@link ChunkPositionAndArea | ChunkPositionAndArea} containing the chunk coordinates and its area.
630
634
  * @example
631
635
  * ```
@@ -985,23 +989,19 @@ interface LuaControl {
985
989
 
986
990
  /**
987
991
  * Gets the parameters of a personal logistic request and auto-trash slot.
988
- * @remarks
989
- * This will silently return an empty value (`name` will be `nil`) if personal logistics are not researched yet.
990
- *
991
992
  * @param slot_index - The slot to get.
993
+ * @returns The logistic parameters. If personal logistics are not researched yet, their `name` will be `nil`.
992
994
  */
993
995
  get_personal_logistic_slot(this: void,
994
- slot_index: number): PersonalLogisticParameters
996
+ slot_index: number): LogisticParameters
995
997
 
996
998
  /**
997
999
  * Gets the parameters of a vehicle logistic request and auto-trash slot.
998
- * @remarks
999
- * This will silently return an empty value (`name` will be `nil`) if the vehicle does not use logistics.
1000
- *
1001
1000
  * @param slot_index - The slot to get.
1001
+ * @returns The logistic parameters. If the vehicle does not use logistics, their `name` will be `nil`.
1002
1002
  */
1003
1003
  get_vehicle_logistic_slot(this: void,
1004
- slot_index: number): PersonalLogisticParameters
1004
+ slot_index: number): LogisticParameters
1005
1005
 
1006
1006
  /**
1007
1007
  * Does this entity have any item inside it?
@@ -1017,7 +1017,10 @@ interface LuaControl {
1017
1017
  items: ItemStackIdentification): number
1018
1018
 
1019
1019
  /**
1020
- * Returns whether the player is holding a blueprint, it takes into account a blueprint as an item as well as blueprint from the blueprint record from the blueprint library. Note that the is_cursor_blueprint and get_cursor_blueprint_entities refer to the currently selected blueprint, so it returns blueprint related information also when holding a blueprint book with a blueprint being selected in it.
1020
+ * Returns whether the player is holding a blueprint. This takes both blueprint items as well as blueprint records from the blueprint library into account.
1021
+ * @remarks
1022
+ * Both this method and {@link LuaControl::get_blueprint_entities | LuaControl::get_blueprint_entities} refer to the currently selected blueprint, meaning a blueprint book with a selected blueprint will return the information as well.
1023
+ *
1021
1024
  */
1022
1025
  is_cursor_blueprint(this: void): boolean
1023
1026
 
@@ -1077,29 +1080,23 @@ interface LuaControl {
1077
1080
 
1078
1081
  /**
1079
1082
  * Sets a personal logistic request and auto-trash slot to the given value.
1080
- * @remarks
1081
- * This will silently fail if personal logistics are not researched yet.
1082
- *
1083
1083
  * @param slot_index - The slot to set.
1084
1084
  * @param value - The logistic request parameters.
1085
- * @returns Whether the slot was set successfully.
1085
+ * @returns Whether the slot was set successfully. `false` if personal logistics are not researched yet.
1086
1086
  */
1087
1087
  set_personal_logistic_slot(this: void,
1088
1088
  slot_index: number,
1089
- value: PersonalLogisticParameters): boolean
1089
+ value: LogisticParameters): boolean
1090
1090
 
1091
1091
  /**
1092
1092
  * Sets a vehicle logistic request and auto-trash slot to the given value.
1093
- * @remarks
1094
- * This will silently fail if the vehicle does not use logistics.
1095
- *
1096
1093
  * @param slot_index - The slot to set.
1097
1094
  * @param value - The logistic request parameters.
1098
- * @returns Whether the slot was set successfully.
1095
+ * @returns Whether the slot was set successfully. `false` if the vehicle does not use logistics.
1099
1096
  */
1100
1097
  set_vehicle_logistic_slot(this: void,
1101
1098
  slot_index: number,
1102
- value: PersonalLogisticParameters): boolean
1099
+ value: LogisticParameters): boolean
1103
1100
 
1104
1101
  /**
1105
1102
  * Teleport the entity to a given position, possibly on another surface.
@@ -1112,7 +1109,7 @@ interface LuaControl {
1112
1109
  * @returns `true` when the entity was successfully teleported.
1113
1110
  */
1114
1111
  teleport(this: void,
1115
- position: Position,
1112
+ position: MapPosition,
1116
1113
  surface?: SurfaceIdentification): boolean
1117
1114
 
1118
1115
  /**
@@ -1120,7 +1117,7 @@ interface LuaControl {
1120
1117
  * @param position - Position of the entity to select
1121
1118
  */
1122
1119
  update_selected_entity(this: void,
1123
- position: Position): void
1120
+ position: MapPosition): void
1124
1121
 
1125
1122
  /**
1126
1123
  * The build distance of this character or max uint when not a character or player connected to a character.
@@ -1278,7 +1275,7 @@ interface LuaControl {
1278
1275
  * ```
1279
1276
  *
1280
1277
  */
1281
- readonly cursor_stack: LuaItemStack
1278
+ readonly cursor_stack?: LuaItemStack
1282
1279
 
1283
1280
  /**
1284
1281
  * `true` if the player is in a vehicle. Writing to this attribute puts the player in or out of a vehicle.
@@ -1328,17 +1325,18 @@ interface LuaControl {
1328
1325
 
1329
1326
  /**
1330
1327
  * The GUI the player currently has open, or `nil` if no GUI is open. Writing to it fires the {@link on_gui_opened | on_gui_opened} event.
1328
+ *
1331
1329
  * This is the GUI that will asked to close (by firing the {@link on_gui_closed | on_gui_closed} event) when the `Esc` or `E` keys are pressed. If this attribute is not `nil`, and a new GUI is written to it, the existing one will be asked to close.
1332
1330
  * @remarks
1333
1331
  * Write supports any of the types. Read will return the `entity`, `equipment`, `equipment-grid`, `player`, `element` or `nil`.
1334
1332
  *
1335
1333
  */
1336
- opened: LuaEntity | LuaItemStack | LuaEquipment | LuaEquipmentGrid | LuaPlayer | LuaGuiElement | defines.gui_type
1334
+ opened?: LuaEntity | LuaItemStack | LuaEquipment | LuaEquipmentGrid | LuaPlayer | LuaGuiElement | defines.gui_type
1337
1335
 
1338
1336
  /**
1339
1337
  * Returns the {@link defines.gui_type | defines.gui_type} or `nil`.
1340
1338
  */
1341
- readonly opened_gui_type: defines.gui_type
1339
+ readonly opened_gui_type?: defines.gui_type
1342
1340
 
1343
1341
  /**
1344
1342
  * Current item-picking state.
@@ -1348,7 +1346,7 @@ interface LuaControl {
1348
1346
  /**
1349
1347
  * Current position of the entity.
1350
1348
  */
1351
- readonly position: Position
1349
+ readonly position: MapPosition
1352
1350
 
1353
1351
  /**
1354
1352
  * The reach distance of this character or max uint when not a character or player connected to a character.
@@ -1541,7 +1539,7 @@ interface LuaCustomInputPrototype {
1541
1539
  /**
1542
1540
  * The item that gets spawned when this custom input is fired or `nil`.
1543
1541
  */
1544
- readonly item_to_spawn: LuaItemPrototype
1542
+ readonly item_to_spawn?: LuaItemPrototype
1545
1543
 
1546
1544
  /**
1547
1545
  * The default key sequence for this custom input.
@@ -1551,7 +1549,7 @@ interface LuaCustomInputPrototype {
1551
1549
  /**
1552
1550
  * The linked game control name or `nil`.
1553
1551
  */
1554
- readonly linked_game_control: string
1552
+ readonly linked_game_control?: string
1555
1553
 
1556
1554
  readonly localised_description: LocalisedString
1557
1555
 
@@ -1581,6 +1579,7 @@ interface LuaCustomInputPrototype {
1581
1579
 
1582
1580
  /**
1583
1581
  * Lazily evaluated table. For performance reasons, we sometimes return a custom table-like type instead of a native Lua table. This custom type lazily constructs the necessary Lua wrappers of the corresponding C++ objects, therefore preventing their unnecessary construction in some cases.
1582
+ *
1584
1583
  * There are some notable consequences to the usage of a custom table type rather than the native Lua table type: Iterating a custom table is only possible using the `pairs` Lua function; `ipairs` won't work. Another key difference is that custom tables cannot be serialised into a game save file -- if saving the game would require serialisation of a custom table, an error will be displayed and the game will not be saved.
1585
1584
  * @example
1586
1585
  * In previous versions of Factorio, this would create a [LuaPlayer](LuaPlayer) instance for every player in the game, even though only one such wrapper is needed. In the current version, accessing [game.players](LuaGameScript::players) by itself does not create any [LuaPlayer](LuaPlayer) instances; they are created lazily when accessed. Therefore, this example only constructs one [LuaPlayer](LuaPlayer) instance, no matter how many elements there are in `game.players`.
@@ -1798,6 +1797,7 @@ interface LuaElectricEnergySourcePrototype {
1798
1797
 
1799
1798
  /**
1800
1799
  * The primary interface for interacting with entities through the Lua API. Entities are everything that exists on the map except for tiles (see {@link LuaTile | LuaTile}).
1800
+ *
1801
1801
  * Most functions on LuaEntity also work when the entity is contained in a ghost.
1802
1802
  */
1803
1803
  interface LuaEntity extends LuaControl {
@@ -1809,7 +1809,7 @@ interface LuaEntity extends LuaControl {
1809
1809
  * @param position - The position the spidertron should move to.
1810
1810
  */
1811
1811
  add_autopilot_destination(this: void,
1812
- position: Position): void
1812
+ position: MapPosition): void
1813
1813
 
1814
1814
  /**
1815
1815
  * Offer a thing on the market.
@@ -1843,7 +1843,7 @@ interface LuaEntity extends LuaControl {
1843
1843
  */
1844
1844
  can_shoot(this: void,
1845
1845
  target: LuaEntity,
1846
- position: Position): boolean
1846
+ position: MapPosition): boolean
1847
1847
 
1848
1848
  /**
1849
1849
  * Can wires reach between these entities.
@@ -1905,7 +1905,7 @@ interface LuaEntity extends LuaControl {
1905
1905
  */
1906
1906
  clone(this: void,
1907
1907
  table: {
1908
- position: Position,
1908
+ position: MapPosition,
1909
1909
  surface?: LuaSurface,
1910
1910
  force?: ForceIdentification,
1911
1911
  create_build_effect_smoke?: boolean
@@ -1913,6 +1913,7 @@ interface LuaEntity extends LuaControl {
1913
1913
 
1914
1914
  /**
1915
1915
  * Connects current linked belt with another one.
1916
+ *
1916
1917
  * Neighbours have to be of different type. If given linked belt is connected to something else it will be disconnected first. If provided neighbour is connected to something else it will also be disconnected first. Automatically updates neighbour to be connected back to this one.
1917
1918
  * @remarks
1918
1919
  * Can also be used on entity ghost if it contains linked-belt
@@ -1925,6 +1926,7 @@ interface LuaEntity extends LuaControl {
1925
1926
 
1926
1927
  /**
1927
1928
  * Connect two devices with a circuit wire or copper cable. Depending on which type of connection should be made, there are different procedures:
1929
+ *
1928
1930
  * - To connect two electric poles, `target` must be a {@link LuaEntity | LuaEntity} that specifies another electric pole. This will connect them with copper cable.
1929
1931
  * - To connect two devices with circuit wire, `target` must be a table of type {@link WireConnectionDefinition | WireConnectionDefinition}.
1930
1932
  * @param target - The target with which to establish a connection.
@@ -1996,6 +1998,7 @@ interface LuaEntity extends LuaControl {
1996
1998
 
1997
1999
  /**
1998
2000
  * Immediately kills the entity. Does nothing if the entity doesn't have health.
2001
+ *
1999
2002
  * Unlike {@link LuaEntity::destroy | LuaEntity::destroy}, `die` will trigger the {@link on_entity_died | on_entity_died} event and the entity will produce a corpse and drop loot if it has any.
2000
2003
  * @remarks
2001
2004
  * If `force` is not specified, `on_entity_died` will blame the `"neutral"` force.
@@ -2025,6 +2028,7 @@ interface LuaEntity extends LuaControl {
2025
2028
 
2026
2029
  /**
2027
2030
  * Disconnect circuit wires or copper cables between devices. Depending on which type of connection should be cut, there are different procedures:
2031
+ *
2028
2032
  * - To remove all copper cables, leave the `target` parameter blank: `pole.disconnect_neighbour()`.
2029
2033
  * - To remove all wires of a specific color, set `target` to {@link defines.wire_type.red | defines.wire_type.red} or {@link defines.wire_type.green | defines.wire_type.green}.
2030
2034
  * - To remove a specific copper cable between two electric poles, `target` must be a {@link LuaEntity | LuaEntity} that specifies the other pole: `pole1.disconnect_neighbour(pole2)`.
@@ -2134,12 +2138,18 @@ interface LuaEntity extends LuaControl {
2134
2138
 
2135
2139
  /**
2136
2140
  * Get amounts of all fluids in this entity.
2141
+ * @remarks
2142
+ * If information about fluid temperatures is required, {@link LuaEntity::fluidbox | LuaEntity::fluidbox} should be used instead.
2143
+ *
2137
2144
  * @returns The amounts, indexed by fluid names.
2138
2145
  */
2139
2146
  get_fluid_contents(this: void): {[key: string]: number}
2140
2147
 
2141
2148
  /**
2142
2149
  * Get the amount of all or some fluid in this entity.
2150
+ * @remarks
2151
+ * If information about fluid temperatures is required, {@link LuaEntity::fluidbox | LuaEntity::fluidbox} should be used instead.
2152
+ *
2143
2153
  * @param fluid - Prototype name of the fluid to count. If not specified, count all fluids.
2144
2154
  */
2145
2155
  get_fluid_count(this: void,
@@ -2339,7 +2349,7 @@ interface LuaEntity extends LuaControl {
2339
2349
  * @remarks
2340
2350
  * Applies to subclasses: TransportBeltConnectable
2341
2351
  *
2342
- * @param index - Index of the requested transport line.
2352
+ * @param index - Index of the requested transport line. Transport lines are 1-indexed.
2343
2353
  */
2344
2354
  get_transport_line(this: void,
2345
2355
  index: number): LuaTransportLine
@@ -2357,11 +2367,11 @@ interface LuaEntity extends LuaControl {
2357
2367
  get_upgrade_target(this: void): LuaEntityPrototype
2358
2368
 
2359
2369
  /**
2360
- * Same as {@link LuaEntity::has_flag | LuaEntity::has_flag} but targets the inner entity on a entity ghost.
2370
+ * Same as {@link LuaEntity::has_flag | LuaEntity::has_flag}, but targets the inner entity on a entity ghost.
2361
2371
  * @remarks
2362
2372
  * Applies to subclasses: EntityGhost
2363
2373
  *
2364
- * @param flag - The flag to test
2374
+ * @param flag - The flag to test. See [EntityPrototypeFlags](EntityPrototypeFlags) for a list of flags.
2365
2375
  * @returns `true` if the entity has the given flag set.
2366
2376
  */
2367
2377
  ghost_has_flag(this: void,
@@ -2376,12 +2386,12 @@ interface LuaEntity extends LuaControl {
2376
2386
  has_command(this: void): boolean
2377
2387
 
2378
2388
  /**
2379
- * Test whether this entity's prototype has a flag set.
2389
+ * Test whether this entity's prototype has a certain flag set.
2380
2390
  * @remarks
2381
2391
  * `entity.has_flag(f)` is a shortcut for `entity.prototype.has_flag(f)`.
2382
2392
  *
2383
- * @param flag - The flag to test
2384
- * @returns `true` if the entity has the given flag set.
2393
+ * @param flag - The flag to test. See [EntityPrototypeFlags](EntityPrototypeFlags) for a list of flags.
2394
+ * @returns `true` if this entity has the given flag set.
2385
2395
  */
2386
2396
  has_flag(this: void,
2387
2397
  flag: string): boolean
@@ -2855,7 +2865,7 @@ interface LuaEntity extends LuaControl {
2855
2865
  * Applies to subclasses: Character
2856
2866
  *
2857
2867
  */
2858
- associated_player: LuaPlayer
2868
+ associated_player?: LuaPlayer
2859
2869
 
2860
2870
  /**
2861
2871
  * Whether this rocket silo automatically launches the rocket when cargo is inserted.
@@ -2871,7 +2881,7 @@ interface LuaEntity extends LuaControl {
2871
2881
  * Applies to subclasses: SpiderVehicle
2872
2882
  *
2873
2883
  */
2874
- autopilot_destination: Position
2884
+ autopilot_destination?: MapPosition
2875
2885
 
2876
2886
  /**
2877
2887
  * The queued destination positions of spidertron's autopilot.
@@ -2879,7 +2889,7 @@ interface LuaEntity extends LuaControl {
2879
2889
  * Applies to subclasses: SpiderVehicle
2880
2890
  *
2881
2891
  */
2882
- readonly autopilot_destinations: Position[]
2892
+ readonly autopilot_destinations: MapPosition[]
2883
2893
 
2884
2894
  /**
2885
2895
  * The backer name assigned to this entity, or `nil` if this entity doesn't support backer names. Entities that support backer names are labs, locomotives, radars, roboports, and train stops.
@@ -2887,7 +2897,7 @@ interface LuaEntity extends LuaControl {
2887
2897
  * While train stops get the name of a backer when placed down, players can rename them if they want to. In this case, `backer_name` returns the player-given name of the entity.
2888
2898
  *
2889
2899
  */
2890
- backer_name: string
2900
+ backer_name?: string
2891
2901
 
2892
2902
  /**
2893
2903
  * The belt connectable neighbours of this belt connectable entity. Only entities that input to or are outputs of this entity. Does not contain the other end of an underground belt, see {@link LuaEntity::neighbours | LuaEntity::neighbours} for that. This is a dictionary with `"inputs"`, `"outputs"` entries that are arrays of transport belt connectable entities, or empty tables if no entities.
@@ -2908,7 +2918,7 @@ interface LuaEntity extends LuaControl {
2908
2918
  /**
2909
2919
  * The bonus mining progress for this mining drill or `nil` if this isn't a mining drill. Read yields a number in range [0, mining_target.prototype.mineable_properties.mining_time]
2910
2920
  */
2911
- bonus_mining_progress: number
2921
+ bonus_mining_progress?: number
2912
2922
 
2913
2923
  /**
2914
2924
  * The current productivity bonus progress, as a number in range [0, 1].
@@ -2926,7 +2936,7 @@ interface LuaEntity extends LuaControl {
2926
2936
  /**
2927
2937
  * The burner energy source for this entity or `nil` if there isn't one.
2928
2938
  */
2929
- readonly burner: LuaBurner
2939
+ readonly burner?: LuaBurner
2930
2940
 
2931
2941
  /**
2932
2942
  * The state of this chain signal.
@@ -2982,7 +2992,7 @@ interface LuaEntity extends LuaControl {
2982
2992
  * Car color is overridden by the color of the current driver/passenger, if there is one.
2983
2993
  *
2984
2994
  */
2985
- color: Color
2995
+ color?: Color
2986
2996
 
2987
2997
  /**
2988
2998
  * The owner of this combat robot if any.
@@ -2995,7 +3005,7 @@ interface LuaEntity extends LuaControl {
2995
3005
  * Applies to subclasses: Unit
2996
3006
  *
2997
3007
  */
2998
- readonly command: Command
3008
+ readonly command?: Command
2999
3009
 
3000
3010
  /**
3001
3011
  * The rail entity this train stop is connected to or `nil` if there is none.
@@ -3003,7 +3013,15 @@ interface LuaEntity extends LuaControl {
3003
3013
  * Applies to subclasses: TrainStop
3004
3014
  *
3005
3015
  */
3006
- readonly connected_rail: LuaEntity
3016
+ readonly connected_rail?: LuaEntity
3017
+
3018
+ /**
3019
+ * Rail direction to which this train stop is binding. This returns a value even when no rails are present.
3020
+ * @remarks
3021
+ * Applies to subclasses: TrainStop
3022
+ *
3023
+ */
3024
+ readonly connected_rail_direction: defines.rail_direction
3007
3025
 
3008
3026
  /**
3009
3027
  * The consumption bonus of this entity.
@@ -3078,7 +3096,7 @@ interface LuaEntity extends LuaControl {
3078
3096
  * Applies to subclasses: Unit
3079
3097
  *
3080
3098
  */
3081
- readonly distraction_command: Command
3099
+ readonly distraction_command?: Command
3082
3100
 
3083
3101
  /**
3084
3102
  * Whether the driver of this car or spidertron is the gunner, if false, the passenger is the gunner.
@@ -3094,12 +3112,12 @@ interface LuaEntity extends LuaControl {
3094
3112
  drop_position: Position
3095
3113
 
3096
3114
  /**
3097
- * The entity this entity is putting its stuff to or `nil` if there is no such entity.
3115
+ * The entity this entity is putting its items to, or `nil` if there is no such entity. If there are multiple possible entities at the drop-off point, writing to this attribute allows a mod to choose which one to drop off items to. The entity needs to collide with the tile box under the drop-off position.
3098
3116
  * @remarks
3099
- * Meaningful only for entities that put stuff somewhere, such as mining drills or inserters.
3117
+ * Meaningful only for entities that put items somewhere, such as mining drills or inserters. Returns `nil` for any other entity.
3100
3118
  *
3101
3119
  */
3102
- drop_target: LuaEntity
3120
+ drop_target?: LuaEntity
3103
3121
 
3104
3122
  /**
3105
3123
  * The current speed of this unit in tiles per tick, taking into account any walking speed modifier given by the tile the unit is standing on.
@@ -3120,7 +3138,7 @@ interface LuaEntity extends LuaControl {
3120
3138
  /**
3121
3139
  * The effects being applied to this entity or `nil`. For beacons this is the effect the beacon is broadcasting.
3122
3140
  */
3123
- readonly effects: ModuleEffects
3141
+ readonly effects?: ModuleEffects
3124
3142
 
3125
3143
  /**
3126
3144
  * The buffer size for the electric energy source or nil if the entity doesn't have an electric energy source.
@@ -3148,7 +3166,7 @@ interface LuaEntity extends LuaControl {
3148
3166
  /**
3149
3167
  * Returns the id of the electric network that this entity is connected to or `nil`.
3150
3168
  */
3151
- readonly electric_network_id: number
3169
+ readonly electric_network_id?: number
3152
3170
 
3153
3171
  /**
3154
3172
  * The electric network statistics for this electric pole.
@@ -3196,7 +3214,7 @@ interface LuaEntity extends LuaControl {
3196
3214
  * only usable on entities that have labels (currently only spider-vehicles).
3197
3215
  *
3198
3216
  */
3199
- entity_label: string
3217
+ entity_label?: string
3200
3218
 
3201
3219
  /**
3202
3220
  * The number of filter slots this inserter, loader, or logistic storage container has. 0 if not one of those entities.
@@ -3288,12 +3306,12 @@ interface LuaEntity extends LuaControl {
3288
3306
  /**
3289
3307
  * The graphics variation for this entity or `nil` if this entity doesn't use graphics variations.
3290
3308
  */
3291
- graphics_variation: number
3309
+ graphics_variation?: number
3292
3310
 
3293
3311
  /**
3294
3312
  * The equipment grid or `nil` if this entity doesn't have an equipment grid.
3295
3313
  */
3296
- readonly grid: LuaEquipmentGrid
3314
+ readonly grid?: LuaEquipmentGrid
3297
3315
 
3298
3316
  /**
3299
3317
  * The current health of the entity, or `nil` if it doesn't have health. Health is automatically clamped to be between `0` and max health (inclusive). Entities with a health of `0` can not be attacked.
@@ -3301,7 +3319,7 @@ interface LuaEntity extends LuaControl {
3301
3319
  * To get the maximum possible health of this entity, see {@link LuaEntityPrototype::max_health | LuaEntityPrototype::max_health} on its prototype.
3302
3320
  *
3303
3321
  */
3304
- health: number
3322
+ health?: number
3305
3323
 
3306
3324
  /**
3307
3325
  * The item stack currently held in an inserter's hand.
@@ -3358,7 +3376,7 @@ interface LuaEntity extends LuaControl {
3358
3376
  * Applies to subclasses: Inserter
3359
3377
  *
3360
3378
  */
3361
- inserter_filter_mode: string
3379
+ inserter_filter_mode?: string
3362
3380
 
3363
3381
  /**
3364
3382
  * Sets the stack size limit on this inserter. If the stack size is > than the force stack size limit the value is ignored.
@@ -3473,7 +3491,7 @@ interface LuaEntity extends LuaControl {
3473
3491
  /**
3474
3492
  * The mining progress for this mining drill or `nil` if this isn't a mining drill. Is a number in range [0, mining_target.prototype.mineable_properties.mining_time]
3475
3493
  */
3476
- mining_progress: number
3494
+ mining_progress?: number
3477
3495
 
3478
3496
  /**
3479
3497
  * The mining target or `nil` if none
@@ -3481,7 +3499,7 @@ interface LuaEntity extends LuaControl {
3481
3499
  * Applies to subclasses: MiningDrill
3482
3500
  *
3483
3501
  */
3484
- readonly mining_target: LuaEntity
3502
+ readonly mining_target?: LuaEntity
3485
3503
 
3486
3504
  /**
3487
3505
  * Returns true if this unit is moving.
@@ -3510,7 +3528,7 @@ interface LuaEntity extends LuaControl {
3510
3528
  * - When called on an underground transport belt, this is the other end of the underground belt connection, or `nil` if none.
3511
3529
  * - When called on a wall-connectable entity or reactor, this is a dictionary of all connections indexed by the connection direction "north", "south", "east", and "west".
3512
3530
  */
3513
- readonly neighbours: {[key: string]: LuaEntity[]} | Array<LuaEntity[]> | LuaEntity
3531
+ readonly neighbours?: {[key: string]: LuaEntity[]} | Array<LuaEntity[]> | LuaEntity
3514
3532
 
3515
3533
  /**
3516
3534
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
@@ -3544,12 +3562,12 @@ interface LuaEntity extends LuaControl {
3544
3562
  pickup_position: Position
3545
3563
 
3546
3564
  /**
3547
- * The entity the inserter will attempt to pick up from. For example, this can be a transport belt or a storage chest.
3565
+ * The entity this inserter will attempt to pick up items from, or `nil` if there is no such entity. If there are multiple possible entities at the pick-up point, writing to this attribute allows a mod to choose which one to pick up items from. The entity needs to collide with the tile box under the pick-up position.
3548
3566
  * @remarks
3549
3567
  * Applies to subclasses: Inserter
3550
3568
  *
3551
3569
  */
3552
- pickup_target: LuaEntity
3570
+ pickup_target?: LuaEntity
3553
3571
 
3554
3572
  /**
3555
3573
  * The player connected to this character or `nil` if none.
@@ -3557,7 +3575,7 @@ interface LuaEntity extends LuaControl {
3557
3575
  * Applies to subclasses: Character
3558
3576
  *
3559
3577
  */
3560
- readonly player: LuaPlayer
3578
+ readonly player?: LuaPlayer
3561
3579
 
3562
3580
  /**
3563
3581
  * The pollution bonus of this entity.
@@ -3617,7 +3635,7 @@ interface LuaEntity extends LuaControl {
3617
3635
  /**
3618
3636
  * The target entity for this item-request-proxy or `nil`
3619
3637
  */
3620
- readonly proxy_target: LuaEntity
3638
+ readonly proxy_target?: LuaEntity
3621
3639
 
3622
3640
  /**
3623
3641
  * The rail target of this pump or `nil`.
@@ -3625,7 +3643,7 @@ interface LuaEntity extends LuaControl {
3625
3643
  * Applies to subclasses: Pump
3626
3644
  *
3627
3645
  */
3628
- readonly pump_rail_target: LuaEntity
3646
+ readonly pump_rail_target?: LuaEntity
3629
3647
 
3630
3648
  /**
3631
3649
  * When locked; the recipe in this assembling machine can't be changed by the player.
@@ -3641,7 +3659,7 @@ interface LuaEntity extends LuaControl {
3641
3659
  * Writing does nothing if the vehicle doesn't have a turret.
3642
3660
  *
3643
3661
  */
3644
- relative_turret_orientation: RealOrientation
3662
+ relative_turret_orientation?: RealOrientation
3645
3663
 
3646
3664
  /**
3647
3665
  * If items not included in this infinity container filters should be removed from the container.
@@ -3696,12 +3714,12 @@ interface LuaEntity extends LuaControl {
3696
3714
  /**
3697
3715
  * The secondary bounding box of this entity or `nil` if it doesn't have one.
3698
3716
  */
3699
- readonly secondary_bounding_box: BoundingBox
3717
+ readonly secondary_bounding_box?: BoundingBox
3700
3718
 
3701
3719
  /**
3702
3720
  * The secondary selection box of this entity or `nil` if it doesn't have one.
3703
3721
  */
3704
- readonly secondary_selection_box: BoundingBox
3722
+ readonly secondary_selection_box?: BoundingBox
3705
3723
 
3706
3724
  /**
3707
3725
  * Index of the currently selected weapon slot of this character, car, or spidertron, or `nil` if the car/spidertron doesn't have guns.
@@ -3709,7 +3727,7 @@ interface LuaEntity extends LuaControl {
3709
3727
  * Applies to subclasses: Character,Car
3710
3728
  *
3711
3729
  */
3712
- selected_gun_index: number
3730
+ selected_gun_index?: number
3713
3731
 
3714
3732
  /**
3715
3733
  * {@link LuaEntityPrototype::selection_box | LuaEntityPrototype::selection_box} around entity's given position and respecting the current entity orientation.
@@ -3719,7 +3737,7 @@ interface LuaEntity extends LuaControl {
3719
3737
  /**
3720
3738
  * The shooting target for this turret or `nil`.
3721
3739
  */
3722
- shooting_target: LuaEntity
3740
+ shooting_target?: LuaEntity
3723
3741
 
3724
3742
  /**
3725
3743
  * The state of this rail signal.
@@ -3732,7 +3750,7 @@ interface LuaEntity extends LuaControl {
3732
3750
  /**
3733
3751
  * The spawner associated with this unit entity or `nil` if the unit has no associated spawner.
3734
3752
  */
3735
- readonly spawner: LuaEntity
3753
+ readonly spawner?: LuaEntity
3736
3754
 
3737
3755
  /**
3738
3756
  * The current speed of this car in tiles per tick, rolling stock, projectile or spider vehicle, or current max speed of the unit. Only the speed of units, cars, and projectiles are writable.
@@ -3753,7 +3771,7 @@ interface LuaEntity extends LuaControl {
3753
3771
  * Applies to subclasses: Splitter
3754
3772
  *
3755
3773
  */
3756
- splitter_filter: LuaItemPrototype
3774
+ splitter_filter?: LuaItemPrototype
3757
3775
 
3758
3776
  /**
3759
3777
  * The input priority for this splitter : "left", "none", or "right".
@@ -3781,7 +3799,7 @@ interface LuaEntity extends LuaControl {
3781
3799
  /**
3782
3800
  * The status of this entity or `nil` if no status.
3783
3801
  */
3784
- readonly status: defines.entity_status
3802
+ readonly status?: defines.entity_status
3785
3803
 
3786
3804
  /**
3787
3805
  * The entity this sticker is sticked to.
@@ -3791,7 +3809,7 @@ interface LuaEntity extends LuaControl {
3791
3809
  /**
3792
3810
  * The sticker entities attached to this entity or `nil` if none.
3793
3811
  */
3794
- readonly stickers: LuaEntity[]
3812
+ readonly stickers?: LuaEntity[]
3795
3813
 
3796
3814
  /**
3797
3815
  * The storage filter for this logistic storage container.
@@ -3806,12 +3824,12 @@ interface LuaEntity extends LuaControl {
3806
3824
  /**
3807
3825
  * The tags associated with this entity ghost or `nil` if not an entity ghost.
3808
3826
  */
3809
- tags: Tags
3827
+ tags?: Tags
3810
3828
 
3811
3829
  /**
3812
3830
  * The temperature of this entities heat energy source if this entity uses a heat energy source or `nil`.
3813
3831
  */
3814
- temperature: number
3832
+ temperature?: number
3815
3833
 
3816
3834
  /**
3817
3835
  * The text of this flying-text entity.
@@ -3839,6 +3857,7 @@ interface LuaEntity extends LuaControl {
3839
3857
 
3840
3858
  /**
3841
3859
  * The ticks left before a ghost, combat robot, highlight box or smoke with trigger is destroyed.
3860
+ *
3842
3861
  * - for ghosts set to uint32 max (4,294,967,295) to never expire.
3843
3862
  * - for ghosts Cannot be set higher than {@link LuaForce::ghost_time_to_live | LuaForce::ghost_time_to_live} of the entity's force.
3844
3863
  */
@@ -3949,7 +3968,7 @@ interface LuaEntity extends LuaControl {
3949
3968
  * Applies to subclasses: Unit
3950
3969
  *
3951
3970
  */
3952
- readonly unit_group: LuaUnitGroup
3971
+ readonly unit_group?: LuaUnitGroup
3953
3972
 
3954
3973
  /**
3955
3974
  * The unit number or nil if the entity doesn't have one. This is universally unique for every entity that has one, for the lifetime of a whole game.
@@ -3987,30 +4006,9 @@ interface LuaEntityPrototype {
3987
4006
  index: defines.inventory): number
3988
4007
 
3989
4008
  /**
3990
- * Does this prototype have a flag enabled?
3991
- * @param flag - The flag to check. Must be one of
3992
- - `"not-rotatable"`
3993
- - `"placeable-neutral"`
3994
- - `"placeable-player"`
3995
- - `"placeable-enemy"`
3996
- - `"placeable-off-grid"`
3997
- - `"player-creation"`
3998
- - `"building-direction-8-way"`
3999
- - `"filter-directions"`
4000
- - `"fast-replaceable-no-build-while-moving"`
4001
- - `"breaths-air"`
4002
- - `"not-repairable"`
4003
- - `"not-on-map"`
4004
- - `"not-deconstructable"`
4005
- - `"not-blueprintable"`
4006
- - `"hide-from-bonus-gui"`
4007
- - `"hide-alt-info"`
4008
- - `"fast-replaceable-no-cross-type-while-moving"`
4009
- - `"no-gap-fill-while-building"`
4010
- - `"not-flammable"`
4011
- - `"no-automated-item-removal"`
4012
- - `"no-automated-item-insertion"`
4013
- - `"not-upgradable"`
4009
+ * Test whether this entity prototype has a certain flag set.
4010
+ * @param flag - The flag to test. See [EntityPrototypeFlags](EntityPrototypeFlags) for a list of flags.
4011
+ * @returns `true` if this prototype has the given flag set.
4014
4012
  */
4015
4013
  has_flag(this: void,
4016
4014
  flag: string): boolean
@@ -4052,12 +4050,12 @@ interface LuaEntityPrototype {
4052
4050
  /**
4053
4051
  * Whether this unit prototype is affected by tile walking speed modifiers or `nil`.
4054
4052
  */
4055
- readonly affected_by_tiles: boolean
4053
+ readonly affected_by_tiles?: boolean
4056
4054
 
4057
4055
  /**
4058
4056
  * The air resistance of this rolling stock prototype or `nil` if not a rolling stock prototype.
4059
4057
  */
4060
- readonly air_resistance: number
4058
+ readonly air_resistance?: number
4061
4059
 
4062
4060
  /**
4063
4061
  * The alert icon shift of this entity prototype.
@@ -4067,12 +4065,12 @@ interface LuaEntityPrototype {
4067
4065
  /**
4068
4066
  * Does this turret prototype alert when attacking? or `nil` if not turret prototype.
4069
4067
  */
4070
- readonly alert_when_attacking: boolean
4068
+ readonly alert_when_attacking?: boolean
4071
4069
 
4072
4070
  /**
4073
4071
  * Does this entity with health prototype alert when damaged? or `nil` if not entity with health prototype.
4074
4072
  */
4075
- readonly alert_when_damaged: boolean
4073
+ readonly alert_when_damaged?: boolean
4076
4074
 
4077
4075
  /**
4078
4076
  * If this market allows access to all forces or just friendly ones.
@@ -4102,17 +4100,17 @@ interface LuaEntityPrototype {
4102
4100
  /**
4103
4101
  * The allowed module effects for this entity or `nil`.
4104
4102
  */
4105
- readonly allowed_effects: {[key: string]: boolean}
4103
+ readonly allowed_effects?: {[key: string]: boolean}
4106
4104
 
4107
4105
  /**
4108
4106
  * Whether the lamp is always on (except when out of power or turned off by the circuit network) or `nil`.
4109
4107
  */
4110
- readonly always_on: boolean
4108
+ readonly always_on?: boolean
4111
4109
 
4112
4110
  /**
4113
4111
  * The attack parameters for this entity or `nil` if the entity doesn't use attack parameters.
4114
4112
  */
4115
- readonly attack_parameters: AttackParameters
4113
+ readonly attack_parameters?: AttackParameters
4116
4114
 
4117
4115
  /**
4118
4116
  * The attack result of this entity if the entity has one, else `nil`.
@@ -4122,7 +4120,7 @@ interface LuaEntityPrototype {
4122
4120
  /**
4123
4121
  * The amount of ammo that inserters automatically insert into this ammo-turret or artillery-turret or `nil`.
4124
4122
  */
4125
- readonly automated_ammo_count: number
4123
+ readonly automated_ammo_count?: number
4126
4124
 
4127
4125
  /**
4128
4126
  * Autoplace specification for this entity prototype. `nil` if none.
@@ -4132,7 +4130,7 @@ interface LuaEntityPrototype {
4132
4130
  /**
4133
4131
  * The base productivity of this crafting machine, lab, or mining drill, or `nil`.
4134
4132
  */
4135
- readonly base_productivity: number
4133
+ readonly base_productivity?: number
4136
4134
 
4137
4135
  /**
4138
4136
  * @remarks
@@ -4151,12 +4149,12 @@ interface LuaEntityPrototype {
4151
4149
  /**
4152
4150
  * The speed of this transport belt or `nil` if this isn't a transport belt related prototype.
4153
4151
  */
4154
- readonly belt_speed: number
4152
+ readonly belt_speed?: number
4155
4153
 
4156
4154
  /**
4157
4155
  * The braking force of this vehicle prototype or `nil` if not a vehicle prototype.
4158
4156
  */
4159
- readonly braking_force: number
4157
+ readonly braking_force?: number
4160
4158
 
4161
4159
  /**
4162
4160
  * The evolution requirement to build this entity as a base when expanding enemy bases.
@@ -4178,14 +4176,14 @@ interface LuaEntityPrototype {
4178
4176
  /**
4179
4177
  * The burner energy source prototype this entity uses or `nil`.
4180
4178
  */
4181
- readonly burner_prototype: LuaBurnerPrototype
4179
+ readonly burner_prototype?: LuaBurnerPrototype
4182
4180
 
4183
4181
  readonly call_for_help_radius: number
4184
4182
 
4185
4183
  /**
4186
4184
  * Whether this unit prototype can open gates or `nil`.
4187
4185
  */
4188
- readonly can_open_gates: boolean
4186
+ readonly can_open_gates?: boolean
4189
4187
 
4190
4188
  /**
4191
4189
  * The collision mask used only for collision test with tile directly at offshore pump position.
@@ -4205,7 +4203,7 @@ interface LuaEntityPrototype {
4205
4203
  /**
4206
4204
  * The item prototype name used to destroy this cliff or `nil`.
4207
4205
  */
4208
- readonly cliff_explosive_prototype: string
4206
+ readonly cliff_explosive_prototype?: string
4209
4207
 
4210
4208
  /**
4211
4209
  * The bounding box used for collision checking.
@@ -4237,17 +4235,17 @@ interface LuaEntityPrototype {
4237
4235
  /**
4238
4236
  * The color of the prototype, or `nil` if the prototype doesn't have color.
4239
4237
  */
4240
- readonly color: Color
4238
+ readonly color?: Color
4241
4239
 
4242
4240
  /**
4243
4241
  * The construction radius for this roboport prototype or `nil`.
4244
4242
  */
4245
- readonly construction_radius: number
4243
+ readonly construction_radius?: number
4246
4244
 
4247
4245
  /**
4248
4246
  * The energy consumption of this car prototype or `nil` if not a car prototype.
4249
4247
  */
4250
- readonly consumption: number
4248
+ readonly consumption?: number
4251
4249
 
4252
4250
  /**
4253
4251
  * @remarks
@@ -4277,7 +4275,7 @@ interface LuaEntityPrototype {
4277
4275
  /**
4278
4276
  * The crafting speed of this crafting-machine or `nil`.
4279
4277
  */
4280
- readonly crafting_speed: number
4278
+ readonly crafting_speed?: number
4281
4279
 
4282
4280
  /**
4283
4281
  * If this prototype will attempt to create a ghost of itself on death.
@@ -4290,12 +4288,12 @@ interface LuaEntityPrototype {
4290
4288
  /**
4291
4289
  * The trigger run when this entity is created or `nil`.
4292
4290
  */
4293
- readonly created_effect: TriggerItem[]
4291
+ readonly created_effect?: TriggerItem[]
4294
4292
 
4295
4293
  /**
4296
4294
  * The smoke trigger run when this entity is built or `nil`.
4297
4295
  */
4298
- readonly created_smoke: { initial_height: number, max_radius?: number, offset_deviation: BoundingBox, offsets: Vector[], smoke_name: string, speed: Vector, speed_from_center: number, speed_from_center_deviation: number, speed_multiplier: number, speed_multiplier_deviation: number, starting_frame: number, starting_frame_deviation: number, starting_frame_speed: number, starting_frame_speed_deviation: number }
4296
+ readonly created_smoke?: { initial_height: number, max_radius?: number, offset_deviation: BoundingBox, offsets: Vector[], smoke_name: string, speed: Vector, speed_from_center: number, speed_from_center_deviation: number, speed_multiplier: number, speed_multiplier_deviation: number, starting_frame: number, starting_frame_deviation: number, starting_frame_speed: number, starting_frame_speed_deviation: number }
4299
4297
 
4300
4298
  /**
4301
4299
  * @remarks
@@ -4307,12 +4305,12 @@ interface LuaEntityPrototype {
4307
4305
  /**
4308
4306
  * Value between 0 and 1 darkness where all lamps of this lamp prototype are off or `nil`.
4309
4307
  */
4310
- readonly darkness_for_all_lamps_off: number
4308
+ readonly darkness_for_all_lamps_off?: number
4311
4309
 
4312
4310
  /**
4313
4311
  * Value between 0 and 1 darkness where all lamps of this lamp prototype are on or `nil`.
4314
4312
  */
4315
- readonly darkness_for_all_lamps_on: number
4313
+ readonly darkness_for_all_lamps_on?: number
4316
4314
 
4317
4315
  /**
4318
4316
  * The hardcoded default collision mask (with flags) for this entity prototype type.
@@ -4322,22 +4320,22 @@ interface LuaEntityPrototype {
4322
4320
  /**
4323
4321
  * The distraction cooldown of this unit prototype or `nil`.
4324
4322
  */
4325
- readonly distraction_cooldown: number
4323
+ readonly distraction_cooldown?: number
4326
4324
 
4327
4325
  /**
4328
4326
  * The distribution effectivity for this beacon prototype or `nil` if not a beacon prototype.
4329
4327
  */
4330
- readonly distribution_effectivity: number
4328
+ readonly distribution_effectivity?: number
4331
4329
 
4332
4330
  /**
4333
4331
  * The door opening speed for this rocket silo prototype or `nil`.
4334
4332
  */
4335
- readonly door_opening_speed: number
4333
+ readonly door_opening_speed?: number
4336
4334
 
4337
4335
  /**
4338
4336
  * Whether this logistics or construction robot renders its cargo when flying or `nil`.
4339
4337
  */
4340
- readonly draw_cargo: boolean
4338
+ readonly draw_cargo?: boolean
4341
4339
 
4342
4340
  /**
4343
4341
  * The bounding box used for drawing the entity icon.
@@ -4354,12 +4352,12 @@ interface LuaEntityPrototype {
4354
4352
  /**
4355
4353
  * The effectivity of this car prototype, generator prototype or `nil`.
4356
4354
  */
4357
- readonly effectivity: number
4355
+ readonly effectivity?: number
4358
4356
 
4359
4357
  /**
4360
4358
  * The electric energy source prototype this entity uses or `nil`.
4361
4359
  */
4362
- readonly electric_energy_source_prototype: LuaElectricEnergySourcePrototype
4360
+ readonly electric_energy_source_prototype?: LuaElectricEnergySourcePrototype
4363
4361
 
4364
4362
  /**
4365
4363
  * Amount of pollution emissions per second this entity will create.
@@ -4374,27 +4372,27 @@ interface LuaEntityPrototype {
4374
4372
  /**
4375
4373
  * The energy used per hitpoint taken for this vehicle during collisions or `nil`.
4376
4374
  */
4377
- readonly energy_per_hit_point: number
4375
+ readonly energy_per_hit_point?: number
4378
4376
 
4379
4377
  /**
4380
4378
  * The energy consumed per tile moved for this flying robot or `nil`.
4381
4379
  */
4382
- readonly energy_per_move: number
4380
+ readonly energy_per_move?: number
4383
4381
 
4384
4382
  /**
4385
4383
  * The energy consumed per tick for this flying robot or `nil`.
4386
4384
  */
4387
- readonly energy_per_tick: number
4385
+ readonly energy_per_tick?: number
4388
4386
 
4389
4387
  /**
4390
4388
  * The direct energy usage of this entity or `nil` if this entity doesn't have a direct energy usage.
4391
4389
  */
4392
- readonly energy_usage: number
4390
+ readonly energy_usage?: number
4393
4391
 
4394
4392
  /**
4395
4393
  * The engine starting speed for this rocket silo rocket prototype or `nil`.
4396
4394
  */
4397
- readonly engine_starting_speed: number
4395
+ readonly engine_starting_speed?: number
4398
4396
 
4399
4397
  /**
4400
4398
  * @remarks
@@ -4406,12 +4404,12 @@ interface LuaEntityPrototype {
4406
4404
  /**
4407
4405
  * Does this explosion have a beam or `nil` if not an explosion prototype.
4408
4406
  */
4409
- readonly explosion_beam: number
4407
+ readonly explosion_beam?: number
4410
4408
 
4411
4409
  /**
4412
4410
  * Does this explosion rotate or `nil` if not an explosion prototype.
4413
4411
  */
4414
- readonly explosion_rotate: number
4412
+ readonly explosion_rotate?: number
4415
4413
 
4416
4414
  /**
4417
4415
  * The group of mutually fast-replaceable entities. Possibly `nil`.
@@ -4421,7 +4419,7 @@ interface LuaEntityPrototype {
4421
4419
  /**
4422
4420
  * The filter count of this inserter, loader, or logistic chest or `nil`. For logistic containers, `nil` means no limit.
4423
4421
  */
4424
- readonly filter_count: number
4422
+ readonly filter_count?: number
4425
4423
 
4426
4424
  /**
4427
4425
  * The final attack result for projectiles `nil` if not a projectile
@@ -4431,17 +4429,17 @@ interface LuaEntityPrototype {
4431
4429
  /**
4432
4430
  * The fixed recipe name for this assembling machine prototype or `nil`.
4433
4431
  */
4434
- readonly fixed_recipe: string
4432
+ readonly fixed_recipe?: string
4435
4433
 
4436
4434
  /**
4437
- * The entity prototype flags for this entity.
4435
+ * The flags for this entity prototype.
4438
4436
  */
4439
4437
  readonly flags: EntityPrototypeFlags
4440
4438
 
4441
4439
  /**
4442
4440
  * The fluid this offshore pump produces or `nil`.
4443
4441
  */
4444
- readonly fluid: LuaFluidPrototype
4442
+ readonly fluid?: LuaFluidPrototype
4445
4443
 
4446
4444
  /**
4447
4445
  * The fluid capacity of this entity or 0 if this entity doesn't support fluids.
@@ -4454,12 +4452,12 @@ interface LuaEntityPrototype {
4454
4452
  /**
4455
4453
  * The fluid energy source prototype this entity uses or `nil`.
4456
4454
  */
4457
- readonly fluid_energy_source_prototype: LuaFluidEnergySourcePrototype
4455
+ readonly fluid_energy_source_prototype?: LuaFluidEnergySourcePrototype
4458
4456
 
4459
4457
  /**
4460
4458
  * The fluid usage of this generator prototype or `nil`.
4461
4459
  */
4462
- readonly fluid_usage_per_tick: number
4460
+ readonly fluid_usage_per_tick?: number
4463
4461
 
4464
4462
  /**
4465
4463
  * The fluidbox prototypes for this entity.
@@ -4469,17 +4467,17 @@ interface LuaEntityPrototype {
4469
4467
  /**
4470
4468
  * The flying acceleration for this rocket silo rocket prototype or `nil`.
4471
4469
  */
4472
- readonly flying_acceleration: number
4470
+ readonly flying_acceleration?: number
4473
4471
 
4474
4472
  /**
4475
4473
  * The flying speed for this rocket silo rocket prototype or `nil`.
4476
4474
  */
4477
- readonly flying_speed: number
4475
+ readonly flying_speed?: number
4478
4476
 
4479
4477
  /**
4480
4478
  * The friction of this vehicle prototype or `nil` if not a vehicle prototype.
4481
4479
  */
4482
- readonly friction_force: number
4480
+ readonly friction_force?: number
4483
4481
 
4484
4482
  /**
4485
4483
  * The friendly map color used when charting this entity.
@@ -4489,7 +4487,7 @@ interface LuaEntityPrototype {
4489
4487
  /**
4490
4488
  * The equipment grid prototype for this entity or `nil`.
4491
4489
  */
4492
- readonly grid_prototype: LuaEquipmentGridPrototype
4490
+ readonly grid_prototype?: LuaEquipmentGridPrototype
4493
4491
 
4494
4492
  /**
4495
4493
  * Group of this entity.
@@ -4499,7 +4497,7 @@ interface LuaEntityPrototype {
4499
4497
  /**
4500
4498
  * The guns this prototype uses or `nil`.
4501
4499
  */
4502
- readonly guns: {[key: string]: LuaItemPrototype}
4500
+ readonly guns?: {[key: string]: LuaItemPrototype}
4503
4501
 
4504
4502
  /**
4505
4503
  * Whether this unit, car, or character prototype has belt immunity, `nil` if not car, unit, or character prototype.
@@ -4514,7 +4512,7 @@ interface LuaEntityPrototype {
4514
4512
  /**
4515
4513
  * The heat energy source prototype this entity uses or `nil`.
4516
4514
  */
4517
- readonly heat_energy_source_prototype: LuaHeatEnergySourcePrototype
4515
+ readonly heat_energy_source_prototype?: LuaHeatEnergySourcePrototype
4518
4516
 
4519
4517
  /**
4520
4518
  * Every time this infinite resource 'ticks' down it is reduced by this amount. `nil` when not a resource. Meaningless if this isn't an infinite type resource.
@@ -4529,37 +4527,42 @@ interface LuaEntityPrototype {
4529
4527
  /**
4530
4528
  * The max number of ingredients this crafting-machine prototype supports or `nil` if this isn't a crafting-machine prototype.
4531
4529
  */
4532
- readonly ingredient_count: number
4530
+ readonly ingredient_count?: number
4533
4531
 
4534
4532
  /**
4535
4533
  * True if this inserter chases items on belts for pickup or `nil`.
4536
4534
  */
4537
- readonly inserter_chases_belt_items: boolean
4535
+ readonly inserter_chases_belt_items?: boolean
4538
4536
 
4539
4537
  /**
4540
4538
  * The drop position for this inserter or `nil`.
4541
4539
  */
4542
- readonly inserter_drop_position: Vector
4540
+ readonly inserter_drop_position?: Vector
4543
4541
 
4544
4542
  /**
4545
4543
  * The extension speed of this inserter or `nil`.
4546
4544
  */
4547
- readonly inserter_extension_speed: number
4545
+ readonly inserter_extension_speed?: number
4548
4546
 
4549
4547
  /**
4550
4548
  * The pickup position for this inserter or `nil`.
4551
4549
  */
4552
- readonly inserter_pickup_position: Vector
4550
+ readonly inserter_pickup_position?: Vector
4553
4551
 
4554
4552
  /**
4555
4553
  * The rotation speed of this inserter or `nil`.
4556
4554
  */
4557
- readonly inserter_rotation_speed: number
4555
+ readonly inserter_rotation_speed?: number
4556
+
4557
+ /**
4558
+ * Gets the built-in stack size bonus of this inserter prototype. `nil` if this is not an inserter.
4559
+ */
4560
+ readonly inserter_stack_size_bonus: number
4558
4561
 
4559
4562
  /**
4560
4563
  * The instruments for this programmable speaker or `nil`.
4561
4564
  */
4562
- readonly instruments: ProgrammableSpeakerInstrument[]
4565
+ readonly instruments?: ProgrammableSpeakerInstrument[]
4563
4566
 
4564
4567
  readonly is_building: boolean
4565
4568
 
@@ -4573,27 +4576,27 @@ interface LuaEntityPrototype {
4573
4576
  /**
4574
4577
  * The item slot count of this constant combinator prototype or `nil`.
4575
4578
  */
4576
- readonly item_slot_count: number
4579
+ readonly item_slot_count?: number
4577
4580
 
4578
4581
  /**
4579
4582
  * Items that, when placed, will produce this entity. It is an array of items, or `nil` if no items place this entity. Construction bots will always choose the first item in this list to build this entity.
4580
4583
  */
4581
- readonly items_to_place_this: SimpleItemStack[]
4584
+ readonly items_to_place_this?: SimpleItemStack[]
4582
4585
 
4583
4586
  /**
4584
4587
  * The item prototype names that are the inputs of this lab prototype or `nil`.
4585
4588
  */
4586
- readonly lab_inputs: string[]
4589
+ readonly lab_inputs?: string[]
4587
4590
 
4588
4591
  /**
4589
4592
  * The rocket launch delay for this rocket silo prototype or `nil`.
4590
4593
  */
4591
- readonly launch_wait_time: number
4594
+ readonly launch_wait_time?: number
4592
4595
 
4593
4596
  /**
4594
4597
  * The light blinking speed for this rocket silo prototype or `nil`.
4595
4598
  */
4596
- readonly light_blinking_speed: number
4599
+ readonly light_blinking_speed?: number
4597
4600
 
4598
4601
  readonly localised_description: LocalisedString
4599
4602
 
@@ -4602,12 +4605,12 @@ interface LuaEntityPrototype {
4602
4605
  /**
4603
4606
  * The logistic mode of this logistic container or `nil` if this isn't a logistic container prototype. One of `"requester"`, `"active-provider"`, `"passive-provider"`, `"buffer"`, `"storage"`, `"none"`.
4604
4607
  */
4605
- readonly logistic_mode: string
4608
+ readonly logistic_mode?: string
4606
4609
 
4607
4610
  /**
4608
4611
  * The logistic radius for this roboport prototype or `nil`.
4609
4612
  */
4610
- readonly logistic_radius: number
4613
+ readonly logistic_radius?: number
4611
4614
 
4612
4615
  /**
4613
4616
  * Loot that will be dropped when this entity is killed. `nil` if there is no loot.
@@ -4624,7 +4627,7 @@ interface LuaEntityPrototype {
4624
4627
  /**
4625
4628
  * The map color used when charting this entity if a friendly or enemy color isn't defined or `nil`.
4626
4629
  */
4627
- readonly map_color: Color
4630
+ readonly map_color?: Color
4628
4631
 
4629
4632
  /**
4630
4633
  * The bounding box used for map generator collision checking.
@@ -4659,7 +4662,7 @@ interface LuaEntityPrototype {
4659
4662
  /**
4660
4663
  * The max energy for this flying robot or `nil`.
4661
4664
  */
4662
- readonly max_energy: number
4665
+ readonly max_energy?: number
4663
4666
 
4664
4667
  /**
4665
4668
  * The theoretical maximum energy production for this this entity.
@@ -4684,32 +4687,32 @@ interface LuaEntityPrototype {
4684
4687
  /**
4685
4688
  * The max payload size of this logistics or construction robot or `nil`.
4686
4689
  */
4687
- readonly max_payload_size: number
4690
+ readonly max_payload_size?: number
4688
4691
 
4689
4692
  /**
4690
4693
  * The maximum polyphony for this programmable speaker or `nil`.
4691
4694
  */
4692
- readonly max_polyphony: number
4695
+ readonly max_polyphony?: number
4693
4696
 
4694
4697
  /**
4695
4698
  * The maximum pursue distance of this unit prototype or `nil`.
4696
4699
  */
4697
- readonly max_pursue_distance: number
4700
+ readonly max_pursue_distance?: number
4698
4701
 
4699
4702
  /**
4700
4703
  * The max speed of this projectile prototype or flying robot prototype or `nil`.
4701
4704
  */
4702
- readonly max_speed: number
4705
+ readonly max_speed?: number
4703
4706
 
4704
4707
  /**
4705
4708
  * The maximum energy for this flying robot above which it won't try to recharge when stationing or `nil`.
4706
4709
  */
4707
- readonly max_to_charge: number
4710
+ readonly max_to_charge?: number
4708
4711
 
4709
4712
  /**
4710
4713
  * The max underground distance for underground belts and underground pipes or `nil` if this isn't one of those prototypes.
4711
4714
  */
4712
- readonly max_underground_distance: number
4715
+ readonly max_underground_distance?: number
4713
4716
 
4714
4717
  /**
4715
4718
  * The maximum wire distance for this entity. 0 when the entity doesn't support wires.
@@ -4726,7 +4729,7 @@ interface LuaEntityPrototype {
4726
4729
  /**
4727
4730
  * The maximum fluid temperature of this generator prototype or `nil`.
4728
4731
  */
4729
- readonly maximum_temperature: number
4732
+ readonly maximum_temperature?: number
4730
4733
 
4731
4734
  /**
4732
4735
  * The minimum darkness at which this unit spawner can spawn entities.
@@ -4736,12 +4739,12 @@ interface LuaEntityPrototype {
4736
4739
  /**
4737
4740
  * The minimum pursue time of this unit prototype or `nil`.
4738
4741
  */
4739
- readonly min_pursue_time: number
4742
+ readonly min_pursue_time?: number
4740
4743
 
4741
4744
  /**
4742
4745
  * The minimum energy for this flying robot before it tries to recharge or `nil`.
4743
4746
  */
4744
- readonly min_to_charge: number
4747
+ readonly min_to_charge?: number
4745
4748
 
4746
4749
  /**
4747
4750
  * Whether this entity is minable and what can be obtained by mining it.
@@ -4756,22 +4759,22 @@ interface LuaEntityPrototype {
4756
4759
  /**
4757
4760
  * The mining radius of this mining drill prototype or `nil` if this isn't a mining drill prototype.
4758
4761
  */
4759
- readonly mining_drill_radius: number
4762
+ readonly mining_drill_radius?: number
4760
4763
 
4761
4764
  /**
4762
4765
  * The mining speed of this mining drill/character prototype or `nil`.
4763
4766
  */
4764
- readonly mining_speed: number
4767
+ readonly mining_speed?: number
4765
4768
 
4766
4769
  /**
4767
4770
  * The module inventory size or `nil` if this entity doesn't support modules.
4768
4771
  */
4769
- readonly module_inventory_size: number
4772
+ readonly module_inventory_size?: number
4770
4773
 
4771
4774
  /**
4772
4775
  * Whether this unit prototype can move while shooting or `nil`.
4773
4776
  */
4774
- readonly move_while_shooting: boolean
4777
+ readonly move_while_shooting?: boolean
4775
4778
 
4776
4779
  /**
4777
4780
  * Name of this prototype.
@@ -4796,7 +4799,7 @@ interface LuaEntityPrototype {
4796
4799
  /**
4797
4800
  * The next upgrade for this entity or `nil`.
4798
4801
  */
4799
- readonly next_upgrade: LuaEntityPrototype
4802
+ readonly next_upgrade?: LuaEntityPrototype
4800
4803
 
4801
4804
  /**
4802
4805
  * The normal amount for this resource. `nil` when not a resource.
@@ -4821,12 +4824,12 @@ interface LuaEntityPrototype {
4821
4824
  /**
4822
4825
  * The pumping speed of this offshore pump, normal pump, or `nil`.
4823
4826
  */
4824
- readonly pumping_speed: number
4827
+ readonly pumping_speed?: number
4825
4828
 
4826
4829
  /**
4827
4830
  * The radar range of this unit prototype or `nil`.
4828
4831
  */
4829
- readonly radar_range: number
4832
+ readonly radar_range?: number
4830
4833
 
4831
4834
  /**
4832
4835
  * The radius of this entity prototype.
@@ -4869,7 +4872,7 @@ interface LuaEntityPrototype {
4869
4872
  /**
4870
4873
  * The base researching speed of this lab prototype or `nil`.
4871
4874
  */
4872
- readonly researching_speed: number
4875
+ readonly researching_speed?: number
4873
4876
 
4874
4877
  /**
4875
4878
  * List of resistances towards each damage type. It is a dictionary indexed by damage type names (see `data/base/prototypes/damage-type.lua`).
@@ -4882,7 +4885,7 @@ interface LuaEntityPrototype {
4882
4885
  * The value in the dictionary is meaningless and exists just to allow the dictionary type for easy lookup.
4883
4886
  *
4884
4887
  */
4885
- readonly resource_categories: {[key: string]: boolean}
4888
+ readonly resource_categories?: {[key: string]: boolean}
4886
4889
 
4887
4890
  /**
4888
4891
  * Name of the category of this resource or `nil` when not a resource.
@@ -4890,7 +4893,7 @@ interface LuaEntityPrototype {
4890
4893
  * During data stage this property is named "category".
4891
4894
  *
4892
4895
  */
4893
- readonly resource_category: string
4896
+ readonly resource_category?: string
4894
4897
 
4895
4898
  /**
4896
4899
  * @remarks
@@ -4907,27 +4910,27 @@ interface LuaEntityPrototype {
4907
4910
  /**
4908
4911
  * The rising speed for this rocket silo rocket prototype or `nil`.
4909
4912
  */
4910
- readonly rising_speed: number
4913
+ readonly rising_speed?: number
4911
4914
 
4912
4915
  /**
4913
4916
  * The rocket entity prototype associated with this rocket silo prototype or `nil`.
4914
4917
  */
4915
- readonly rocket_entity_prototype: LuaEntityPrototype
4918
+ readonly rocket_entity_prototype?: LuaEntityPrototype
4916
4919
 
4917
4920
  /**
4918
4921
  * The rocket parts required for this rocket silo prototype or `nil`.
4919
4922
  */
4920
- readonly rocket_parts_required: number
4923
+ readonly rocket_parts_required?: number
4921
4924
 
4922
4925
  /**
4923
4926
  * The rocket rising delay for this rocket silo prototype or `nil`.
4924
4927
  */
4925
- readonly rocket_rising_delay: number
4928
+ readonly rocket_rising_delay?: number
4926
4929
 
4927
4930
  /**
4928
4931
  * The rotation speed of this car prototype or `nil` if not a car prototype.
4929
4932
  */
4930
- readonly rotation_speed: number
4933
+ readonly rotation_speed?: number
4931
4934
 
4932
4935
  /**
4933
4936
  * Gets the current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.
@@ -4940,7 +4943,7 @@ interface LuaEntityPrototype {
4940
4943
  /**
4941
4944
  * The secondary bounding box used for collision checking, or `nil` if it doesn't have one. This is only used in rails and rail remnants.
4942
4945
  */
4943
- readonly secondary_collision_box: BoundingBox
4946
+ readonly secondary_collision_box?: BoundingBox
4944
4947
 
4945
4948
  /**
4946
4949
  * Is this entity selectable?
@@ -4965,7 +4968,7 @@ interface LuaEntityPrototype {
4965
4968
  /**
4966
4969
  * The spawning cooldown for this enemy spawner prototype or `nil`.
4967
4970
  */
4968
- readonly spawn_cooldown: { max: number, min: number }
4971
+ readonly spawn_cooldown?: { max: number, min: number }
4969
4972
 
4970
4973
  /**
4971
4974
  * How far from the spawner can the units be spawned.
@@ -4980,7 +4983,7 @@ interface LuaEntityPrototype {
4980
4983
  /**
4981
4984
  * The spawning time modifier of this unit prototype or `nil`.
4982
4985
  */
4983
- readonly spawning_time_modifier: number
4986
+ readonly spawning_time_modifier?: number
4984
4987
 
4985
4988
  /**
4986
4989
  * The default speed of this flying robot, rolling stock or unit, `nil` if not one of these.
@@ -4993,7 +4996,7 @@ interface LuaEntityPrototype {
4993
4996
  /**
4994
4997
  * The speed multiplier when this flying robot is out of energy or `nil`.
4995
4998
  */
4996
- readonly speed_multiplier_when_out_of_energy: number
4999
+ readonly speed_multiplier_when_out_of_energy?: number
4997
5000
 
4998
5001
  /**
4999
5002
  * If this inserter is a stack-type.
@@ -5013,7 +5016,7 @@ interface LuaEntityPrototype {
5013
5016
  /**
5014
5017
  * The supply area of this electric pole, beacon, or `nil` if this is neither.
5015
5018
  */
5016
- readonly supply_area_distance: number
5019
+ readonly supply_area_distance?: number
5017
5020
 
5018
5021
  /**
5019
5022
  * If this entity prototype could possibly ever be rotated.
@@ -5023,12 +5026,12 @@ interface LuaEntityPrototype {
5023
5026
  /**
5024
5027
  * If this car prototype uses tank controls to drive or `nil` if this is not a car prototype.
5025
5028
  */
5026
- readonly tank_driving: boolean
5029
+ readonly tank_driving?: boolean
5027
5030
 
5028
5031
  /**
5029
5032
  * The target temperature of this boiler prototype or `nil`.
5030
5033
  */
5031
- readonly target_temperature: number
5034
+ readonly target_temperature?: number
5032
5035
 
5033
5036
  /**
5034
5037
  * The terrain friction modifier for this vehicle.
@@ -5074,12 +5077,12 @@ interface LuaEntityPrototype {
5074
5077
  /**
5075
5078
  * The range of this turret or `nil` if this isn't a turret related prototype.
5076
5079
  */
5077
- readonly turret_range: number
5080
+ readonly turret_range?: number
5078
5081
 
5079
5082
  /**
5080
5083
  * The turret rotation speed of this car prototype or `nil` if not a car prototype.
5081
5084
  */
5082
- readonly turret_rotation_speed: number
5085
+ readonly turret_rotation_speed?: number
5083
5086
 
5084
5087
  /**
5085
5088
  * Type of this prototype.
@@ -5094,17 +5097,17 @@ interface LuaEntityPrototype {
5094
5097
  /**
5095
5098
  * The vision distance of this unit prototype or `nil`.
5096
5099
  */
5097
- readonly vision_distance: number
5100
+ readonly vision_distance?: number
5098
5101
 
5099
5102
  /**
5100
5103
  * The void energy source prototype this entity uses or `nil`.
5101
5104
  */
5102
- readonly void_energy_source_prototype: LuaVoidEnergySourcePrototype
5105
+ readonly void_energy_source_prototype?: LuaVoidEnergySourcePrototype
5103
5106
 
5104
5107
  /**
5105
5108
  * The weight of this vehicle prototype or `nil` if not a vehicle prototype.
5106
5109
  */
5107
- readonly weight: number
5110
+ readonly weight?: number
5108
5111
 
5109
5112
  }
5110
5113
 
@@ -5123,7 +5126,7 @@ interface LuaEquipment {
5123
5126
  /**
5124
5127
  * The burner energy source for this equipment or `nil` if there isn't one.
5125
5128
  */
5126
- readonly burner: LuaBurner
5129
+ readonly burner?: LuaBurner
5127
5130
 
5128
5131
  /**
5129
5132
  * Current available energy.
@@ -5447,7 +5450,7 @@ interface LuaEquipmentPrototype {
5447
5450
  /**
5448
5451
  * The equipment attack parameters or `nil`.
5449
5452
  */
5450
- readonly attack_parameters: AttackParameters
5453
+ readonly attack_parameters?: AttackParameters
5451
5454
 
5452
5455
  /**
5453
5456
  * Is this active defense equipment automatic. Returns false if not active defense equipment.
@@ -5462,12 +5465,12 @@ interface LuaEquipmentPrototype {
5462
5465
  /**
5463
5466
  * The burner energy source prototype this equipment uses or `nil`.
5464
5467
  */
5465
- readonly burner_prototype: LuaBurnerPrototype
5468
+ readonly burner_prototype?: LuaBurnerPrototype
5466
5469
 
5467
5470
  /**
5468
5471
  * The electric energy source prototype this equipment uses or `nil`.
5469
5472
  */
5470
- readonly electric_energy_source_prototype: LuaElectricEnergySourcePrototype
5473
+ readonly electric_energy_source_prototype?: LuaElectricEnergySourcePrototype
5471
5474
 
5472
5475
  readonly energy_consumption: number
5473
5476
 
@@ -5555,6 +5558,7 @@ interface LuaEquipmentPrototype {
5555
5558
 
5556
5559
  /**
5557
5560
  * Encapsulates statistic data for different parts of the game. In the context of flow statistics, `input` and `output` describe on which side of the associated GUI the values are shown. Input values are shown on the left side, output values on the right side.
5561
+ *
5558
5562
  * Examples:
5559
5563
  * - The item production GUI shows "consumption" on the right, thus `output` describes the item consumption numbers. The same goes for fluid consumption.
5560
5564
  * - The kills gui shows "losses" on the right, so `output` describes how many of the force's entities were killed by enemies.
@@ -5630,7 +5634,7 @@ interface LuaFlowStatistics {
5630
5634
  /**
5631
5635
  * The force these statistics belong to or `nil` for pollution statistics.
5632
5636
  */
5633
- readonly force: LuaForce
5637
+ readonly force?: LuaForce
5634
5638
 
5635
5639
  /**
5636
5640
  * List of input counts indexed by prototype name. Represents the data that is shown on the left side of the GUI for the given statistics.
@@ -5656,7 +5660,9 @@ interface LuaFlowStatistics {
5656
5660
 
5657
5661
  /**
5658
5662
  * An array of fluid boxes of an entity. Entities may contain more than one fluid box, and some can change the number of fluid boxes -- for instance, an assembling machine will change its number of fluid boxes depending on its active recipe.
5663
+ *
5659
5664
  * See {@link Fluid | Fluid}
5665
+ *
5660
5666
  * Do note that reading from a {@link LuaFluidBox | LuaFluidBox} creates a new table and writing will copy the given fields from the table into the engine's own fluid box structure. Therefore, the correct way to update a fluidbox of an entity is to read it first, modify the table, then write the modified table back. Directly accessing the returned table's attributes won't have the desired effect.
5661
5667
  * @example
5662
5668
  * Double the temperature of the fluid in `entity`'s first fluid box.
@@ -5787,7 +5793,7 @@ interface LuaFluidBoxPrototype {
5787
5793
  /**
5788
5794
  * The filter or `nil` if no filter is set.
5789
5795
  */
5790
- readonly filter: LuaFluidPrototype
5796
+ readonly filter?: LuaFluidPrototype
5791
5797
 
5792
5798
  readonly height: number
5793
5799
 
@@ -5799,12 +5805,12 @@ interface LuaFluidBoxPrototype {
5799
5805
  /**
5800
5806
  * The maximum temperature or `nil` if none is set.
5801
5807
  */
5802
- readonly maximum_temperature: number
5808
+ readonly maximum_temperature?: number
5803
5809
 
5804
5810
  /**
5805
5811
  * The minimum temperature or `nil` if none is set.
5806
5812
  */
5807
- readonly minimum_temperature: number
5813
+ readonly minimum_temperature?: number
5808
5814
 
5809
5815
  /**
5810
5816
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
@@ -5851,6 +5857,8 @@ interface LuaFluidEnergySourcePrototype {
5851
5857
 
5852
5858
  readonly burns_fluid: boolean
5853
5859
 
5860
+ readonly destroy_non_fuel_fluid: boolean
5861
+
5854
5862
  readonly effectivity: number
5855
5863
 
5856
5864
  readonly emissions: number
@@ -5985,7 +5993,7 @@ interface LuaFontPrototype {
5985
5993
  /**
5986
5994
  * The border color or `nil` if not set.
5987
5995
  */
5988
- readonly border_color: Color
5996
+ readonly border_color?: Color
5989
5997
 
5990
5998
  readonly filtered: boolean
5991
5999
 
@@ -6435,6 +6443,7 @@ interface LuaForce {
6435
6443
 
6436
6444
  /**
6437
6445
  * The connected players belonging to this force.
6446
+ *
6438
6447
  * This is primarily useful when you want to do some action against all online players of this force.
6439
6448
  * @remarks
6440
6449
  * This does *not* index using player index. See {@link LuaPlayer::index | LuaPlayer::index} on each player instance for the player index.
@@ -6445,7 +6454,7 @@ interface LuaForce {
6445
6454
  /**
6446
6455
  * The current technology in research, or `nil` if no research is currently ongoing.
6447
6456
  */
6448
- readonly current_research: LuaTechnology
6457
+ readonly current_research?: LuaTechnology
6449
6458
 
6450
6459
  /**
6451
6460
  * The time, in ticks, before a deconstruction order is removed.
@@ -6604,12 +6613,13 @@ interface LuaForce {
6604
6613
 
6605
6614
  /**
6606
6615
  * The research queue of this force. The first technology in the array is the currently active one. Reading this attribute gives an array of {@link LuaTechnology | LuaTechnology}.
6616
+ *
6607
6617
  * To write to this, the entire table must be written. Providing an empty table or `nil` will empty the research queue and cancel the current research. Writing to this when the research queue is disabled will simply set the last research in the table as the current research.
6608
6618
  * @remarks
6609
6619
  * This only allows mods to queue research that this force is able to research in the first place. As an example, an already researched technology or one whose prerequisites are not fulfilled will not be queued, but dropped silently instead.
6610
6620
  *
6611
6621
  */
6612
- research_queue: TechnologyIdentification[]
6622
+ research_queue?: TechnologyIdentification[]
6613
6623
 
6614
6624
  /**
6615
6625
  * Whether the research queue is available for this force.
@@ -7199,6 +7209,11 @@ interface LuaGameScript {
7199
7209
  remove_path(this: void,
7200
7210
  path: string): void
7201
7211
 
7212
+ /**
7213
+ * Reset scenario state (game_finished, player_won, etc.).
7214
+ */
7215
+ reset_game_state(this: void): void
7216
+
7202
7217
  /**
7203
7218
  * Resets the amount of time played for this map.
7204
7219
  */
@@ -7390,6 +7405,7 @@ interface LuaGameScript {
7390
7405
 
7391
7406
  /**
7392
7407
  * The players that are currently online.
7408
+ *
7393
7409
  * This is primarily useful when you want to do some action against all online players.
7394
7410
  * @remarks
7395
7411
  * This does *not* index using player index. See {@link LuaPlayer::index | LuaPlayer::index} on each player instance for the player index.
@@ -7464,10 +7480,15 @@ interface LuaGameScript {
7464
7480
  readonly equipment_prototypes: {[key: string]: LuaEquipmentPrototype}
7465
7481
 
7466
7482
  /**
7467
- * Is the scenario finished?
7483
+ * True while the victory screen is shown.
7468
7484
  */
7469
7485
  readonly finished: boolean
7470
7486
 
7487
+ /**
7488
+ * True after players finished the game and clicked "continue".
7489
+ */
7490
+ readonly finished_but_continuing: boolean
7491
+
7471
7492
  /**
7472
7493
  * A dictionary containing every LuaFluidPrototype indexed by `name`.
7473
7494
  */
@@ -7857,7 +7878,9 @@ interface LuaGui {
7857
7878
 
7858
7879
  /**
7859
7880
  * An element of a custom GUI. This type is used to represent any kind of a GUI element - labels, buttons and frames are all instances of this type. Just like {@link LuaEntity | LuaEntity}, different kinds of elements support different attributes; attempting to access an attribute on an element that doesn't support it (for instance, trying to access the `column_count` of a `textfield`) will result in a runtime error.
7881
+ *
7860
7882
  * The following types of GUI element are supported:
7883
+ *
7861
7884
  * - `"button"`: A clickable element. Relevant event: {@link on_gui_click | on_gui_click}
7862
7885
  * - `"sprite-button"`: A `button` that displays a sprite rather than text. Relevant event: {@link on_gui_click | on_gui_click}
7863
7886
  * - `"checkbox"`: A clickable element with a check mark that can be turned off or on. Relevant event: {@link on_gui_checked_state_changed | on_gui_checked_state_changed}
@@ -7883,6 +7906,7 @@ interface LuaGui {
7883
7906
  * - `"tabbed-pane"`: A collection of `tab`s and their contents. Relevant event: {@link on_gui_selected_tab_changed | on_gui_selected_tab_changed}
7884
7907
  * - `"tab"`: A tab for use in a `tabbed-pane`.
7885
7908
  * - `"switch"`: A switch with three possible states. Can have labels attached to either side. Relevant event: {@link on_gui_switch_state_changed | on_gui_switch_state_changed}
7909
+ *
7886
7910
  * Each GUI element allows access to its children by having them as attributes. Thus, one can use the `parent.child` syntax to refer to children. Lua also supports the `parent["child"]` syntax to refer to the same element. This can be used in cases where the child has a name that isn't a valid Lua identifier.
7887
7911
  * @example
7888
7912
  * This will add a label called `greeting` to the top flow. Immediately after, it will change its text to illustrate accessing child elements.
@@ -8183,6 +8207,15 @@ interface LuaGuiElement {
8183
8207
  set_slider_value_step(this: void,
8184
8208
  value: number): void
8185
8209
 
8210
+ /**
8211
+ * Swaps the children at the given indices in this element.
8212
+ * @param index_1 - The index of the first child.
8213
+ * @param index_2 - The index of the second child.
8214
+ */
8215
+ swap_children(this: void,
8216
+ index_1: number,
8217
+ index_2: number): void
8218
+
8186
8219
  /**
8187
8220
  * Whether this textfield (when in numeric mode) allows decimal numbers.
8188
8221
  * @remarks
@@ -8312,6 +8345,7 @@ interface LuaGuiElement {
8312
8345
 
8313
8346
  /**
8314
8347
  * The elem filters of this choose-elem-button or `nil` if there are no filters.
8348
+ *
8315
8349
  * The compatible type of filter is determined by elem_type:
8316
8350
  * - Type `"item"` - {@link ItemPrototypeFilter | ItemPrototypeFilter}
8317
8351
  * - Type `"tile"` - {@link TilePrototypeFilter | TilePrototypeFilter}
@@ -8347,7 +8381,7 @@ interface LuaGuiElement {
8347
8381
  * ```
8348
8382
  *
8349
8383
  */
8350
- elem_filters: ItemPrototypeFilter | TilePrototypeFilter | EntityPrototypeFilter | FluidPrototypeFilter | RecipePrototypeFilter | DecorativePrototypeFilter | AchievementPrototypeFilter | EquipmentPrototypeFilter | TechnologyPrototypeFilter[]
8384
+ elem_filters?: ItemPrototypeFilter | TilePrototypeFilter | EntityPrototypeFilter | FluidPrototypeFilter | RecipePrototypeFilter | DecorativePrototypeFilter | AchievementPrototypeFilter | EquipmentPrototypeFilter | TechnologyPrototypeFilter[]
8351
8385
 
8352
8386
  /**
8353
8387
  * The elem type of this choose-elem-button.
@@ -8364,7 +8398,7 @@ interface LuaGuiElement {
8364
8398
  * Applies to subclasses: choose-elem-button
8365
8399
  *
8366
8400
  */
8367
- elem_value: string | SignalID
8401
+ elem_value?: string | SignalID
8368
8402
 
8369
8403
  /**
8370
8404
  * Whether this GUI element is enabled. Disabled GUI elements don't trigger events when clicked.
@@ -8374,12 +8408,12 @@ interface LuaGuiElement {
8374
8408
  /**
8375
8409
  * The entity associated with this entity-preview, camera, minimap or `nil` if no entity is associated.
8376
8410
  */
8377
- entity: LuaEntity
8411
+ entity?: LuaEntity
8378
8412
 
8379
8413
  /**
8380
8414
  * The force this minimap is using or `nil` if no force is set.
8381
8415
  */
8382
- force: string
8416
+ force?: string
8383
8417
 
8384
8418
  /**
8385
8419
  * The GUI this element is a child of.
@@ -8444,7 +8478,7 @@ interface LuaGuiElement {
8444
8478
  /**
8445
8479
  * The location of this widget when stored in {@link LuaGui::screen | LuaGui::screen}, or `nil` if not set or not in {@link LuaGui::screen | LuaGui::screen}.
8446
8480
  */
8447
- location: GuiLocation
8481
+ location?: GuiLocation
8448
8482
 
8449
8483
  /**
8450
8484
  * Whether this choose-elem-button can be changed by the player.
@@ -8566,7 +8600,7 @@ interface LuaGuiElement {
8566
8600
  * Applies to subclasses: tabbed-pane
8567
8601
  *
8568
8602
  */
8569
- selected_tab_index: number
8603
+ selected_tab_index?: number
8570
8604
 
8571
8605
  /**
8572
8606
  * Related to the number to be shown in the bottom right corner of this sprite-button. When set to `true`, numbers that are non-zero and smaller than one are shown as a percentage rather than the value. For example, `0.5` will be shown as `50%` instead.
@@ -8974,22 +9008,22 @@ interface LuaInventory {
8974
9008
  /**
8975
9009
  * The entity that owns this inventory or `nil` if this isn't owned by an entity.
8976
9010
  */
8977
- readonly entity_owner: LuaEntity
9011
+ readonly entity_owner?: LuaEntity
8978
9012
 
8979
9013
  /**
8980
9014
  * The equipment that owns this inventory or `nil` if this isn't owned by an equipment.
8981
9015
  */
8982
- readonly equipment_owner: LuaEquipment
9016
+ readonly equipment_owner?: LuaEquipment
8983
9017
 
8984
9018
  /**
8985
9019
  * The inventory index this inventory uses, or `nil` if the inventory doesn't have an index.
8986
9020
  */
8987
- readonly index: defines.inventory
9021
+ readonly index?: defines.inventory
8988
9022
 
8989
9023
  /**
8990
9024
  * The mod that owns this inventory or `nil` if this isn't owned by a mod.
8991
9025
  */
8992
- readonly mod_owner: string
9026
+ readonly mod_owner?: string
8993
9027
 
8994
9028
  /**
8995
9029
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
@@ -8999,7 +9033,7 @@ interface LuaInventory {
8999
9033
  /**
9000
9034
  * The player that owns this inventory or `nil` if this isn't owned by a player.
9001
9035
  */
9002
- readonly player_owner: LuaPlayer
9036
+ readonly player_owner?: LuaPlayer
9003
9037
 
9004
9038
  /**
9005
9039
  * 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.
@@ -9050,9 +9084,9 @@ interface LuaItemPrototype {
9050
9084
  ammo_source_type?: string): AmmoType
9051
9085
 
9052
9086
  /**
9053
- * Does this prototype have a flag enabled?
9054
- * Any other value will cause an error.
9055
- * @param flag - The flag to check. Can be one of [ItemPrototypeFlags](ItemPrototypeFlags)
9087
+ * Test whether this item prototype has a certain flag set.
9088
+ * @param flag - The flag to test. See [ItemPrototypeFlags](ItemPrototypeFlags) for a list of flags.
9089
+ * @returns `true` if this prototype has the given flag set.
9056
9090
  */
9057
9091
  has_flag(this: void,
9058
9092
  flag: string): boolean
@@ -9137,12 +9171,12 @@ interface LuaItemPrototype {
9137
9171
  /**
9138
9172
  * The gun attack parameters or `nil` if not a gun item prototype.
9139
9173
  */
9140
- readonly attack_parameters: AttackParameters
9174
+ readonly attack_parameters?: AttackParameters
9141
9175
 
9142
9176
  /**
9143
9177
  * The result of burning this item as fuel or `nil`.
9144
9178
  */
9145
- readonly burnt_result: LuaItemPrototype
9179
+ readonly burnt_result?: LuaItemPrototype
9146
9180
 
9147
9181
  /**
9148
9182
  * If this item can be mod-opened.
@@ -9152,7 +9186,7 @@ interface LuaItemPrototype {
9152
9186
  /**
9153
9187
  * The capsule action for this capsule item prototype or `nil` if this isn't a capsule item prototype.
9154
9188
  */
9155
- readonly capsule_action: CapsuleAction
9189
+ readonly capsule_action?: CapsuleAction
9156
9190
 
9157
9191
  /**
9158
9192
  * The name of a {@link LuaModuleCategoryPrototype | LuaModuleCategoryPrototype}. Used when upgrading modules: Ctrl + click modules into an entity and it will replace lower tier modules of the same category with higher tier modules.
@@ -9197,7 +9231,7 @@ interface LuaItemPrototype {
9197
9231
  * Applies to subclasses: ToolItem
9198
9232
  *
9199
9233
  */
9200
- readonly durability: number
9234
+ readonly durability?: number
9201
9235
 
9202
9236
  /**
9203
9237
  * The durability message key used when displaying the durability of this tool.
@@ -9221,7 +9255,7 @@ interface LuaItemPrototype {
9221
9255
  * Applies to subclasses: DeconstructionItem
9222
9256
  *
9223
9257
  */
9224
- readonly entity_filter_slots: number
9258
+ readonly entity_filter_slots?: number
9225
9259
 
9226
9260
  /**
9227
9261
  * The entity filters used by this selection tool indexed by entity name.
@@ -9243,7 +9277,7 @@ interface LuaItemPrototype {
9243
9277
  /**
9244
9278
  * The prototype of this armor equipment grid or `nil` if none or this is not an armor item.
9245
9279
  */
9246
- readonly equipment_grid: LuaEquipmentGridPrototype
9280
+ readonly equipment_grid?: LuaEquipmentGridPrototype
9247
9281
 
9248
9282
  /**
9249
9283
  * If this item with inventory extends the inventory it resides in by default.
@@ -9262,7 +9296,7 @@ interface LuaItemPrototype {
9262
9296
  readonly filter_mode: string
9263
9297
 
9264
9298
  /**
9265
- * The item prototype flags for this item prototype.
9299
+ * The flags for this item prototype.
9266
9300
  */
9267
9301
  readonly flags: ItemPrototypeFlags
9268
9302
 
@@ -9274,7 +9308,7 @@ interface LuaItemPrototype {
9274
9308
  /**
9275
9309
  * The fuel category or `nil`.
9276
9310
  */
9277
- readonly fuel_category: string
9311
+ readonly fuel_category?: string
9278
9312
 
9279
9313
  /**
9280
9314
  * The emissions multiplier if this is used as fuel.
@@ -9416,7 +9450,7 @@ interface LuaItemPrototype {
9416
9450
  /**
9417
9451
  * Prototype of the equipment that will be created by placing this item in an equipment grid or `nil` if there is no equipment defined.
9418
9452
  */
9419
- readonly place_as_equipment_result: LuaEquipmentPrototype
9453
+ readonly place_as_equipment_result?: LuaEquipmentPrototype
9420
9454
 
9421
9455
  /**
9422
9456
  * The place-as-tile result if one is defined, else `nil`.
@@ -9426,12 +9460,12 @@ interface LuaItemPrototype {
9426
9460
  /**
9427
9461
  * Prototype of the entity that will be created by placing this item, or `nil` if there is no such entity.
9428
9462
  */
9429
- readonly place_result: LuaEntityPrototype
9463
+ readonly place_result?: LuaEntityPrototype
9430
9464
 
9431
9465
  /**
9432
9466
  * Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine or `nil` if this is not an ammo item.
9433
9467
  */
9434
- readonly reload_time: number
9468
+ readonly reload_time?: number
9435
9469
 
9436
9470
  /**
9437
9471
  * The repair result of this repair tool prototype or `nil` if this isn't a repair tool prototype.
@@ -9439,7 +9473,7 @@ interface LuaItemPrototype {
9439
9473
  * Applies to subclasses: RepairTool
9440
9474
  *
9441
9475
  */
9442
- readonly repair_result: TriggerItem[]
9476
+ readonly repair_result?: TriggerItem[]
9443
9477
 
9444
9478
  /**
9445
9479
  * Resistances of this armour item, indexed by damage type name. `nil` if not an armor or the armor has no resistances.
@@ -9524,7 +9558,7 @@ interface LuaItemPrototype {
9524
9558
  * Applies to subclasses: DeconstructionItem
9525
9559
  *
9526
9560
  */
9527
- readonly tile_filter_slots: number
9561
+ readonly tile_filter_slots?: number
9528
9562
 
9529
9563
  /**
9530
9564
  * The tile filters used by this selection tool indexed by tile name.
@@ -9580,7 +9614,6 @@ interface LuaItemStack {
9580
9614
  amount: number): void
9581
9615
 
9582
9616
  /**
9583
- * Build this blueprint
9584
9617
  * @remarks
9585
9618
  * Built entities can be come invalid between the building of the blueprint and the function returning if by_player or raise_built is used and one of those events invalidates the entity.
9586
9619
  *
@@ -9731,7 +9764,7 @@ interface LuaItemStack {
9731
9764
  amount: number): void
9732
9765
 
9733
9766
  /**
9734
- * Export a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) to a string
9767
+ * Export a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) to a string.
9735
9768
  * @returns The exported string
9736
9769
  */
9737
9770
  export_stack(this: void): string
@@ -9834,7 +9867,7 @@ interface LuaItemStack {
9834
9867
  help(this: void): string
9835
9868
 
9836
9869
  /**
9837
- * Import a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) from a string
9870
+ * Import a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) from a string.
9838
9871
  * @param data - The string to import
9839
9872
  * @returns 0 if the import succeeded with no errors. -1 if the import succeeded with errors. 1 if the import failed.
9840
9873
  */
@@ -10098,7 +10131,7 @@ interface LuaItemStack {
10098
10131
  /**
10099
10132
  * The equipment grid of this item or `nil` if this item doesn't have a grid.
10100
10133
  */
10101
- readonly grid: LuaEquipmentGrid
10134
+ readonly grid?: LuaEquipmentGrid
10102
10135
 
10103
10136
  /**
10104
10137
  * How much health the item has, as a number in range [0, 1].
@@ -10177,6 +10210,7 @@ interface LuaItemStack {
10177
10210
 
10178
10211
  /**
10179
10212
  * The unique identifier for this item if it has one, `nil` otherwise. Note that this ID stays the same no matter where the item is moved to.
10213
+ *
10180
10214
  * Only these types of items have unique IDs:
10181
10215
  * - `"armor"`
10182
10216
  * - `"spidertron-remote"`
@@ -10304,7 +10338,7 @@ interface LuaLampControlBehavior extends LuaGenericOnOffControlBehavior {
10304
10338
  /**
10305
10339
  * The color the lamp is showing or `nil` if not using any color.
10306
10340
  */
10307
- readonly color: Color
10341
+ readonly color?: Color
10308
10342
 
10309
10343
  /**
10310
10344
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
@@ -10325,6 +10359,7 @@ interface LuaLampControlBehavior extends LuaGenericOnOffControlBehavior {
10325
10359
 
10326
10360
  /**
10327
10361
  * A lazily loaded value. For performance reasons, we sometimes return a custom lazily-loaded value type instead of the native Lua value. This custom type lazily constructs the necessary value when {@link LuaLazyLoadedValue::get | LuaLazyLoadedValue::get} is called, therefore preventing its unnecessary construction in some cases.
10362
+ *
10328
10363
  * An instance of LuaLazyLoadedValue is only valid during the event it was created from and cannot be saved.
10329
10364
  */
10330
10365
  interface LuaLazyLoadedValue<T> {
@@ -10400,7 +10435,7 @@ interface LuaLogisticCell {
10400
10435
  /**
10401
10436
  * The network that owns this cell or `nil`.
10402
10437
  */
10403
- readonly logistic_network: LuaLogisticNetwork
10438
+ readonly logistic_network?: LuaLogisticNetwork
10404
10439
 
10405
10440
  /**
10406
10441
  * Logistic radius of this cell.
@@ -10707,7 +10742,7 @@ interface LuaLogisticPoint {
10707
10742
  * The returned array will always have an entry for each filter and will be indexed in sequence when not nil.
10708
10743
  *
10709
10744
  */
10710
- readonly filters: LogisticFilter[]
10745
+ readonly filters?: LogisticFilter[]
10711
10746
 
10712
10747
  /**
10713
10748
  * The force of this logistic point.
@@ -10809,17 +10844,17 @@ interface LuaModSettingPrototype {
10809
10844
  /**
10810
10845
  * If this string setting allows blank values or `nil` if not a string setting.
10811
10846
  */
10812
- readonly allow_blank: boolean
10847
+ readonly allow_blank?: boolean
10813
10848
 
10814
10849
  /**
10815
10850
  * The allowed values for this setting or `nil` if this setting doesn't use the a fixed set of values.
10816
10851
  */
10817
- readonly allowed_values: string[] | number[]
10852
+ readonly allowed_values?: string[] | number[]
10818
10853
 
10819
10854
  /**
10820
10855
  * If this string setting auto-trims values or `nil` if not a string setting.
10821
10856
  */
10822
- readonly auto_trim: boolean
10857
+ readonly auto_trim?: boolean
10823
10858
 
10824
10859
  /**
10825
10860
  * The default value of this setting.
@@ -10838,12 +10873,12 @@ interface LuaModSettingPrototype {
10838
10873
  /**
10839
10874
  * The maximum value for this setting or `nil` if this setting type doesn't support a maximum.
10840
10875
  */
10841
- readonly maximum_value: number
10876
+ readonly maximum_value?: number
10842
10877
 
10843
10878
  /**
10844
10879
  * The minimum value for this setting or `nil` if this setting type doesn't support a minimum.
10845
10880
  */
10846
- readonly minimum_value: number
10881
+ readonly minimum_value?: number
10847
10882
 
10848
10883
  /**
10849
10884
  * The mod that owns this setting.
@@ -11225,7 +11260,7 @@ interface LuaPlayer extends LuaControl {
11225
11260
  */
11226
11261
  build_from_cursor(this: void,
11227
11262
  table: {
11228
- position: Position,
11263
+ position: MapPosition,
11229
11264
  direction?: defines.direction,
11230
11265
  alt?: boolean,
11231
11266
  terrain_building_size?: number,
@@ -11242,7 +11277,7 @@ interface LuaPlayer extends LuaControl {
11242
11277
  */
11243
11278
  can_build_from_cursor(this: void,
11244
11279
  table: {
11245
- position: Position,
11280
+ position: MapPosition,
11246
11281
  direction?: defines.direction,
11247
11282
  alt?: boolean,
11248
11283
  terrain_building_size?: number,
@@ -11258,7 +11293,7 @@ interface LuaPlayer extends LuaControl {
11258
11293
  can_place_entity(this: void,
11259
11294
  table: {
11260
11295
  name: string,
11261
- position: Position,
11296
+ position: MapPosition,
11262
11297
  direction?: defines.direction
11263
11298
  }): boolean
11264
11299
 
@@ -11332,7 +11367,7 @@ interface LuaPlayer extends LuaControl {
11332
11367
  create_local_flying_text(this: void,
11333
11368
  table: {
11334
11369
  text: LocalisedString,
11335
- position?: Position,
11370
+ position?: MapPosition,
11336
11371
  create_at_cursor?: boolean,
11337
11372
  color?: Color,
11338
11373
  time_to_live?: number,
@@ -11373,7 +11408,7 @@ interface LuaPlayer extends LuaControl {
11373
11408
  */
11374
11409
  drag_wire(this: void,
11375
11410
  table: {
11376
- position: Position
11411
+ position: MapPosition
11377
11412
  }): boolean
11378
11413
 
11379
11414
  /**
@@ -11504,7 +11539,7 @@ interface LuaPlayer extends LuaControl {
11504
11539
  * Queues a request to open the map at the specified position. If the map is already opened, the request will simply set the position (and scale). Render mode change requests are processed before rendering of the next frame.
11505
11540
  */
11506
11541
  open_map(this: void,
11507
- position: Position,
11542
+ position: MapPosition,
11508
11543
  scale?: number): void
11509
11544
 
11510
11545
  /**
@@ -11675,7 +11710,7 @@ interface LuaPlayer extends LuaControl {
11675
11710
  * @param selection_mode - The type of selection to start. Can be `select`, `alternative-select`, `reverse-select`.
11676
11711
  */
11677
11712
  start_selection(this: void,
11678
- position: Position,
11713
+ position: MapPosition,
11679
11714
  selection_mode: string): void
11680
11715
 
11681
11716
  /**
@@ -11708,7 +11743,7 @@ interface LuaPlayer extends LuaControl {
11708
11743
  * Queues a request to zoom to world at the specified position. If the player is already zooming to world, the request will simply set the position (and scale). Render mode change requests are processed before rendering of the next frame.
11709
11744
  */
11710
11745
  zoom_to_world(this: void,
11711
- position: Position,
11746
+ position: MapPosition,
11712
11747
  scale?: number): void
11713
11748
 
11714
11749
  /**
@@ -11740,7 +11775,7 @@ interface LuaPlayer extends LuaControl {
11740
11775
  * Will also return `nil` when the player is disconnected (see {@link LuaPlayer::connected | LuaPlayer::connected}).
11741
11776
  *
11742
11777
  */
11743
- character: LuaEntity
11778
+ character?: LuaEntity
11744
11779
 
11745
11780
  /**
11746
11781
  * The color used when this player talks in game.
@@ -11785,6 +11820,7 @@ interface LuaPlayer extends LuaControl {
11785
11820
 
11786
11821
  /**
11787
11822
  * The source entity used during entity settings copy-paste if any.
11823
+ *
11788
11824
  * `nil` if there isn't currently a source entity.
11789
11825
  */
11790
11826
  readonly entity_copy_source: LuaEntity
@@ -11857,7 +11893,7 @@ interface LuaPlayer extends LuaControl {
11857
11893
  /**
11858
11894
  * The permission group this player is part of or `nil` if not part of any group.
11859
11895
  */
11860
- permission_group: LuaPermissionGroup
11896
+ permission_group?: LuaPermissionGroup
11861
11897
 
11862
11898
  /**
11863
11899
  * If items not included in this map editor infinity inventory filters should be removed.
@@ -11869,6 +11905,11 @@ interface LuaPlayer extends LuaControl {
11869
11905
  */
11870
11906
  readonly render_mode: defines.render_mode
11871
11907
 
11908
+ /**
11909
+ * If `true`, circle and name of given player is rendered on the map/chart.
11910
+ */
11911
+ show_on_map: boolean
11912
+
11872
11913
  /**
11873
11914
  * If `true`, zoom-to-world noise effect will be disabled and environmental sounds will be based on zoom-to-world view instead of position of player's character.
11874
11915
  */
@@ -11880,7 +11921,7 @@ interface LuaPlayer extends LuaControl {
11880
11921
  * This is mainly useful when a player is in the map editor.
11881
11922
  *
11882
11923
  */
11883
- readonly stashed_controller_type: defines.controllers
11924
+ readonly stashed_controller_type?: defines.controllers
11884
11925
 
11885
11926
  /**
11886
11927
  * The tag that is shown after the player in chat and on the map.
@@ -11894,7 +11935,7 @@ interface LuaPlayer extends LuaControl {
11894
11935
  * Set to any positive value to trigger the respawn state for this player.
11895
11936
  *
11896
11937
  */
11897
- ticks_to_respawn: number
11938
+ ticks_to_respawn?: number
11898
11939
 
11899
11940
  /**
11900
11941
  * 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.
@@ -13830,6 +13871,7 @@ interface LuaSettings {
13830
13871
 
13831
13872
  /**
13832
13873
  * The current global mod settings, indexed by prototype name.
13874
+ *
13833
13875
  * Even though these are marked as read-only, they can be changed by overwriting individual {@link ModSetting | ModSetting} tables in the custom table. Mods can only change their own settings. Using the in-game console, all global settings can be changed.
13834
13876
  */
13835
13877
  readonly global: {[key: string]: ModSetting}
@@ -13841,6 +13883,7 @@ interface LuaSettings {
13841
13883
 
13842
13884
  /**
13843
13885
  * The default player mod settings for this map, indexed by prototype name.
13886
+ *
13844
13887
  * Even though these are marked as read-only, they can be changed by overwriting individual {@link ModSetting | ModSetting} tables in the custom table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
13845
13888
  */
13846
13889
  readonly player: {[key: string]: ModSetting}
@@ -13941,6 +13984,13 @@ interface LuaStyle {
13941
13984
  */
13942
13985
  badge_horizontal_spacing: number
13943
13986
 
13987
+ /**
13988
+ * @remarks
13989
+ * Applies to subclasses: LuaProgressBarStyle
13990
+ *
13991
+ */
13992
+ bar_width: number
13993
+
13944
13994
  /**
13945
13995
  * Space between the table cell contents bottom and border.
13946
13996
  * @remarks
@@ -14534,6 +14584,7 @@ interface LuaSurface {
14534
14584
 
14535
14585
  /**
14536
14586
  * 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.
14587
+ *
14537
14588
  * If no `area` or `position` are given, the entire surface is searched. If `position` is given, this returns the entities colliding with that position (i.e the given position is within the entity's collision box). If `position` and `radius` are given, this returns entities in the radius of the position. If `area` is specified, this returns entities colliding with that area.
14538
14589
  * @param table.invert - If the filters should be inverted. These filters are: name, type, ghost_name, ghost_type, direction, collision_mask, force.
14539
14590
  * @param table.radius - If given with position, will count all entities within the radius of the position.
@@ -14558,6 +14609,7 @@ interface LuaSurface {
14558
14609
 
14559
14610
  /**
14560
14611
  * Count tiles of a given name in a given area. Works just like {@link LuaSurface::find_tiles_filtered | LuaSurface::find_tiles_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 tiles.
14612
+ *
14561
14613
  * If no `area` or `position` and `radius` is given, the entire surface is searched. If `position` and `radius` are given, only tiles within the radius of the position are included.
14562
14614
  * @param table.position - Ignored if not given with radius.
14563
14615
  * @param table.radius - If given with position, will return all entities within the radius of the position.
@@ -14743,6 +14795,7 @@ interface LuaSurface {
14743
14795
 
14744
14796
  /**
14745
14797
  * Find decoratives of a given name in a given area.
14798
+ *
14746
14799
  * If no filters are given, returns all decoratives in the search area. If multiple filters are specified, returns only decoratives matching every given filter. If no area and no position are given, the entire surface is searched.
14747
14800
  * @param table.invert - If the filters should be inverted.
14748
14801
  * @example
@@ -14783,6 +14836,7 @@ interface LuaSurface {
14783
14836
 
14784
14837
  /**
14785
14838
  * Find entities in a given area.
14839
+ *
14786
14840
  * If no area is given all entities on the surface are returned.
14787
14841
  * @example
14788
14842
  * Will evaluate to a list of all entities within given area.
@@ -14796,7 +14850,9 @@ interface LuaSurface {
14796
14850
 
14797
14851
  /**
14798
14852
  * Find all entities of the given type or name in the given area.
14853
+ *
14799
14854
  * If no filters (`name`, `type`, `force`, etc.) are given, this returns all entities in the search area. If multiple filters are specified, only entities matching all given filters are returned.
14855
+ *
14800
14856
  * If no `area` or `position` are given, the entire surface is searched. If `position` is given, this returns the entities colliding with that position (i.e the given position is within the entity's collision box). If `position` and `radius` are given, this returns the entities within the radius of the position. If `area` is specified, this returns the entities colliding with that area.
14801
14857
  * @param table.invert - If the filters should be inverted. These filters are: name, type, ghost_name, ghost_type, direction, collision_mask, force.
14802
14858
  * @param table.position - Has precedence over area field.
@@ -14925,7 +14981,9 @@ interface LuaSurface {
14925
14981
 
14926
14982
  /**
14927
14983
  * Find all tiles of the given name in the given area.
14984
+ *
14928
14985
  * If no filters are given, this returns all tiles in the search area.
14986
+ *
14929
14987
  * If no `area` or `position` and `radius` is given, the entire surface is searched. If `position` and `radius` are given, only tiles within the radius of the position are included.
14930
14988
  * @param table.position - Ignored if not given with radius.
14931
14989
  * @param table.radius - If given with position, will return all entities within the radius of the position.
@@ -15192,6 +15250,7 @@ interface LuaSurface {
15192
15250
 
15193
15251
  /**
15194
15252
  * Generates a path with the specified constraints (as an array of {@link PathfinderWaypoints | PathfinderWaypoint}) using the unit pathfinding algorithm. This path can be used to emulate pathing behavior by script for non-unit entities. If you want to command actual units to move, use the {@link LuaEntity::set_command | LuaEntity::set_command} functionality instead.
15253
+ *
15195
15254
  * The resulting path is ultimately returned asynchronously via {@link on_script_path_request_finished | on_script_path_request_finished}.
15196
15255
  * @param table.bounding_box - The dimensions of the object that's supposed to travel the path.
15197
15256
  * @param table.can_open_gates - Whether the path request can open gates. Defaults to `false`.
@@ -15263,6 +15322,7 @@ interface LuaSurface {
15263
15322
 
15264
15323
  /**
15265
15324
  * Set tiles at specified locations. Can automatically correct the edges around modified tiles.
15325
+ *
15266
15326
  * Placing a {@link mineable | LuaTilePrototype::mineable_properties} tile on top of a non-mineable one will turn the latter into the {@link LuaTile::hidden_tile | LuaTile::hidden_tile} for that tile. Placing a mineable tile on a mineable one or a non-mineable tile on a non-mineable one will not modify the hidden tile. This restriction can however be circumvented by using {@link LuaSurface::set_hidden_tile | LuaSurface::set_hidden_tile}.
15267
15327
  * @remarks
15268
15328
  * It is recommended to call this method once for all the tiles you want to change rather than calling it individually for every tile. As the tile correction is used after every step, calling it one by one could cause the tile correction logic to redo some of the changes. Also, many small API calls are generally more performance intensive than one big one.
@@ -15319,7 +15379,9 @@ interface LuaSurface {
15319
15379
 
15320
15380
  /**
15321
15381
  * Defines how surface daytime brightness influences each color channel of the current color lookup table (LUT).
15382
+ *
15322
15383
  * The LUT is multiplied by `((1 - weight) + brightness * weight)` and result is clamped to range [0, 1].
15384
+ *
15323
15385
  * Default is `{0, 0, 0}`, which means no influence.
15324
15386
  * @example
15325
15387
  * Makes night on the surface pitch black, assuming [LuaSurface::min_brightness](LuaSurface::min_brightness) being set to default value `0.15`.
@@ -15720,7 +15782,7 @@ interface LuaTile {
15720
15782
  /**
15721
15783
  * The name of the {@link LuaTilePrototype | LuaTilePrototype} hidden under this tile or `nil` if there is no hidden tile. During normal gameplay, only {@link non-mineable | LuaTilePrototype::mineable_properties} tiles can become hidden. This can however be circumvented with {@link LuaSurface::set_hidden_tile | LuaSurface::set_hidden_tile}.
15722
15784
  */
15723
- readonly hidden_tile: string
15785
+ readonly hidden_tile?: string
15724
15786
 
15725
15787
  /**
15726
15788
  * Prototype name of this tile. E.g. `"sand-3"` or `"grass-2"`.
@@ -15819,7 +15881,7 @@ interface LuaTilePrototype {
15819
15881
  /**
15820
15882
  * The next direction of this tile or `nil` - used when a tile has multiple directions (such as hazard concrete)
15821
15883
  */
15822
- readonly next_direction: LuaTilePrototype
15884
+ readonly next_direction?: LuaTilePrototype
15823
15885
 
15824
15886
  /**
15825
15887
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
@@ -15942,7 +16004,7 @@ interface LuaTrain {
15942
16004
  /**
15943
16005
  * The back stock of this train or `nil`.
15944
16006
  */
15945
- readonly back_stock: LuaEntity
16007
+ readonly back_stock?: LuaEntity
15946
16008
 
15947
16009
  /**
15948
16010
  * The cargo carriages the train contains.
@@ -15967,7 +16029,7 @@ interface LuaTrain {
15967
16029
  /**
15968
16030
  * The front stock of this train or `nil`.
15969
16031
  */
15970
- readonly front_stock: LuaEntity
16032
+ readonly front_stock?: LuaEntity
15971
16033
 
15972
16034
  /**
15973
16035
  * If this train has a path.
@@ -15986,7 +16048,8 @@ interface LuaTrain {
15986
16048
 
15987
16049
  /**
15988
16050
  * The players killed by this train.
15989
- * The keys are the player indexes, the values are how often this train killed that player.
16051
+ *
16052
+ * The keys are the player indices, the values are how often this train killed that player.
15990
16053
  */
15991
16054
  readonly killed_players: {[key: number]: number}
15992
16055
 
@@ -16026,17 +16089,17 @@ interface LuaTrain {
16026
16089
  /**
16027
16090
  * The path this train is using or `nil` if none.
16028
16091
  */
16029
- readonly path: LuaRailPath
16092
+ readonly path?: LuaRailPath
16030
16093
 
16031
16094
  /**
16032
16095
  * The destination rail this train is currently pathing to or `nil`.
16033
16096
  */
16034
- readonly path_end_rail: LuaEntity
16097
+ readonly path_end_rail?: LuaEntity
16035
16098
 
16036
16099
  /**
16037
16100
  * The destination train stop this train is currently pathing to or `nil`.
16038
16101
  */
16039
- readonly path_end_stop: LuaEntity
16102
+ readonly path_end_stop?: LuaEntity
16040
16103
 
16041
16104
  readonly rail_direction_from_back_rail: defines.rail_direction
16042
16105
 
@@ -16053,12 +16116,12 @@ interface LuaTrain {
16053
16116
  * The schedule can't be changed by modifying the returned table. Instead, changes must be made by assigning a new table to this attribute.
16054
16117
  *
16055
16118
  */
16056
- schedule: TrainSchedule
16119
+ schedule?: TrainSchedule
16057
16120
 
16058
16121
  /**
16059
16122
  * The signal this train is arriving or waiting at or `nil` if none.
16060
16123
  */
16061
- readonly signal: LuaEntity
16124
+ readonly signal?: LuaEntity
16062
16125
 
16063
16126
  /**
16064
16127
  * Current speed.
@@ -16076,7 +16139,7 @@ interface LuaTrain {
16076
16139
  /**
16077
16140
  * The train stop this train is stopped at or `nil`.
16078
16141
  */
16079
- readonly station: LuaEntity
16142
+ readonly station?: LuaEntity
16080
16143
 
16081
16144
  /**
16082
16145
  * 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.
@@ -16421,12 +16484,12 @@ interface LuaUnitGroup {
16421
16484
  /**
16422
16485
  * The command given to this group or `nil` is the group has no command.
16423
16486
  */
16424
- readonly command: Command
16487
+ readonly command?: Command
16425
16488
 
16426
16489
  /**
16427
16490
  * The distraction command given to this group or `nil` is the group currently isn't distracted.
16428
16491
  */
16429
- readonly distraction_command: Command
16492
+ readonly distraction_command?: Command
16430
16493
 
16431
16494
  /**
16432
16495
  * The force of this unit group.