factorio-types 0.0.45 → 0.0.47

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.100
5
+ // Factorio version 1.1.102
6
6
  // API version 4
7
7
 
8
8
  declare namespace runtime {
@@ -1679,9 +1679,9 @@ interface LuaCustomInputPrototype {
1679
1679
  readonly alternative_key_sequence?: string
1680
1680
 
1681
1681
  /**
1682
- * The consuming type: `"none"` or `"game-only"`.
1682
+ * The consuming type.
1683
1683
  */
1684
- readonly consuming: string
1684
+ readonly consuming: 'none' | 'game-only'
1685
1685
 
1686
1686
  /**
1687
1687
  * The default controller alternative key sequence for this custom input, if any
@@ -2140,7 +2140,7 @@ interface LuaEntity extends LuaControl {
2140
2140
  * @param damage - The amount of damage to be done.
2141
2141
  * @param dealer - The entity to consider as the damage dealer. Needs to be on the same surface as the entity being damaged.
2142
2142
  * @param force - The force that will be doing the damage.
2143
- * @param type - The type of damage to be done, defaults to "impact". Can't be `nil`.
2143
+ * @param type - The type of damage to be done, defaults to `"impact"`. Can't be `nil`.
2144
2144
  * @returns the total damage actually applied after resistances.
2145
2145
  */
2146
2146
  damage(this: void,
@@ -2616,11 +2616,11 @@ interface LuaEntity extends LuaControl {
2616
2616
  * @remarks
2617
2617
  * Applies to subclasses: EntityGhost
2618
2618
  *
2619
- * @param flag - The flag to test. See [EntityPrototypeFlags](runtime:EntityPrototypeFlags) for a list of flags.
2619
+ * @param flag - The flag to test.
2620
2620
  * @returns `true` if the entity has the given flag set.
2621
2621
  */
2622
2622
  ghost_has_flag(this: void,
2623
- flag: string): boolean
2623
+ flag: EntityPrototypeFlag): boolean
2624
2624
 
2625
2625
  /**
2626
2626
  * Has this unit been assigned a command?
@@ -2635,11 +2635,11 @@ interface LuaEntity extends LuaControl {
2635
2635
  * @remarks
2636
2636
  * `entity.has_flag(f)` is a shortcut for `entity.prototype.has_flag(f)`.
2637
2637
  *
2638
- * @param flag - The flag to test. See [EntityPrototypeFlags](runtime:EntityPrototypeFlags) for a list of flags.
2638
+ * @param flag - The flag to test.
2639
2639
  * @returns `true` if this entity has the given flag set.
2640
2640
  */
2641
2641
  has_flag(this: void,
2642
- flag: string): boolean
2642
+ flag: EntityPrototypeFlag): boolean
2643
2643
 
2644
2644
  /**
2645
2645
  * All methods and properties that this object supports.
@@ -2893,7 +2893,7 @@ interface LuaEntity extends LuaControl {
2893
2893
  by_player?: PlayerIdentification,
2894
2894
  spill_items?: boolean,
2895
2895
  enable_looted?: boolean,
2896
- force?: LuaForce | string
2896
+ force?: ForceIdentification
2897
2897
  }): LuaMultiReturn<[boolean, {[key: string]: number} | null]>
2898
2898
 
2899
2899
  /**
@@ -3007,7 +3007,7 @@ interface LuaEntity extends LuaControl {
3007
3007
  * @returns Any items removed from this entity as a result of setting the recipe.
3008
3008
  */
3009
3009
  set_recipe(this: void,
3010
- recipe?: string | LuaRecipe): {[key: string]: number}
3010
+ recipe: string | LuaRecipe | null): {[key: string]: number}
3011
3011
 
3012
3012
  /**
3013
3013
  * Set a logistic requester slot.
@@ -3190,17 +3190,28 @@ interface LuaEntity extends LuaControl {
3190
3190
  readonly beacons_count?: number
3191
3191
 
3192
3192
  /**
3193
- * 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 | runtime: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.
3193
+ * 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 | runtime:LuaEntity::neighbours} for that.
3194
3194
  * @remarks
3195
3195
  * Applies to subclasses: TransportBeltConnectable
3196
3196
  *
3197
3197
  */
3198
- readonly belt_neighbours: {[key: string]: LuaEntity[]}
3198
+ readonly belt_neighbours: {
3199
+
3200
+ /**
3201
+ * Array of transport belt connectable entities.
3202
+ */
3203
+ inputs: LuaEntity[],
3204
+
3205
+ /**
3206
+ * Array of transport belt connectable entities.
3207
+ */
3208
+ outputs: LuaEntity[]
3209
+ }
3199
3210
 
3200
3211
  /**
3201
3212
  * Gives what is the current shape of a transport-belt.
3202
3213
  * @remarks
3203
- * Can also be used on entity ghost if it contains transport-belt
3214
+ * Can also be used on entity ghost if it contains transport-belt.
3204
3215
  * Applies to subclasses: TransportBelt
3205
3216
  *
3206
3217
  */
@@ -3416,7 +3427,7 @@ interface LuaEntity extends LuaControl {
3416
3427
  readonly distraction_command?: Command
3417
3428
 
3418
3429
  /**
3419
- * Gives a draw data of the given entity if it supports such data
3430
+ * Gives a draw data of the given entity if it supports such data.
3420
3431
  * @remarks
3421
3432
  * Applies to subclasses: RollingStock
3422
3433
  *
@@ -3626,7 +3637,16 @@ interface LuaEntity extends LuaControl {
3626
3637
  readonly ghost_unit_number?: number
3627
3638
 
3628
3639
  /**
3629
- * Returns a {@link rich text | https://wiki.factorio.com/Rich_text} string containing this entity's position and surface name as a gps tag. Printing it will ping the location of the entity.
3640
+ * Returns a {@link rich text | https://wiki.factorio.com/Rich_text} string containing this entity's position and surface name as a gps tag. {@link Printing | runtime:LuaGameScript::print} it will ping the location of the entity.
3641
+ * @example
3642
+ * ```
3643
+ * -- called on a LuaEntity on the default surface it returns:
3644
+ * entity.gps_tag -- => "[gps=-4,-9]"
3645
+ *
3646
+ * -- called on a LuaEntity on "custom-surface" it returns:
3647
+ * different_entity.gps_tag -- => "[gps=1,-5,custom-surface]"
3648
+ * ```
3649
+ *
3630
3650
  */
3631
3651
  readonly gps_tag: string
3632
3652
 
@@ -3678,7 +3698,7 @@ interface LuaEntity extends LuaControl {
3678
3698
  * Applies to subclasses: HighlightBox
3679
3699
  *
3680
3700
  */
3681
- highlight_box_type: string
3701
+ highlight_box_type: CursorBoxRenderType
3682
3702
 
3683
3703
  /**
3684
3704
  * The filters for this infinity container.
@@ -3698,12 +3718,12 @@ interface LuaEntity extends LuaControl {
3698
3718
  initial_amount?: number
3699
3719
 
3700
3720
  /**
3701
- * The filter mode for this filter inserter. Either `"whitelist"` or `"blacklist"`. `nil` if this inserter doesn't use filters.
3721
+ * The filter mode for this filter inserter. `nil` if this inserter doesn't use filters.
3702
3722
  * @remarks
3703
3723
  * Applies to subclasses: Inserter
3704
3724
  *
3705
3725
  */
3706
- inserter_filter_mode?: string
3726
+ inserter_filter_mode?: 'whitelist' | 'blacklist'
3707
3727
 
3708
3728
  /**
3709
3729
  * Sets the stack size limit on this inserter. If the stack size is > than the force stack size limit the value is ignored.
@@ -3737,7 +3757,7 @@ interface LuaEntity extends LuaControl {
3737
3757
  readonly is_entity_with_owner: boolean
3738
3758
 
3739
3759
  /**
3740
- * If the rolling stock is facing train's front
3760
+ * If the rolling stock is facing train's front.
3741
3761
  * @remarks
3742
3762
  * Applies to subclasses: RollingStock
3743
3763
  *
@@ -3767,7 +3787,7 @@ interface LuaEntity extends LuaControl {
3767
3787
  *
3768
3788
  * Reading this property will return a {@link LuaPlayer | runtime:LuaPlayer}, while {@link PlayerIdentification | runtime:PlayerIdentification} can be used when writing.
3769
3789
  * @remarks
3770
- * Applies to subclasses: EntityWithOwner
3790
+ * Applies to subclasses: EntityWithOwner,DeconstructibleTileProxy,TileGhost
3771
3791
  *
3772
3792
  */
3773
3793
  last_user?: LuaPlayer | PlayerIdentification
@@ -3780,22 +3800,22 @@ interface LuaEntity extends LuaControl {
3780
3800
  /**
3781
3801
  * Neighbour to which this linked belt is connected to, if any.
3782
3802
  * @remarks
3783
- * Can also be used on entity ghost if it contains linked-belt
3784
- * May return entity ghost which contains linked belt to which connection is made
3803
+ * Can also be used on entity ghost if it contains linked-belt.
3804
+ * May return entity ghost which contains linked belt to which connection is made.
3785
3805
  * Applies to subclasses: LinkedBelt
3786
3806
  *
3787
3807
  */
3788
3808
  readonly linked_belt_neighbour?: LuaEntity
3789
3809
 
3790
3810
  /**
3791
- * Type of linked belt: it is either `"input"` or `"output"`. Changing type will also flip direction so the belt is out of the same side
3811
+ * Type of linked belt. Changing type will also flip direction so the belt is out of the same side.
3792
3812
  * @remarks
3793
- * Can only be changed when linked belt is disconnected (has no neighbour set)
3794
- * Can also be used on entity ghost if it contains linked-belt
3813
+ * Can only be changed when linked belt is disconnected (has no neighbour set).
3814
+ * Can also be used on entity ghost if it contains linked-belt.
3795
3815
  * Applies to subclasses: LinkedBelt
3796
3816
  *
3797
3817
  */
3798
- linked_belt_type: string
3818
+ linked_belt_type: 'input' | 'output'
3799
3819
 
3800
3820
  /**
3801
3821
  * The container entity this loader is pointing at/pulling from depending on the {@link LuaEntity::loader_type | runtime:LuaEntity::loader_type}, if any.
@@ -4158,20 +4178,20 @@ interface LuaEntity extends LuaControl {
4158
4178
  splitter_filter?: LuaItemPrototype
4159
4179
 
4160
4180
  /**
4161
- * The input priority for this splitter. Either `"left"`, `"none"`, or `"right"`.
4181
+ * The input priority for this splitter.
4162
4182
  * @remarks
4163
4183
  * Applies to subclasses: Splitter
4164
4184
  *
4165
4185
  */
4166
- splitter_input_priority: string
4186
+ splitter_input_priority: 'left' | 'none' | 'right'
4167
4187
 
4168
4188
  /**
4169
- * The output priority for this splitter. Either `"left"`, `"none"`, or `"right"`.
4189
+ * The output priority for this splitter.
4170
4190
  * @remarks
4171
4191
  * Applies to subclasses: Splitter
4172
4192
  *
4173
4193
  */
4174
- splitter_output_priority: string
4194
+ splitter_output_priority: 'left' | 'none' | 'right'
4175
4195
 
4176
4196
  /**
4177
4197
  * @remarks
@@ -4414,11 +4434,11 @@ interface LuaEntityPrototype {
4414
4434
 
4415
4435
  /**
4416
4436
  * Test whether this entity prototype has a certain flag set.
4417
- * @param flag - The flag to test. See [EntityPrototypeFlags](runtime:EntityPrototypeFlags) for a list of flags.
4437
+ * @param flag - The flag to test.
4418
4438
  * @returns `true` if this prototype has the given flag set.
4419
4439
  */
4420
4440
  has_flag(this: void,
4421
- flag: string): boolean
4441
+ flag: EntityPrototypeFlag): boolean
4422
4442
 
4423
4443
  /**
4424
4444
  * All methods and properties that this object supports.
@@ -4639,6 +4659,14 @@ interface LuaEntityPrototype {
4639
4659
  */
4640
4660
  readonly belt_speed?: number
4641
4661
 
4662
+ /**
4663
+ * The boiler operation mode of this boiler prototype.
4664
+ * @remarks
4665
+ * Applies to subclasses: Boiler
4666
+ *
4667
+ */
4668
+ readonly boiler_mode?: 'heat-water-inside' | 'output-to-separate-pipe'
4669
+
4642
4670
  /**
4643
4671
  * The braking force of this vehicle prototype.
4644
4672
  * @remarks
@@ -4810,16 +4838,16 @@ interface LuaEntityPrototype {
4810
4838
  readonly count_as_rock_for_filtered_deconstruction?: boolean
4811
4839
 
4812
4840
  /**
4813
- * The crafting categories this entity prototype supports.
4841
+ * The {@link crafting categories | runtime:LuaRecipeCategoryPrototype} this entity prototype supports.
4814
4842
  * @remarks
4815
4843
  * The value in the dictionary is meaningless and exists just to allow for easy lookup.
4816
- * Applies to subclasses: CraftingMachine Character
4844
+ * Applies to subclasses: CraftingMachine,Character
4817
4845
  *
4818
4846
  */
4819
4847
  readonly crafting_categories?: {[key: string]: boolean}
4820
4848
 
4821
4849
  /**
4822
- * The crafting speed..
4850
+ * The crafting speed.
4823
4851
  * @remarks
4824
4852
  * Applies to subclasses: CraftingMachine
4825
4853
  *
@@ -5386,12 +5414,12 @@ interface LuaEntityPrototype {
5386
5414
  readonly localised_name: LocalisedString
5387
5415
 
5388
5416
  /**
5389
- * The logistic mode of this logistic container. One of `"requester"`, `"active-provider"`, `"passive-provider"`, `"buffer"`, `"storage"`, `"none"`.
5417
+ * The logistic mode of this logistic container.
5390
5418
  * @remarks
5391
5419
  * Applies to subclasses: LogisticContainer
5392
5420
  *
5393
5421
  */
5394
- readonly logistic_mode?: string
5422
+ readonly logistic_mode?: 'requester' | 'active-provider' | 'passive-provider' | 'buffer' | 'storage' | 'none'
5395
5423
 
5396
5424
  /**
5397
5425
  * The logistic parameters for this roboport.
@@ -5801,6 +5829,9 @@ interface LuaEntityPrototype {
5801
5829
  */
5802
5830
  readonly remains_when_mined: LuaEntityPrototype[]
5803
5831
 
5832
+ /**
5833
+ * Whether this entity should remove decoratives that collide with it when this entity is built. Possible values are `"automatic"`, `"true"` and `"false"`.
5834
+ */
5804
5835
  readonly remove_decoratives: string
5805
5836
 
5806
5837
  /**
@@ -5828,7 +5859,7 @@ interface LuaEntityPrototype {
5828
5859
  readonly resistances?: {[key: string]: Resistance}
5829
5860
 
5830
5861
  /**
5831
- * The resource categories this character or mining drill supports.
5862
+ * The {@link resource categories | runtime:LuaResourceCategoryPrototype} this character or mining drill supports.
5832
5863
  * @remarks
5833
5864
  * The value in the dictionary is meaningless and exists just to allow for easy lookup.
5834
5865
  * Applies to subclasses: MiningDrill,Character
@@ -6988,9 +7019,9 @@ interface LuaFluidBoxPrototype {
6988
7019
  readonly pipe_connections: FluidBoxConnection[]
6989
7020
 
6990
7021
  /**
6991
- * The production type. "input", "output", "input-output", or "none".
7022
+ * The production type.
6992
7023
  */
6993
- readonly production_type: string
7024
+ readonly production_type: 'input' | 'input-output' | 'output' | 'none'
6994
7025
 
6995
7026
  /**
6996
7027
  * The render layer.
@@ -7438,6 +7469,9 @@ interface LuaForce {
7438
7469
 
7439
7470
  /**
7440
7471
  * Play a sound for every player in this force.
7472
+ * @remarks
7473
+ * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for this force.
7474
+ *
7441
7475
  * @param table.override_sound_type - The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
7442
7476
  * @param table.path - The sound to play.
7443
7477
  * @param table.position - Where the sound should be played. If not given, it's played at the current position of each player.
@@ -8029,7 +8063,7 @@ interface LuaGameScript {
8029
8063
  * @param surface - The surface to be deleted. Currently the primary surface (1, 'nauvis') cannot be deleted.
8030
8064
  */
8031
8065
  delete_surface(this: void,
8032
- surface: string | LuaSurface): void
8066
+ surface: SurfaceIdentification): void
8033
8067
 
8034
8068
  /**
8035
8069
  * Converts the given direction into the string version of the direction.
@@ -8086,6 +8120,9 @@ interface LuaGameScript {
8086
8120
  get_active_entities_count(this: void,
8087
8121
  surface?: SurfaceIdentification): number
8088
8122
 
8123
+ /**
8124
+ * Gets an entity by its name tag. Entity name tags can be set in the entity "extra settings" GUI in the map editor.
8125
+ */
8089
8126
  get_entity_by_tag(this: void,
8090
8127
  tag: string): LuaEntity | null
8091
8128
 
@@ -8332,6 +8369,9 @@ interface LuaGameScript {
8332
8369
 
8333
8370
  /**
8334
8371
  * Play a sound for every player in the game.
8372
+ * @remarks
8373
+ * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for that player.
8374
+ *
8335
8375
  * @param table.override_sound_type - The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
8336
8376
  * @param table.path - The sound to play.
8337
8377
  * @param table.position - Where the sound should be played. If not given, it's played at the current position of each player.
@@ -8395,7 +8435,7 @@ interface LuaGameScript {
8395
8435
  * @param players - List of players to remove. If not specified, remove all offline players.
8396
8436
  */
8397
8437
  remove_offline_players(this: void,
8398
- players?: Array<LuaPlayer | string>): void
8438
+ players?: PlayerIdentification[]): void
8399
8439
 
8400
8440
  /**
8401
8441
  * Remove a file or directory in the `script-output` folder, located in the game's {@link user data directory | https://wiki.factorio.com/User_data_directory}. Can be used to remove files created by {@link LuaGameScript::write_file | runtime:LuaGameScript::write_file}.
@@ -8404,6 +8444,35 @@ interface LuaGameScript {
8404
8444
  remove_path(this: void,
8405
8445
  path: string): void
8406
8446
 
8447
+ /**
8448
+ * Direct access to Trains Pathfinder. Allows to search rail paths or querying which stops are accessible
8449
+ * @param table.allow_path_within_segment_back - Only relevant if `from_back` is given. Defaults to `true`. Providing false will cause the pathfinder to reject a path that starts on back and ends within the same segment as the path would be too short to provide correct alignment with a goal.
8450
+ * @param table.allow_path_within_segment_front - Only relevant if `from_front` is given. Defaults to `true`. Providing false will cause the pathfinder to reject a path that starts on front and ends within the same segment as the path would be too short to provide correct alignment with a goal.
8451
+ * @param table.from_back - Manually provided starting back of the train.
8452
+ * @param table.from_front - Manually provided starting front of the train.
8453
+ * @param table.in_chain_signal_section - Defaults to `false`. If set to true, pathfinder will not return a path that cannot have its beginning immediately reserved. A path that cannot have its beginning immediately reserved could cause a train to stop inside of an intersection.
8454
+ * @param table.return_path - Only relevant if request type is `"path"`. Returning a full path is expensive due to multiple LuaEntity created. In order for path to be returned, true must be provided here. Defaults to false in which case a path will not be provided.
8455
+ * @param table.search_direction - Only relevant if none of `from_front`/`from_back` was provided in which case `from_front` and `from_back` are deduced from the train. Selects which train ends should be considered as starts. Defaults to `"any-direction-with-locomotives"`.
8456
+ * @param table.steps_limit - Maximum amount of steps pathfinder is allowed to perform.
8457
+ * @param table.train - Mandatory if `from_front` and `from_back` are not provided, optional otherwise. Selects a context for the pathfinder to decide which train to exclude from penalties and which signals are considered possible to reacquire. If `from_front` and `from_back` are not provided, then it is also used to collect front and back ends for the search
8458
+ * @param table.type - Request type. Determines the return type of the method. Defaults to `"path"`.
8459
+ * @returns The type of the returned value depends on `type`.
8460
+ */
8461
+ request_train_path(this: void,
8462
+ table: {
8463
+ goals: Array<TrainStopGoal | RailEnd>,
8464
+ in_chain_signal_section?: boolean,
8465
+ train?: LuaTrain,
8466
+ type?: TrainPathRequestType,
8467
+ return_path?: boolean,
8468
+ from_front?: RailEnd,
8469
+ allow_path_within_segment_front?: boolean,
8470
+ from_back?: RailEnd,
8471
+ allow_path_within_segment_back?: boolean,
8472
+ search_direction?: 'respect-movement-direction' | 'any-direction-with-locomotives',
8473
+ steps_limit?: number
8474
+ }): TrainPathFinderPathResult | TrainPathAnyGoalResult | TrainPathAllGoalsResult
8475
+
8407
8476
  /**
8408
8477
  * Reset scenario state (game_finished, player_won, etc.).
8409
8478
  */
@@ -8903,7 +8972,7 @@ interface LuaGenericOnOffControlBehavior extends LuaControlBehavior {
8903
8972
  /**
8904
8973
  * The circuit condition. Writing `nil` clears the circuit condition.
8905
8974
  * @example
8906
- * Tell an entity to be active (e.g. a lamp to be lit) when it receives a circuit signal of more than 4 chain signals.
8975
+ * Tell an entity to be active (for example a lamp to be lit) when it receives a circuit signal of more than 4 chain signals.
8907
8976
  * ```
8908
8977
  * a_behavior.circuit_condition = {condition={comparator=">",
8909
8978
  * first_signal={type="item", name="rail-chain-signal"},
@@ -8926,7 +8995,7 @@ interface LuaGenericOnOffControlBehavior extends LuaControlBehavior {
8926
8995
  /**
8927
8996
  * The logistic condition. Writing `nil` clears the logistic condition.
8928
8997
  * @example
8929
- * Tell an entity to be active (e.g. a lamp to be lit) when the logistics network it's connected to has more than four chain signals.
8998
+ * Tell an entity to be active (for example a lamp to be lit) when the logistics network it's connected to has more than four chain signals.
8930
8999
  * ```
8931
9000
  * a_behavior.logistic_condition = {condition={comparator=">",
8932
9001
  * first_signal={type="item", name="rail-chain-signal"},
@@ -8958,16 +9027,19 @@ interface LuaGroup {
8958
9027
  help(this: void): string
8959
9028
 
8960
9029
  /**
8961
- * The parent group, if any.
9030
+ * The parent group.
9031
+ * @remarks
9032
+ * Applies to subclasses: ItemSubGroup
9033
+ *
8962
9034
  */
8963
- readonly group?: LuaGroup
9035
+ readonly group: LuaGroup
8964
9036
 
8965
9037
  /**
8966
9038
  * Localised name of the group.
8967
9039
  */
8968
- readonly localised_name?: LocalisedString
9040
+ readonly localised_name: LocalisedString
8969
9041
 
8970
- readonly name?: string
9042
+ readonly name: string
8971
9043
 
8972
9044
  /**
8973
9045
  * 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.
@@ -8980,16 +9052,22 @@ interface LuaGroup {
8980
9052
  readonly order: string
8981
9053
 
8982
9054
  /**
8983
- * The additional order value used in recipe ordering. Can only be used on groups, not on subgroups.
9055
+ * The additional order value used in recipe ordering.
9056
+ * @remarks
9057
+ * Applies to subclasses: ItemGroup
9058
+ *
8984
9059
  */
8985
- readonly order_in_recipe?: string
9060
+ readonly order_in_recipe: string
8986
9061
 
8987
9062
  /**
8988
- * Subgroups of this group. Can only be used on groups, not on subgroups.
9063
+ * Subgroups of this group.
9064
+ * @remarks
9065
+ * Applies to subclasses: ItemGroup
9066
+ *
8989
9067
  */
8990
- readonly subgroups?: LuaGroup[]
9068
+ readonly subgroups: LuaGroup[]
8991
9069
 
8992
- readonly type?: string
9070
+ readonly type: string
8993
9071
 
8994
9072
  /**
8995
9073
  * 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.
@@ -9279,11 +9357,11 @@ interface LuaGuiElement {
9279
9357
  * Applies to subclasses: scroll-pane
9280
9358
  *
9281
9359
  * @param element - The element to scroll to.
9282
- * @param scroll_mode - Where the element should be positioned in the scroll-pane. Must be either `"in-view"` or `"top-third"`. Defaults to `"in-view"`.
9360
+ * @param scroll_mode - Where the element should be positioned in the scroll-pane. Defaults to `"in-view"`.
9283
9361
  */
9284
9362
  scroll_to_element(this: void,
9285
9363
  element: LuaGuiElement,
9286
- scroll_mode?: string): void
9364
+ scroll_mode?: 'in-view' | 'top-third'): void
9287
9365
 
9288
9366
  /**
9289
9367
  * Scrolls the scroll bar such that the specified listbox item is visible to the player.
@@ -9291,11 +9369,11 @@ interface LuaGuiElement {
9291
9369
  * Applies to subclasses: list-box
9292
9370
  *
9293
9371
  * @param index - The item index to scroll to.
9294
- * @param scroll_mode - Where the item should be positioned in the list-box. Must be either `"in-view"` or `"top-third"`. Defaults to `"in-view"`.
9372
+ * @param scroll_mode - Where the item should be positioned in the list-box. Defaults to `"in-view"`.
9295
9373
  */
9296
9374
  scroll_to_item(this: void,
9297
9375
  index: number,
9298
- scroll_mode?: string): void
9376
+ scroll_mode?: 'in-view' | 'top-third'): void
9299
9377
 
9300
9378
  /**
9301
9379
  * Scrolls this scroll bar to the left.
@@ -9326,8 +9404,8 @@ interface LuaGuiElement {
9326
9404
  * @remarks
9327
9405
  * Applies to subclasses: textfield,text-box
9328
9406
  *
9329
- * @param end - The index of the last character to select
9330
- * @param start - The index of the first character to select
9407
+ * @param end_index - The index of the last character to select
9408
+ * @param start_index - The index of the first character to select
9331
9409
  * @example
9332
9410
  * Select the characters `amp` from `example`:
9333
9411
  * ```
@@ -9342,8 +9420,8 @@ interface LuaGuiElement {
9342
9420
  *
9343
9421
  */
9344
9422
  select(this: void,
9345
- start: number,
9346
- end: number): void
9423
+ start_index: number,
9424
+ end_index: number): void
9347
9425
 
