factorio-types 1.2.62 → 1.2.64

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 2.1.10
5
+ // Factorio version 2.1.12
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -406,6 +406,10 @@ interface LuaBootstrap {
406
406
  * Converts LuaEventType into related value of defines.events. Value will be provided also if event was not given a constant inside of defines.events.
407
407
  */
408
408
  get_event_id(this: void, event: LuaEventType): defines.events;
409
+ /**
410
+ * Converts LuaEventType into corresponding event name. If event has no name, no value will be given.
411
+ */
412
+ get_event_name(this: void, event: LuaEventType): string | null;
409
413
  /**
410
414
  * Gets the mod event order as a string.
411
415
  */
@@ -7751,7 +7755,7 @@ interface LuaEntity extends LuaControl {
7751
7755
  /**
7752
7756
  * The effects being applied to this entity, if any. For beacons, this is the effect the beacon is broadcasting.
7753
7757
  */
7754
- readonly effects?: ModuleEffects;
7758
+ readonly effects?: Effect;
7755
7759
  /**
7756
7760
  * The buffer size for the electric energy source. `nil` if the entity doesn't have an electric energy source.
7757
7761
  *
@@ -14265,7 +14269,7 @@ interface LuaItemPrototype extends LuaPrototypeBase {
14265
14269
  /**
14266
14270
  * Effects of this module at the specified quality.
14267
14271
  */
14268
- get_module_effects(this: void, quality?: QualityID): ModuleEffects | null;
14272
+ get_module_effects(this: void, quality?: QualityID): Effect | null;
14269
14273
  /**
14270
14274
  * The color used when doing normal selection with this selection tool prototype.
14271
14275
  */
@@ -14418,7 +14422,7 @@ interface LuaItemPrototype extends LuaPrototypeBase {
14418
14422
  /**
14419
14423
  * Effects of this module.
14420
14424
  */
14421
- readonly module_effects?: ModuleEffects;
14425
+ readonly module_effects?: Effect;
14422
14426
  readonly moved_to_hub_when_building: boolean;
14423
14427
  /**
14424
14428
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
@@ -16253,6 +16257,14 @@ interface LuaPlayer extends LuaControl {
16253
16257
  * The wire drag target for this player, if any.
16254
16258
  */
16255
16259
  readonly drag_target?: DragTarget;
16260
+ /**
16261
+ * The map editor settings if the map editor exists for this player.
16262
+ *
16263
+ * When reading this may return nil if the map editor does not yet exist for this player.
16264
+ *
16265
+ * When writing the full table of settings is always required.
16266
+ */
16267
+ editor_settings?: MapEditorSetting;
16256
16268
  /**
16257
16269
  * The source entity used during entity settings copy-paste, if any.
16258
16270
  */
@@ -16793,6 +16805,7 @@ interface LuaPrototypes {
16793
16805
  readonly max_force_distraction_distance: double;
16794
16806
  readonly max_gate_activation_distance: double;
16795
16807
  readonly max_inserter_reach_distance: double;
16808
+ readonly max_logistics_connection_distance: float;
16796
16809
  readonly max_pipe_to_ground_distance: uint8;
16797
16810
  readonly max_underground_belt_distance: uint8;
16798
16811
  /**
@@ -16920,6 +16933,13 @@ interface LuaPumpControlBehavior extends LuaGenericOnOffControlBehavior {
16920
16933
  * Prototype of a quality.
16921
16934
  */
16922
16935
  interface LuaQualityPrototype extends LuaPrototypeBase {
16936
+ /**
16937
+ * Performs quality roll
16938
+ * @param quality_effect Strength of quality effect. Larger value makes it easier to roll better qualities.
16939
+ * @param quality_seed Random value in [0, 1) used to select result quality.
16940
+ * @param force Force which is doing the quality roll. Used to select unlocked qualities. If not provided, all qualities are considered unlocked.
16941
+ */
16942
+ roll_quality(this: void, quality_effect: EffectValue, quality_seed: double, force?: ForceID): LuaQualityPrototype;
16923
16943
  readonly accumulator_capacity_multiplier: double;
16924
16944
  readonly asteroid_collector_collection_radius_bonus: uint32;
16925
16945
  readonly beacon_module_slots_bonus: ItemStackIndex;
@@ -17288,7 +17308,7 @@ interface LuaRecipe {
17288
17308
  /**
17289
17309
  * The productivity bonus for this recipe.
17290
17310
  */
17291
- productivity_bonus: float;
17311
+ productivity_bonus: EffectValue;
17292
17312
  /**
17293
17313
  * The results/products of this recipe.
17294
17314
  * @example ```
@@ -17439,6 +17459,10 @@ interface LuaRecipePrototype extends LuaPrototypeBase {
17439
17459
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
17440
17460
  */
17441
17461
  readonly object_name: string;
17462
+ /**
17463
+ * Event raised when this recipe is crafted. Only available if {@link RecipePrototype::raise_on_crafted | prototype:RecipePrototype::raise_on_crafted} was set to true.
17464
+ */
17465
+ readonly on_crafted_event?: LuaEventType;
17442
17466
  /**
17443
17467
  * Used to determine how many extra items are put into an assembling machine before it's considered "full enough".
17444
17468
  */
@@ -20591,7 +20615,7 @@ interface LuaSurface {
20591
20615
  /**
20592
20616
  * Surface-wide effects applied to entities with effect receivers. `nil` if this surface is not using surface-wide effect source.
20593
20617
  */
20594
- global_effect?: ModuleEffects;
20618
+ global_effect?: Effect;
20595
20619
  /**
20596
20620
  * Global electric network for this surface.
20597
20621
  */
@@ -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 2.1.10
5
+ // Factorio version 2.1.12
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -2507,8 +2507,21 @@ interface EditorUtilityConstants {
2507
2507
  tile_editor_selection_preview_radius: uint8;
2508
2508
  decorative_editor_selection_preview_radius: uint8;
2509
2509
  }
2510
+ /**
2511
+ * @example ```
2512
+ -- These are the effects of the vanilla Speed Module 3
2513
+ {speed = 0.5, consumption = 0.7, quality = -0.025}
2514
+ ```
2515
+ */
2516
+ interface Effect {
2517
+ consumption?: EffectValue;
2518
+ speed?: EffectValue;
2519
+ productivity?: EffectValue;
2520
+ pollution?: EffectValue;
2521
+ quality?: EffectValue;
2522
+ }
2510
2523
  interface EffectReceiver {
2511
- base_effect: ModuleEffects;
2524
+ base_effect: Effect;
2512
2525
  uses_module_effects: boolean;
2513
2526
  uses_beacon_effects: boolean;
2514
2527
  /**
@@ -2521,9 +2534,13 @@ interface EffectReceiver {
2521
2534
  pollution_limits: EffectValueRange;
2522
2535
  quality_limits: EffectValueRange;
2523
2536
  }
2537
+ /**
2538
+ * Precision is ignored beyond four decimals - `0.56789` results in `0.5678` and means 56.78% etc. Values can range from `-1000.0000` to `1000.0000`.
2539
+ */
2540
+ type EffectValue = float;
2524
2541
  interface EffectValueRange {
2525
- low: double;
2526
- high: double;
2542
+ low: EffectValue;
2543
+ high: EffectValue;
2527
2544
  }
2528
2545
  /**
2529
2546
  * An item thrown overboard on a space platform.
@@ -6861,6 +6878,40 @@ interface MapDifficultySettings {
6861
6878
  */
6862
6879
  spoil_time_modifier: double;
6863
6880
  }
6881
+ interface MapEditorSetting {
6882
+ position?: MapPosition;
6883
+ inventory_size: ItemStackIndex;
6884
+ gun_inventory_size: ItemStackIndex;
6885
+ /**
6886
+ * Must be >= 0.34375.
6887
+ */
6888
+ movement_speed: double;
6889
+ /**
6890
+ * Must be >= 0.34375.
6891
+ */
6892
+ base_movement_speed: double;
6893
+ item_pickup_distance: double;
6894
+ loot_pickup_distance: double;
6895
+ mining_speed: double;
6896
+ enable_flash_light: boolean;
6897
+ adjust_speed_based_off_zoom: boolean;
6898
+ render_as_day: boolean;
6899
+ instant_blueprint_building: boolean;
6900
+ instant_deconstruction: boolean;
6901
+ instant_upgrading: boolean;
6902
+ instant_rail_planner: boolean;
6903
+ show_status_icons: boolean;
6904
+ show_hidden_entities: boolean;
6905
+ show_entity_tags: boolean;
6906
+ show_entity_health_bars: boolean;
6907
+ show_additional_entity_info_gui: boolean;
6908
+ generate_neighbor_chunks: boolean;
6909
+ fill_built_entity_energy_buffers: boolean;
6910
+ show_character_tab_in_controller_gui: boolean;
6911
+ show_infinity_filters_in_controller_gui: boolean;
6912
+ placed_corpses_never_expire: boolean;
6913
+ ignore_tile_conditions: boolean;
6914
+ }
6864
6915
  /**
6865
6916
  * The data that can be extracted from a map exchange string, as a plain table.
6866
6917
  */
@@ -7248,23 +7299,6 @@ interface ModSettingPrototypeFilterType extends BaseModSettingPrototypeFilter {
7248
7299
  * Used by {@link TechnologyModifier | runtime:TechnologyModifier}.
7249
7300
  */
7250
7301
  type ModifierType = 'inserter-stack-size-bonus' | 'bulk-inserter-capacity-bonus' | 'laboratory-speed' | 'character-logistic-trash-slots' | 'maximum-following-robots-count' | 'worker-robot-speed' | 'worker-robot-storage' | 'turret-attack' | 'ammo-damage' | 'give-item' | 'gun-speed' | 'unlock-recipe' | 'character-crafting-speed' | 'character-mining-speed' | 'character-running-speed' | 'character-build-distance' | 'character-item-drop-distance' | 'character-reach-distance' | 'character-resource-reach-distance' | 'character-item-pickup-distance' | 'character-loot-pickup-distance' | 'character-inventory-slots-bonus' | 'deconstruction-time-to-live' | 'max-failed-attempts-per-tick-per-construction-queue' | 'max-successful-attempts-per-tick-per-construction-queue' | 'character-health-bonus' | 'mining-drill-productivity-bonus' | 'train-braking-force-bonus' | 'worker-robot-battery' | 'laboratory-productivity' | 'follower-robot-lifetime' | 'artillery-range' | 'nothing' | 'character-logistic-requests' | 'unlock-space-location' | 'unlock-quality' | 'unlock-space-platforms' | 'unlock-circuit-network' | 'cargo-landing-pad-count' | 'max-cargo-bay-unloading-distance' | 'change-recipe-productivity' | 'cliff-deconstruction-enabled' | 'mining-with-fluid' | 'rail-support-on-deep-oil-ocean' | 'rail-planner-allow-elevated-rails' | 'beacon-distribution' | 'create-ghost-on-entity-death' | 'belt-stack-size-bonus' | 'vehicle-logistics' | 'unlock-logistic-network' | 'unlock-travel-to-space-platforms';
7251
- /**
7252
- * The percentual increase of the attribute. A value of `0.6` means a 60% increase.
7253
- */
7254
- type ModuleEffectValue = float;
7255
- /**
7256
- * @example ```
7257
- -- These are the effects of the vanilla Speed Module 3
7258
- {speed = 0.5, consumption = 0.7, quality = -0.025}
7259
- ```
7260
- */
7261
- interface ModuleEffects {
7262
- consumption?: ModuleEffectValue;
7263
- speed?: ModuleEffectValue;
7264
- productivity?: ModuleEffectValue;
7265
- pollution?: ModuleEffectValue;
7266
- quality?: ModuleEffectValue;
7267
- }
7268
7302
  type MouseButtonFlags = ('left' | 'right' | /**
7269
7303
  * Sets both `"left"` and `"right"` flags.
7270
7304
  */
@@ -7326,6 +7360,48 @@ interface OldTileAndPosition {
7326
7360
  old_tile: LuaTilePrototype;
7327
7361
  position: TilePosition;
7328
7362
  }
7363
+ interface OnRecipeCraftedData {
7364
+ /**
7365
+ * Identifier of the event.
7366
+ */
7367
+ name: defines.events;
7368
+ /**
7369
+ * Tick the event was generated.
7370
+ */
7371
+ tick: MapTick;
7372
+ /**
7373
+ * Entity that crafted recipe.
7374
+ */
7375
+ entity: LuaEntity;
7376
+ /**
7377
+ * Name of recipe that was crafted.
7378
+ */
7379
+ recipe: string;
7380
+ /**
7381
+ * Quality of the recipe crafted.
7382
+ */
7383
+ recipe_quality: string;
7384
+ /**
7385
+ * Quality effect used when giving products. Not provided if value is 0. May be different than value obtained from {@link LuaEntity::effects | runtime:LuaEntity::effects} when quality modules were changed between craft starting and products being given.
7386
+ */
7387
+ quality_effect?: EffectValue;
7388
+ /**
7389
+ * Random value in range [0, 1) that was used when selecting product quality. Only provided when quality_effect is provided.
7390
+ */
7391
+ quality_seed?: double;
7392
+ /**
7393
+ * Quality of products given. May be different than recipe quality if quality modules are present. Always provided even if quality_effect is zero because {@link LuaEntity::result_quality | runtime:LuaEntity::result_quality} may have been used. Only used by products without quality control.
7394
+ */
7395
+ product_quality: string;
7396
+ /**
7397
+ * If crafted as part of bonus products.
7398
+ */
7399
+ bonus: boolean;
7400
+ /**
7401
+ * Random value in range {@link 0, 1) used as part of shared roll when giving products. Related to [ProductPrototypeBase::shared_probability | prototype:ProductPrototypeBase::shared_probability}.
7402
+ */
7403
+ shared_roll: double;
7404
+ }
7329
7405
  interface OrientedCliffPrototypeSet {
7330
7406
  west_to_east: BoundingBox;
7331
7407
  north_to_south: BoundingBox;
@@ -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/prototype-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 2.1.10
5
+ // Factorio version 2.1.12
6
6
  // API version 6
7
7
 
8
8
  declare namespace prototype {
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 2.1.10
5
+ // Factorio version 2.1.12
6
6
  // API version 6
7
7
 
8
8
  declare namespace defines {
@@ -2286,10 +2286,11 @@ enum segmented_unit_created_cause {
2286
2286
  script_created = 1
2287
2287
  }
2288
2288
  enum selection_mode {
2289
- alt_reverse_select = 3,
2289
+ alt_reverse_select = 4,
2290
2290
  alt_select = 1,
2291
- reverse_select = 2,
2292
- select = 0
2291
+ reverse_select = 3,
2292
+ select = 0,
2293
+ super_forced_select = 2
2293
2294
  }
2294
2295
  enum shooting {
2295
2296
  not_shooting = 0,
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 2.1.10
5
+ // Factorio version 2.1.12
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -2246,6 +2246,7 @@ interface on_player_deconstructed_area {
2246
2246
  * The record that was used to select the area.
2247
2247
  */
2248
2248
  record?: LuaRecord;
2249
+ selection_mode: defines.selection_mode;
2249
2250
  /**
2250
2251
  * The item stack used to select the area.
2251
2252
  */
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 2.1.10
5
+ // Factorio version 2.1.12
6
6
  // API version 6
7
7
 
8
8
  /**
@@ -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/prototype-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 2.1.10
5
+ // Factorio version 2.1.12
6
6
  // API version 6
7
7
 
8
8
  declare namespace prototype {
@@ -7720,6 +7720,20 @@ interface RecipePrototype extends Prototype {
7720
7720
  */
7721
7721
  overload_multiplier?: uint32;
7722
7722
  preserve_products_in_machine_output?: boolean;
7723
+ /**
7724
+ * If set to true, an event with identifier of {@link LuaRecipePrototype::on_crafted_event | runtime:LuaRecipePrototype::on_crafted_event} will be raised when this recipe is crafted. Currently this is only raised when recipe is crafted by a crafting machine.
7725
+ *
7726
+ * Event raised will be given data as described by {@link OnRecipeCraftedData | runtime:OnRecipeCraftedData}.
7727
+ * @example ```
7728
+ -- in data stage:
7729
+ data.raw.recipe["iron-plate"].raise_on_crafted = true
7730
+ -- in control stage:
7731
+ script.on_event(prototypes.recipe["iron-plate"].on_crafted_event, function(event)
7732
+ game.print("Iron plate was crafted by ".. event.entity.name .. " at " .. event.entity.gps_tag)
7733
+ end)
7734
+ ```
7735
+ */
7736
+ raise_on_crafted?: boolean;
7723
7737
  requester_paste_multiplier?: uint32;
7724
7738
  /**
7725
7739
  * Whether enabling this recipe requires the ingredients be unlocked before the products are marked as unlocked.
package/dist/types.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/prototype-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 2.1.10
5
+ // Factorio version 2.1.12
6
6
  // API version 6
7
7
 
8
8
  declare namespace prototype {
@@ -3626,6 +3626,10 @@ type CursorBoxType = /**
3626
3626
  * Green by default.
3627
3627
  */
3628
3628
  'blueprint-snap-rectangle' | 'spidertron-remote-selected' | 'spidertron-remote-to-be-selected';
3629
+ /**
3630
+ * The name of an {@link CustomEventPrototype | prototype:CustomEventPrototype}.
3631
+ */
3632
+ type CustomEventID = string;
3629
3633
  /**
3630
3634
  * Allows to add extra description items to the tooltip.
3631
3635
  */
@@ -4076,12 +4080,6 @@ type EffectTypeLimitation = (/**
4076
4080
  'quality')[];
4077
4081
  /**
4078
4082
  * Precision is ignored beyond four decimals - `0.56789` results in `0.5678` and means 56.78% etc. Values can range from `-1000.0000` to `1000.0000`.
4079
- * @example ```
4080
- {speed = 0.07} -- 7% bonus
4081
- ```
4082
- * @example ```
4083
- {quality = 0.025} -- 2.5% bonus
4084
- ```
4085
4083
  */
4086
4084
  type EffectValue = float;
4087
4085
  interface EffectValueRange {
@@ -9456,6 +9454,10 @@ interface RotatedSpriteFrame {
9456
9454
  y?: SpriteSizeType;
9457
9455
  }
9458
9456
  interface ScriptTriggerEffectItem extends TriggerEffectItem {
9457
+ /**
9458
+ * Event to be raised. When set, that event will be raised instead of {@link on_script_trigger_effect | runtime:on_script_trigger_effect}.
9459
+ */
9460
+ custom_event?: CustomEventID;
9459
9461
  /**
9460
9462
  * The effect ID that will be provided in {@link on_script_trigger_effect | runtime:on_script_trigger_effect}.
9461
9463
  */
@@ -11892,6 +11894,10 @@ interface ThrowCapsuleAction {
11892
11894
  uses_stack?: boolean;
11893
11895
  }
11894
11896
  interface ThrusterGraphicsSet extends WorkingVisualisations {
11897
+ /**
11898
+ * If true the starting frame will be randomized upon placement.
11899
+ */
11900
+ animation_random_start_frame?: boolean;
11895
11901
  flame?: Sprite;
11896
11902
  flame_effect?: EffectTexture;
11897
11903
  flame_effect_height?: float;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "factorio-types",
3
- "version": "1.2.62",
3
+ "version": "1.2.64",
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",
@@ -23,7 +23,7 @@
23
23
  "src/**/*.d.ts",
24
24
  "dist/**/*.d.ts"
25
25
  ],
26
- "factorioVersion": "2.1.10",
26
+ "factorioVersion": "2.1.12",
27
27
  "dependencies": {
28
28
  "lua-types": "^2.13.1"
29
29
  },