typed-factorio 1.15.0 → 1.16.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typed-factorio",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "description": "Featureful typescript definitions for the the Factorio modding lua api.",
5
5
  "keywords": [
6
6
  "factorio",
@@ -33,30 +33,28 @@
33
33
  "typescript-to-lua": "^1.6.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@types/jest": "^29.5.1",
37
- "@types/node": "^20.2.3",
38
- "@types/prettier": "^2.7.2",
39
- "@typescript-eslint/eslint-plugin": "^5.59.7",
40
- "@typescript-eslint/parser": "^5.59.7",
36
+ "@types/jest": "^29.5.2",
37
+ "@types/node": "^20.3.1",
38
+ "@types/prettier": "^2.7.3",
39
+ "@typescript-eslint/eslint-plugin": "^5.59.11",
40
+ "@typescript-eslint/parser": "^5.59.11",
41
41
  "array.prototype.flatmap": "^1.3.1",
42
42
  "chalk": "^5.2.0",
43
- "eslint": "~8.41.0",
43
+ "eslint": "~8.42.0",
44
44
  "eslint-config-prettier": "^8.8.0",
45
- "eslint-config-standard": "^17.0.0",
46
45
  "eslint-import-resolver-typescript": "^3.5.5",
46
+ "eslint-plugin-eslint-comments": "latest",
47
47
  "eslint-plugin-import": "^2.27.5",
48
- "eslint-plugin-n": "^16.0.0",
49
48
  "eslint-plugin-node": "^11.1.0",
50
49
  "eslint-plugin-prettier": "^4.2.1",
51
- "eslint-plugin-promise": "^6.1.1",
52
50
  "jest": "^29.5.0",
53
51
  "lua-types": "^2.13.1",
54
52
  "prettier": "^2.8.8",
55
53
  "rimraf": "^5.0.1",
56
54
  "ts-jest": "^29.1.0",
57
55
  "ts-node": "^10.9.1",
58
- "typescript": "~5.0.4",
59
- "typescript-to-lua": "^1.15.1"
56
+ "typescript": "~5.1.3",
57
+ "typescript-to-lua": "^1.16.2"
60
58
  },
61
59
  "packageManager": "yarn@3.2.3"
62
60
  }
@@ -15,7 +15,7 @@ type float = number
15
15
  type double = number
16
16
 
17
17
  /**
18
- * 32-bit signed integer. Possible values are -2,147,483,648 to 2,147,483,647.
18
+ * 32-bit signed integer. Possible values are -2'147'483'648 to 2'147'483'647.
19
19
  * @see {@link https://lua-api.factorio.com/latest/Builtin-Types.html#int Online documentation}
20
20
  */
21
21
  type int = number
@@ -27,7 +27,7 @@ type int = number
27
27
  type int8 = number
28
28
 
29
29
  /**
30
- * 32-bit unsigned integer. Possible values are 0 to 4,294,967,295.
30
+ * 32-bit unsigned integer. Possible values are 0 to 4'294'967'295.
31
31
  * @see {@link https://lua-api.factorio.com/latest/Builtin-Types.html#uint Online documentation}
32
32
  */
33
33
  type uint = number
@@ -45,7 +45,7 @@ type uint8 = number
45
45
  type uint16 = number
46
46
 
47
47
  /**
48
- * 64-bit unsigned integer. Possible values are 0 to 18,446,744,073,709,551,615.
48
+ * 64-bit unsigned integer. Possible values are 0 to 18'446'744'073'709'551'615.
49
49
  * @see {@link https://lua-api.factorio.com/latest/Builtin-Types.html#uint64 Online documentation}
50
50
  */
51
51
  type uint64 = number