9348
9426
  /**
9349
9427
  * Selects all the text in this textbox.
@@ -9502,12 +9580,12 @@ interface LuaGuiElement {
9502
9580
  readonly column_count: number
9503
9581
 
9504
9582
  /**
9505
- * Direction of this element's layout. May be either `"horizontal"` or `"vertical"`.
9583
+ * Direction of this element's layout.
9506
9584
  * @remarks
9507
9585
  * Applies to subclasses: frame,flow,line
9508
9586
  *
9509
9587
  */
9510
- readonly direction: string
9588
+ readonly direction: GuiDirection
9511
9589
 
9512
9590
  /**
9513
9591
  * The `frame` that is being moved when dragging this GUI element, if any. This element needs to be a child of the `drag_target` at some level.
@@ -9578,13 +9656,18 @@ interface LuaGuiElement {
9578
9656
  */
9579
9657
  elem_filters?: ItemPrototypeFilter | TilePrototypeFilter | EntityPrototypeFilter | FluidPrototypeFilter | RecipePrototypeFilter | DecorativePrototypeFilter | AchievementPrototypeFilter | EquipmentPrototypeFilter | TechnologyPrototypeFilter
9580
9658
 
9659
+ /**
9660
+ * The element tooltip to display when hovering over this element, or `nil`.
9661
+ */
9662
+ elem_tooltip?: ElemID
9663
+
9581
9664
  /**
9582
9665
  * The elem type of this choose-elem-button.
9583
9666
  * @remarks
9584
9667
  * Applies to subclasses: choose-elem-button
9585
9668
  *
9586
9669
  */
