factorio-types 0.0.25 → 0.0.28
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 +1405 -611
- package/dist/concepts.d.ts +1937 -2817
- package/dist/defines.d.ts +30 -2
- package/dist/events.d.ts +25 -4
- package/dist/global.d.ts +33 -3
- package/package.json +2 -2
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.
|
|
6
|
-
// API version
|
|
5
|
+
// Factorio version 1.1.69
|
|
6
|
+
// API version 3
|
|
7
7
|
|
|
8
8
|
declare namespace defines {
|
|
9
9
|
enum alert_type {
|
|
@@ -70,6 +70,7 @@ declare namespace defines {
|
|
|
70
70
|
electric_pole,
|
|
71
71
|
inserter,
|
|
72
72
|
lamp,
|
|
73
|
+
linked_container,
|
|
73
74
|
offshore_pump,
|
|
74
75
|
programmable_speaker,
|
|
75
76
|
pump,
|
|
@@ -615,6 +616,7 @@ declare namespace defines {
|
|
|
615
616
|
on_pre_chunk_deleted,
|
|
616
617
|
on_pre_entity_settings_pasted,
|
|
617
618
|
on_pre_ghost_deconstructed,
|
|
619
|
+
on_pre_ghost_upgraded,
|
|
618
620
|
on_pre_permission_group_deleted,
|
|
619
621
|
on_pre_permission_string_imported,
|
|
620
622
|
on_pre_player_crafted_item,
|
|
@@ -706,6 +708,7 @@ declare namespace defines {
|
|
|
706
708
|
player_management,
|
|
707
709
|
production,
|
|
708
710
|
research,
|
|
711
|
+
script_inventory,
|
|
709
712
|
server_management,
|
|
710
713
|
tile,
|
|
711
714
|
trains,
|
|
@@ -913,6 +916,10 @@ declare namespace defines {
|
|
|
913
916
|
wire_dragging,
|
|
914
917
|
write_to_console,
|
|
915
918
|
}
|
|
919
|
+
enum input_method {
|
|
920
|
+
game_controller,
|
|
921
|
+
keyboard_and_mouse,
|
|
922
|
+
}
|
|
916
923
|
enum inventory {
|
|
917
924
|
artillery_turret_ammo,
|
|
918
925
|
artillery_wagon_ammo,
|
|
@@ -950,6 +957,9 @@ declare namespace defines {
|
|
|
950
957
|
robot_cargo,
|
|
951
958
|
robot_repair,
|
|
952
959
|
rocket,
|
|
960
|
+
rocket_silo_input,
|
|
961
|
+
rocket_silo_modules,
|
|
962
|
+
rocket_silo_output,
|
|
953
963
|
rocket_silo_result,
|
|
954
964
|
rocket_silo_rocket,
|
|
955
965
|
spider_ammo,
|
|
@@ -1052,6 +1062,7 @@ declare namespace defines {
|
|
|
1052
1062
|
resource_entity_gui,
|
|
1053
1063
|
roboport_gui,
|
|
1054
1064
|
rocket_silo_gui,
|
|
1065
|
+
script_inventory_gui,
|
|
1055
1066
|
server_config_gui,
|
|
1056
1067
|
spider_vehicle_gui,
|
|
1057
1068
|
splitter_gui,
|
|
@@ -1088,6 +1099,23 @@ declare namespace defines {
|
|
|
1088
1099
|
straight,
|
|
1089
1100
|
}
|
|
1090
1101
|
}
|
|
1102
|
+
enum rocket_silo_status {
|
|
1103
|
+
arms_advance,
|
|
1104
|
+
arms_retract,
|
|
1105
|
+
building_rocket,
|
|
1106
|
+
create_rocket,
|
|
1107
|
+
doors_closing,
|
|
1108
|
+
doors_opened,
|
|
1109
|
+
doors_opening,
|
|
1110
|
+
engine_starting,
|
|
1111
|
+
launch_started,
|
|
1112
|
+
launch_starting,
|
|
1113
|
+
lights_blinking_close,
|
|
1114
|
+
lights_blinking_open,
|
|
1115
|
+
rocket_flying,
|
|
1116
|
+
rocket_ready,
|
|
1117
|
+
rocket_rising,
|
|
1118
|
+
}
|
|
1091
1119
|
enum shooting {
|
|
1092
1120
|
not_shooting,
|
|
1093
1121
|
shooting_enemies,
|
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.
|
|
6
|
-
// API version
|
|
5
|
+
// Factorio version 1.1.69
|
|
6
|
+
// API version 3
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Base type for all events
|
|
@@ -139,8 +139,10 @@ interface on_cancelled_deconstruction extends event {
|
|
|
139
139
|
* Called when the upgrade of an entity is canceled. Can be filtered using {@link LuaUpgradeCancelledEventFilter | LuaUpgradeCancelledEventFilter}.
|
|
140
140
|
*/
|
|
141
141
|
interface on_cancelled_upgrade extends event {
|
|
142
|
+
direction?: defines.direction
|
|
142
143
|
entity: LuaEntity
|
|
143
144
|
player_index?: number
|
|
145
|
+
target: LuaEntityPrototype
|
|
144
146
|
}
|
|
145
147
|
/**
|
|
146
148
|
* Called when a character corpse expires due to timeout or all of the items being removed from it.
|
|
@@ -621,6 +623,10 @@ interface on_gui_closed extends event {
|
|
|
621
623
|
* The GUI type that was open.
|
|
622
624
|
*/
|
|
623
625
|
gui_type: defines.gui_type
|
|
626
|
+
/**
|
|
627
|
+
* The script inventory that was open
|
|
628
|
+
*/
|
|
629
|
+
inventory?: LuaInventory
|
|
624
630
|
/**
|
|
625
631
|
* The item that was open
|
|
626
632
|
*/
|
|
@@ -713,6 +719,10 @@ interface on_gui_opened extends event {
|
|
|
713
719
|
* The GUI type that was opened.
|
|
714
720
|
*/
|
|
715
721
|
gui_type: defines.gui_type
|
|
722
|
+
/**
|
|
723
|
+
* The script inventory that was opened
|
|
724
|
+
*/
|
|
725
|
+
inventory?: LuaInventory
|
|
716
726
|
/**
|
|
717
727
|
* The item that was opened
|
|
718
728
|
*/
|
|
@@ -1312,7 +1322,7 @@ interface on_player_gun_inventory_changed extends event {
|
|
|
1312
1322
|
player_index: number
|
|
1313
1323
|
}
|
|
1314
1324
|
/**
|
|
1315
|
-
* Called after a player joins the game.
|
|
1325
|
+
* 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.
|
|
1316
1326
|
*/
|
|
1317
1327
|
interface on_player_joined_game extends event {
|
|
1318
1328
|
player_index: number
|
|
@@ -1335,7 +1345,7 @@ interface on_player_kicked extends event {
|
|
|
1335
1345
|
reason?: string
|
|
1336
1346
|
}
|
|
1337
1347
|
/**
|
|
1338
|
-
* Called after a player leaves the game.
|
|
1348
|
+
* Called after a player leaves the game. This is not called when closing a save file in singleplayer, as the player doesn't actually leave the game, and the save is just on pause until they rejoin.
|
|
1339
1349
|
*/
|
|
1340
1350
|
interface on_player_left_game extends event {
|
|
1341
1351
|
player_index: number
|
|
@@ -1785,6 +1795,17 @@ interface on_pre_ghost_deconstructed extends event {
|
|
|
1785
1795
|
*/
|
|
1786
1796
|
player_index?: number
|
|
1787
1797
|
}
|
|
1798
|
+
/**
|
|
1799
|
+
* Called before a ghost entity is upgraded. Can be filtered using {@link LuaPreGhostUpgradedEventFilter | LuaPreGhostUpgradedEventFilter}.
|
|
1800
|
+
*/
|
|
1801
|
+
interface on_pre_ghost_upgraded extends event {
|
|
1802
|
+
ghost: LuaEntity
|
|
1803
|
+
/**
|
|
1804
|
+
* The player that did the upgrade if any.
|
|
1805
|
+
*/
|
|
1806
|
+
player_index?: number
|
|
1807
|
+
target: LuaEntityPrototype
|
|
1808
|
+
}
|
|
1788
1809
|
/**
|
|
1789
1810
|
* Called directly before a permission group is deleted.
|
|
1790
1811
|
*/
|
package/dist/global.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// Factorio global
|
|
1
|
+
// Factorio global definitions
|
|
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.
|
|
6
|
-
// API version
|
|
5
|
+
// Factorio version 1.1.69
|
|
6
|
+
// API version 3
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Allows registering custom commands for the in-game console accessible via the grave key.
|
|
@@ -33,3 +33,33 @@ declare const script: LuaBootstrap
|
|
|
33
33
|
* Allows reading the current mod settings.
|
|
34
34
|
*/
|
|
35
35
|
declare const settings: LuaSettings
|
|
36
|
+
/**
|
|
37
|
+
* `localised_print()` allows printing {@link LocalisedString | LocalisedString} to stdout without polluting the Factorio {@link log file | https://wiki.factorio.com/Log_file}. This is primarily useful when communicating with external tools that launch Factorio as a child process.
|
|
38
|
+
*/
|
|
39
|
+
declare function localised_print(this: void,
|
|
40
|
+
string: LocalisedString): void
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* `log()` can print {@link LocalisedStrings | LocalisedString} to the Factorio {@link log file | https://wiki.factorio.com/Log_file}. This, in combination with the serpent library, makes debugging in the data stage easier because it allows the inspection of entire prototype tables. For example, printing all properties of the sulfur item prototype can be done like so: `log(serpent.block(data.raw["item"]["sulfur"]))`
|
|
44
|
+
*/
|
|
45
|
+
declare function log(this: void,
|
|
46
|
+
string: LocalisedString): void
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Factorio provides the `table_size()` function as a simple way to determine the size of tables with non-continuous keys, as the standard `#` operator does not work correctly for these. The function is a C++ implementation of the following Lua code, which is faster than doing the same in Lua:
|
|
50
|
+
*
|
|
51
|
+
* ```
|
|
52
|
+
* local function size(t)
|
|
53
|
+
* local count = 0
|
|
54
|
+
* for k,v in pairs(t) do
|
|
55
|
+
* count = count + 1
|
|
56
|
+
* end
|
|
57
|
+
* return count
|
|
58
|
+
* end
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* Note that `table_size()` does not work correctly for {@link LuaCustomTable | LuaCustomTable}, their size has to be determined with {@link LuaCustomTable::length | LuaCustomTable::length} instead.
|
|
62
|
+
*/
|
|
63
|
+
declare function table_size(this: void,
|
|
64
|
+
table: Table): void
|
|
65
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "factorio-types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
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",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"cpy-cli": "^3.1.1",
|
|
18
18
|
"node-html-parser": "^1.1.16",
|
|
19
19
|
"ts-node": "^10.0.0",
|
|
20
|
-
"typescript": "
|
|
20
|
+
"typescript": "4.7.4"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"index.d.ts",
|