factorio-types 0.0.19 → 0.0.22

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/defines.d.ts CHANGED
@@ -2,8 +2,8 @@
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.50
6
- // API version 1
5
+ // Factorio version 1.1.57
6
+ // API version 2
7
7
 
8
8
  declare namespace defines {
9
9
  enum alert_type {
package/dist/events.d.ts CHANGED
@@ -2,8 +2,8 @@
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.50
6
- // API version 1
5
+ // Factorio version 1.1.57
6
+ // API version 2
7
7
 
8
8
  /**
9
9
  * Base type for all events
@@ -28,7 +28,7 @@ interface CustomInputEvent extends event {
28
28
  /**
29
29
  * The mouse cursor position when the custom input was activated.
30
30
  */
31
- cursor_position: Position
31
+ cursor_position: MapPosition
32
32
  /**
33
33
  * The prototype name of the custom input that was activated.
34
34
  */
@@ -38,7 +38,7 @@ interface CustomInputEvent extends event {
38
38
  */
39
39
  player_index: number
40
40
  /**
41
- * Information about the prototype that is selected when the custom input is used. `nil` if none is selected.
41
+ * 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.
42
42
  */
43
43
  selected_prototype?: SelectedPrototypeData
44
44
  }
@@ -338,13 +338,19 @@ interface on_entity_damaged extends event {
338
338
  original_damage_amount: number
339
339
  }
340
340
  /**
341
- * Called after an entity is destroyed that has been registered with {@link LuaBootstrap::register_on_entity_destroyed | LuaBootstrap::register_on_entity_destroyed}
341
+ * Called after an entity is destroyed that has been registered with {@link LuaBootstrap::register_on_entity_destroyed | LuaBootstrap::register_on_entity_destroyed}.
342
342
  * @remarks
343
- * Depending on when a given entity is destroyed this will be fired at the end of the current tick or end of the next tick.
343
+ * Depending on when a given entity is destroyed, this event will be fired at the end of the current tick or at the end of the next tick.
344
344
  *
345
345
  */
346
346
  interface on_entity_destroyed extends event {
347
+ /**
348
+ * The number returned by {@link register_on_entity_destroyed | LuaBootstrap::register_on_entity_destroyed} to uniquely identify this entity during this event.
349
+ */
347
350
  registration_number: number
351
+ /**
352
+ * The {@link LuaEntity::unit_number | LuaEntity::unit_number} of the destroyed entity, if it had one.
353
+ */
348
354
  unit_number?: number
349
355
  }
350
356
  /**
@@ -592,8 +598,9 @@ interface on_gui_click extends event {
592
598
  }
593
599
  /**
594
600
  * Called when the player closes the GUI they have open.
601
+ *
602
+ * This can only be raised when the GUI's player controller is still valid. If a GUI is thus closed due to the player disconnecting, dying, or becoming a spectator in other ways, it won't cause this event to be raised.
595
603
  * @remarks
596
- * This is only called if the player explicitly closed the GUI.
597
604
  * It's not advised to open any other GUI during this event because if this is run as a request to open a different GUI the game will force close the new opened GUI without notice to ensure the original requested GUI is opened.
598
605
  *
599
606
  */
@@ -1112,7 +1119,7 @@ interface on_player_clicked_gps_tag extends event {
1112
1119
  /**
1113
1120
  * Map position contained in gps tag
1114
1121
  */
1115
- position: Position
1122
+ position: MapPosition
1116
1123
  /**
1117
1124
  * Surface name contained in gps tag, even when such surface does not exists
1118
1125
  */
@@ -1622,7 +1629,7 @@ interface on_player_used_capsule extends event {
1622
1629
  /**
1623
1630
  * The position the capsule was used.
1624
1631
  */
1625
- position: Position
1632
+ position: MapPosition
1626
1633
  }
1627
1634
  /**
1628
1635
  * Called when a player uses spidertron remote to send a spidertron to a given position
@@ -1635,7 +1642,7 @@ interface on_player_used_spider_remote extends event {
1635
1642
  /**
1636
1643
  * Goal position to which spidertron was sent to.
1637
1644
  */
1638
- position: Position
1645
+ position: MapPosition
1639
1646
  /**
1640
1647
  * If the use was successful. It may fail when spidertron has different driver or when player is on different surface.
1641
1648
  */
@@ -1668,7 +1675,7 @@ interface on_post_entity_died extends event {
1668
1675
  /**
1669
1676
  * Position where the entity died.
1670
1677
  */
1671
- position: Position
1678
+ position: MapPosition
1672
1679
  /**
1673
1680
  * The entity prototype of the entity that died.
1674
1681
  */
@@ -1709,7 +1716,7 @@ interface on_pre_build extends event {
1709
1716
  /**
1710
1717
  * Where the item was placed.
1711
1718
  */
1712
- position: Position
1719
+ position: MapPosition
1713
1720
  /**
1714
1721
  * Item was placed using shift building.
1715
1722
  */
@@ -2132,13 +2139,13 @@ interface on_script_trigger_effect extends event {
2132
2139
  */
2133
2140
  effect_id: string
2134
2141
  source_entity?: LuaEntity
2135
- source_position?: Position
2142
+ source_position?: MapPosition
2136
2143
  /**
2137
2144
  * The surface the effect happened on.
2138
2145
  */
2139
2146
  surface_index: number
2140
2147
  target_entity?: LuaEntity
2141
- target_position?: Position
2148
+ target_position?: MapPosition
2142
2149
  }
2143
2150
  /**
2144
2151
  * Called when an entity of type `radar` finishes scanning a sector. Can be filtered for the radar using {@link LuaSectorScannedEventFilter | LuaSectorScannedEventFilter}.
package/dist/global.d.ts CHANGED
@@ -2,8 +2,8 @@
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.50
6
- // API version 1
5
+ // Factorio version 1.1.57
6
+ // API version 2
7
7
 
8
8
  /**
9
9
  * Allows registering custom commands for the in-game console accessible via the grave key.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "factorio-types",
3
- "version": "0.0.19",
3
+ "version": "0.0.22",
4
4
  "description": "Typescript declarations for the factorio mod API",
5
5
  "main": "index.d.ts",
6
6
  "repository": "https://github.com/sguest/factorio-types.git",