9587
- readonly elem_type: string
9670
+ readonly elem_type: ElemType
9588
9671
 
9589
9672
  /**
9590
9673
  * The elem value of this choose-elem-button, if any.
@@ -9627,12 +9710,12 @@ interface LuaGuiElement {
9627
9710
  readonly gui: LuaGui
9628
9711
 
9629
9712
  /**
9630
- * Policy of the horizontal scroll bar. Possible values are `"auto"`, `"never"`, `"always"`, `"auto-and-reserve-space"`, `"dont-show-but-allow-scrolling"`.
9713
+ * Policy of the horizontal scroll bar.
9631
9714
  * @remarks
9632
9715
  * Applies to subclasses: scroll-pane
9633
9716
  *
9634
9717
  */
9635
- horizontal_scroll_policy: string
9718
+ horizontal_scroll_policy: ScrollPolicy
9636
9719
 
9637
9720
  /**
9638
9721
  * The sprite to display on this sprite-button when it is hovered.
@@ -9877,13 +9960,13 @@ interface LuaGuiElement {
9877
9960
  surface_index: number
9878
9961
 
9879
9962
  /**
9880
- * The switch state (left, none, right) for this switch.
9963
+ * The switch state for this switch.
9881
9964
  * @remarks
9882
9965
  * If {@link LuaGuiElement::allow_none_state | runtime:LuaGuiElement::allow_none_state} is false this can't be set to `"none"`.
9883
9966
  * Applies to subclasses: switch
9884
9967
  *
9885
9968
  */
