typed-factorio 0.19.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -300,7 +300,7 @@ interface LuaBootstrap {
300
300
  * @returns The registration number. It is used to identify the entity in the {@link OnEntityDestroyedEvent on_entity_destroyed} event.
301
301
  * @remarks Depending on when a given entity is destroyed, {@link OnEntityDestroyedEvent on_entity_destroyed} will either be fired at the end of the current tick or at the end of the next tick.
302
302
  */
303
- register_on_entity_destroyed(entity: LuaEntity): uint64
303
+ register_on_entity_destroyed(entity: LuaEntity): RegistrationNumber
304
304
  /**
305
305
  * Generate a new, unique event ID that can be used to raise custom events with {@link LuaBootstrap#raise_event LuaBootstrap::raise_event}.
306
306
  *
@@ -392,7 +392,7 @@ interface LuaBootstrap {
392
392
  /**
393
393
  * The player doing the chatting.
394
394
  */
395
- readonly player_index: uint
395
+ readonly player_index: PlayerIndex
396
396
  /**
397
397
  * The chat message to send.
398
398
  */
@@ -413,7 +413,7 @@ interface LuaBootstrap {
413
413
  /**
414
414
  * The player doing the crafting.
415
415
  */
416
- readonly player_index: uint
416
+ readonly player_index: PlayerIndex
417
417
  /**
418
418
  * The recipe used to craft this item.
419
419
  */
@@ -430,7 +430,7 @@ interface LuaBootstrap {
430
430
  /**
431
431
  * The player transferred from or to.
432
432
  */
433
- readonly player_index: uint
433
+ readonly player_index: PlayerIndex
434
434
  /**
435
435
  * The entity transferred from or to.
436
436
  */
@@ -464,7 +464,7 @@ interface LuaBootstrap {
464
464
  /**
465
465
  * The player who did the purchasing.
466
466
  */
467
- readonly player_index: uint
467
+ readonly player_index: PlayerIndex
468
468
  /**
469
469
  * The market entity.
470
470
  */
@@ -532,7 +532,7 @@ interface LuaBootstrap {
532
532
  /**
533
533
  * The surface whose tiles have been changed.
534
534
  */
535
- readonly surface_index: uint
535
+ readonly surface_index: SurfaceIndex
536
536
  /**
537
537
  * The tiles that have been changed.
538
538
  */
@@ -725,7 +725,8 @@ interface LuaBurnerPrototype {
725
725
  * {@link https://lua-api.factorio.com/latest/LuaChunkIterator.html View documentation}
726
726
  * @noSelf
727
727
  * @example
728
- ```
728
+ *
729
+ * ```
729
730
  * for chunk in some_surface.get_chunks() do
730
731
  * game.player.print("x: " .. chunk.x .. ", y: " .. chunk.y)
731
732
  * game.player.print("area: " .. serpent.line(chunk.area))
@@ -1170,7 +1171,7 @@ interface LuaControl {
1170
1171
  *
1171
1172
  * {@link https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.is_flashlight_enabled View documentation}
1172
1173
  */
1173
- is_flashlight_enabled(): void
1174
+ is_flashlight_enabled(): boolean
1174
1175
  /**
1175
1176
  * Gets the count of the given recipe that can be crafted.
1176
1177
  *
@@ -1529,14 +1530,15 @@ interface LuaControl {
1529
1530
  readonly position: MapPosition
1530
1531
  })
1531
1532
  /**
1532
- * The player's cursor stack, or `nil` if the player controller is a spectator. Even though this property is marked as read-only, it returns a {@link LuaItemStack}, meaning it can be manipulated like so:
1533
- *
1534
- * {@link https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.cursor_stack View documentation}
1535
- * @example
1536
- ```
1537
- * player.cursor_stack.clear()
1538
- * ```
1539
- */
1533
+ * The player's cursor stack, or `nil` if the player controller is a spectator. Even though this property is marked as read-only, it returns a {@link LuaItemStack}, meaning it can be manipulated like so:
1534
+ *
1535
+ * {@link https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.cursor_stack View documentation}
1536
+ * @example
1537
+ *
1538
+ * ```
1539
+ * player.cursor_stack.clear()
1540
+ * ```
1541
+ */
1540
1542
  readonly cursor_stack: LuaItemStack | undefined
1541
1543
  /**
1542
1544
  * The ghost prototype in the player's cursor.
@@ -1936,7 +1938,7 @@ interface LuaCustomInputPrototype {
1936
1938
  help(): string
1937
1939
  }
1938
1940
 
1939
- type CustomTableIndex<K extends string | number, V>
1941
+ type CustomTableIndexer<K extends string | number, V>
1940
1942
  /**
1941
1943
  * Access an element of this custom table.
1942
1944
  *
@@ -1997,8 +1999,13 @@ interface LuaCustomTableMembers {
1997
1999
  * ```
1998
2000
  */
1999
2001
  type LuaCustomTable<K extends string | number, V> = LuaCustomTableMembers &
2000
- CustomTableIndex<K, V> &
2001
- LuaPairsIterable<[number] extends [K] ? number : K, V>
2002
+ CustomTableIndexer<K, V> &
2003
+ LuaPairsIterable<
2004
+ // this convoluted expression gives a number type if K includes a number, even if it includes a string, and K otherwise.
2005
+ // it also preserves number branding
2006
+ [number] extends [K extends number & IndexBrand<infer A> ? number : K] ? (K extends string ? never : K) : K,
2007
+ V
2008
+ >
2002
2009
 
2003
2010
  /**
2004
2011
  * Prototype of a damage.
@@ -2465,13 +2472,13 @@ interface LuaEntity extends LuaControl {
2465
2472
  */
2466
2473
  clear_request_slot(slot: uint): void
2467
2474
  /**
2468
- * Returns whether a craft is currently in process. It does not indicate whether progress is currently being made, but whether any crafting action has made progress in this machine.
2475
+ * Returns whether a craft is currently in process. It does not indicate whether progress is currently being made, but whether a crafting process has been started in this machine.
2469
2476
  *
2470
2477
  * _Can only be used if this is CraftingMachine_
2471
2478
  *
2472
2479
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_crafting View documentation}
2473
2480
  */
2474
- is_crafting(): void
2481
+ is_crafting(): boolean
2475
2482
  /**
2476
2483
  * _Can only be used if this is Gate_
2477
2484
  *
@@ -3487,15 +3494,16 @@ interface LuaEntity extends LuaControl {
3487
3494
  */
3488
3495
  selected_gun_index: uint | undefined
3489
3496
  /**
3490
- * Energy stored in the entity (heat in furnace, energy stored in electrical devices etc.). always 0 for entities that don't have the concept of energy stored inside.
3491
- *
3492
- * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.energy View documentation}
3493
- * @example
3494
- ```
3495
- * game.player.print("Machine energy: " .. game.player.selected.energy .. "J")
3496
- * game.player.selected.energy = 3000
3497
- * ```
3498
- */
3497
+ * Energy stored in the entity (heat in furnace, energy stored in electrical devices etc.). always 0 for entities that don't have the concept of energy stored inside.
3498
+ *
3499
+ * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.energy View documentation}
3500
+ * @example
3501
+ *
3502
+ * ```
3503
+ * game.player.print("Machine energy: " .. game.player.selected.energy .. "J")
3504
+ * game.player.selected.energy = 3000
3505
+ * ```
3506
+ */
3499
3507
  energy: double
3500
3508
  /**
3501
3509
  * The temperature of this entities heat energy source if this entity uses a heat energy source or `nil`.
@@ -3790,7 +3798,7 @@ interface LuaEntity extends LuaControl {
3790
3798
  *
3791
3799
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_number View documentation}
3792
3800
  */
3793
- readonly unit_number: uint | undefined
3801
+ readonly unit_number: UnitNumber | undefined
3794
3802
  /**
3795
3803
  * The {@link LuaEntity#unit_number unit_number} of the entity contained in this ghost. It is the same as the unit number of the {@link https://wiki.factorio.com/Prototype/EntityWithOwner EntityWithOwner} that was destroyed to create this ghost. If it was created by other means, or if the inner entity doesn not support unit numbers, this property is `nil`.
3796
3804
  *
@@ -3798,7 +3806,7 @@ interface LuaEntity extends LuaControl {
3798
3806
  *
3799
3807
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_unit_number View documentation}
3800
3808
  */
3801
- readonly ghost_unit_number: uint | undefined
3809
+ readonly ghost_unit_number: UnitNumber | undefined
3802
3810
  /**
3803
3811
  * 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]
3804
3812
  *
@@ -5200,15 +5208,16 @@ interface BaseEntity extends LuaControl {
5200
5208
  */
5201
5209
  drop_target: LuaEntity | undefined
5202
5210
  /**
5203
- * Energy stored in the entity (heat in furnace, energy stored in electrical devices etc.). always 0 for entities that don't have the concept of energy stored inside.
5204
- *
5205
- * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.energy View documentation}
5206
- * @example
5207
- ```
5208
- * game.player.print("Machine energy: " .. game.player.selected.energy .. "J")
5209
- * game.player.selected.energy = 3000
5210
- * ```
5211
- */
5211
+ * Energy stored in the entity (heat in furnace, energy stored in electrical devices etc.). always 0 for entities that don't have the concept of energy stored inside.
5212
+ *
5213
+ * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.energy View documentation}
5214
+ * @example
5215
+ *
5216
+ * ```
5217
+ * game.player.print("Machine energy: " .. game.player.selected.energy .. "J")
5218
+ * game.player.selected.energy = 3000
5219
+ * ```
5220
+ */
5212
5221
  energy: double
5213
5222
  /**
5214
5223
  * The temperature of this entities heat energy source if this entity uses a heat energy source or `nil`.
@@ -5351,7 +5360,7 @@ interface BaseEntity extends LuaControl {
5351
5360
  *
5352
5361
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_number View documentation}
5353
5362
  */
5354
- readonly unit_number: uint | undefined
5363
+ readonly unit_number: UnitNumber | undefined
5355
5364
  /**
5356
5365
  * 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]
5357
5366
  *
@@ -5768,7 +5777,7 @@ interface EntityGhostEntity extends BaseEntity {
5768
5777
  *
5769
5778
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_unit_number View documentation}
5770
5779
  */
5771
- readonly ghost_unit_number: uint | undefined
5780
+ readonly ghost_unit_number: UnitNumber | undefined
5772
5781
  }
5773
5782
 
5774
5783
  /**
@@ -5827,13 +5836,13 @@ interface MarketEntity extends BaseEntity {
5827
5836
  */
5828
5837
  interface CraftingMachineEntity extends BaseEntity {
5829
5838
  /**
5830
- * Returns whether a craft is currently in process. It does not indicate whether progress is currently being made, but whether any crafting action has made progress in this machine.
5839
+ * Returns whether a craft is currently in process. It does not indicate whether progress is currently being made, but whether a crafting process has been started in this machine.
5831
5840
  *
5832
5841
  * _Can only be used if this is CraftingMachine_
5833
5842
  *
5834
5843
  * {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_crafting View documentation}
5835
5844
  */
5836
- is_crafting(): void
5845
+ is_crafting(): boolean
5837
5846
  /**
5838
5847
  * Current recipe being assembled by this machine or `nil` if no recipe is set.
5839
5848
  *
@@ -11950,7 +11959,7 @@ interface LuaGameScript {
11950
11959
  * @param player The player index or name.
11951
11960
  * @remarks This is a shortcut for game.players[...]
11952
11961
  */
11953
- get_player(player: uint | string): LuaPlayer | undefined
11962
+ get_player(index: PlayerIndex | string): LuaPlayer | undefined
11954
11963
  /**
11955
11964
  * Gets the given surface or returns `nil` if no surface is found.
11956
11965
  *
@@ -11958,7 +11967,7 @@ interface LuaGameScript {
11958
11967
  * @param surface The surface index or name.
11959
11968
  * @remarks This is a shortcut for game.surfaces[...]
11960
11969
  */
11961
- get_surface(surface: uint | string): LuaSurface | undefined
11970
+ get_surface(index: SurfaceIndex | string): LuaSurface | undefined
11962
11971
  /**
11963
11972
  * Creates a {@link LuaProfiler}, which is used for measuring script performance.
11964
11973
  *
@@ -12151,7 +12160,7 @@ interface LuaGameScript {
12151
12160
  *
12152
12161
  * {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.players View documentation}
12153
12162
  */
12154
- readonly players: LuaCustomTable<uint | string, LuaPlayer>
12163
+ readonly players: LuaCustomTable<PlayerIndex | string, LuaPlayer>
12155
12164
  /**
12156
12165
  * The currently active set of map settings. Even though this property is marked as read-only, the members of the dictionary that is returned can be modified mid-game.
12157
12166
  *
@@ -12418,7 +12427,7 @@ interface LuaGameScript {
12418
12427
  *
12419
12428
  * {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.surfaces View documentation}
12420
12429
  */
12421
- readonly surfaces: LuaCustomTable<uint | string, LuaSurface>
12430
+ readonly surfaces: LuaCustomTable<SurfaceIndex | string, LuaSurface>
12422
12431
  /**
12423
12432
  * The active mods versions. The keys are mod names, the values are the versions.
12424
12433
  *
@@ -12962,7 +12971,7 @@ interface CameraGuiSpec extends BaseGuiSpec {
12962
12971
  /**
12963
12972
  * The surface that the camera will render. Defaults to the player's current surface.
12964
12973
  */
12965
- readonly surface_index?: uint
12974
+ readonly surface_index?: SurfaceIndex
12966
12975
  /**
12967
12976
  * The initial camera zoom. Defaults to `0.75`.
12968
12977
  */
@@ -13132,7 +13141,7 @@ interface MinimapGuiSpec extends BaseGuiSpec {
13132
13141
  /**
13133
13142
  * The surface the camera will render. Defaults to the player's current surface.
13134
13143
  */
13135
- readonly surface_index?: uint
13144
+ readonly surface_index?: SurfaceIndex
13136
13145
  /**
13137
13146
  * The player index the map should use. Defaults to the current player.
13138
13147
  */
@@ -13214,7 +13223,7 @@ type GuiSpec =
13214
13223
  | TabbedPaneGuiSpec
13215
13224
  | LabelGuiSpec
13216
13225
 
13217
- interface GuiElementIndex {
13226
+ interface GuiElementIndexer {
13218
13227
  /**
13219
13228
  * The indexing operator. Gets children by name.
13220
13229
  *
@@ -13246,25 +13255,27 @@ interface BaseGuiElement {
13246
13255
  }
13247
13256
  >
13248
13257
  /**
13249
- * Remove children of this element. Any {@link LuaGuiElement} objects referring to the destroyed elements become invalid after this operation.
13250
- *
13251
- * {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.clear View documentation}
13252
- * @example
13253
- ```
13254
- * game.player.gui.top.clear()
13255
- * ```
13256
- */
13258
+ * Remove children of this element. Any {@link LuaGuiElement} objects referring to the destroyed elements become invalid after this operation.
13259
+ *
13260
+ * {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.clear View documentation}
13261
+ * @example
13262
+ *
13263
+ * ```
13264
+ * game.player.gui.top.clear()
13265
+ * ```
13266
+ */
13257
13267
  clear(): void
13258
13268
  /**
13259
- * Remove this element, along with its children. Any {@link LuaGuiElement} objects referring to the destroyed elements become invalid after this operation.
13260
- *
13261
- * {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.destroy View documentation}
13262
- * @remarks The top-level GUI elements - {@link LuaGui#top LuaGui::top}, {@link LuaGui#left LuaGui::left}, {@link LuaGui#center LuaGui::center} and {@link LuaGui#screen LuaGui::screen} - can't be destroyed.
13263
- * @example
13264
- ```
13265
- * game.player.gui.top.greeting.destroy()
13266
- * ```
13267
- */
13269
+ * Remove this element, along with its children. Any {@link LuaGuiElement} objects referring to the destroyed elements become invalid after this operation.
13270
+ *
13271
+ * {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.destroy View documentation}
13272
+ * @remarks The top-level GUI elements - {@link LuaGui#top LuaGui::top}, {@link LuaGui#left LuaGui::left}, {@link LuaGui#center LuaGui::center} and {@link LuaGui#screen LuaGui::screen} - can't be destroyed.
13273
+ * @example
13274
+ *
13275
+ * ```
13276
+ * game.player.gui.top.greeting.destroy()
13277
+ * ```
13278
+ */
13268
13279
  destroy(): void
13269
13280
  /**
13270
13281
  * The mod that owns this Gui element or `nil` if it's owned by the scenario script.
@@ -13306,7 +13317,7 @@ interface BaseGuiElement {
13306
13317
  *
13307
13318
  * {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.index View documentation}
13308
13319
  */
13309
- readonly index: uint
13320
+ readonly index: GuiElementIndex
13310
13321
  /**
13311
13322
  * The GUI this element is a child of.
13312
13323
  *
@@ -13320,14 +13331,15 @@ interface BaseGuiElement {
13320
13331
  */
13321
13332
  readonly parent: LuaGuiElement | undefined
13322
13333
  /**
13323
- * The name of this element.
13324
- *
13325
- * {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.name View documentation}
13326
- * @example
13327
- ```
13328
- * game.player.gui.top.greeting.name == "greeting"
13329
- * ```
13330
- */
13334
+ * The name of this element.
13335
+ *
13336
+ * {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.name View documentation}
13337
+ * @example
13338
+ *
13339
+ * ```
13340
+ * game.player.gui.top.greeting.name == "greeting"
13341
+ * ```
13342
+ */
13331
13343
  name: string
13332
13344
  /**
13333
13345
  * The text displayed on this element. For frames, this is the "heading". For other elements, like buttons or labels, this is the content.
@@ -13360,7 +13372,7 @@ interface BaseGuiElement {
13360
13372
  *
13361
13373
  * {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.player_index View documentation}
13362
13374
  */
13363
- readonly player_index: uint
13375
+ readonly player_index: PlayerIndex
13364
13376
  tooltip: LocalisedString
13365
13377
  /**
13366
13378
  * The type of this GUI element.
@@ -13490,7 +13502,7 @@ interface ChooseElemButtonGuiElementMembers extends BaseGuiElement {
13490
13502
  locked: boolean
13491
13503
  }
13492
13504
 
13493
- type ChooseElemButtonGuiElement = ChooseElemButtonGuiElementMembers & GuiElementIndex
13505
+ type ChooseElemButtonGuiElement = ChooseElemButtonGuiElementMembers & GuiElementIndexer
13494
13506
 
13495
13507
  /**
13496
13508
  * @noSelf
@@ -13552,7 +13564,7 @@ interface DropDownGuiElementMembers extends BaseGuiElement {
13552
13564
  selected_index: uint
13553
13565
  }
13554
13566
 
13555
- type DropDownGuiElement = DropDownGuiElementMembers & GuiElementIndex
13567
+ type DropDownGuiElement = DropDownGuiElementMembers & GuiElementIndexer
13556
13568
 
13557
13569
  interface EmptyWidgetGuiElementMembers extends BaseGuiElement {
13558
13570
  /**
@@ -13580,7 +13592,7 @@ interface EmptyWidgetGuiElementMembers extends BaseGuiElement {
13580
13592
  drag_target: LuaGuiElement | undefined
13581
13593
  }
13582
13594
 
13583
- type EmptyWidgetGuiElement = EmptyWidgetGuiElementMembers & GuiElementIndex
13595
+ type EmptyWidgetGuiElement = EmptyWidgetGuiElementMembers & GuiElementIndexer
13584
13596
 
13585
13597
  interface EntityPreviewGuiElementMembers extends BaseGuiElement {
13586
13598
  /**
@@ -13597,7 +13609,7 @@ interface EntityPreviewGuiElementMembers extends BaseGuiElement {
13597
13609
  entity: LuaEntity | undefined
13598
13610
  }
13599
13611
 
13600
- type EntityPreviewGuiElement = EntityPreviewGuiElementMembers & GuiElementIndex
13612
+ type EntityPreviewGuiElement = EntityPreviewGuiElementMembers & GuiElementIndexer
13601
13613
 
13602
13614
  /**
13603
13615
  * @noSelf
@@ -13669,7 +13681,7 @@ interface ListBoxGuiElementMembers extends BaseGuiElement {
13669
13681
  selected_index: uint
13670
13682
  }
13671
13683
 
13672
- type ListBoxGuiElement = ListBoxGuiElementMembers & GuiElementIndex
13684
+ type ListBoxGuiElement = ListBoxGuiElementMembers & GuiElementIndexer
13673
13685
 
13674
13686
  /**
13675
13687
  * @noSelf
@@ -13741,7 +13753,7 @@ interface ScrollPaneGuiElementMembers extends BaseGuiElement {
13741
13753
  vertical_scroll_policy: "auto" | "never" | "always" | "auto-and-reserve-space" | "dont-show-but-allow-scrolling"
13742
13754
  }
13743
13755
 
13744
- type ScrollPaneGuiElement = ScrollPaneGuiElementMembers & GuiElementIndex
13756
+ type ScrollPaneGuiElement = ScrollPaneGuiElementMembers & GuiElementIndexer
13745
13757
 
13746
13758
  interface SpriteButtonGuiElementMembers extends BaseGuiElement {
13747
13759
  /**
@@ -13791,7 +13803,7 @@ interface SpriteButtonGuiElementMembers extends BaseGuiElement {
13791
13803
  set mouse_button_filter(value: MouseButtonFlags)
13792
13804
  }
13793
13805
 
13794
- type SpriteButtonGuiElement = SpriteButtonGuiElementMembers & GuiElementIndex
13806
+ type SpriteButtonGuiElement = SpriteButtonGuiElementMembers & GuiElementIndexer
13795
13807
 
13796
13808
  /**
13797
13809
  * @noSelf
@@ -13839,7 +13851,7 @@ interface TabbedPaneGuiElementMembers extends BaseGuiElement {
13839
13851
  readonly tabs: TabAndContent[]
13840
13852
  }
13841
13853
 
13842
- type TabbedPaneGuiElement = TabbedPaneGuiElementMembers & GuiElementIndex
13854
+ type TabbedPaneGuiElement = TabbedPaneGuiElementMembers & GuiElementIndexer
13843
13855
 
13844
13856
  /**
13845
13857
  * @noSelf
@@ -13953,7 +13965,7 @@ interface TextBoxGuiElementMembers extends BaseGuiElement {
13953
13965
  clear_and_focus_on_right_click: boolean
13954
13966
  }
13955
13967
 
13956
- type TextBoxGuiElement = TextBoxGuiElementMembers & GuiElementIndex
13968
+ type TextBoxGuiElement = TextBoxGuiElementMembers & GuiElementIndexer
13957
13969
 
13958
13970
  interface ButtonGuiElementMembers extends BaseGuiElement {
13959
13971
  /**
@@ -13971,7 +13983,7 @@ interface ButtonGuiElementMembers extends BaseGuiElement {
13971
13983
  set mouse_button_filter(value: MouseButtonFlags)
13972
13984
  }
13973
13985
 
13974
- type ButtonGuiElement = ButtonGuiElementMembers & GuiElementIndex
13986
+ type ButtonGuiElement = ButtonGuiElementMembers & GuiElementIndexer
13975
13987
 
13976
13988
  interface CameraGuiElementMembers extends BaseGuiElement {
13977
13989
  /**
@@ -13992,7 +14004,7 @@ interface CameraGuiElementMembers extends BaseGuiElement {
13992
14004
  *
13993
14005
  * {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.surface_index View documentation}
13994
14006
  */
13995
- surface_index: uint
14007
+ surface_index: SurfaceIndex
13996
14008
  /**
13997
14009
  * The zoom this camera or minimap is using.
13998
14010
  *
@@ -14007,7 +14019,7 @@ interface CameraGuiElementMembers extends BaseGuiElement {
14007
14019
  entity: LuaEntity | undefined
14008
14020
  }
14009
14021
 
14010
- type CameraGuiElement = CameraGuiElementMembers & GuiElementIndex
14022
+ type CameraGuiElement = CameraGuiElementMembers & GuiElementIndexer
14011
14023
 
14012
14024
  interface CheckboxGuiElementMembers extends BaseGuiElement {
14013
14025
  /**
@@ -14026,7 +14038,7 @@ interface CheckboxGuiElementMembers extends BaseGuiElement {
14026
14038
  state: boolean
14027
14039
  }
14028
14040
 
14029
- type CheckboxGuiElement = CheckboxGuiElementMembers & GuiElementIndex
14041
+ type CheckboxGuiElement = CheckboxGuiElementMembers & GuiElementIndexer
14030
14042
 
14031
14043
  interface FlowGuiElementMembers extends BaseGuiElement {
14032
14044
  /**
@@ -14062,7 +14074,7 @@ interface FlowGuiElementMembers extends BaseGuiElement {
14062
14074
  drag_target: LuaGuiElement | undefined
14063
14075
  }
14064
14076
 
14065
- type FlowGuiElement = FlowGuiElementMembers & GuiElementIndex
14077
+ type FlowGuiElement = FlowGuiElementMembers & GuiElementIndexer
14066
14078
 
14067
14079
  /**
14068
14080
  * @noSelf
@@ -14120,7 +14132,7 @@ interface FrameGuiElementMembers extends BaseGuiElement {
14120
14132
  drag_target: LuaGuiElement | undefined
14121
14133
  }
14122
14134
 
14123
- type FrameGuiElement = FrameGuiElementMembers & GuiElementIndex
14135
+ type FrameGuiElement = FrameGuiElementMembers & GuiElementIndexer
14124
14136
 
14125
14137
  interface LabelGuiElementMembers extends BaseGuiElement {
14126
14138
  /**
@@ -14148,7 +14160,7 @@ interface LabelGuiElementMembers extends BaseGuiElement {
14148
14160
  drag_target: LuaGuiElement | undefined
14149
14161
  }
14150
14162
 
14151
- type LabelGuiElement = LabelGuiElementMembers & GuiElementIndex
14163
+ type LabelGuiElement = LabelGuiElementMembers & GuiElementIndexer
14152
14164
 
14153
14165
  interface LineGuiElementMembers extends BaseGuiElement {
14154
14166
  /**
@@ -14167,7 +14179,7 @@ interface LineGuiElementMembers extends BaseGuiElement {
14167
14179
  readonly direction: "horizontal" | "vertical"
14168
14180
  }
14169
14181
 
14170
- type LineGuiElement = LineGuiElementMembers & GuiElementIndex
14182
+ type LineGuiElement = LineGuiElementMembers & GuiElementIndexer
14171
14183
 
14172
14184
  interface MinimapGuiElementMembers extends BaseGuiElement {
14173
14185
  /**
@@ -14188,7 +14200,7 @@ interface MinimapGuiElementMembers extends BaseGuiElement {
14188
14200
  *
14189
14201
  * {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.surface_index View documentation}
14190
14202
  */
14191
- surface_index: uint
14203
+ surface_index: SurfaceIndex
14192
14204
  /**
14193
14205
  * The zoom this camera or minimap is using.
14194
14206
  *
@@ -14217,7 +14229,7 @@ interface MinimapGuiElementMembers extends BaseGuiElement {
14217
14229
  entity: LuaEntity | undefined
14218
14230
  }
14219
14231
 
14220
- type MinimapGuiElement = MinimapGuiElementMembers & GuiElementIndex
14232
+ type MinimapGuiElement = MinimapGuiElementMembers & GuiElementIndexer
14221
14233
 
14222
14234
  interface ProgressBarGuiElementMembers extends BaseGuiElement {
14223
14235
  /**
@@ -14236,7 +14248,7 @@ interface ProgressBarGuiElementMembers extends BaseGuiElement {
14236
14248
  value: double
14237
14249
  }
14238
14250
 
14239
- type ProgressBarGuiElement = ProgressBarGuiElementMembers & GuiElementIndex
14251
+ type ProgressBarGuiElement = ProgressBarGuiElementMembers & GuiElementIndexer
14240
14252
 
14241
14253
  interface RadioButtonGuiElementMembers extends BaseGuiElement {
14242
14254
  /**
@@ -14255,7 +14267,7 @@ interface RadioButtonGuiElementMembers extends BaseGuiElement {
14255
14267
  state: boolean
14256
14268
  }
14257
14269
 
14258
- type RadioButtonGuiElement = RadioButtonGuiElementMembers & GuiElementIndex
14270
+ type RadioButtonGuiElement = RadioButtonGuiElementMembers & GuiElementIndexer
14259
14271
 
14260
14272
  /**
14261
14273
  * @noSelf
@@ -14333,7 +14345,7 @@ interface SliderGuiElementMembers extends BaseGuiElement {
14333
14345
  slider_value: double
14334
14346
  }
14335
14347
 
14336
- type SliderGuiElement = SliderGuiElementMembers & GuiElementIndex
14348
+ type SliderGuiElement = SliderGuiElementMembers & GuiElementIndexer
14337
14349
 
14338
14350
  interface SpriteGuiElementMembers extends BaseGuiElement {
14339
14351
  /**
@@ -14356,7 +14368,7 @@ interface SpriteGuiElementMembers extends BaseGuiElement {
14356
14368
  resize_to_sprite: boolean
14357
14369
  }
14358
14370
 
14359
- type SpriteGuiElement = SpriteGuiElementMembers & GuiElementIndex
14371
+ type SpriteGuiElement = SpriteGuiElementMembers & GuiElementIndexer
14360
14372
 
14361
14373
  interface SwitchGuiElementMembers extends BaseGuiElement {
14362
14374
  /**
@@ -14417,7 +14429,7 @@ interface SwitchGuiElementMembers extends BaseGuiElement {
14417
14429
  right_label_tooltip: LocalisedString
14418
14430
  }
14419
14431
 
14420
- type SwitchGuiElement = SwitchGuiElementMembers & GuiElementIndex
14432
+ type SwitchGuiElement = SwitchGuiElementMembers & GuiElementIndexer
14421
14433
 
14422
14434
  interface TabGuiElementMembers extends BaseGuiElement {
14423
14435
  /**
@@ -14436,7 +14448,7 @@ interface TabGuiElementMembers extends BaseGuiElement {
14436
14448
  badge_text: LocalisedString
14437
14449
  }
14438
14450
 
14439
- type TabGuiElement = TabGuiElementMembers & GuiElementIndex
14451
+ type TabGuiElement = TabGuiElementMembers & GuiElementIndexer
14440
14452
 
14441
14453
  interface TableGuiElementMembers extends BaseGuiElement {
14442
14454
  /**
@@ -14504,7 +14516,7 @@ interface TableGuiElementMembers extends BaseGuiElement {
14504
14516
  drag_target: LuaGuiElement | undefined
14505
14517
  }
14506
14518
 
14507
- type TableGuiElement = TableGuiElementMembers & GuiElementIndex
14519
+ type TableGuiElement = TableGuiElementMembers & GuiElementIndexer
14508
14520
 
14509
14521
  /**
14510
14522
  * @noSelf
@@ -14602,7 +14614,7 @@ interface TextFieldGuiElementMembers extends BaseGuiElement {
14602
14614
  clear_and_focus_on_right_click: boolean
14603
14615
  }
14604
14616
 
14605
- type TextFieldGuiElement = TextFieldGuiElementMembers & GuiElementIndex
14617
+ type TextFieldGuiElement = TextFieldGuiElementMembers & GuiElementIndexer
14606
14618
 
14607
14619
  type GuiElementMembers =
14608
14620
  | ChooseElemButtonGuiElementMembers
@@ -14684,7 +14696,7 @@ type GuiElementMembers =
14684
14696
  * tabbed_pane.add_tab(tab2, label2)
14685
14697
  * ```
14686
14698
  */
14687
- type LuaGuiElement = GuiElementMembers & GuiElementIndex
14699
+ type LuaGuiElement = GuiElementMembers & GuiElementIndexer
14688
14700
 
14689
14701
  /**
14690
14702
  * Prototype of a heat energy source.
@@ -15017,7 +15029,8 @@ interface LuaInventory extends ReadonlyArray<LuaItemStack> {
15017
15029
  * {@link https://lua-api.factorio.com/latest/LuaItemPrototype.html View documentation}
15018
15030
  * @noSelf
15019
15031
  * @example
15020
- ```
15032
+ *
15033
+ * ```
15021
15034
  * game.item_prototypes["iron-plate"]
15022
15035
  * ```
15023
15036
  */
@@ -19301,7 +19314,7 @@ interface LuaPlayer extends LuaControl {
19301
19314
  *
19302
19315
  * {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.index View documentation}
19303
19316
  */
19304
- readonly index: uint
19317
+ readonly index: PlayerIndex
19305
19318
  readonly gui: LuaGui
19306
19319
  /**
19307
19320
  * `true` if the player opened itself. I.e. if they opened the character or god-controller GUI.
@@ -21896,14 +21909,15 @@ interface LuaStyle {
21896
21909
  get color(): ColorTable
21897
21910
  set color(value: Color)
21898
21911
  /**
21899
- * Array containing the alignment for every column of this table element. Even though this property is marked as read-only, the alignment can be changed by indexing the LuaCustomTable, like so:
21900
- *
21901
- * {@link https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.column_alignments View documentation}
21902
- * @example
21903
- ```
21904
- * table_element.style.column_alignments[1] = "center"
21905
- * ```
21906
- */
21912
+ * Array containing the alignment for every column of this table element. Even though this property is marked as read-only, the alignment can be changed by indexing the LuaCustomTable, like so:
21913
+ *
21914
+ * {@link https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.column_alignments View documentation}
21915
+ * @example
21916
+ *
21917
+ * ```
21918
+ * table_element.style.column_alignments[1] = "center"
21919
+ * ```
21920
+ */
21907
21921
  readonly column_alignments: LuaCustomTable<uint, Alignment>
21908
21922
  /**
21909
21923
  * _Can only be used if this is LabelStyle_
@@ -22162,14 +22176,15 @@ interface BaseStyle {
22162
22176
  */
22163
22177
  vertically_squashable: boolean
22164
22178
  /**
22165
- * Array containing the alignment for every column of this table element. Even though this property is marked as read-only, the alignment can be changed by indexing the LuaCustomTable, like so:
22166
- *
22167
- * {@link https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.column_alignments View documentation}
22168
- * @example
22169
- ```
22170
- * table_element.style.column_alignments[1] = "center"
22171
- * ```
22172
- */
22179
+ * Array containing the alignment for every column of this table element. Even though this property is marked as read-only, the alignment can be changed by indexing the LuaCustomTable, like so:
22180
+ *
22181
+ * {@link https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.column_alignments View documentation}
22182
+ * @example
22183
+ *
22184
+ * ```
22185
+ * table_element.style.column_alignments[1] = "center"
22186
+ * ```
22187
+ */
22173
22188
  readonly column_alignments: LuaCustomTable<uint, Alignment>
22174
22189
  /**
22175
22190
  * Sets both minimal and maximal width to the given value.
@@ -22794,7 +22809,7 @@ interface ProgrammableSpeakerSurfaceCreateEntity extends BaseSurfaceCreateEntity
22794
22809
 
22795
22810
  interface CharacterCorpseSurfaceCreateEntity extends BaseSurfaceCreateEntity {
22796
22811
  readonly inventory_size?: uint
22797
- readonly player_index?: uint
22812
+ readonly player_index?: PlayerIndex
22798
22813
  }
22799
22814
 
22800
22815
  interface HighlightBoxSurfaceCreateEntity extends BaseSurfaceCreateEntity {
@@ -22867,15 +22882,16 @@ type SurfaceCreateEntity =
22867
22882
  */
22868
22883
  interface LuaSurface {
22869
22884
  /**
22870
- * Get the pollution for a given position.
22871
- *
22872
- * {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_pollution View documentation}
22873
- * @remarks Pollution is stored per chunk, so this will return the same value for all positions in one chunk.
22874
- * @example
22875
- ```
22876
- * game.surfaces[1].get_pollution({1,2})
22877
- * ```
22878
- */
22885
+ * Get the pollution for a given position.
22886
+ *
22887
+ * {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_pollution View documentation}
22888
+ * @remarks Pollution is stored per chunk, so this will return the same value for all positions in one chunk.
22889
+ * @example
22890
+ *
22891
+ * ```
22892
+ * game.surfaces[1].get_pollution({1,2})
22893
+ * ```
22894
+ */
22879
22895
  get_pollution(position: MapPosition): double
22880
22896
  /**
22881
22897
  * Check for collisions with terrain or other entities.
@@ -22936,17 +22952,18 @@ interface LuaSurface {
22936
22952
  readonly force?: ForceIdentification
22937
22953
  }): boolean
22938
22954
  /**
22939
- * Find a specific entity at a specific position.
22940
- *
22941
- * {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entity View documentation}
22942
- * @param entity Entity to look for.
22943
- * @param position Coordinates to look at.
22944
- * @returns `nil` if no such entity is found.
22945
- * @example
22946
- ```
22947
- * game.player.selected.surface.find_entity('filter-inserter', {0,0})
22948
- * ```
22949
- */
22955
+ * Find a specific entity at a specific position.
22956
+ *
22957
+ * {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entity View documentation}
22958
+ * @param entity Entity to look for.
22959
+ * @param position Coordinates to look at.
22960
+ * @returns `nil` if no such entity is found.
22961
+ * @example
22962
+ *
22963
+ * ```
22964
+ * game.player.selected.surface.find_entity('filter-inserter', {0,0})
22965
+ * ```
22966
+ */
22950
22967
  find_entity(entity: string, position: MapPosition): LuaEntity | undefined
22951
22968
  /**
22952
22969
  * Find entities in a given area.
@@ -22962,23 +22979,24 @@ interface LuaSurface {
22962
22979
  */
22963
22980
  find_entities(area?: BoundingBox): LuaEntity[]
22964
22981
  /**
22965
- * Find all entities of the given type or name in the given area.
22966
- *
22967
- * 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.
22968
- *
22969
- * 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.
22970
- *
22971
- * {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered View documentation}
22972
- * @example
22973
- ```
22974
- * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, type = "resource"} -- gets all resources in the rectangle
22975
- * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, name = "iron-ore"} -- gets all iron ores in the rectangle
22976
- * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, name = {"iron-ore", "copper-ore"}} -- gets all iron ore and copper ore in the rectangle
22977
- * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, force = "player"} -- gets player owned entities in the rectangle
22978
- * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, limit = 5} -- gets the first 5 entities in the rectangle
22979
- * game.surfaces[1].find_entities_filtered{position = {0, 0}, radius = 10} -- gets all entities within 10 tiles of the position [0,0].
22980
- * ```
22981
- */
22982
+ * Find all entities of the given type or name in the given area.
22983
+ *
22984
+ * 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.
22985
+ *
22986
+ * 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.
22987
+ *
22988
+ * {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_entities_filtered View documentation}
22989
+ * @example
22990
+ *
22991
+ * ```
22992
+ * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, type = "resource"} -- gets all resources in the rectangle
22993
+ * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, name = "iron-ore"} -- gets all iron ores in the rectangle
22994
+ * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, name = {"iron-ore", "copper-ore"}} -- gets all iron ore and copper ore in the rectangle
22995
+ * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, force = "player"} -- gets player owned entities in the rectangle
22996
+ * game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, limit = 5} -- gets the first 5 entities in the rectangle
22997
+ * game.surfaces[1].find_entities_filtered{position = {0, 0}, radius = 10} -- gets all entities within 10 tiles of the position [0,0].
22998
+ * ```
22999
+ */
22982
23000
  find_entities_filtered(params: {
22983
23001
  readonly area?: BoundingBox
22984
23002
  /**
@@ -23241,50 +23259,52 @@ interface LuaSurface {
23241
23259
  readonly unit_search_distance?: uint
23242
23260
  }): uint
23243
23261
  /**
23244
- * Create an entity on this surface.
23245
- *
23246
- * Other attributes may be specified depending on the type of entity:
23247
- *
23248
- * **Raised events:**
23249
- * - {@link ScriptRaisedBuiltEvent script_raised_built}? _instantly_ Raised if the `raise_built` flag was set and the entity was successfully created.
23250
- *
23251
- *
23252
- * {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity View documentation}
23253
- * @returns The created entity or `nil` if the creation failed.
23254
- * @example
23255
- ```
23256
- * asm = game.surfaces[1].create_entity{name = "assembling-machine-1", position = {15, 3}, force = game.forces.player, recipe = "iron-stick"}
23257
- * ```
23258
- * @example Creates a filter inserter with circuit conditions and a filter
23259
- *
23260
- * ```
23261
- * game.surfaces[1].create_entity{
23262
- * name = "filter-inserter", position = {20, 15}, force = game.player.force,
23263
- * conditions = {red = {name = "wood", count = 3, operator = ">"},
23264
- * green = {name = "iron-ore", count = 1, operator = "<"},
23265
- * logistics = {name = "wood", count = 3, operator = "="}},
23266
- * filters = {{index = 1, name = "iron-ore"}}
23267
- * }
23268
- * ```
23269
- * @example Creates a requester chest already set to request 128 iron plates.
23270
- *
23271
- * ```
23272
- * game.surfaces[1].create_entity{
23273
- * name = "logistic-chest-requester", position = {game.player.position.x+3, game.player.position.y},
23274
- * force = game.player.force, request_filters = {{index = 1, name = "iron-plate", count = 128}}
23275
- * }
23276
- * ```
23277
- * @example
23278
- ```
23279
- * game.surfaces[1].create_entity{name = "big-biter", position = {15, 3}, force = game.forces.player} -- Friendly biter
23280
- * game.surfaces[1].create_entity{name = "medium-biter", position = {15, 3}, force = game.forces.enemy} -- Enemy biter
23281
- * ```
23282
- * @example Creates a basic inserter at the player's location facing north
23283
- *
23284
- * ```
23285
- * game.surfaces[1].create_entity{name = "inserter", position = game.player.position, direction = defines.direction.north}
23286
- * ```
23287
- */
23262
+ * Create an entity on this surface.
23263
+ *
23264
+ * Other attributes may be specified depending on the type of entity:
23265
+ *
23266
+ * **Raised events:**
23267
+ * - {@link ScriptRaisedBuiltEvent script_raised_built}? _instantly_ Raised if the `raise_built` flag was set and the entity was successfully created.
23268
+ *
23269
+ *
23270
+ * {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.create_entity View documentation}
23271
+ * @returns The created entity or `nil` if the creation failed.
23272
+ * @example
23273
+ *
23274
+ * ```
23275
+ * asm = game.surfaces[1].create_entity{name = "assembling-machine-1", position = {15, 3}, force = game.forces.player, recipe = "iron-stick"}
23276
+ * ```
23277
+ * @example Creates a filter inserter with circuit conditions and a filter
23278
+ *
23279
+ * ```
23280
+ * game.surfaces[1].create_entity{
23281
+ * name = "filter-inserter", position = {20, 15}, force = game.player.force,
23282
+ * conditions = {red = {name = "wood", count = 3, operator = ">"},
23283
+ * green = {name = "iron-ore", count = 1, operator = "<"},
23284
+ * logistics = {name = "wood", count = 3, operator = "="}},
23285
+ * filters = {{index = 1, name = "iron-ore"}}
23286
+ * }
23287
+ * ```
23288
+ * @example Creates a requester chest already set to request 128 iron plates.
23289
+ *
23290
+ * ```
23291
+ * game.surfaces[1].create_entity{
23292
+ * name = "logistic-chest-requester", position = {game.player.position.x+3, game.player.position.y},
23293
+ * force = game.player.force, request_filters = {{index = 1, name = "iron-plate", count = 128}}
23294
+ * }
23295
+ * ```
23296
+ * @example
23297
+ *
23298
+ * ```
23299
+ * game.surfaces[1].create_entity{name = "big-biter", position = {15, 3}, force = game.forces.player} -- Friendly biter
23300
+ * game.surfaces[1].create_entity{name = "medium-biter", position = {15, 3}, force = game.forces.enemy} -- Enemy biter
23301
+ * ```
23302
+ * @example Creates a basic inserter at the player's location facing north
23303
+ *
23304
+ * ```
23305
+ * game.surfaces[1].create_entity{name = "inserter", position = game.player.position, direction = defines.direction.north}
23306
+ * ```
23307
+ */
23288
23308
  create_entity(params: SurfaceCreateEntity): LuaEntity | undefined
23289
23309
  create_trivial_smoke(params: {
23290
23310
  /**
@@ -23646,17 +23666,18 @@ interface LuaSurface {
23646
23666
  readonly decoratives: readonly Decorative[]
23647
23667
  }): void
23648
23668
  /**
23649
- * Find decoratives of a given name in a given area.
23650
- *
23651
- * 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.
23652
- *
23653
- * {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_decoratives_filtered View documentation}
23654
- * @example
23655
- ```
23656
- * game.surfaces[1].find_decoratives_filtered{area = {{-10, -10}, {10, 10}}, name = "sand-decal"} -- gets all sand-decals in the rectangle
23657
- * game.surfaces[1].find_decoratives_filtered{area = {{-10, -10}, {10, 10}}, limit = 5} -- gets the first 5 decoratives in the rectangle
23658
- * ```
23659
- */
23669
+ * Find decoratives of a given name in a given area.
23670
+ *
23671
+ * 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.
23672
+ *
23673
+ * {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_decoratives_filtered View documentation}
23674
+ * @example
23675
+ *
23676
+ * ```
23677
+ * game.surfaces[1].find_decoratives_filtered{area = {{-10, -10}, {10, 10}}, name = "sand-decal"} -- gets all sand-decals in the rectangle
23678
+ * game.surfaces[1].find_decoratives_filtered{area = {{-10, -10}, {10, 10}}, limit = 5} -- gets the first 5 decoratives in the rectangle
23679
+ * ```
23680
+ */
23660
23681
  find_decoratives_filtered(params: {
23661
23682
  readonly area?: BoundingBox
23662
23683
  readonly position?: TilePosition
@@ -23839,7 +23860,7 @@ interface LuaSurface {
23839
23860
  */
23840
23861
  clear(ignore_characters?: boolean): void
23841
23862
  /**
23842
- * Generates a path with the specified constraints (as an array of {@link PathfinderWaypoint PathfinderWaypoints}) 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.
23863
+ * Generates a path with the specified constraints (as an array of {@link PathfinderWaypoint PathfinderWaypoints}) using the unit pathfinding algorithm. This path can be used to emulate pathing behavior by script for non-unit entities, such as vehicles. If you want to command actual units (such as biters or spitters) to move, use {@link LuaEntity#set_command LuaEntity::set_command} instead.
23843
23864
  *
23844
23865
  * The resulting path is ultimately returned asynchronously via {@link OnScriptPathRequestFinishedEvent on_script_path_request_finished}.
23845
23866
  *
@@ -24055,7 +24076,7 @@ interface LuaSurface {
24055
24076
  *
24056
24077
  * {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.index View documentation}
24057
24078
  */
24058
- readonly index: uint
24079
+ readonly index: SurfaceIndex
24059
24080
  /**
24060
24081
  * The generation settings for this surface. These can be modified to after surface generation, but note that this will not retroactively update the surface. To manually adjust it, {@link LuaSurface#regenerate_entity LuaSurface::regenerate_entity}, {@link LuaSurface#regenerate_decorative LuaSurface::regenerate_decorative} and {@link LuaSurface#delete_chunk LuaSurface::delete_chunk} can be used.
24061
24082
  *