typed-factorio 1.13.0 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * The template can contain placeholders such as `__1__` or `__2__`. These will be replaced by the respective parameter in the LocalisedString. The parameters themselves can be other localised strings, which will be processed recursively in the same fashion. Localised strings can not be recursed deeper than 20 levels and can not have more than 20 parameters.
11
11
  *
12
- * As a special case, when the key is just the empty string, all the parameters will be concatenated (after processing, if any are localised strings). If there is only one parameter, it will be used as is.
12
+ * There are two special flags for the localised string, indicated by the key being a particular string. First, if the key is the empty string (`""`), then all parameters will be concatenated (after processing, if any are localised strings themselves). Second, if the key is a question mark (`"?"`), then the first valid parameter will be used. A parameter can be invalid if its name doesn't match any string template. If no parameters are valid, the last one is returned. This is useful to implement a fallback for missing locale templates.
13
13
  *
14
14
  * Furthermore, when an API function expects a localised string, it will also accept a regular string (i.e. not a table) which will not be translated, as well as a number, boolean or `nil`, which will be converted to their textual representation.
15
15
  * @example In the English translation, this will print `"No ammo"`; in the Czech translation, it will print `"Bez munice"`:
@@ -34,6 +34,13 @@
34
34
  * ```
35
35
  * game.print({"", {"item-name.iron-plate"}, ": ", 60})
36
36
  * ```