9886
- switch_state: string
9969
+ switch_state: SwitchState
9887
9970
 
9888
9971
  /**
9889
9972
  * The tabs and contents being shown in this tabbed-pane.
@@ -9946,12 +10029,12 @@ interface LuaGuiElement {
9946
10029
  vertical_centering: boolean
9947
10030
 
9948
10031
  /**
9949
- * Policy of the vertical scroll bar. Possible values are `"auto"`, `"never"`, `"always"`, `"auto-and-reserve-space"`, `"dont-show-but-allow-scrolling"`.
10032
+ * Policy of the vertical scroll bar.
9950
10033
  * @remarks
9951
10034
  * Applies to subclasses: scroll-pane
9952
10035
  *
9953
10036
  */
9954
- vertical_scroll_policy: string
10037
+ vertical_scroll_policy: ScrollPolicy
9955
10038
 
9956
10039
  /**
9957
10040
  * Sets whether this GUI element is visible or completely hidden, taking no space in the layout.
@@ -10210,7 +10293,7 @@ interface LuaInventory {
10210
10293
  * @param item - The item to check.
10211
10294
  */
10212
10295
  get_insertable_count(this: void,
10213
- item: string): void
10296
+ item: string): number
10214
10297
 
10215
10298
  /**
10216
10299
  * Get the number of all or some items in this inventory.
@@ -10383,17 +10466,17 @@ interface LuaItemPrototype {
10383
10466
  * @remarks
10384
10467
  * Applies to subclasses: AmmoItem
10385
10468
  *
10386
- * @param ammo_source_type - One of `"default"`, `"player"`, `"turret"`, or `"vehicle"`. Defaults to `"default"`.
10469
+ * @param ammo_source_type - Defaults to `"default"`.
10387
10470
  */
10388
10471
  get_ammo_type(this: void,
10389
- ammo_source_type?: string): AmmoType | null
10472
+ ammo_source_type?: 'default' | 'player' | 'turret' | 'vehicle'): AmmoType | null
10390
10473
 
10391
10474
  /**
10392
10475
  * Does this prototype have a flag enabled?
10393
- * @param flag - The flag to check. Can be one of [ItemPrototypeFlags](runtime:ItemPrototypeFlags). Any other value will cause an error.
10476
+ * @param flag - The flag to check.
10394
10477
  */
10395
10478
  has_flag(this: void,
10396
- flag: string): boolean
10479
+ flag: ItemPrototypeFlag): boolean
10397
10480
 
10398
10481
  /**
10399
10482
  * All methods and properties that this object supports.
@@ -10406,7 +10489,7 @@ interface LuaItemPrototype {
10406
10489
  * Applies to subclasses: SelectionTool
10407
10490
  *
10408
10491
  */
10409
- readonly alt_entity_filter_mode?: string
10492
+ readonly alt_entity_filter_mode?: PrototypeFilterMode
10410
10493
 
10411
10494
  /**
10412
10495
  * The alt entity filters used by this selection tool indexed by entity name.
@@ -10431,7 +10514,7 @@ interface LuaItemPrototype {
10431
10514
  * Applies to subclasses: SelectionTool
10432
10515
  *
10433
10516
  */
10434
- readonly alt_reverse_alt_entity_filter_mode?: string
10517
+ readonly alt_reverse_alt_entity_filter_mode?: PrototypeFilterMode
10435
10518
 
10436
10519
  /**
10437
10520
  * The alt reverse entity filters used by this selection tool indexed by entity name.
@@ -10463,7 +10546,7 @@ interface LuaItemPrototype {
10463
10546
  * Applies to subclasses: SelectionTool
10464
10547
  *
10465
10548
  */
10466
- readonly alt_reverse_selection_cursor_box_type?: string
10549
+ readonly alt_reverse_selection_cursor_box_type?: CursorBoxRenderType
10467
10550
 
10468
10551
  /**
10469
10552
  * Flags that affect which entities will be selected during alt reverse selection.
@@ -10479,7 +10562,7 @@ interface LuaItemPrototype {
10479
10562
  * Applies to subclasses: SelectionTool
10480
10563
  *
10481
10564
  */
