factorio-types 0.0.29 → 0.0.31
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 +93 -20
- package/dist/concepts.d.ts +2 -2
- package/dist/defines.d.ts +3 -1
- package/dist/events.d.ts +30 -1
- package/dist/global.d.ts +1 -1
- package/package.json +1 -1
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.
|
|
5
|
+
// Factorio version 1.1.72
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -253,16 +253,16 @@ interface LuaBootstrap {
|
|
|
253
253
|
* @remarks
|
|
254
254
|
* For more context, refer to the {@link Data Lifecycle | data-lifecycle} page.
|
|
255
255
|
*
|
|
256
|
-
* @param
|
|
256
|
+
* @param handler - The handler for this event. Passing `nil` will unregister it.
|
|
257
257
|
*/
|
|
258
258
|
on_configuration_changed(this: void,
|
|
259
|
-
|
|
259
|
+
handler: (this: void, arg0: ConfigurationChangedData) => any | null): void
|
|
260
260
|
|
|
261
261
|
/**
|
|
262
262
|
* Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
|
|
263
263
|
* @param event - The event(s) or custom-input to invoke the handler on.
|
|
264
|
-
* @param f - The handler for this event. Passing `nil` will unregister it.
|
|
265
264
|
* @param filters - The filters for this event. Can only be used when registering for individual events.
|
|
265
|
+
* @param handler - The handler for this event. Passing `nil` will unregister it.
|
|
266
266
|
* @example
|
|
267
267
|
* Register for the [on_tick](on_tick) event to print the current tick to console each tick.
|
|
268
268
|
* ```
|
|
@@ -281,7 +281,7 @@ interface LuaBootstrap {
|
|
|
281
281
|
*/
|
|
282
282
|
on_event<T extends event>(this: void,
|
|
283
283
|
event: defines.events | defines.events[] | string,
|
|
284
|
-
|
|
284
|
+
handler: (this: void, arg0: EventData) => any | null,
|
|
285
285
|
filters?: EventFilter): void
|
|
286
286
|
|
|
287
287
|
/**
|
|
@@ -289,7 +289,7 @@ interface LuaBootstrap {
|
|
|
289
289
|
* @remarks
|
|
290
290
|
* For more context, refer to the {@link Data Lifecycle | data-lifecycle} page.
|
|
291
291
|
*
|
|
292
|
-
* @param
|
|
292
|
+
* @param handler - The handler for this event. Passing `nil` will unregister it.
|
|
293
293
|
* @example
|
|
294
294
|
* Initialize a `players` table in `global` for later use.
|
|
295
295
|
* ```
|
|
@@ -300,7 +300,7 @@ interface LuaBootstrap {
|
|
|
300
300
|
*
|
|
301
301
|
*/
|
|
302
302
|
on_init(this: void,
|
|
303
|
-
|
|
303
|
+
handler: (this: void) => any | null): void
|
|
304
304
|
|
|
305
305
|
/**
|
|
306
306
|
* Register a function to be run on save load. This is only called for mods that have been part of the save previously, or for players connecting to a running multiplayer session. It gives the mod the opportunity to do some very specific actions, should it need to. Doing anything other than these three will lead to desyncs, which breaks multiplayer and replay functionality. Access to {@link LuaGameScript | LuaGameScript} is not available. The {@link global | global} table can be accessed and is safe to read from, but not write to, as doing so will lead to an error.
|
|
@@ -314,19 +314,19 @@ interface LuaBootstrap {
|
|
|
314
314
|
* @remarks
|
|
315
315
|
* For more context, refer to the {@link Data Lifecycle | data-lifecycle} page.
|
|
316
316
|
*
|
|
317
|
-
* @param
|
|
317
|
+
* @param handler - The handler for this event. Passing `nil` will unregister it.
|
|
318
318
|
*/
|
|
319
319
|
on_load(this: void,
|
|
320
|
-
|
|
320
|
+
handler: (this: void) => any | null): void
|
|
321
321
|
|
|
322
322
|
/**
|
|
323
323
|
* Register a handler to run every nth-tick(s). When the game is on tick 0 it will trigger all registered handlers.
|
|
324
|
-
* @param
|
|
324
|
+
* @param handler - The handler to run. Passing `nil` will unregister it for the provided nth-tick(s).
|
|
325
325
|
* @param tick - The nth-tick(s) to invoke the handler on. Passing `nil` as the only parameter will unregister all nth-tick handlers.
|
|
326
326
|
*/
|
|
327
327
|
on_nth_tick(this: void,
|
|
328
328
|
tick: number | number[] | null,
|
|
329
|
-
|
|
329
|
+
handler: (this: void, arg0: NthTickEventData) => any | null): void
|
|
330
330
|
|
|
331
331
|
/**
|
|
332
332
|
* @param table.entity - The entity that was built.
|
|
@@ -2038,7 +2038,7 @@ interface LuaEntity extends LuaControl {
|
|
|
2038
2038
|
* @param damage - The amount of damage to be done.
|
|
2039
2039
|
* @param dealer - The entity to consider as the damage dealer. Needs to be on the same surface as the entity being damaged.
|
|
2040
2040
|
* @param force - The force that will be doing the damage.
|
|
2041
|
-
* @param type - The type of damage to be done, defaults to "impact".
|
|
2041
|
+
* @param type - The type of damage to be done, defaults to "impact". Can't be `nil`.
|
|
2042
2042
|
*/
|
|
2043
2043
|
damage(this: void,
|
|
2044
2044
|
damage: number,
|
|
@@ -7957,9 +7957,9 @@ interface LuaGameScript {
|
|
|
7957
7957
|
reason?: LocalisedString): void
|
|
7958
7958
|
|
|
7959
7959
|
/**
|
|
7960
|
-
* Marks two forces to be merged together. All entities in the source force will be reassigned to the target force. The source force will then be destroyed.
|
|
7960
|
+
* Marks two forces to be merged together. All players and entities in the source force will be reassigned to the target force. The source force will then be destroyed. Importantly, this does not merge technologies or bonuses, which are instead retained from the target force.
|
|
7961
7961
|
* @remarks
|
|
7962
|
-
* The three built-in forces
|
|
7962
|
+
* The three built-in forces (player, enemy and neutral) can't be destroyed, meaning they can't be used as the source argument to this function.
|
|
7963
7963
|
* The source force is not removed until the end of the current tick, or if called during the {@link on_forces_merging | on_forces_merging} or {@link on_forces_merged | on_forces_merged} event, the end of the next tick.
|
|
7964
7964
|
*
|
|
7965
7965
|
* @param destination - The force to reassign all entities to.
|
|
@@ -8830,6 +8830,11 @@ interface LuaGuiElement {
|
|
|
8830
8830
|
*/
|
|
8831
8831
|
clear_items(this: void): void
|
|
8832
8832
|
|
|
8833
|
+
/**
|
|
8834
|
+
* Closes the dropdown list if this is a dropdown and it is open.
|
|
8835
|
+
*/
|
|
8836
|
+
close_dropdown(this: void): void
|
|
8837
|
+
|
|
8833
8838
|
/**
|
|
8834
8839
|
* Remove this element, along with its children. Any {@link LuaGuiElement | LuaGuiElement} objects referring to the destroyed elements become invalid after this operation.
|
|
8835
8840
|
* @remarks
|
|
@@ -9782,10 +9787,12 @@ interface LuaInventory {
|
|
|
9782
9787
|
|
|
9783
9788
|
/**
|
|
9784
9789
|
* Counts the number of empty stacks.
|
|
9790
|
+
* @param include_bar - If true, slots blocked by the current bar will be included. Defaults to true.
|
|
9785
9791
|
* @param include_filtered - If true, filtered slots will be included. Defaults to false.
|
|
9786
9792
|
*/
|
|
9787
9793
|
count_empty_stacks(this: void,
|
|
9788
|
-
include_filtered?: boolean
|
|
9794
|
+
include_filtered?: boolean,
|
|
9795
|
+
include_bar?: boolean): void
|
|
9789
9796
|
|
|
9790
9797
|
/**
|
|
9791
9798
|
* Destroys this inventory.
|
|
@@ -9870,6 +9877,11 @@ interface LuaInventory {
|
|
|
9870
9877
|
*/
|
|
9871
9878
|
is_filtered(this: void): void
|
|
9872
9879
|
|
|
9880
|
+
/**
|
|
9881
|
+
* Is every stack in this inventory full? Ignores stacks blocked by the current bar.
|
|
9882
|
+
*/
|
|
9883
|
+
is_full(this: void): void
|
|
9884
|
+
|
|
9873
9885
|
/**
|
|
9874
9886
|
* Remove items from this inventory.
|
|
9875
9887
|
* @param items - Items to remove.
|
|
@@ -10046,6 +10058,70 @@ interface LuaItemPrototype {
|
|
|
10046
10058
|
*/
|
|
10047
10059
|
readonly alt_entity_type_filters?: {[key: string]: boolean}
|
|
10048
10060
|
|
|
10061
|
+
/**
|
|
10062
|
+
* The alt reverse entity filter mode used by this selection tool.
|
|
10063
|
+
* @remarks
|
|
10064
|
+
* Applies to subclasses: SelectionTool
|
|
10065
|
+
*
|
|
10066
|
+
*/
|
|
10067
|
+
readonly alt_reverse_alt_entity_filter_mode?: string
|
|
10068
|
+
|
|
10069
|
+
/**
|
|
10070
|
+
* The alt reverse entity filters used by this selection tool indexed by entity name.
|
|
10071
|
+
* @remarks
|
|
10072
|
+
* Applies to subclasses: SelectionTool
|
|
10073
|
+
*
|
|
10074
|
+
*/
|
|
10075
|
+
readonly alt_reverse_entity_filters?: {[key: string]: LuaEntityPrototype}
|
|
10076
|
+
|
|
10077
|
+
/**
|
|
10078
|
+
* The alt reverse entity type filters used by this selection tool indexed by entity type.
|
|
10079
|
+
* @remarks
|
|
10080
|
+
* The boolean value is meaningless and is used to allow easy lookup if a type exists in the dictionary.
|
|
10081
|
+
* Applies to subclasses: SelectionTool
|
|
10082
|
+
*
|
|
10083
|
+
*/
|
|
10084
|
+
readonly alt_reverse_entity_type_filters?: {[key: string]: boolean}
|
|
10085
|
+
|
|
10086
|
+
/**
|
|
10087
|
+
* The color used when doing alt reverse selection with this selection tool prototype.
|
|
10088
|
+
* @remarks
|
|
10089
|
+
* Applies to subclasses: SelectionTool
|
|
10090
|
+
*
|
|
10091
|
+
*/
|
|
10092
|
+
readonly alt_reverse_selection_border_color?: Color
|
|
10093
|
+
|
|
10094
|
+
/**
|
|
10095
|
+
* @remarks
|
|
10096
|
+
* Applies to subclasses: SelectionTool
|
|
10097
|
+
*
|
|
10098
|
+
*/
|
|
10099
|
+
readonly alt_reverse_selection_cursor_box_type?: string
|
|
10100
|
+
|
|
10101
|
+
/**
|
|
10102
|
+
* Flags that affect which entities will be selected during alt reverse selection.
|
|
10103
|
+
* @remarks
|
|
10104
|
+
* Applies to subclasses: SelectionTool
|
|
10105
|
+
*
|
|
10106
|
+
*/
|
|
10107
|
+
readonly alt_reverse_selection_mode_flags?: SelectionModeFlags
|
|
10108
|
+
|
|
10109
|
+
/**
|
|
10110
|
+
* The alt reverse tile filter mode used by this selection tool.
|
|
10111
|
+
* @remarks
|
|
10112
|
+
* Applies to subclasses: SelectionTool
|
|
10113
|
+
*
|
|
10114
|
+
*/
|
|
10115
|
+
readonly alt_reverse_tile_filter_mode?: string
|
|
10116
|
+
|
|
10117
|
+
/**
|
|
10118
|
+
* The alt reverse tile filters used by this selection tool indexed by tile name.
|
|
10119
|
+
* @remarks
|
|
10120
|
+
* Applies to subclasses: SelectionTool
|
|
10121
|
+
*
|
|
10122
|
+
*/
|
|
10123
|
+
readonly alt_reverse_tile_filters?: {[key: string]: LuaTilePrototype}
|
|
10124
|
+
|
|
10049
10125
|
/**
|
|
10050
10126
|
* The color used when doing alt selection with this selection tool prototype.
|
|
10051
10127
|
* @remarks
|
|
@@ -11511,7 +11587,7 @@ interface LuaLogisticContainerControlBehavior extends LuaControlBehavior {
|
|
|
11511
11587
|
help(this: void): void
|
|
11512
11588
|
|
|
11513
11589
|
/**
|
|
11514
|
-
* The circuit mode of operations for the logistic container.
|
|
11590
|
+
* The circuit mode of operations for the logistic container. Can only be set on containers whose {@link logistic_mode | LuaEntityPrototype::logistic_mode} is set to "requester".
|
|
11515
11591
|
*/
|
|
11516
11592
|
circuit_mode_of_operation: defines.control_behavior.logistic_container.circuit_mode_of_operation
|
|
11517
11593
|
|
|
@@ -12298,7 +12374,7 @@ interface LuaPlayer extends LuaControl {
|
|
|
12298
12374
|
}): void
|
|
12299
12375
|
|
|
12300
12376
|
/**
|
|
12301
|
-
* Checks if this player can build the
|
|
12377
|
+
* Checks if this player can build the given entity at the given location on the surface the player is on.
|
|
12302
12378
|
* @param table.direction - Direction the entity would be placed. Defaults to `north`.
|
|
12303
12379
|
* @param table.name - Name of the entity to check.
|
|
12304
12380
|
* @param table.position - Where the entity would be placed.
|
|
@@ -12673,9 +12749,6 @@ interface LuaPlayer extends LuaControl {
|
|
|
12673
12749
|
|
|
12674
12750
|
/**
|
|
12675
12751
|
* Sets the filter for this map editor infinity filters at the given index.
|
|
12676
|
-
* @remarks
|
|
12677
|
-
* Applies to subclasses: InfinityContainer
|
|
12678
|
-
*
|
|
12679
12752
|
* @param filter - The new filter or `nil` to clear the filter.
|
|
12680
12753
|
* @param index - The index to set.
|
|
12681
12754
|
*/
|
package/dist/concepts.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.
|
|
5
|
+
// Factorio version 1.1.72
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1192,7 +1192,7 @@ interface InfinityInventoryFilter {
|
|
|
1192
1192
|
count?: number,
|
|
1193
1193
|
|
|
1194
1194
|
/**
|
|
1195
|
-
* The index of this filter in the filters list.
|
|
1195
|
+
* The index of this filter in the filters list. Not required when writing a filter.
|
|
1196
1196
|
*/
|
|
1197
1197
|
index: number,
|
|
1198
1198
|
|
package/dist/defines.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.
|
|
5
|
+
// Factorio version 1.1.72
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
declare namespace defines {
|
|
@@ -557,6 +557,7 @@ declare namespace defines {
|
|
|
557
557
|
on_permission_group_edited,
|
|
558
558
|
on_permission_string_imported,
|
|
559
559
|
on_picked_up_item,
|
|
560
|
+
on_player_alt_reverse_selected_area,
|
|
560
561
|
on_player_alt_selected_area,
|
|
561
562
|
on_player_ammo_inventory_changed,
|
|
562
563
|
on_player_armor_inventory_changed,
|
|
@@ -721,6 +722,7 @@ declare namespace defines {
|
|
|
721
722
|
add_permission_group,
|
|
722
723
|
add_train_station,
|
|
723
724
|
admin_action,
|
|
725
|
+
alt_reverse_select_area,
|
|
724
726
|
alt_select_area,
|
|
725
727
|
alt_select_blueprint_entities,
|
|
726
728
|
alternative_copy,
|
package/dist/events.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.
|
|
5
|
+
// Factorio version 1.1.72
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -953,6 +953,35 @@ interface on_picked_up_item extends event {
|
|
|
953
953
|
item_stack: SimpleItemStack
|
|
954
954
|
player_index: number
|
|
955
955
|
}
|
|
956
|
+
/**
|
|
957
|
+
* Called after a player alt-reverse-selects an area with a selection-tool item.
|
|
958
|
+
*/
|
|
959
|
+
interface on_player_alt_reverse_selected_area extends event {
|
|
960
|
+
/**
|
|
961
|
+
* The area selected.
|
|
962
|
+
*/
|
|
963
|
+
area: BoundingBox
|
|
964
|
+
/**
|
|
965
|
+
* The entities selected.
|
|
966
|
+
*/
|
|
967
|
+
entities: LuaEntity[]
|
|
968
|
+
/**
|
|
969
|
+
* The item used to select the area.
|
|
970
|
+
*/
|
|
971
|
+
item: string
|
|
972
|
+
/**
|
|
973
|
+
* The player doing the selection.
|
|
974
|
+
*/
|
|
975
|
+
player_index: number
|
|
976
|
+
/**
|
|
977
|
+
* The surface selected.
|
|
978
|
+
*/
|
|
979
|
+
surface: LuaSurface
|
|
980
|
+
/**
|
|
981
|
+
* The tiles selected.
|
|
982
|
+
*/
|
|
983
|
+
tiles: LuaTile[]
|
|
984
|
+
}
|
|
956
985
|
/**
|
|
957
986
|
* Called after a player alt-selects an area with a selection-tool item.
|
|
958
987
|
*/
|
package/dist/global.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.
|
|
5
|
+
// Factorio version 1.1.72
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
/**
|