@@ -1760,6 +1760,16 @@ interface LuaCustomInputPrototype {
1760
1760
  * @see {@link https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.alternative_key_sequence Online documentation}
1761
1761
  */
1762
1762
  readonly alternative_key_sequence?: string
1763
+ /**
1764
+ * The default controller key sequence for this custom input, if any
1765
+ * @see {@link https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.controller_key_sequence Online documentation}
1766
+ */
1767
+ readonly controller_key_sequence?: string
1768
+ /**
1769
+ * The default controller alternative key sequence for this custom input, if any
1770
+ * @see {@link https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.controller_alternative_key_sequence Online documentation}
1771
+ */
1772
+ readonly controller_alternative_key_sequence?: string
1763
1773
  /**
1764
1774
  * The linked game control name, if any.
1765
1775
  * @see {@link https://lua-api.factorio.com/latest/LuaCustomInputPrototype.html#LuaCustomInputPrototype.linked_game_control Online documentation}
@@ -3350,6 +3360,9 @@ interface LuaEntity extends LuaControl {
3350
3360
  fluidbox: LuaFluidBox
3351
3361
  /**
3352
3362
  * The backer name assigned to this entity. Entities that support backer names are labs, locomotives, radars, roboports, and train stops. `nil` if this entity doesn't support backer names.
3363
+ *
3364
+ * **Raised events:**
3365
+ * - {@link OnEntityRenamedEvent on_entity_renamed} _instantly_
3353
3366
  * @remarks While train stops get the name of a backer when placed down, players can rename them if they want to. In this case, `backer_name` returns the player-given name of the entity.
3354
3367
  * @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.backer_name Online documentation}
3355
3368
  */
@@ -3365,7 +3378,7 @@ interface LuaEntity extends LuaControl {
3365
3378
  /**
3366
3379
  * The ticks left before a ghost, combat robot, highlight box or smoke with trigger is destroyed.
3367
3380
  *
3368
- * - for ghosts set to uint32 max (4,294,967,295) to never expire.
3381
+ * - for ghosts set to uint32 max (4'294'967'295) to never expire.
3369
3382
  * - for ghosts Cannot be set higher than {@link LuaForce#ghost_time_to_live LuaForce::ghost_time_to_live} of the entity's force.
3370
3383
  * @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.time_to_live Online documentation}
3371
3384
  */
@@ -4862,6 +4875,9 @@ interface BaseEntity extends LuaControl {
4862
4875
  fluidbox: LuaFluidBox
4863
4876
  /**
4864
4877
  * The backer name assigned to this entity. Entities that support backer names are labs, locomotives, radars, roboports, and train stops. `nil` if this entity doesn't support backer names.
4878
+ *
4879
+ * **Raised events:**
4880
+ * - {@link OnEntityRenamedEvent on_entity_renamed} _instantly_
4865
4881
  * @remarks While train stops get the name of a backer when placed down, players can rename them if they want to. In this case, `backer_name` returns the player-given name of the entity.
4866
4882
  * @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.backer_name Online documentation}
4867
4883
  */
@@ -4877,7 +4893,7 @@ interface BaseEntity extends LuaControl {
4877
4893
  /**
4878
4894
  * The ticks left before a ghost, combat robot, highlight box or smoke with trigger is destroyed.
4879
4895
  *
4880
- * - for ghosts set to uint32 max (4,294,967,295) to never expire.
4896
+ * - for ghosts set to uint32 max (4'294'967'295) to never expire.
4881
4897
  * - for ghosts Cannot be set higher than {@link LuaForce#ghost_time_to_live LuaForce::ghost_time_to_live} of the entity's force.
4882
4898
  * @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.time_to_live Online documentation}
4883
4899
  */
@@ -12035,7 +12051,7 @@ interface LuaGameScript {
12035
12051
  * @param name Name of the new surface.
12036
12052
  * @param settings Map generation settings.
12037
12053
  * @returns The surface that was just created.
12038
- * @remarks The game currently supports a maximum of 4,294,967,295 surfaces, including the default surface.<br>Surface names must be unique.
12054
+ * @remarks The game currently supports a maximum of 4'294'967'295 surfaces, including the default surface.<br>Surface names must be unique.
12039
12055
  * @see {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.create_surface Online documentation}
12040
12056
  */
12041
12057
  create_surface(name: string, settings?: MapGenSettingsWrite): LuaSurface
@@ -12454,7 +12470,7 @@ interface LuaGameScript {
12454
12470
  */
12455
12471
  readonly difficulty: defines.difficulty
12456
12472
  /**
12457
- * Get a table of all the forces that currently exist. This sparse table allows you to find forces by indexing it with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the array part of the table. Iterating with `ipairs()` will not work at all.
12473
+ * Get a table of all the forces that currently exist. This sparse table allows you to find forces by indexing it with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the hash part of the table. Iterating with `ipairs()` will not work at all.
12458
12474
  * @see {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.forces Online documentation}
12459
12475
  */
12460
12476
  readonly forces: LuaCustomTable<uint | string, LuaForce>
@@ -12625,8 +12641,9 @@ interface LuaGameScript {
12625
12641
  */
12626
12642
  readonly tick: uint
12627
12643
  /**
12628
- * The number of ticks since this game was 'created'. A game is 'created' either by using "new game" or "new game from scenario".
12629
- * @remarks This differs over {@link LuaGameScript#tick LuaGameScript::tick} in that making a game from a scenario always starts with ticks_played value at 0 even if the scenario has its own level data where the {@link LuaGameScript#tick LuaGameScript::tick} is > 0.<br>This value has no relation with {@link LuaGameScript#tick LuaGameScript::tick} and can be completely different values.
12644
+ * The number of ticks since this game was created using either "new game" or "new game from scenario". Notably, this number progresses even when the game is {@link LuaGameScript#tick_paused tick_paused}.
12645
+ *
12646
+ * This differs from {@link LuaGameScript#tick LuaGameScript::tick} in that creating a game from a scenario always starts with this value at `0`, even if the scenario has its own level data where the `tick` has progressed past `0`.
12630
12647
  * @see {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.ticks_played Online documentation}
12631
12648
  */
12632
12649
  readonly ticks_played: uint
@@ -12657,7 +12674,7 @@ interface LuaGameScript {
12657
12674
  */
12658
12675
  speed: float
12659
12676
  /**
12660
- * Get a table of all the surfaces that currently exist. This sparse table allows you to find surfaces by indexing it with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the array part of the table. Iterating with `ipairs()` will not work at all.
12677
+ * Get a table of all the surfaces that currently exist. This sparse table allows you to find surfaces by indexing it with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the hash part of the table. Iterating with `ipairs()` will not work at all.
12661
12678
  * @see {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.surfaces Online documentation}
12662
12679
  */
12663
12680
  readonly surfaces: LuaCustomTable<SurfaceIndex | string, LuaSurface>
@@ -12974,6 +12991,14 @@ interface BaseGuiSpec {
12974
12991
  * Where to position the child element when in the `relative` element.
12975
12992
  */
12976
12993
  readonly anchor?: GuiAnchor
12994
+ /**
12995
+ * How the element should interact with game controllers. Defaults to {@link defines.game_controller_interaction.normal}.
12996
+ */
12997
+ readonly game_controller_interaction?: defines.game_controller_interaction
12998
+ /**
12999
+ * Whether this element will raise {@link OnGuiHoverEvent on_gui_hover} and {@link OnGuiLeaveEvent on_gui_leave}. Defaults to `false`.
13000
+ */
13001
+ readonly raise_hover_events?: boolean
12977
13002
  }
12978
13003
 
12979
13004
  /**
@@ -13674,6 +13699,11 @@ interface BaseGuiElement {
13674
13699
  */
13675
13700
  get location(): GuiLocation | nil
13676
13701
  set location(value: GuiLocation | GuiLocationArray | nil)
13702
+ /**
13703
+ * How this element should interact with game controllers.
13704
+ * @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.game_controller_interaction Online documentation}
13705
+ */
13706
+ game_controller_interaction: defines.game_controller_interaction
13677
13707
  /**
13678
13708
  * Whether this GUI element is enabled. Disabled GUI elements don't trigger events when clicked.
13679
13709
  * @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.enabled Online documentation}
@@ -14074,7 +14104,7 @@ interface SpriteButtonGuiElementMembers extends BaseGuiElement {
14074
14104
  */
14075
14105
  auto_toggle: boolean
14076
14106
  /**
14077
- * Whether this button is currently toggled.
14107
+ * Whether this button is currently toggled. When a button is toggled, it will use the `selected_graphical_set` and `selected_font_color` defined in its style.
14078
14108
  *
14079
14109
  * _Can only be used if this is button or sprite-button_
14080
14110
  * @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.toggled Online documentation}
@@ -14253,7 +14283,7 @@ interface ButtonGuiElementMembers extends BaseGuiElement {
14253
14283
  */
14254
14284
  auto_toggle: boolean
14255
14285
  /**
14256
- * Whether this button is currently toggled.
14286
+ * Whether this button is currently toggled. When a button is toggled, it will use the `selected_graphical_set` and `selected_font_color` defined in its style.
14257
14287
  *
14258
14288
  * _Can only be used if this is button or sprite-button_
14259
14289
  * @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.toggled Online documentation}
@@ -18517,6 +18547,11 @@ interface LuaMiningDrillControlBehavior extends LuaGenericOnOffControlBehavior {
18517
18547
  * @noSelf
18518
18548
  */
18519
18549
  interface LuaModSettingPrototype {
18550
+ /**
18551
+ * Type of this prototype.
18552
+ * @see {@link https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.type Online documentation}
18553
+ */
18554
+ readonly type: string
18520
18555
  /**
18521
18556
  * Name of this prototype.
18522
18557
  * @see {@link https://lua-api.factorio.com/latest/LuaModSettingPrototype.html#LuaModSettingPrototype.name Online documentation}
@@ -19531,6 +19566,11 @@ interface LuaPlayer extends LuaControl {
19531
19566
  * @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.render_mode Online documentation}
19532
19567
  */
19533
19568
  readonly render_mode: defines.render_mode
19569
+ /**
19570
+ * The input method of the player, mouse and keyboard or game controller
19571
+ * @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.input_method Online documentation}
19572
+ */
19573
+ readonly input_method: defines.input_method
19534
19574
  /**
19535
19575
  * If `true`, zoom-to-world noise effect will be disabled and environmental sounds will be based on zoom-to-world view instead of position of player's character.
19536
19576
  * @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.spectator Online documentation}
@@ -22904,7 +22944,7 @@ interface LuaSurface {
22904
22944
  readonly force?: ForceIdentification
22905
22945
  }): boolean
22906
22946
  /**
22907
- * Find a specific entity at a specific position.
22947
+ * Find an entity of the given type at the given position. This checks both the exact position and the bounding box of the entity.
22908
22948
  * @param entity Entity to look for.
22909
22949
  * @param position Coordinates to look at.
22910
22950
  * @returns `nil` if no such entity is found.
@@ -23425,6 +23465,16 @@ interface LuaSurface {
23425
23465
  position: MapPosition | MapPositionArray,
23426
23466
  force: ForceIdentification
23427
23467
  ): LuaLogisticNetwork | nil
23468
+ /**
23469
+ * Find the logistic network with a cell closest to a given position.
23470
+ * @param force Force the logistic network should belong to.
23471
+ * @returns The found network or `nil` if no such network was found.
23472
+ * @see {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.find_closest_logistic_network_by_position Online documentation}
23473
+ */
23474
+ find_closest_logistic_network_by_position(
23475
+ position: MapPosition | MapPositionArray,
23476
+ force: ForceIdentification
23477
+ ): LuaLogisticNetwork | nil
23428
23478
  /**
23429
23479
  * Finds all of the logistics networks whose construction area intersects with the given position.
23430
23480
  * @param force Force the logistic networks should belong to.
@@ -23568,11 +23618,18 @@ interface LuaSurface {
23568
23618
  * Gets all tiles of the given types that are connected horizontally or vertically to the given tile position including the given tile position.
23569
23619
  * @param position The tile position to start at.
23570
23620
  * @param tiles The tiles to search for.
23621
+ * @param include_diagonal Include tiles that are connected diagonally.
23622
+ * @param area The area to find connected tiles in. If provided the start position must be in this area.
23571
23623
  * @returns The resulting set of tiles.
23572
23624
  * @remarks This won't find tiles in non-generated chunks.
23573
23625
  * @see {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.get_connected_tiles Online documentation}
23574
23626
  */
23575
- get_connected_tiles(position: TilePosition | TilePositionArray, tiles: readonly string[]): TilePosition[]
23627
+ get_connected_tiles(
23628
+ position: TilePosition | TilePositionArray,
23629
+ tiles: readonly string[],
23630
+ include_diagonal?: boolean,
23631
+ area?: BoundingBoxWrite | BoundingBoxArray
23632
+ ): TilePosition[]
23576
23633
  /**
23577
23634
  * **Raised events:**
23578
23635
  * - {@link OnPreChunkDeletedEvent on_pre_chunk_deleted} _future_tick_
@@ -800,26 +800,26 @@ interface EnemyExpansionMapSettings {
800
800
  */
801
801
  readonly settler_group_max_size: uint
802
802
  /**
803
- * The minimum time between expansions in ticks. The actual cooldown is adjusted to the current evolution levels. Defaults to `4*3,600=14,400` ticks.
803
+ * The minimum time between expansions in ticks. The actual cooldown is adjusted to the current evolution levels. Defaults to `4*3'600=14'400` ticks.
804
804
  */
805
805
  readonly min_expansion_cooldown: uint
806
806
  /**
807
- * The maximum time between expansions in ticks. The actual cooldown is adjusted to the current evolution levels. Defaults to `60*3,600=216,000` ticks.
807
+ * The maximum time between expansions in ticks. The actual cooldown is adjusted to the current evolution levels. Defaults to `60*3'600=216'000` ticks.
808
808
  */
809
809
  readonly max_expansion_cooldown: uint
810
810
  }
811
811
 
812
812
  interface UnitGroupMapSettings {
813
813
  /**
814
- * The minimum amount of time in ticks a group will spend gathering before setting off. The actual time is a random time between the minimum and maximum times. Defaults to `3,600` ticks.
814
+ * The minimum amount of time in ticks a group will spend gathering before setting off. The actual time is a random time between the minimum and maximum times. Defaults to `3'600` ticks.
815
815
  */
816
816
  readonly min_group_gathering_time: uint
817
817
  /**
818
- * The maximum amount of time in ticks a group will spend gathering before setting off. The actual time is a random time between the minimum and maximum times. Defaults to `10*3,600=36,000` ticks.
818
+ * The maximum amount of time in ticks a group will spend gathering before setting off. The actual time is a random time between the minimum and maximum times. Defaults to `10*3'600=36'000` ticks.
819
819
  */
820
820
  readonly max_group_gathering_time: uint
821
821
  /**
822
- * After gathering has finished, the group is allowed to wait this long in ticks for delayed members. New members are not accepted anymore however. Defaults to `2*3,600=7,200` ticks.
822
+ * After gathering has finished, the group is allowed to wait this long in ticks for delayed members. New members are not accepted anymore however. Defaults to `2*3'600=7'200` ticks.
823
823
  */
824
824
  readonly max_wait_time_for_late_members: uint
825
825
  /**
@@ -889,11 +889,11 @@ interface PathFinderMapSettings {
889
889
  */
890
890
  readonly goal_pressure_ratio: double
891
891
  /**
892
- * The maximum number of nodes that are expanded per tick. Defaults to `1,000`.
892
+ * The maximum number of nodes that are expanded per tick. Defaults to `1'000`.
893
893
  */
894
894
  readonly max_steps_worked_per_tick: double
895
895
  /**
896
- * The maximum amount of work each pathfinding job is allowed to do per tick. Defaults to `8,000`.
896
+ * The maximum amount of work each pathfinding job is allowed to do per tick. Defaults to `8'000`.
897
897
  */
898
898
  readonly max_work_done_per_tick: uint
899
899
  /**
@@ -1341,6 +1341,10 @@ declare namespace defines {
1341
1341
  * Event type: {@link OnGuiLeaveEvent}
1342
1342
  */
1343
1343
  const on_gui_leave: EventId<OnGuiLeaveEvent>
1344
+ /**
1345
+ * Event type: {@link OnEntityColorChangedEvent}
1346
+ */
1347
+ const on_entity_color_changed: EventId<OnEntityColorChangedEvent>
1344
1348
  /**
1345
1349
  * Event type: {@link OnCutsceneStartedEvent}
1346
1350
  */
@@ -1349,6 +1353,10 @@ declare namespace defines {
1349
1353
  * Event type: {@link OnCutsceneFinishedEvent}
1350
1354
  */
1351
1355
  const on_cutscene_finished: EventId<OnCutsceneFinishedEvent>
1356
+ /**
1357
+ * Event type: {@link OnPlayerInputMethodChangedEvent}
1358
+ */
1359
+ const on_player_input_method_changed: EventId<OnPlayerInputMethodChangedEvent>
1352
1360
  }
1353
1361
  /**
1354
1362
  * See the {@linkplain https://lua-api.factorio.com/latest/events.html events page} for more info on what events contain and when they get raised.
@@ -1365,6 +1373,23 @@ declare namespace defines {
1365
1373
  two_hundred_fifty_hours,
1366
1374
  one_thousand_hours,
1367
1375
  }
1376
+ enum game_controller_interaction {
1377
+ /**
1378
+ * Game controller will always hover this element regardless of type or state.
1379
+ * @see {@link https://lua-api.factorio.com/latest/defines.html#defines.game_controller_interaction.always Online documentation}
1380
+ */
1381
+ always,
1382
+ /**
1383
+ * Hover according to the element type and implementation.
1384
+ * @see {@link https://lua-api.factorio.com/latest/defines.html#defines.game_controller_interaction.never Online documentation}
1385
+ */
1386
+ never,
1387
+ /**
1388
+ * Never hover this element with a game controller.
1389
+ * @see {@link https://lua-api.factorio.com/latest/defines.html#defines.game_controller_interaction.normal Online documentation}
1390
+ */
1391
+ normal,
1392
+ }
1368
1393
  enum group_state {
1369
1394
  gathering,
1370
1395
  moving,
@@ -19,6 +19,10 @@ interface CustomInputEvent extends EventData {
19
19
  * The mouse cursor position when the custom input was activated.
20
20
  */
21
21
  readonly cursor_position: MapPosition
22
+ /**
23
+ * The mouse cursor display location when the custom input was activated.
24
+ */
25
+ readonly cursor_display_location: GuiLocation
22
26
  /**
23
27
  * Information about the prototype that is selected when the custom input is used. Needs to be enabled on the custom input's prototype. `nil` if none is selected.
24
28
  */
@@ -548,6 +552,25 @@ interface OnEntityClonedEvent extends EventData {
548
552
  readonly tick: uint
549
553
  }
550
554
 
555
+ /**
556
+ * Called after an entity has been recolored either by the player or through script.
557
+ * @see {@link https://lua-api.factorio.com/latest/events.html#on_entity_color_changed Online documentation}
558
+ */
559
+ interface OnEntityColorChangedEvent extends EventData {
560
+ /**
561
+ * The entity that was recolored.
562
+ */
563
+ readonly entity: LuaEntity
564
+ /**
565
+ * Identifier of the event
566
+ */
567
+ readonly name: typeof defines.events.on_entity_color_changed
568
+ /**
569
+ * Tick the event was generated.
570
+ */
571
+ readonly tick: uint
572
+ }
573
+
551
574
  /**
552
575
  * Called when an entity is damaged. Can be filtered using {@link LuaEntityDamagedEventFilter}.
553
576
  * @remarks This is not called when an entities health is set directly by another mod.
@@ -983,6 +1006,10 @@ interface OnGuiClickEvent extends EventData {
983
1006
  * The mouse button used if any.
984
1007
  */
985
1008
  readonly button: defines.mouse_button_type
1009
+ /**
1010
+ * The display location of the player's cursor.
1011
+ */
1012
+ readonly cursor_display_location: GuiLocation
986
1013
  /**
987
1014
  * If alt was pressed.
988
1015
  */
@@ -2301,6 +2328,26 @@ interface OnPlayerGunInventoryChangedEvent extends EventData {
2301
2328
  readonly tick: uint
2302
2329
  }
2303
2330
 
2331
+ /**
2332
+ * Called when a player's input method changes.
2333
+ * @remarks See {@link LuaPlayer#input_method LuaPlayer::input_method}.
2334
+ * @see {@link https://lua-api.factorio.com/latest/events.html#on_player_input_method_changed Online documentation}
2335
+ */
2336
+ interface OnPlayerInputMethodChangedEvent extends EventData {
2337
+ /**
2338
+ * The player whose input method changed.
2339
+ */
2340
+ readonly player_index: PlayerIndex
2341
+ /**
2342
+ * Identifier of the event
2343
+ */
2344
+ readonly name: typeof defines.events.on_player_input_method_changed
2345
+ /**
2346
+ * Tick the event was generated.
2347
+ */
2348
+ readonly tick: uint
2349
+ }
2350
+
2304
2351
  /**
2305
2352
  * Called after a player joins the game. This is not called when loading a save file in singleplayer, as the player doesn't actually leave the game, and the save is just on pause until they rejoin.
2306
2353
  * @see {@link https://lua-api.factorio.com/latest/events.html#on_player_joined_game Online documentation}