10482
- readonly alt_reverse_tile_filter_mode?: string
10565
+ readonly alt_reverse_tile_filter_mode?: PrototypeFilterMode
10483
10566
 
10484
10567
  /**
10485
10568
  * The alt reverse tile filters used by this selection tool indexed by tile name.
@@ -10502,7 +10585,7 @@ interface LuaItemPrototype {
10502
10585
  * Applies to subclasses: SelectionTool
10503
10586
  *
10504
10587
  */
10505
- readonly alt_selection_cursor_box_type?: string
10588
+ readonly alt_selection_cursor_box_type?: CursorBoxRenderType
10506
10589
 
10507
10590
  /**
10508
10591
  * Flags that affect which entities will be selected during alternate selection.
@@ -10518,7 +10601,7 @@ interface LuaItemPrototype {
10518
10601
  * Applies to subclasses: SelectionTool
10519
10602
  *
10520
10603
  */
10521
- readonly alt_tile_filter_mode?: string
10604
+ readonly alt_tile_filter_mode?: PrototypeFilterMode
10522
10605
 
10523
10606
  /**
10524
10607
  * The alt tile filters used by this selection tool indexed by tile name.
@@ -10621,7 +10704,7 @@ interface LuaItemPrototype {
10621
10704
  * Applies to subclasses: SelectionTool
10622
10705
  *
10623
10706
  */
10624
- readonly entity_filter_mode?: string
10707
+ readonly entity_filter_mode?: PrototypeFilterMode
10625
10708
 
10626
10709
  /**
10627
10710
  * The number of entity filters this deconstruction item has.
@@ -10649,7 +10732,7 @@ interface LuaItemPrototype {
10649
10732
  readonly entity_type_filters?: {[key: string]: boolean}
10650
10733
 
10651
10734
  /**
10652
- * The prototype of this armor equipment grid, if any.
10735
+ * The prototype of this armor's equipment grid, if any.
10653
10736
  * @remarks
10654
10737
  * Applies to subclasses: Armor
10655
10738
  *
@@ -10670,7 +10753,7 @@ interface LuaItemPrototype {
10670
10753
  * Applies to subclasses: ItemWithInventory
10671
10754
  *
10672
10755
  */
10673
- readonly filter_mode?: string
10756
+ readonly filter_mode?: 'none' | 'whitelist' | 'blacklist'
10674
10757
 
10675
10758
  /**
10676
10759
  * The flags for this item prototype.
@@ -10721,7 +10804,7 @@ interface LuaItemPrototype {
10721
10804
  * Applies to subclasses: ItemWithInventory
10722
10805
  *
10723
10806
  */
10724
- readonly insertion_priority_mode?: string
10807
+ readonly insertion_priority_mode?: 'default' | 'never' | 'always' | 'when-manually-filtered'
10725
10808
 
10726
10809
  /**
10727
10810
  * The main inventory size for item-with-inventory-prototype.
@@ -10872,7 +10955,7 @@ interface LuaItemPrototype {
10872
10955
  * Applies to subclasses: SelectionTool
10873
10956
  *
10874
10957
  */
10875
- readonly reverse_alt_entity_filter_mode?: string
10958
+ readonly reverse_alt_entity_filter_mode?: PrototypeFilterMode
10876
10959
 
10877
10960
  /**
10878
10961
  * The reverse entity filters used by this selection tool indexed by entity name.
@@ -10904,7 +10987,7 @@ interface LuaItemPrototype {
10904
10987
  * Applies to subclasses: SelectionTool
10905
10988
  *
10906
10989
  */
10907
- readonly reverse_selection_cursor_box_type?: string
10990
+ readonly reverse_selection_cursor_box_type?: CursorBoxRenderType
10908
10991
 
10909
10992
  /**
10910
10993
  * Flags that affect which entities will be selected during reverse selection.
@@ -10920,7 +11003,7 @@ interface LuaItemPrototype {
10920
11003
  * Applies to subclasses: SelectionTool
10921
11004
  *
10922
11005
  */
10923
- readonly reverse_tile_filter_mode?: string
11006
+ readonly reverse_tile_filter_mode?: PrototypeFilterMode
10924
11007
 
10925
11008
  /**
10926
11009
  * The reverse tile filters used by this selection tool indexed by tile name.
@@ -10948,7 +11031,7 @@ interface LuaItemPrototype {
10948
11031
  * Applies to subclasses: SelectionTool
10949
11032
  *
10950
11033
  */
10951
- readonly selection_cursor_box_type?: string
11034
+ readonly selection_cursor_box_type?: CursorBoxRenderType
10952
11035
 
10953
11036
  /**
10954
11037
  * Flags that affect which entities will be selected.
@@ -11003,7 +11086,7 @@ interface LuaItemPrototype {
11003
11086
  * Applies to subclasses: SelectionTool
11004
11087
  *
11005
11088
  */
11006
- readonly tile_filter_mode?: string
11089
+ readonly tile_filter_mode?: PrototypeFilterMode
11007
11090
 
11008
11091
  /**
11009
11092
  * The number of tile filters this deconstruction item has.
@@ -11290,11 +11373,10 @@ interface LuaItemStack {
11290
11373
  * Applies to subclasses: UpgradeItem
11291
11374
  *
11292
11375
  * @param index - The index of the mapper to read.
11293
- * @param type - `"from"` or `"to"`.
11294
11376
  */
11295
11377
  get_mapper(this: void,
11296
11378
  index: number,
11297
- type: string): UpgradeFilter
11379
+ type: 'from' | 'to'): UpgradeFilter
11298
11380
 
11299
11381
  /**
11300
11382
  * Gets the tag with the given name or returns `nil` if it doesn't exist.
@@ -11393,7 +11475,7 @@ interface LuaItemStack {
11393
11475
  * Applies to subclasses: DeconstructionItem
11394
11476
  *
11395
11477
  * @param filter - Writing `nil` removes the filter.
11396
- * @returns Whether the new filter was successfully set (ie. was valid).
11478
+ * @returns Whether the new filter was successfully set (meaning it was valid).
11397
11479
  */
11398
11480
  set_entity_filter(this: void,
11399
11481
  index: number,
@@ -11406,12 +11488,11 @@ interface LuaItemStack {
11406
11488
  *
11407
11489
  * @param filter - The filter to set or `nil`
11408
11490
  * @param index - The index of the mapper to set.
11409
- * @param type - `from` or `to`.
11410
11491
  */
11411
11492
  set_mapper(this: void,
11412
11493
  index: number,
11413
- type: string,
11414
- filter: UpgradeFilter): void
11494
+ type: 'from' | 'to',
11495
+ filter: UpgradeFilter | null): void
11415
11496
 
11416
11497
  /**
11417
11498
  * Set this item stack to another item stack.
@@ -11436,12 +11517,12 @@ interface LuaItemStack {
11436
11517
  * @remarks
11437
11518
  * Applies to subclasses: DeconstructionItem
11438
11519
  *
11439
- * @param filter - Setting to nil erases the filter.
11440
- * @returns Whether the new filter was successfully set (ie. was valid).
11520
+ * @param filter - Writing `nil` removes the filter.
11521
+ * @returns Whether the new filter was successfully set (meaning was valid).
11441
11522
  */
11442
11523
  set_tile_filter(this: void,
11443
11524
  index: number,
11444
- filter: string | LuaTilePrototype | LuaTile): boolean
11525
+ filter: string | LuaTilePrototype | LuaTile | null): boolean
11445
11526
 
11446
11527
  /**
11447
11528
  * Swaps this item stack with the given item stack if allowed.
@@ -11740,7 +11821,7 @@ interface LuaItemStack {
11740
11821
  * Applies to subclasses: ItemWithInventory
11741
11822
  *
11742
11823
  */
11743
- prioritize_insertion_mode: string
11824
+ prioritize_insertion_mode: 'default' | 'never' | 'always' | 'when-manually-filtered'
11744
11825
 
11745
11826
  /**
11746
11827
  * Prototype of the item held in this stack.
@@ -12039,27 +12120,25 @@ interface LuaLogisticNetwork {
12039
12120
  /**
12040
12121
  * Count given or all items in the network or given members.
12041
12122
  * @param item - Item name to count. If not given, gives counts of all items in the network.
12042
- * @param member - Logistic members to check, must be either `"storage"` or `"providers"`. If not given, gives count in the entire network.
12123
+ * @param member - Logistic members to check. If not given, gives count in the entire network.
12043
12124
  */
12044
12125
  get_item_count(this: void,
12045
12126
  item?: string,
12046
- member?: string): number
12127
+ member?: 'storage' | 'providers'): number
12047
12128
 
