factorio-types 0.0.29 → 0.0.30

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 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.70
5
+ // Factorio version 1.1.71
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 f - The handler for this event. Passing `nil` will unregister it.
256
+ * @param handler - The handler for this event. Passing `nil` will unregister it.
257
257
  */
258
258
  on_configuration_changed(this: void,
259
- f: (this: void, arg0: ConfigurationChangedData) => any | null): void
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
- f: (this: void, arg0: T) => any | null,
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 f - The handler for this event. Passing `nil` will unregister it.
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
- f: (this: void) => any | null): void
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 f - The handler for this event. Passing `nil` will unregister it.
317
+ * @param handler - The handler for this event. Passing `nil` will unregister it.
318
318
  */
319
319
  on_load(this: void,
320
- f: (this: void) => any | null): void
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 f - The handler to run. Passing `nil` will unregister it for the provided nth-tick(s).
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
- f: (this: void, arg0: NthTickEventData) => any | null): void
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 -- player, enemy and neutral -- can't be destroyed. I.e. they can't be used as the source argument to this function.
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
@@ -10046,6 +10051,70 @@ interface LuaItemPrototype {
10046
10051
  */
10047
10052
  readonly alt_entity_type_filters?: {[key: string]: boolean}
10048
10053
 
10054
+ /**
10055
+ * The alt reverse entity filter mode used by this selection tool.
10056
+ * @remarks
10057
+ * Applies to subclasses: SelectionTool
10058
+ *
10059
+ */
10060
+ readonly alt_reverse_alt_entity_filter_mode?: string
10061
+
10062
+ /**
10063
+ * The alt reverse entity filters used by this selection tool indexed by entity name.
10064
+ * @remarks
10065
+ * Applies to subclasses: SelectionTool
10066
+ *
10067
+ */
10068
+ readonly alt_reverse_entity_filters?: {[key: string]: LuaEntityPrototype}
10069
+
10070
+ /**
10071
+ * The alt reverse entity type filters used by this selection tool indexed by entity type.
10072
+ * @remarks
10073
+ * The boolean value is meaningless and is used to allow easy lookup if a type exists in the dictionary.
10074
+ * Applies to subclasses: SelectionTool
10075
+ *
10076
+ */
10077
+ readonly alt_reverse_entity_type_filters?: {[key: string]: boolean}
10078
+
10079
+ /**
10080
+ * The color used when doing alt reverse selection with this selection tool prototype.
10081
+ * @remarks
10082
+ * Applies to subclasses: SelectionTool
10083
+ *
10084
+ */
10085
+ readonly alt_reverse_selection_border_color?: Color
10086
+
10087
+ /**
10088
+ * @remarks
10089
+ * Applies to subclasses: SelectionTool
10090
+ *
10091
+ */
10092
+ readonly alt_reverse_selection_cursor_box_type?: string
10093
+
10094
+ /**
10095
+ * Flags that affect which entities will be selected during alt reverse selection.
10096
+ * @remarks
10097
+ * Applies to subclasses: SelectionTool
10098
+ *
10099
+ */
10100
+ readonly alt_reverse_selection_mode_flags?: SelectionModeFlags
10101
+
10102
+ /**
10103
+ * The alt reverse tile filter mode used by this selection tool.
10104
+ * @remarks
10105
+ * Applies to subclasses: SelectionTool
10106
+ *
10107
+ */
10108
+ readonly alt_reverse_tile_filter_mode?: string
10109
+
10110
+ /**
10111
+ * The alt reverse tile filters used by this selection tool indexed by tile name.
10112
+ * @remarks
10113
+ * Applies to subclasses: SelectionTool
10114
+ *
10115
+ */
10116
+ readonly alt_reverse_tile_filters?: {[key: string]: LuaTilePrototype}
10117
+
10049
10118
  /**
10050
10119
  * The color used when doing alt selection with this selection tool prototype.
10051
10120
  * @remarks
@@ -11511,7 +11580,7 @@ interface LuaLogisticContainerControlBehavior extends LuaControlBehavior {
11511
11580
  help(this: void): void
11512
11581
 
11513
11582
  /**
11514
- * The circuit mode of operations for the logistic container.
11583
+ * 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
11584
  */
11516
11585
  circuit_mode_of_operation: defines.control_behavior.logistic_container.circuit_mode_of_operation
11517
11586
 
@@ -12298,7 +12367,7 @@ interface LuaPlayer extends LuaControl {
12298
12367
  }): void
12299
12368
 
12300
12369
  /**
12301
- * Checks if this player can build the give entity at the given location on the surface the player is on.
12370
+ * Checks if this player can build the given entity at the given location on the surface the player is on.
12302
12371
  * @param table.direction - Direction the entity would be placed. Defaults to `north`.
12303
12372
  * @param table.name - Name of the entity to check.
12304
12373
  * @param table.position - Where the entity would be placed.
@@ -12673,9 +12742,6 @@ interface LuaPlayer extends LuaControl {
12673
12742
 
12674
12743
  /**
12675
12744
  * Sets the filter for this map editor infinity filters at the given index.
12676
- * @remarks
12677
- * Applies to subclasses: InfinityContainer
12678
- *
12679
12745
  * @param filter - The new filter or `nil` to clear the filter.
12680
12746
  * @param index - The index to set.
12681
12747
  */
@@ -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.70
5
+ // Factorio version 1.1.71
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.70
5
+ // Factorio version 1.1.71
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.70
5
+ // Factorio version 1.1.71
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.70
5
+ // Factorio version 1.1.71
6
6
  // API version 3
7
7
 
8
8
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "factorio-types",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
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",