37
+ * @example As an example of a localised string with fallback, consider this:
38
+ *
39
+ * ```
40
+ * {"?", {"", {"entity-description.furnace"}, "\n"}, {"item-description.furnace"}, "optional fallback"}
41
+ * ```
42
+ *
43
+ * If `entity-description.furnace` exists, it is concatenated with `"\n"` and returned. Otherwise, if `item-description.furnace` exists, it is returned as-is. Otherwise, `"optional fallback"` is returned. If this value wasn't specified, the translation result would be `"Unknown key: 'item-description.furnace'"`.
37
44
  * @see {@link https://lua-api.factorio.com/latest/Concepts.html#LocalisedString Online documentation}
38
45
  */
39
46
  type LocalisedString = string | number | boolean | LuaObject | nil | readonly [string, ...LocalisedString[]]
@@ -291,7 +298,7 @@ interface SmokeSource {
291
298
  type Vector = MapPositionArray
292
299
 
293
300
  /**
294
- * Two positions, specifying the top-left and bottom-right corner of the box respectively. Like with {@link MapPosition}, the names of the members may be omitted. When read from the game, the third member `orientation` is present if it is non-zero, however it is ignored when provided to the game.
301
+ * Two positions, specifying the top-left and bottom-right corner of the box respectively. Like with {@link MapPosition}, the names of the members may be omitted. When read from the game, the third member `orientation` is present if it is non-zero.
295
302
  * @see BoundingBoxArray
296
303
  * @example Explicit definition:
297
304
  *
@@ -1073,17 +1080,6 @@ interface MapExchangeStringData {
1073
1080
  readonly map_gen_settings: MapGenSettings
1074
1081
  }
1075
1082
 
1076
- interface BlueprintItemIcon {
1077
- /**
1078
- * Name of the item prototype whose icon should be used.
1079
- */
1080
- readonly name: string
1081
- /**
1082
- * Index of the icon in the blueprint icons slots. Has to be an integer in the range [1, 4].
1083
- */
1084
- readonly index: uint
1085
- }
1086
-
1087
1083
  interface BlueprintSignalIcon {
1088
1084
  /**
1089
1085
  * The icon to use. It can be any item icon as well as any virtual signal icon.
@@ -2631,7 +2627,7 @@ interface CircuitConnectionDefinition {
2631
2627
 
2632
2628
  interface WireConnectionDefinition {
2633
2629
  /**
2634
- * Wire color, either {@link defines.wire_type.red} or {@link defines.wire_type.green}.
2630
+ * The type of wire used.
2635
2631
  */
2636
2632
  readonly wire: defines.wire_type
2637
2633
  /**
@@ -3093,14 +3089,15 @@ type SimpleItemStack = string | ItemStackDefinition
3093
3089
  type FluidIdentification = string | LuaFluidPrototype | Fluid
3094
3090
 
3095
3091
  /**
3096
- * A force may be specified in one of two ways.
3092
+ * A force may be specified in one of three ways.
3097
3093
  *
3098
3094
  * **Options:**
3095
+ * - ForceIndex: The force index.
3099
3096
  * - `string`: The force name.
3100
3097
  * - {@link LuaForce}: A reference to {@link LuaForce} may be passed directly.
3101
3098
  * @see {@link https://lua-api.factorio.com/latest/Concepts.html#ForceIdentification Online documentation}
3102
3099
  */
3103
- type ForceIdentification = string | LuaForce
3100
+ type ForceIdentification = ForceIndex | string | LuaForce
3104
3101
 
3105
3102
  /**
3106
3103
  * A technology may be specified in one of three ways.
@@ -4143,7 +4140,9 @@ type CapsuleAction =
4143
4140
  * - `"entity-with-force"`: Deprecated. Replaced by `is-military-target`.
4144
4141
  * - `"is-military-target"`: Selects entities that are {@link LuaEntity#is_military_target military targets}.
4145
4142
  * - `"entity-with-owner"`: Selects entities that are {@link LuaEntity#is_entity_with_owner entities with owner}.
4146
- * - `"avoid-rolling-stock"`: Selects entities that are not `rolling-stocks`.
4143
+ * - `"avoid-rolling-stock"`: Selects entities that are not `rolling-stock`s.
4144
+ * - `"entity-ghost"`: Selects entities that are `entity-ghost`s.
4145
+ * - `"tile-ghost"`: Selects entities that are `tile-ghost`s.
4147
4146
  * @see {@link https://lua-api.factorio.com/latest/Concepts.html#SelectionModeFlags Online documentation}
4148
4147
  */
4149
4148
  interface SelectionModeFlags {
@@ -4232,9 +4231,17 @@ interface SelectionModeFlags {
4232
4231
  */
4233
4232
  readonly "entity-with-owner"?: true
4234
4233
  /**
4235
- * Selects entities that are not `rolling-stocks`.
4234
+ * Selects entities that are not `rolling-stock`s.
4236
4235
  */
4237
4236
  readonly "avoid-rolling-stock"?: true
4237
+ /**
4238
+ * Selects entities that are `entity-ghost`s.
4239
+ */
4240
+ readonly "entity-ghost"?: true
4241
+ /**
4242
+ * Selects entities that are `tile-ghost`s.
4243
+ */
4244
+ readonly "tile-ghost"?: true
4238
4245
  }
4239
4246
 
4240
4247
  interface LogisticFilter {
@@ -4252,15 +4259,11 @@ interface LogisticFilter {
4252
4259
  readonly count: uint
4253
4260
  }
4254
4261
 
4255
- /**
4256
- * @remarks Runtime settings can be changed through console commands and by the mod that owns the settings by writing a new table to the ModSetting.
4257
- * @see {@link https://lua-api.factorio.com/latest/Concepts.html#ModSetting Online documentation}
4258
- */
4259
4262
  interface ModSetting {
4260
4263
  /**
4261
4264
  * The value of the mod setting. The type depends on the kind of setting.
4262
4265
  */
4263
- readonly value: int | double | boolean | string
4266
+ readonly value: int | double | boolean | string | Color
4264
4267
  }
4265
4268
 
4266
4269
  /**
@@ -5194,7 +5197,7 @@ type ModSettingPrototypeFilter =
5194
5197
  */
5195
5198
  interface BaseTechnologyPrototypeFilter {
5196
5199
  /**
5197
- * The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"level"`, `"max-level"`, `"time"`.
5200
+ * The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"unlocks-recipe"`, `"level"`, `"max-level"`, `"time"`.
5198
5201
  */
5199
5202
  readonly filter:
5200
5203
  | "enabled"
@@ -5204,6 +5207,7 @@ interface BaseTechnologyPrototypeFilter {
5204
5207
  | "has-effects"
5205
5208
  | "has-prerequisites"
5206
5209
  | "research-unit-ingredient"
5210
+ | "unlocks-recipe"
5207
5211
  | "level"
5208
5212
  | "max-level"
5209
5213
  | "time"
@@ -5228,6 +5232,17 @@ interface ResearchUnitIngredientTechnologyPrototypeFilter extends BaseTechnology
5228
5232
  readonly ingredient: string
5229
5233
  }
5230
5234
 
5235
+ /**
5236
+ * `"unlocks-recipe"` variant of {@link TechnologyPrototypeFilter}.
5237
+ */
5238
+ interface UnlocksRecipeTechnologyPrototypeFilter extends BaseTechnologyPrototypeFilter {
5239
+ readonly filter: "unlocks-recipe"
5240
+ /**
5241
+ * The recipe to check.
5242
+ */
5243
+ readonly recipe: string
5244
+ }
5245
+
5231
5246
  /**
5232
5247
  * `"level"` variant of {@link TechnologyPrototypeFilter}.
5233
5248
  */
@@ -5305,6 +5320,7 @@ interface OtherTechnologyPrototypeFilter extends BaseTechnologyPrototypeFilter {
5305
5320
  *
5306
5321
  * Other attributes may be specified depending on `filter`:
5307
5322
  * - `"research-unit-ingredient"`: {@link ResearchUnitIngredientTechnologyPrototypeFilter}
5323
+ * - `"unlocks-recipe"`: {@link UnlocksRecipeTechnologyPrototypeFilter}
5308
5324
  * - `"level"`: {@link LevelTechnologyPrototypeFilter}
5309
5325
  * - `"max-level"`: {@link MaxLevelTechnologyPrototypeFilter}
5310
5326
  * - `"time"`: {@link TimeTechnologyPrototypeFilter}
@@ -5312,6 +5328,7 @@ interface OtherTechnologyPrototypeFilter extends BaseTechnologyPrototypeFilter {
5312
5328
  */
5313
5329
  type TechnologyPrototypeFilter =
5314
5330
  | ResearchUnitIngredientTechnologyPrototypeFilter
5331
+ | UnlocksRecipeTechnologyPrototypeFilter
5315
5332
  | LevelTechnologyPrototypeFilter
5316
5333
  | MaxLevelTechnologyPrototypeFilter
5317
5334
  | TimeTechnologyPrototypeFilter
@@ -5323,6 +5340,7 @@ type TechnologyPrototypeFilter =
5323
5340
  */
5324
5341
  type TechnologyPrototypeFilterWrite =
5325
5342
  | ResearchUnitIngredientTechnologyPrototypeFilter
5343
+ | UnlocksRecipeTechnologyPrototypeFilter
5326
5344
  | LevelTechnologyPrototypeFilterWrite
5327
5345
  | MaxLevelTechnologyPrototypeFilterWrite
5328
5346
  | TimeTechnologyPrototypeFilterWrite
@@ -7314,6 +7332,120 @@ type LuaPlayerRepairedEntityEventFilter =
7314
7332
  | GhostNamePlayerRepairedEntityEventFilter
7315
7333
  | OtherPlayerRepairedEntityEventFilter
7316
7334
 
7335
+ /**
7336
+ * Common attributes to all variants of {@link LuaScriptRaisedTeleportedEventFilter}.
7337
+ */
7338
+ interface BaseScriptRaisedTeleportedEventFilter {
7339
+ /**
7340
+ * The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"`.
7341
+ */
7342
+ readonly filter:
7343
+ | "ghost"
7344
+ | "rail"
7345
+ | "rail-signal"
7346
+ | "rolling-stock"
7347
+ | "robot-with-logistics-interface"
7348
+ | "vehicle"
7349
+ | "turret"
7350
+ | "crafting-machine"
7351
+ | "wall-connectable"
7352
+ | "transport-belt-connectable"
7353
+ | "circuit-network-connectable"
7354
+ | "type"
7355
+ | "name"
7356
+ | "ghost_type"
7357
+ | "ghost_name"
7358
+ /**
7359
+ * How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
7360
+ */
7361
+ readonly mode?: "or" | "and"
7362
+ /**
7363
+ * Inverts the condition. Default is `false`.
7364
+ */
7365
+ readonly invert?: boolean
7366
+ }
7367
+
7368
+ /**
7369
+ * `"type"` variant of {@link LuaScriptRaisedTeleportedEventFilter}.
7370
+ */
7371
+ interface TypeScriptRaisedTeleportedEventFilter extends BaseScriptRaisedTeleportedEventFilter {
7372
+ readonly filter: "type"
7373
+ /**
7374
+ * The prototype type
7375
+ */
7376
+ readonly type: string
7377
+ }
7378
+
7379
+ /**
7380
+ * `"name"` variant of {@link LuaScriptRaisedTeleportedEventFilter}.
7381
+ */
7382
+ interface NameScriptRaisedTeleportedEventFilter extends BaseScriptRaisedTeleportedEventFilter {
7383
+ readonly filter: "name"
7384
+ /**
7385
+ * The prototype name
7386
+ */
7387
+ readonly name: string
7388
+ }
7389
+
7390
+ /**
7391
+ * `"ghost_type"` variant of {@link LuaScriptRaisedTeleportedEventFilter}.
7392
+ */
7393
+ interface GhostTypeScriptRaisedTeleportedEventFilter extends BaseScriptRaisedTeleportedEventFilter {
7394
+ readonly filter: "ghost_type"
7395
+ /**
7396
+ * The ghost prototype type
7397
+ */
7398
+ readonly type: string
7399
+ }
7400
+
7401
+ /**
7402
+ * `"ghost_name"` variant of {@link LuaScriptRaisedTeleportedEventFilter}.
7403
+ */
7404
+ interface GhostNameScriptRaisedTeleportedEventFilter extends BaseScriptRaisedTeleportedEventFilter {
7405
+ readonly filter: "ghost_name"
7406
+ /**
7407
+ * The ghost prototype name
7408
+ */
7409
+ readonly name: string
7410
+ }
7411
+
7412
+ /**
7413
+ * Variants of {@link LuaScriptRaisedTeleportedEventFilter} with no additional attributes.
7414
+ */
7415
+ interface OtherScriptRaisedTeleportedEventFilter extends BaseScriptRaisedTeleportedEventFilter {
7416
+ readonly filter:
7417
+ | "ghost"
7418
+ | "rail"
7419
+ | "rail-signal"
7420
+ | "rolling-stock"
7421
+ | "robot-with-logistics-interface"
7422
+ | "vehicle"
7423
+ | "turret"
7424
+ | "crafting-machine"
7425
+ | "wall-connectable"
7426
+ | "transport-belt-connectable"
7427
+ | "circuit-network-connectable"
7428
+ }
7429
+
7430
+ /**
7431
+ * Depending on the value of `filter`, the table may take additional fields. `filter` may be one of the following:
7432
+ *
7433
+ * Base attributes: {@link BaseScriptRaisedTeleportedEventFilter}
7434
+ *
7435
+ * Other attributes may be specified depending on `filter`:
7436
+ * - `"type"`: {@link TypeScriptRaisedTeleportedEventFilter}
7437
+ * - `"name"`: {@link NameScriptRaisedTeleportedEventFilter}
7438
+ * - `"ghost_type"`: {@link GhostTypeScriptRaisedTeleportedEventFilter}
7439
+ * - `"ghost_name"`: {@link GhostNameScriptRaisedTeleportedEventFilter}
7440
+ * @see {@link https://lua-api.factorio.com/latest/Concepts.html#LuaScriptRaisedTeleportedEventFilter Online documentation}
7441
+ */
7442
+ type LuaScriptRaisedTeleportedEventFilter =
7443
+ | TypeScriptRaisedTeleportedEventFilter
7444
+ | NameScriptRaisedTeleportedEventFilter
7445
+ | GhostTypeScriptRaisedTeleportedEventFilter
7446
+ | GhostNameScriptRaisedTeleportedEventFilter
7447
+ | OtherScriptRaisedTeleportedEventFilter
7448
+
7317
7449
  /**
7318
7450
  * Common attributes to all variants of {@link LuaEntityMarkedForUpgradeEventFilter}.
7319
7451
  */
@@ -939,6 +939,12 @@ declare namespace defines {
939
939
  * Event filter: {@link LuaScriptRaisedReviveEventFilter}
940
940
  */
941
941
  const script_raised_revive: EventId<ScriptRaisedReviveEvent, LuaScriptRaisedReviveEventFilter>
942
+ /**
943
+ * Event type: {@link ScriptRaisedTeleportedEvent}
944
+ *
945
+ * Event filter: {@link LuaScriptRaisedTeleportedEventFilter}
946
+ */
947
+ const script_raised_teleported: EventId<ScriptRaisedTeleportedEvent, LuaScriptRaisedTeleportedEventFilter>
942
948
  /**
943
949
  * Event type: {@link ScriptRaisedSetTilesEvent}
944
950
  */
@@ -1327,6 +1333,22 @@ declare namespace defines {
1327
1333
  * Event type: {@link OnPlayerAltReverseSelectedAreaEvent}
1328
1334
  */
1329
1335
  const on_player_alt_reverse_selected_area: EventId<OnPlayerAltReverseSelectedAreaEvent>
1336
+ /**
1337
+ * Event type: {@link OnGuiHoverEvent}
1338
+ */
1339
+ const on_gui_hover: EventId<OnGuiHoverEvent>
1340
+ /**
1341
+ * Event type: {@link OnGuiLeaveEvent}
1342
+ */
1343
+ const on_gui_leave: EventId<OnGuiLeaveEvent>
1344
+ /**
1345
+ * Event type: {@link OnCutsceneStartedEvent}
1346
+ */
1347
+ const on_cutscene_started: EventId<OnCutsceneStartedEvent>
1348
+ /**
1349
+ * Event type: {@link OnCutsceneFinishedEvent}
1350
+ */
1351
+ const on_cutscene_finished: EventId<OnCutsceneFinishedEvent>
1330
1352
  }
1331
1353
  /**
1332
1354
  * See the {@linkplain https://lua-api.factorio.com/latest/events.html events page} for more info on what events contain and when they get raised.
@@ -1452,6 +1474,8 @@ declare namespace defines {
1452
1474
  gui_click,
1453
1475
  gui_confirmed,
1454
1476
  gui_elem_changed,
1477
+ gui_hover,
1478
+ gui_leave,
1455
1479
  gui_location_changed,
1456
1480
  gui_selected_tab_changed,
1457
1481
  gui_selection_state_changed,
@@ -449,6 +449,44 @@ interface OnCutsceneCancelledEvent extends EventData {
449
449
  readonly tick: uint
450
450
  }
451
451
 
452
+ /**
453
+ * Called when a cutscene finishes naturally (was not cancelled).
454
+ * @see {@link https://lua-api.factorio.com/latest/events.html#on_cutscene_finished Online documentation}
455
+ */
456
+ interface OnCutsceneFinishedEvent extends EventData {
457
+ /**
458
+ * The player the cutscene was shown to.
459
+ */
460
+ readonly player_index: PlayerIndex
461
+ /**
462
+ * Identifier of the event
463
+ */
464
+ readonly name: typeof defines.events.on_cutscene_finished
465
+ /**
466
+ * Tick the event was generated.
467
+ */
468
+ readonly tick: uint
469
+ }
470
+
471
+ /**
472
+ * Called when a cutscene starts.
473
+ * @see {@link https://lua-api.factorio.com/latest/events.html#on_cutscene_started Online documentation}
474
+ */
475
+ interface OnCutsceneStartedEvent extends EventData {
476
+ /**
477
+ * The player the cutscene is being shown to.
478
+ */
479
+ readonly player_index: PlayerIndex
480
+ /**
481
+ * Identifier of the event
482
+ */
483
+ readonly name: typeof defines.events.on_cutscene_started
484
+ /**
485
+ * Tick the event was generated.
486
+ */
487
+ readonly tick: uint
488
+ }
489
+
452
490
  /**
453
491
  * Called when a cutscene is playing, each time it reaches a waypoint in that cutscene.
454
492
  *
@@ -1083,6 +1121,52 @@ interface OnGuiElemChangedEvent extends EventData {
1083
1121
  readonly tick: uint
1084
1122
  }
1085
1123
 
1124
+ /**
1125
+ * Called when {@link LuaGuiElement} is hovered by the mouse.
1126
+ * @see {@link https://lua-api.factorio.com/latest/events.html#on_gui_hover Online documentation}
1127
+ */
1128
+ interface OnGuiHoverEvent extends EventData {
1129
+ /**
1130
+ * The element that is being hovered over.
1131
+ */
1132
+ readonly element: LuaGuiElement
1133
+ /**
1134
+ * The player whose cursor is hovering.
1135
+ */
1136
+ readonly player_index: PlayerIndex
1137
+ /**
1138
+ * Identifier of the event
1139
+ */
1140
+ readonly name: typeof defines.events.on_gui_hover
1141
+ /**
1142
+ * Tick the event was generated.
1143
+ */
1144
+ readonly tick: uint
1145
+ }
1146
+
1147
+ /**
1148
+ * Called when the player's cursor leaves a {@link LuaGuiElement} that was previously hovered.
1149
+ * @see {@link https://lua-api.factorio.com/latest/events.html#on_gui_leave Online documentation}
1150
+ */
1151
+ interface OnGuiLeaveEvent extends EventData {
1152
+ /**
1153
+ * The element that was being hovered.
1154
+ */
1155
+ readonly element: LuaGuiElement
1156
+ /**
1157
+ * The player whose cursor was hovering.
1158
+ */
1159
+ readonly player_index: PlayerIndex
1160
+ /**
1161
+ * Identifier of the event
1162
+ */
1163
+ readonly name: typeof defines.events.on_gui_leave
1164
+ /**
1165
+ * Tick the event was generated.
1166
+ */
1167
+ readonly tick: uint
1168
+ }
1169
+
1086
1170
  /**
1087
1171
  * Called when {@link LuaGuiElement} element location is changed (related to frames in `player.gui.screen`).
1088
1172
  * @see {@link https://lua-api.factorio.com/latest/events.html#on_gui_location_changed Online documentation}
@@ -1962,7 +2046,7 @@ interface OnPlayerCreatedEvent extends EventData {
1962
2046
  }
1963
2047
 
1964
2048
  /**
1965
- * Called after a players cursorstack changed in some way.
2049
+ * Called after a player's {@link LuaControl#cursor_stack cursor stack} changed in some way.
1966
2050
  * @see {@link https://lua-api.factorio.com/latest/events.html#on_player_cursor_stack_changed Online documentation}
1967
2051
  */
1968
2052
  interface OnPlayerCursorStackChangedEvent extends EventData {
@@ -2455,12 +2539,12 @@ interface OnPlayerPromotedEvent extends EventData {
2455
2539
  }
2456
2540
 
2457
2541
  /**
2458
- * Called when a player is removed (deleted) from the game. Not to be confused with the player logging of this is different in that the player is deleted as if he never existed in the save file.
2542
+ * Called when a player is removed (deleted) from the game. This is markedly different from a player temporarily {@link OnPlayerLeftGameEvent leaving} the game, and instead behaves like the player never existed in the save file.
2459
2543
  * @see {@link https://lua-api.factorio.com/latest/events.html#on_player_removed Online documentation}
2460
2544
  */
2461
2545
  interface OnPlayerRemovedEvent extends EventData {
2462
2546
  /**
2463
- * The player index that was removed
2547
+ * The index of the removed player.
2464
2548
  */
2465
2549
  readonly player_index: PlayerIndex
2466
2550
  /**
@@ -3158,12 +3242,12 @@ interface OnPrePlayerMinedItemEvent extends EventData {
3158
3242
  }
3159
3243
 
3160
3244
  /**
3161
- * Called before a player is removed (deleted) from the game. Not to be confused with the player logging of this is different in that the player is deleted as if he never existed in the save file.
3245
+ * Called before a player is removed (deleted) from the game. This is markedly different from a player temporarily {@link OnPlayerLeftGameEvent leaving} the game, and instead behaves like the player never existed in the save file.
3162
3246
  * @see {@link https://lua-api.factorio.com/latest/events.html#on_pre_player_removed Online documentation}
3163
3247
  */
3164
3248
  interface OnPrePlayerRemovedEvent extends EventData {
3165
3249
  /**
3166
- * The player index that will be removed
3250
+ * The index of the removed player.
3167
3251
  */
3168
3252
  readonly player_index: PlayerIndex
3169
3253
  /**
@@ -3802,7 +3886,7 @@ interface OnSpiderCommandCompletedEvent extends EventData {
3802
3886
  }
3803
3887
 
3804
3888
  /**
3805
- * Called when a translation request generated through {@link LuaPlayer#request_translation LuaPlayer::request_translation} is translated.
3889
+ * Called when a translation request generated through {@link LuaPlayer#request_translation LuaPlayer::request_translation} or {@link LuaPlayer#request_translations LuaPlayer::request_translations} has been completed.
3806
3890
  * @see {@link https://lua-api.factorio.com/latest/events.html#on_string_translated Online documentation}
3807
3891
  */
3808
3892
  interface OnStringTranslatedEvent extends EventData {
@@ -3886,7 +3970,7 @@ interface OnSurfaceDeletedEvent extends EventData {
3886
3970
  }
3887
3971
 
3888
3972
  /**
3889
- * Called after a surface is imported.
3973
+ * Called after a surface is imported via the map editor.
3890
3974
  * @see {@link https://lua-api.factorio.com/latest/events.html#on_surface_imported Online documentation}
3891
3975
  */
3892
3976
  interface OnSurfaceImportedEvent extends EventData {
@@ -4215,6 +4299,33 @@ interface ScriptRaisedSetTilesEvent extends EventData {
4215
4299
  readonly tick: uint
4216
4300
  }
4217
4301
 
4302
+ /**
4303
+ * A static event mods can use to tell other mods they teleported something by script. This event is only raised if a mod does so with {@link LuaBootstrap#raise_event LuaBootstrap::raise_event} or {@link LuaBootstrap#raise_script_teleported LuaBootstrap::raise_script_teleported}, or when `raise_teleported` is passed to {@link LuaControl#teleport LuaControl::teleport}. Can be filtered using {@link LuaScriptRaisedTeleportedEventFilter}.
4304
+ * @see {@link https://lua-api.factorio.com/latest/events.html#script_raised_teleported Online documentation}
4305
+ */
4306
+ interface ScriptRaisedTeleportedEvent extends EventData {
4307
+ /**
4308
+ * The entity that was teleported.
4309
+ */
4310
+ readonly entity: LuaEntity
4311
+ /**
4312
+ * The entity's surface before the teleportation.
4313
+ */
4314
+ readonly old_surface_index: uint8
4315
+ /**
4316
+ * The entity's position before the teleportation.
4317
+ */
4318
+ readonly old_position: MapPosition
4319
+ /**
4320
+ * Identifier of the event
4321
+ */
4322
+ readonly name: typeof defines.events.script_raised_teleported
4323
+ /**
4324
+ * Tick the event was generated.
4325
+ */
4326
+ readonly tick: uint
4327
+ }
4328
+
4218
4329
  /** An event id. */
4219
4330
  type EventId<T extends table, F = unknown> = uint & {
4220
4331
  readonly _eventData: T
@@ -16,6 +16,13 @@ type PlayerIndex = uint & IndexBrand<"_playerIndexBrand">
16
16
  */
17
17
  type SurfaceIndex = uint & IndexBrand<"_surfaceIndexBrand">
18
18
 
19
+ /**
20
+ * See {@link LuaForce#index LuaForce.index}.
21
+ *
22
+ * If using strict-index-types, and you need to use a plain number for this type, you can use a cast, e.g. `1 as ForceIndex`.
23
+ */
24
+ type ForceIndex = uint & IndexBrand<"_forceIndexBrand">
25
+
19
26
  /**
20
27
  * See {@link LuaEntity#unit_number LuaEntity.unit_number}.
21
28
  *