12048
12129
  /**
12049
12130
  * Get the amount of items of the given type indexed by the storage member.
12050
12131
  * @param item - Item name to check.
12051
- * @returns A mapping of member types ("storage", "passive-provider", "buffer", "active-provider") to the number available in the members.
12052
12132
  */
12053
12133
  get_supply_counts(this: void,
12054
- item: string): {[key: string]: number}
12134
+ item: string): LogisticsNetworkSupplyCounts
12055
12135
 
12056
12136
  /**
12057
12137
  * Gets the logistic points with of the given type indexed by the storage member.
12058
12138
  * @param item - Item name to check.
12059
- * @returns A mapping of member types ("storage", "passive-provider", "buffer", "active-provider") to an array of LuaLogisticPoint.
12060
12139
  */
12061
12140
  get_supply_points(this: void,
12062
- item: string): {[key: string]: LuaLogisticPoint[]}
12141
+ item: string): LogisticsNetworkSupplyPoints
12063
12142
 
12064
12143
  /**
12065
12144
  * All methods and properties that this object supports.
@@ -12069,40 +12148,40 @@ interface LuaLogisticNetwork {
12069
12148
  /**
12070
12149
  * Insert items into the logistic network. This will actually insert the items into some logistic chests.
12071
12150
  * @param item - What to insert.
12072
- * @param members - Which logistic members to insert the items to. Must be `"storage"`, `"storage-empty"` (storage chests that are completely empty), `"storage-empty-slot"` (storage chests that have an empty slot), or `"requester"`. If not specified, inserts items into the logistic network in the usual order.
12151
+ * @param members - Which logistic members to insert the items to. `"storage-empty"` inserts into storage chests that are completely empty, `"storage-empty-slot"` inserts into storage chests that have an empty slot. If not specified, inserts items into the logistic network in the usual order.
12073
12152
  * @returns Number of items actually inserted.
12074
12153
  */
12075
12154
  insert(this: void,
12076
12155
  item: ItemStackIdentification,
12077
- members?: string): number
12156
+ members?: 'storage' | 'storage-empty' | 'storage-empty-slot' | 'requester'): number
12078
12157
 
12079
12158
  /**
12080
12159
  * Remove items from the logistic network. This will actually remove the items from some logistic chests.
12081
12160
  * @param item - What to remove.
12082
- * @param members - Which logistic members to remove from. Must be `"storage"`, `"passive-provider"`, `"buffer"`, or `"active-provider"`. If not specified, removes from the network in the usual order.
12161
+ * @param members - Which logistic members to remove from. If not specified, removes from the network in the usual order.
12083
12162
  * @returns Number of items removed.
12084
12163
  */
12085
12164
  remove_item(this: void,
12086
12165
  item: ItemStackIdentification,
12087
- members?: string): number
12166
+ members?: 'active-provider' | 'passive-provider' | 'buffer' | 'storage'): number
12088
12167
 
12089
12168
  /**
12090
12169
  * Find a logistic point to drop the specific item stack.
12091
- * @param table.members - When given, it will find from only the specific type of member. Must be `"storage"`, `"storage-empty"`, `"storage-empty-slot"` or `"requester"`. If not specified, selects with normal priorities.
12092
- * @param table.stack - Name of the item to select.
12170
+ * @param table.members - When given, it will find from only the specific type of member. If not specified, selects with normal priorities.
12171
+ * @param table.stack - Name of the item to drop off.
12093
12172
  * @returns `nil` if no point was found.
12094
12173
  */
12095
12174
  select_drop_point(this: void,
12096
12175
  table: {
12097
12176
  stack: ItemStackIdentification,
12098
- members?: string
12177
+ members?: 'storage' | 'storage-empty' | 'storage-empty-slot' | 'requester'
12099
12178
  }): LuaLogisticPoint | null
12100
12179
 
12101
12180
  /**
12102
12181
  * Find the 'best' logistic point with this item ID and from the given position or from given chest type.
12103
12182
  * @param table.include_buffers - Whether to consider buffer chests or not. Defaults to false. Only considered if selecting with position.
12104
- * @param table.members - When given, it will find from only the specific type of member. Must be `"storage"`, `"passive-provider"`, `"buffer"` or `"active-provider"`. If not specified, selects with normal priorities. Not considered if position is specified.
12105
- * @param table.name - Name of the item to select.
12183
+ * @param table.members - When given, it will find from only the specific type of member. If not specified, selects with normal priorities. Not considered if position is specified.
12184
+ * @param table.name - Name of the item to pick up.
12106
12185
  * @param table.position - When given, it will find the storage 'best' storage point from this position.
12107
12186
  * @returns `nil` if no point was found.
12108
12187
  */
@@ -12111,7 +12190,7 @@ interface LuaLogisticNetwork {
12111
12190
  name: string,
12112
12191
  position?: MapPosition,
12113
12192
  include_buffers?: boolean,
12114
- members?: string
12193
+ members?: 'active-provider' | 'passive-provider' | 'buffer' | 'storage'
12115
12194
  }): LuaLogisticPoint | null
12116
12195
 
12117
12196
  /**
@@ -13062,6 +13141,9 @@ interface LuaPlayer extends LuaControl {
13062
13141
 
13063
13142
  /**
13064
13143
  * Play a sound for this player.
13144
+ * @remarks
13145
+ * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for this player.
13146
+ *
13065
13147
  * @param table.override_sound_type - The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
13066
13148
  * @param table.path - The sound to play.
13067
13149
  * @param table.position - Where the sound should be played. If not given, it's played at the current position of the player.
@@ -14132,7 +14214,7 @@ interface LuaRendering {
14132
14214
  id: number): void
14133
14215
 
14134
14216
  /**
14135
- * Destroys all render objects. Passing an empty string (`""`)
14217
+ * Destroys all render objects.
14136
14218
  * @param mod_name - If provided, only the render objects created by this mod are destroyed. An empty string (`""`) refers to all objects not belonging to a mod, such as those created using console commands.
14137
14219
  */
14138
14220
  clear(this: void,
@@ -14472,7 +14554,7 @@ interface LuaRendering {
14472
14554
  * @remarks
14473
14555
  * Not all fonts support scaling.
14474
14556
  *
14475
- * @param table.alignment - Defaults to "left". Other options are "right" and "center".
14557
+ * @param table.alignment - Defaults to "left".
14476
14558
  * @param table.draw_on_ground - If this should be drawn below sprites and entities. Rich text does not support this option.
14477
14559
  * @param table.font - Name of font to use. Defaults to the same font as flying-text.
14478
14560
  * @param table.forces - The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
@@ -14484,7 +14566,7 @@ interface LuaRendering {
14484
14566
  * @param table.text - The text to display.
14485
14567
  * @param table.time_to_live - In ticks. Defaults to living forever.
14486
14568
  * @param table.use_rich_text - If rich text rendering is enabled. Defaults to false.
14487
- * @param table.vertical_alignment - Defaults to "top". Other options are "middle", "baseline" and "bottom".
14569
+ * @param table.vertical_alignment - Defaults to "top".
14488
14570
  * @param table.visible - If this is rendered to anyone at all. Defaults to true.
14489
14571
  * @returns Id of the render object
14490
14572
  */
@@ -14503,8 +14585,8 @@ interface LuaRendering {
14503
14585
  visible?: boolean,
14504
14586
  draw_on_ground?: boolean,
14505
14587
  orientation?: RealOrientation,
14506
- alignment?: string,
14507
- vertical_alignment?: string,
14588
+ alignment?: TextAlign,
14589
+ vertical_alignment?: VerticalTextAlign,
14508
14590
  scale_with_zoom?: boolean,
14509
14591
  only_in_alt_mode?: boolean,
14510
14592
  use_rich_text?: boolean
@@ -14518,7 +14600,7 @@ interface LuaRendering {
14518
14600
  * @returns `nil` if the object is not a text.
14519
14601
  */
14520
14602
  get_alignment(this: void,
14521
- id: number): string | null
14603
+ id: number): TextAlign | null
14522
14604
 
14523
14605
  /**
14524
14606
  * Gets an array of all valid object ids.
@@ -14860,10 +14942,10 @@ interface LuaRendering {
14860
14942
  id: number): ScriptRenderTarget | null
14861
14943
 
14862
14944
  /**
14863
- * Gets the type of the given object. The types are "text", "line", "circle", "rectangle", "arc", "polygon", "sprite", "light" and "animation".
14945
+ * Gets the type of the given object.
14864
14946
  */
14865
14947
  get_type(this: void,
14866
- id: number): string
14948
+ id: number): 'text' | 'line' | 'circle' | 'rectangle' | 'arc' | 'polygon' | 'sprite' | 'light' | 'animation'
14867
14949
 
14868
14950
  /**
14869
14951
  * Get if the text with this id parses rich text tags.
@@ -14890,7 +14972,7 @@ interface LuaRendering {
14890
14972
  * @returns `nil` if the object is not a text.
14891
14973
  */
14892
14974
  get_vertical_alignment(this: void,
14893
- id: number): string | null
14975
+ id: number): VerticalTextAlign | null
14894
14976
 
14895
14977
  /**
14896
14978
  * Get the vertices of the polygon with this id.
@@ -14955,11 +15037,10 @@ interface LuaRendering {
14955
15037
  * @remarks
14956
15038
  * Applies to subclasses: Text
14957
15039
  *
14958
- * @param alignment - "left", "right" or "center".
14959
15040
  */
14960
15041
  set_alignment(this: void,
14961
15042
  id: number,
14962
- alignment: string): void
15043
+ alignment: TextAlign): void
14963
15044
 
14964
15045
  /**
14965
15046
  * Set the angle of the arc with this id. Does nothing if this object is not a arc.
@@ -15350,11 +15431,10 @@ interface LuaRendering {
15350
15431
  * @remarks
15351
15432
  * Applies to subclasses: Text
15352
15433
  *
15353
- * @param alignment - "top", "middle", "baseline" or "bottom"
15354
15434
  */
15355
15435
  set_vertical_alignment(this: void,
15356
15436
  id: number,
15357
- alignment: string): void
15437
+ alignment: VerticalTextAlign): void
15358
15438
 
15359
15439
  /**
15360
15440
  * Set the vertices of the polygon with this id. Does nothing if this object is not a polygon.
@@ -15793,9 +15873,9 @@ interface LuaStyle {
15793
15873
  height: number
15794
15874
 
15795
15875
  /**
15796
- * Horizontal align of the inner content of the widget, if any. Possible values are "left", "center" or "right".
15876
+ * Horizontal align of the inner content of the widget, if any.
15797
15877
  */
15798
- horizontal_align?: string
15878
+ horizontal_align?: 'left' | 'center' | 'right'
15799
15879
 
15800
15880
  /**
15801
15881
  * Horizontal space between individual cells.
@@ -15990,9 +16070,9 @@ interface LuaStyle {
15990
16070
  readonly valid: boolean
15991
16071
 
15992
16072
  /**
15993
- * Vertical align of the inner content of the widget, if any. Possible values are "top", "center" or "bottom".
16073
+ * Vertical align of the inner content of the widget, if any.
15994
16074
  */
15995
- vertical_align?: string
16075
+ vertical_align?: 'top' | 'center' | 'bottom'
15996
16076
 
15997
16077
  /**
15998
16078
  * Vertical space between individual cells.
@@ -16060,7 +16140,7 @@ interface LuaSurface {
16060
16140
 
16061
16141
  /**
16062
16142
  * @param positions - Positions for which to calculate property values
16063
- * @param property_names - Names of properties (e.g. "elevation") to calculate
16143
+ * @param property_names - Names of properties (`"elevation"`, etc) to calculate.
16064
16144
  * @returns Table of property value lists, keyed by property name
16065
16145
  */
16066
16146
  calculate_tile_properties(this: void,
@@ -16167,7 +16247,7 @@ interface LuaSurface {
16167
16247
  source_area: BoundingBox,
16168
16248
  destination_area: BoundingBox,
16169
16249
  destination_surface?: SurfaceIdentification,
16170
- destination_force?: LuaForce | string,
16250
+ destination_force?: ForceIdentification,
16171
16251
  clone_tiles?: boolean,
16172
16252
  clone_entities?: boolean,
16173
16253
  clone_decoratives?: boolean,
@@ -16502,7 +16582,7 @@ interface LuaSurface {
16502
16582
  find_enemy_units(this: void,
16503
16583
  center: MapPosition,
16504
16584
  radius: number,
16505
- force?: LuaForce | string): LuaEntity[]
16585
+ force?: ForceIdentification): LuaEntity[]
16506
16586
 
16507
16587
  /**
16508
16588
  * Find entities in a given area.
@@ -16561,8 +16641,8 @@ interface LuaSurface {
16561
16641
  }): LuaEntity[]
16562
16642
 
16563
16643
  /**
16564
- * Find an entity of the given type at the given position. This checks both the exact position and the bounding box of the entity.
16565
- * @param entity - Entity to look for.
16644
+ * Find an entity of the given name at the given position. This checks both the exact position and the bounding box of the entity.
16645
+ * @param entity - Name of the entity to look for.
16566
16646
  * @param position - Coordinates to look at.
16567
16647
  * @example
16568
16648
  * ```
@@ -16704,7 +16784,7 @@ interface LuaSurface {
16704
16784
  find_units(this: void,
16705
16785
  table: {
16706
16786
  area: BoundingBox,
16707
- force: LuaForce | string,
16787
+ force: ForceIdentification,
16708
16788
  condition: ForceCondition
16709
16789
  }): LuaEntity[]
16710
16790
 
@@ -16750,7 +16830,7 @@ interface LuaSurface {
16750
16830
  */
16751
16831
  get_entities_with_force(this: void,
16752
16832
  position: ChunkPosition,
16753
- force: LuaForce | string): LuaEntity[]
16833
+ force: ForceIdentification): LuaEntity[]
16754
16834
 
16755
16835
  /**
16756
16836
  * The hidden tile name.
@@ -16866,6 +16946,9 @@ interface LuaSurface {
16866
16946
 
16867
16947
  /**
16868
16948
  * Play a sound for every player on this surface.
16949
+ * @remarks
16950
+ * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for that player.
16951
+ *
16869
16952
  * @param table.override_sound_type - The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
16870
16953
  * @param table.path - The sound to play.
16871
16954
  * @param table.position - Where the sound should be played. If not given, it's played at the current position of each player.
@@ -16967,13 +17050,13 @@ interface LuaSurface {
16967
17050
  }): number
16968
17051
 
16969
17052
  /**
16970
- * Request that the game's map generator generate chunks at the given position for the given radius on this surface.
17053
+ * Request that the game's map generator generate chunks at the given position for the given radius on this surface. If the radius is `0`, then only the chunk at the given position is generated.
16971
17054
  * @param position - Where to generate the new chunks.
16972
- * @param radius - The chunk radius from `position` to generate new chunks in.
17055
+ * @param radius - The chunk radius from `position` to generate new chunks in. Defaults to `0`.
16973
17056
  */
16974
17057
  request_to_generate_chunks(this: void,
16975
17058
  position: MapPosition,
16976
- radius: number): void
17059
+ radius?: number): void
16977
17060
 
16978
17061
  /**
16979
17062
  * Set generated status of a chunk. Useful when copying chunks.
@@ -17016,14 +17099,14 @@ interface LuaSurface {
17016
17099
  * 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.
17017
17100
  *
17018
17101
  * @param correct_tiles - If `false`, the correction logic is not applied to the changed tiles. Defaults to `true`.
17019
- * @param raise_event - `true` or `false`. Defaults to `false`.
17020
- * @param remove_colliding_decoratives - `true` or `false`. Defaults to `true`.
17021
- * @param remove_colliding_entities - `true`, `false`, or `abort_on_collision`. Defaults to `true`.
17102
+ * @param raise_event - Defaults to `false`.
17103
+ * @param remove_colliding_decoratives - Defaults to `true`.
17104
+ * @param remove_colliding_entities - Defaults to `true`.
17022
17105
  */
17023
17106
  set_tiles(this: void,
17024
17107
  tiles: Tile[],
17025
17108
  correct_tiles?: boolean,
17026
- remove_colliding_entities?: boolean | string,
17109
+ remove_colliding_entities?: boolean | 'abort_on_collision',
17027
17110
  remove_colliding_decoratives?: boolean,
17028
17111
  raise_event?: boolean): void
17029
17112
 
@@ -17040,7 +17123,7 @@ interface LuaSurface {
17040
17123
  position: MapPosition,
17041
17124
  items: ItemStackIdentification,
17042
17125
  enable_looted?: boolean,
17043
- force?: LuaForce | string,
17126
+ force?: ForceIdentification,
17044
17127
  allow_belts?: boolean): LuaEntity[]
17045
17128
 
17046
17129
  /**
@@ -17163,9 +17246,6 @@ interface LuaSurface {
17163
17246
 
17164
17247
  /**
17165
17248
  * The multiplier of solar power on this surface. Cannot be less than 0.
17166
- * @remarks
17167
- * Solar equipment is still limited to its maximum power output.
17168
- *
17169
17249
  */
17170
17250
  solar_power_multiplier: number
17171
17251
 
@@ -17778,9 +17858,26 @@ interface LuaTrain {
17778
17858
  readonly killed_players: {[key: number]: number}
17779
17859
 
17780
17860
  /**
17781
- * Arrays of locomotives. The result is two arrays, indexed by `"front_movers"` and `"back_movers"` containing the locomotives. E.g. `{front_movers={loco1, loco2}, back_movers={loco3}}`.
17861
+ * Locomotives of the train.
17862
+ * @example
17863
+ * ```
17864
+ * -- called on a LuaTrain with 3 locomotives, it returns 3 LuaEntities:
17865
+ * train.locomotives -- => {front_movers = {loco1, loco2}, back_movers = {loco3}}
17866
+ * ```
17867
+ *
17782
17868
  */
17783
- readonly locomotives: {[key: string]: LuaEntity[]}
17869
+ readonly locomotives: {
17870
+
17871
+ /**
17872
+ * Array of locomotives.
17873
+ */
17874
+ back_movers: LuaEntity[],
17875
+
17876
+ /**
17877
+ * Array of locomotives.
17878
+ */
17879
+ front_movers: LuaEntity[]
17880
+ }
17784
17881
 
17785
17882
  /**
17786
17883
  * When `true`, the train is explicitly controlled by the player or script. When `false`, the train moves autonomously according to its schedule.
@@ -18367,6 +18464,8 @@ interface LuaWallControlBehavior extends LuaControlBehavior {
18367
18464
  *
18368
18465
  */
18369
18466
  interface LuaControlSetGuiArrowParams {
18467
+ 'margin': number
18468
+
18370
18469
  /**
18371
18470
  * Where to point to. This field determines what other fields are mandatory.
18372
18471
  */
@@ -18380,6 +18479,9 @@ interface LuaControlSetGuiArrowParams {
18380
18479
  *
18381
18480
  */
18382
18481
  interface LuaControlSetGuiArrowParamsCraftingQueue extends LuaControlSetGuiArrowParams {
18482
+ /**
18483
+ * Index in the crafting queue to point to.
18484
+ */
18383
18485
  'crafting_queueindex': number
18384
18486
 
18385
18487
  }
@@ -18400,14 +18502,17 @@ interface LuaControlSetGuiArrowParamsEntity extends LuaControlSetGuiArrowParams
18400
18502
  *
18401
18503
  */
18402
18504
  interface LuaControlSetGuiArrowParamsItemStack extends LuaControlSetGuiArrowParams {
18505
+ /**
18506
+ * Which inventory the stack is in.
18507
+ */
18403
18508
  'inventory_index': defines.inventory
18404
18509
 
18405
- 'item_stack_index': number
18406
-
18407
18510
  /**
18408
- * May be either `"player"` or `"target"`.
18511
+ * Which stack to point to.
18409
18512
  */
18410
- 'source': string
18513
+ 'item_stack_index': number
18514
+
18515
+ 'source': 'player' | 'target' | 'player-quickbar' | 'player-equipment-bar'
18411
18516
 
18412
18517
  }
18413
18518
 
@@ -18437,6 +18542,11 @@ interface LuaGuiElementAddParams {
18437
18542
  */
18438
18543
  'caption'?: LocalisedString
18439
18544
 
18545
+ /**
18546
+ * Elem tooltip of the child element. Will be displayed above `tooltip`.
18547
+ */
18548
+ 'elem_tooltip'?: ElemID
18549
+
18440
18550
  /**
18441
18551
  * Whether the child element is enabled. Defaults to `true`.
18442
18552
  */
@@ -18577,7 +18687,7 @@ interface LuaGuiElementAddParamsChooseElemButton extends LuaGuiElementAddParams
18577
18687
  /**
18578
18688
  * The type of the button - one of the following values.
18579
18689
  */
18580
- 'elem_type': string
18690
+ 'elem_type': ElemType
18581
18691
 
18582
18692
  /**
18583
18693
  * If type is `"entity"` - the default value for the button.
@@ -18651,9 +18761,9 @@ interface LuaGuiElementAddParamsDropDown extends LuaGuiElementAddParams {
18651
18761
  */
18652
18762
  interface LuaGuiElementAddParamsFlow extends LuaGuiElementAddParams {
18653
18763
  /**
18654
- * The initial direction of the flow's layout. See {@link LuaGuiElement::direction | runtime:LuaGuiElement::direction}. Defaults to `"horizontal"`.
18764
+ * The initial direction of the flow's layout. Defaults to `"horizontal"`.
18655
18765
  */
18656
- 'direction'?: string
18766
+ 'direction'?: GuiDirection
18657
18767
 
18658
18768
  }
18659
18769
 
@@ -18664,9 +18774,9 @@ interface LuaGuiElementAddParamsFlow extends LuaGuiElementAddParams {
18664
18774
  */
18665
18775
  interface LuaGuiElementAddParamsFrame extends LuaGuiElementAddParams {
18666
18776
  /**
18667
- * The initial direction of the frame's layout. See {@link LuaGuiElement::direction | runtime:LuaGuiElement::direction}. Defaults to `"horizontal"`.
18777
+ * The initial direction of the frame's layout. Defaults to `"horizontal"`.
18668
18778
  */
18669
- 'direction'?: string
18779
+ 'direction'?: GuiDirection
18670
18780
 
18671
18781
  }
18672
18782
 
@@ -18679,7 +18789,7 @@ interface LuaGuiElementAddParamsLine extends LuaGuiElementAddParams {
18679
18789
  /**
18680
18790
  * The initial direction of the line. Defaults to `"horizontal"`.
18681
18791
  */
18682
- 'direction'?: string
18792
+ 'direction'?: GuiDirection
18683
18793
 
18684
18794
  }
18685
18795
 
@@ -18767,14 +18877,14 @@ interface LuaGuiElementAddParamsRadiobutton extends LuaGuiElementAddParams {
18767
18877
  */
18768
18878
  interface LuaGuiElementAddParamsScrollPane extends LuaGuiElementAddParams {
18769
18879
  /**
18770
- * Policy of the horizontal scroll bar. Possible values are `"auto"`, `"never"`, `"always"`, `"auto-and-reserve-space"`, `"dont-show-but-allow-scrolling"`. Defaults to `"auto"`.
18880
+ * Policy of the horizontal scroll bar. Defaults to `"auto"`.
18771
18881
  */
18772
- 'horizontal_scroll_policy'?: string
18882
+ 'horizontal_scroll_policy'?: ScrollPolicy
18773
18883
 
18774
18884
  /**
18775
- * Policy of the vertical scroll bar. Possible values are `"auto"`, `"never"`, `"always"`, `"auto-and-reserve-space"`, `"dont-show-but-allow-scrolling"`. Defaults to `"auto"`.
18885
+ * Policy of the vertical scroll bar. Defaults to `"auto"`.
18776
18886
  */
18777
- 'vertical_scroll_policy'?: string
18887
+ 'vertical_scroll_policy'?: ScrollPolicy
18778
18888
 
18779
18889
  }
18780
18890
 
@@ -18902,9 +19012,9 @@ interface LuaGuiElementAddParamsSwitch extends LuaGuiElementAddParams {
18902
19012
  'right_label_tooltip'?: LocalisedString
18903
19013
 
18904
19014
  /**
18905
- * Possible values are `"left"`, `"right"`, or `"none"`. If set to "none", `allow_none_state` must be `true`. Defaults to `"left"`.
19015
+ * If set to "none", `allow_none_state` must be `true`. Defaults to `"left"`.
18906
19016
  */
18907
- 'switch_state'?: string
19017
+ 'switch_state'?: SwitchState
18908
19018
 
18909
19019
  }
18910
19020
 
@@ -19502,9 +19612,9 @@ interface LuaSurfaceCreateEntityParamsStream extends LuaSurfaceCreateEntityParam
19502
19612
  */
19503
19613
  interface LuaSurfaceCreateEntityParamsUndergroundBelt extends LuaSurfaceCreateEntityParams {
19504
19614
  /**
19505
- * `"output"` or `"input"`; default is `"input"`.
19615
+ * Defaults to `"input"`.
19506
19616
  */
19507
- 'type'?: string
19617
+ 'type'?: 'output' | 'input'
19508
19618
 
19509
19619
  }
19510
19620