typed-factorio 0.18.1 → 0.20.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,17 +8,29 @@
8
8
  * {@link https://lua-api.factorio.com/latest/events.html#CustomInputEvent View documentation}
9
9
  */
10
10
  interface CustomInputEvent extends EventData {
11
- /** The player that activated the custom input. */
12
- readonly player_index: uint
13
- /** The prototype name of the custom input that was activated. */
11
+ /**
12
+ * The player that activated the custom input.
13
+ */
14
+ readonly player_index: PlayerIndex
15
+ /**
16
+ * The prototype name of the custom input that was activated.
17
+ */
14
18
  readonly input_name: string
15
- /** The mouse cursor position when the custom input was activated. */
16
- readonly cursor_position: PositionTable
17
- /** Information about the prototype that is selected when the custom input is used. `nil` if none is selected. */
19
+ /**
20
+ * The mouse cursor position when the custom input was activated.
21
+ */
22
+ readonly cursor_position: MapPositionTable
23
+ /**
24
+ * Information about the prototype that is selected when the custom input is used. `nil` if none is selected.
25
+ */
18
26
  readonly selected_prototype?: SelectedPrototypeData
19
- /** Identifier of the event */
27
+ /**
28
+ * Identifier of the event
29
+ */
20
30
  readonly name: string
21
- /** Tick the event was generated. */
31
+ /**
32
+ * Tick the event was generated.
33
+ */
22
34
  readonly tick: uint
23
35
  }
24
36
 
@@ -28,14 +40,22 @@ interface CustomInputEvent extends EventData {
28
40
  * {@link https://lua-api.factorio.com/latest/events.html#on_ai_command_completed View documentation}
29
41
  */
30
42
  interface OnAiCommandCompletedEvent extends EventData {
31
- /** Unit_number/group_number of the unit/group which just completed a command. */
32
- readonly unit_number: uint
43
+ /**
44
+ * unit_number/group_number of the unit/group which just completed a command.
45
+ */
46
+ readonly unit_number: UnitNumber
33
47
  readonly result: defines.behavior_result
34
- /** Was this command generated by a distraction. */
48
+ /**
49
+ * Was this command generated by a distraction.
50
+ */
35
51
  readonly was_distracted: boolean
36
- /** Identifier of the event */
52
+ /**
53
+ * Identifier of the event
54
+ */
37
55
  readonly name: typeof defines.events.on_ai_command_completed
38
- /** Tick the event was generated. */
56
+ /**
57
+ * Tick the event was generated.
58
+ */
39
59
  readonly tick: uint
40
60
  }
41
61
 
@@ -55,26 +75,34 @@ interface OnAreaClonedEvent extends EventData {
55
75
  readonly clone_decoratives: boolean
56
76
  readonly clear_destination_entities: boolean
57
77
  readonly clear_destination_decoratives: boolean
58
- /** Identifier of the event */
78
+ /**
79
+ * Identifier of the event
80
+ */
59
81
  readonly name: typeof defines.events.on_area_cloned
60
- /** Tick the event was generated. */
82
+ /**
83
+ * Tick the event was generated.
84
+ */
61
85
  readonly tick: uint
62
86
  }
63
87
 
64
88
  /**
65
89
  * Called when a biter migration builds a base.
66
90
  *
67
- * **Note**: This will be called multiple times for each migration, once for every biter that is sacrificed to build
68
- * part of the new base.
69
- *
70
91
  * {@link https://lua-api.factorio.com/latest/events.html#on_biter_base_built View documentation}
92
+ * @remarks This will be called multiple times for each migration, once for every biter that is sacrificed to build part of the new base.
71
93
  */
72
94
  interface OnBiterBaseBuiltEvent extends EventData {
73
- /** The entity that was built. */
95
+ /**
96
+ * The entity that was built.
97
+ */
74
98
  readonly entity: LuaEntity
75
- /** Identifier of the event */
99
+ /**
100
+ * Identifier of the event
101
+ */
76
102
  readonly name: typeof defines.events.on_biter_base_built
77
- /** Tick the event was generated. */
103
+ /**
104
+ * Tick the event was generated.
105
+ */
78
106
  readonly tick: uint
79
107
  }
80
108
 
@@ -95,9 +123,13 @@ interface OnBrushClonedEvent extends EventData {
95
123
  readonly clone_decoratives: boolean
96
124
  readonly clear_destination_entities: boolean
97
125
  readonly clear_destination_decoratives: boolean
98
- /** Identifier of the event */
126
+ /**
127
+ * Identifier of the event
128
+ */
99
129
  readonly name: typeof defines.events.on_brush_cloned
100
- /** Tick the event was generated. */
130
+ /**
131
+ * Tick the event was generated.
132
+ */
101
133
  readonly tick: uint
102
134
  }
103
135
 
@@ -107,13 +139,21 @@ interface OnBrushClonedEvent extends EventData {
107
139
  * {@link https://lua-api.factorio.com/latest/events.html#on_build_base_arrived View documentation}
108
140
  */
109
141
  interface OnBuildBaseArrivedEvent extends EventData {
110
- /** The unit the command was assigned to. */
142
+ /**
143
+ * The unit the command was assigned to.
144
+ */
111
145
  readonly unit?: LuaEntity
112
- /** The unit group the command was assigned to. */
146
+ /**
147
+ * The unit group the command was assigned to.
148
+ */
113
149
  readonly group?: LuaUnitGroup
114
- /** Identifier of the event */
150
+ /**
151
+ * Identifier of the event
152
+ */
115
153
  readonly name: typeof defines.events.on_build_base_arrived
116
- /** Tick the event was generated. */
154
+ /**
155
+ * Tick the event was generated.
156
+ */
117
157
  readonly tick: uint
118
158
  }
119
159
 
@@ -124,30 +164,41 @@ interface OnBuildBaseArrivedEvent extends EventData {
124
164
  */
125
165
  interface OnBuiltEntityEvent extends EventData {
126
166
  readonly created_entity: LuaEntity
127
- readonly player_index: uint
167
+ readonly player_index: PlayerIndex
128
168
  readonly stack: LuaItemStack
129
- /** The item prototype used to build the entity. Note this won't exist in some situations (built from blueprint, undo, etc). */
169
+ /**
170
+ * The item prototype used to build the entity. Note this won't exist in some situations (built from blueprint, undo, etc).
171
+ */
130
172
  readonly item?: LuaItemPrototype
131
- /** The tags associated with this entity if any. */
173
+ /**
174
+ * The tags associated with this entity if any.
175
+ */
132
176
  readonly tags?: Tags
133
- /** Identifier of the event */
177
+ /**
178
+ * Identifier of the event
179
+ */
134
180
  readonly name: typeof defines.events.on_built_entity
135
- /** Tick the event was generated. */
181
+ /**
182
+ * Tick the event was generated.
183
+ */
136
184
  readonly tick: uint
137
185
  }
138
186
 
139
187
  /**
140
- * Called when the deconstruction of an entity is canceled. Can be filtered using
141
- * {@link LuaEntityDeconstructionCancelledEventFilter}.
188
+ * Called when the deconstruction of an entity is canceled. Can be filtered using {@link LuaEntityDeconstructionCancelledEventFilter}.
142
189
  *
143
190
  * {@link https://lua-api.factorio.com/latest/events.html#on_cancelled_deconstruction View documentation}
144
191
  */
145
192
  interface OnCancelledDeconstructionEvent extends EventData {
146
193
  readonly entity: LuaEntity
147
- readonly player_index?: uint
148
- /** Identifier of the event */
194
+ readonly player_index?: PlayerIndex
195
+ /**
196
+ * Identifier of the event
197
+ */
149
198
  readonly name: typeof defines.events.on_cancelled_deconstruction
150
- /** Tick the event was generated. */
199
+ /**
200
+ * Tick the event was generated.
201
+ */
151
202
  readonly tick: uint
152
203
  }
153
204
 
@@ -158,26 +209,35 @@ interface OnCancelledDeconstructionEvent extends EventData {
158
209
  */
159
210
  interface OnCancelledUpgradeEvent extends EventData {
160
211
  readonly entity: LuaEntity
161
- readonly player_index?: uint
162
- /** Identifier of the event */
212
+ readonly player_index?: PlayerIndex
213
+ /**
214
+ * Identifier of the event
215
+ */
163
216
  readonly name: typeof defines.events.on_cancelled_upgrade
164
- /** Tick the event was generated. */
217
+ /**
218
+ * Tick the event was generated.
219
+ */
165
220
  readonly tick: uint
166
221
  }
167
222
 
168
223
  /**
169
224
  * Called when a character corpse expires due to timeout or all of the items being removed from it.
170
225
  *
171
- * **Note**: this is not called if the corpse is mined. See {@link defines.events.on_pre_player_mined_item} to detect that.
172
- *
173
226
  * {@link https://lua-api.factorio.com/latest/events.html#on_character_corpse_expired View documentation}
227
+ * @remarks this is not called if the corpse is mined. See {@link defines.events.on_pre_player_mined_item} to detect that.
174
228
  */
175
229
  interface OnCharacterCorpseExpiredEvent extends EventData {
176
- /** The corpse. */
230
+ /**
231
+ * The corpse.
232
+ */
177
233
  readonly corpse: LuaEntity
178
- /** Identifier of the event */
234
+ /**
235
+ * Identifier of the event
236
+ */
179
237
  readonly name: typeof defines.events.on_character_corpse_expired
180
- /** Tick the event was generated. */
238
+ /**
239
+ * Tick the event was generated.
240
+ */
181
241
  readonly tick: uint
182
242
  }
183
243
 
@@ -189,10 +249,14 @@ interface OnCharacterCorpseExpiredEvent extends EventData {
189
249
  interface OnChartTagAddedEvent extends EventData {
190
250
  readonly tag: LuaCustomChartTag
191
251
  readonly force: LuaForce
192
- readonly player_index?: uint
193
- /** Identifier of the event */
252
+ readonly player_index?: PlayerIndex
253
+ /**
254
+ * Identifier of the event
255
+ */
194
256
  readonly name: typeof defines.events.on_chart_tag_added
195
- /** Tick the event was generated. */
257
+ /**
258
+ * Tick the event was generated.
259
+ */
196
260
  readonly tick: uint
197
261
  }
198
262
 
@@ -203,14 +267,18 @@ interface OnChartTagAddedEvent extends EventData {
203
267
  */
204
268
  interface OnChartTagModifiedEvent extends EventData {
205
269
  readonly tag: LuaCustomChartTag
206
- readonly player_index?: uint
270
+ readonly player_index?: PlayerIndex
207
271
  readonly force: LuaForce
208
272
  readonly old_text: string
209
273
  readonly old_icon?: SignalID
210
274
  readonly old_player?: uint
211
- /** Identifier of the event */
275
+ /**
276
+ * Identifier of the event
277
+ */
212
278
  readonly name: typeof defines.events.on_chart_tag_modified
213
- /** Tick the event was generated. */
279
+ /**
280
+ * Tick the event was generated.
281
+ */
214
282
  readonly tick: uint
215
283
  }
216
284
 
@@ -222,10 +290,14 @@ interface OnChartTagModifiedEvent extends EventData {
222
290
  interface OnChartTagRemovedEvent extends EventData {
223
291
  readonly tag: LuaCustomChartTag
224
292
  readonly force: LuaForce
225
- readonly player_index?: uint
226
- /** Identifier of the event */
293
+ readonly player_index?: PlayerIndex
294
+ /**
295
+ * Identifier of the event
296
+ */
227
297
  readonly name: typeof defines.events.on_chart_tag_removed
228
- /** Tick the event was generated. */
298
+ /**
299
+ * Tick the event was generated.
300
+ */
229
301
  readonly tick: uint
230
302
  }
231
303
 
@@ -235,29 +307,41 @@ interface OnChartTagRemovedEvent extends EventData {
235
307
  * {@link https://lua-api.factorio.com/latest/events.html#on_chunk_charted View documentation}
236
308
  */
237
309
  interface OnChunkChartedEvent extends EventData {
238
- readonly surface_index: uint
310
+ readonly surface_index: SurfaceIndex
239
311
  readonly position: ChunkPositionTable
240
- /** Area of the chunk. */
312
+ /**
313
+ * Area of the chunk.
314
+ */
241
315
  readonly area: BoundingBoxRead
242
316
  readonly force: LuaForce
243
- /** Identifier of the event */
317
+ /**
318
+ * Identifier of the event
319
+ */
244
320
  readonly name: typeof defines.events.on_chunk_charted
245
- /** Tick the event was generated. */
321
+ /**
322
+ * Tick the event was generated.
323
+ */
246
324
  readonly tick: uint
247
325
  }
248
326
 
249
327
  /**
250
- * Called when one or more chunks are deleted using {@link LuaSurface.delete_chunk LuaSurface::delete_chunk}.
328
+ * Called when one or more chunks are deleted using {@link LuaSurface#delete_chunk LuaSurface::delete_chunk}.
251
329
  *
252
330
  * {@link https://lua-api.factorio.com/latest/events.html#on_chunk_deleted View documentation}
253
331
  */
254
332
  interface OnChunkDeletedEvent extends EventData {
255
- readonly surface_index: uint
256
- /** The chunks deleted. */
333
+ readonly surface_index: SurfaceIndex
334
+ /**
335
+ * The chunks deleted.
336
+ */
257
337
  readonly positions: ChunkPositionTable[]
258
- /** Identifier of the event */
338
+ /**
339
+ * Identifier of the event
340
+ */
259
341
  readonly name: typeof defines.events.on_chunk_deleted
260
- /** Tick the event was generated. */
342
+ /**
343
+ * Tick the event was generated.
344
+ */
261
345
  readonly tick: uint
262
346
  }
263
347
 
@@ -267,15 +351,25 @@ interface OnChunkDeletedEvent extends EventData {
267
351
  * {@link https://lua-api.factorio.com/latest/events.html#on_chunk_generated View documentation}
268
352
  */
269
353
  interface OnChunkGeneratedEvent extends EventData {
270
- /** Area of the chunk. */
354
+ /**
355
+ * Area of the chunk.
356
+ */
271
357
  readonly area: BoundingBoxRead
272
- /** Position of the chunk. */
358
+ /**
359
+ * Position of the chunk.
360
+ */
273
361
  readonly position: ChunkPositionTable
274
- /** The surface the chunk is on. */
362
+ /**
363
+ * The surface the chunk is on.
364
+ */
275
365
  readonly surface: LuaSurface
276
- /** Identifier of the event */
366
+ /**
367
+ * Identifier of the event
368
+ */
277
369
  readonly name: typeof defines.events.on_chunk_generated
278
- /** Tick the event was generated. */
370
+ /**
371
+ * Tick the event was generated.
372
+ */
279
373
  readonly tick: uint
280
374
  }
281
375
 
@@ -286,29 +380,42 @@ interface OnChunkGeneratedEvent extends EventData {
286
380
  */
287
381
  interface OnCombatRobotExpiredEvent extends EventData {
288
382
  readonly robot: LuaEntity
289
- /** The entity that owns the robot if any. */
383
+ /**
384
+ * The entity that owns the robot if any.
385
+ */
290
386
  readonly owner?: LuaEntity
291
- /** Identifier of the event */
387
+ /**
388
+ * Identifier of the event
389
+ */
292
390
  readonly name: typeof defines.events.on_combat_robot_expired
293
- /** Tick the event was generated. */
391
+ /**
392
+ * Tick the event was generated.
393
+ */
294
394
  readonly tick: uint
295
395
  }
296
396
 
297
397
  /**
298
398
  * Called when a message is sent to the in-game console, either by a player or through the server interface.
299
399
  *
300
- * **Note**: This event only fires for plain messages, not for any commands (including `/shout` or `/whisper`).
301
- *
302
400
  * {@link https://lua-api.factorio.com/latest/events.html#on_console_chat View documentation}
401
+ * @remarks This event only fires for plain messages, not for any commands (including `/shout` or `/whisper`).
303
402
  */
304
403
  interface OnConsoleChatEvent extends EventData {
305
- /** The player doing the chatting, if any. */
306
- readonly player_index?: uint
307
- /** The chat message that was sent. */
404
+ /**
405
+ * The player doing the chatting, if any.
406
+ */
407
+ readonly player_index?: PlayerIndex
408
+ /**
409
+ * The chat message that was sent.
410
+ */
308
411
  readonly message: string
309
- /** Identifier of the event */
412
+ /**
413
+ * Identifier of the event
414
+ */
310
415
  readonly name: typeof defines.events.on_console_chat
311
- /** Tick the event was generated. */
416
+ /**
417
+ * Tick the event was generated.
418
+ */
312
419
  readonly tick: uint
313
420
  }
314
421
 
@@ -318,15 +425,25 @@ interface OnConsoleChatEvent extends EventData {
318
425
  * {@link https://lua-api.factorio.com/latest/events.html#on_console_command View documentation}
319
426
  */
320
427
  interface OnConsoleCommandEvent extends EventData {
321
- /** The player if any. */
322
- readonly player_index?: uint
323
- /** The command as typed without the preceding forward slash ('/'). */
428
+ /**
429
+ * The player if any.
430
+ */
431
+ readonly player_index?: PlayerIndex
432
+ /**
433
+ * The command as typed without the preceding forward slash ('/').
434
+ */
324
435
  readonly command: string
325
- /** The parameters provided if any. */
436
+ /**
437
+ * The parameters provided if any.
438
+ */
326
439
  readonly parameters: string
327
- /** Identifier of the event */
440
+ /**
441
+ * Identifier of the event
442
+ */
328
443
  readonly name: typeof defines.events.on_console_command
329
- /** Tick the event was generated. */
444
+ /**
445
+ * Tick the event was generated.
446
+ */
330
447
  readonly tick: uint
331
448
  }
332
449
 
@@ -336,11 +453,17 @@ interface OnConsoleCommandEvent extends EventData {
336
453
  * {@link https://lua-api.factorio.com/latest/events.html#on_cutscene_cancelled View documentation}
337
454
  */
338
455
  interface OnCutsceneCancelledEvent extends EventData {
339
- /** The player the cutscene was shown to. */
340
- readonly player_index: uint
341
- /** Identifier of the event */
456
+ /**
457
+ * The player the cutscene was shown to.
458
+ */
459
+ readonly player_index: PlayerIndex
460
+ /**
461
+ * Identifier of the event
462
+ */
342
463
  readonly name: typeof defines.events.on_cutscene_cancelled
343
- /** Tick the event was generated. */
464
+ /**
465
+ * Tick the event was generated.
466
+ */
344
467
  readonly tick: uint
345
468
  }
346
469
 
@@ -349,34 +472,44 @@ interface OnCutsceneCancelledEvent extends EventData {
349
472
  *
350
473
  * This refers to an index in the table previously passed to set_controller which started the cutscene.
351
474
  *
352
- * **Note**: Due to implementation omission, waypoint_index is 0-based.
353
- *
354
475
  * {@link https://lua-api.factorio.com/latest/events.html#on_cutscene_waypoint_reached View documentation}
476
+ * @remarks Due to implementation omission, waypoint_index is 0-based.
355
477
  */
356
478
  interface OnCutsceneWaypointReachedEvent extends EventData {
357
- /** The player index of the player viewing the cutscene. */
358
- readonly player_index: uint
359
- /** The index of the waypoint we just completed. */
479
+ /**
480
+ * The player index of the player viewing the cutscene.
481
+ */
482
+ readonly player_index: PlayerIndex
483
+ /**
484
+ * The index of the waypoint we just completed.
485
+ */
360
486
  readonly waypoint_index: uint
361
- /** Identifier of the event */
487
+ /**
488
+ * Identifier of the event
489
+ */
362
490
  readonly name: typeof defines.events.on_cutscene_waypoint_reached
363
- /** Tick the event was generated. */
491
+ /**
492
+ * Tick the event was generated.
493
+ */
364
494
  readonly tick: uint
365
495
  }
366
496
 
367
497
  /**
368
498
  * Called when the map difficulty settings are changed.
369
499
  *
370
- * **Note**: It's not guaranteed that both settings are changed - just that at least one has been changed.
371
- *
372
500
  * {@link https://lua-api.factorio.com/latest/events.html#on_difficulty_settings_changed View documentation}
501
+ * @remarks It's not guaranteed that both settings are changed - just that at least one has been changed.
373
502
  */
374
503
  interface OnDifficultySettingsChangedEvent extends EventData {
375
504
  readonly old_recipe_difficulty: uint
376
505
  readonly old_technology_difficulty: uint
377
- /** Identifier of the event */
506
+ /**
507
+ * Identifier of the event
508
+ */
378
509
  readonly name: typeof defines.events.on_difficulty_settings_changed
379
- /** Tick the event was generated. */
510
+ /**
511
+ * Tick the event was generated.
512
+ */
380
513
  readonly tick: uint
381
514
  }
382
515
 
@@ -388,53 +521,77 @@ interface OnDifficultySettingsChangedEvent extends EventData {
388
521
  interface OnEntityClonedEvent extends EventData {
389
522
  readonly source: LuaEntity
390
523
  readonly destination: LuaEntity
391
- /** Identifier of the event */
524
+ /**
525
+ * Identifier of the event
526
+ */
392
527
  readonly name: typeof defines.events.on_entity_cloned
393
- /** Tick the event was generated. */
528
+ /**
529
+ * Tick the event was generated.
530
+ */
394
531
  readonly tick: uint
395
532
  }
396
533
 
397
534
  /**
398
535
  * Called when an entity is damaged. Can be filtered using {@link LuaEntityDamagedEventFilter}.
399
536
  *
400
- * **Note**: This is not called when an entities health is set directly by another mod.
401
- *
402
537
  * {@link https://lua-api.factorio.com/latest/events.html#on_entity_damaged View documentation}
538
+ * @remarks This is not called when an entities health is set directly by another mod.
403
539
  */
404
540
  interface OnEntityDamagedEvent extends EventData {
405
541
  readonly entity: LuaEntity
406
542
  readonly damage_type: LuaDamagePrototype
407
- /** The damage amount before resistances. */
543
+ /**
544
+ * The damage amount before resistances.
545
+ */
408
546
  readonly original_damage_amount: float
409
- /** The damage amount after resistances. */
547
+ /**
548
+ * The damage amount after resistances.
549
+ */
410
550
  readonly final_damage_amount: float
411
- /** The health of the entity after the damage was applied. */
551
+ /**
552
+ * The health of the entity after the damage was applied.
553
+ */
412
554
  readonly final_health: float
413
- /** The entity that did the attacking if available. */
555
+ /**
556
+ * The entity that did the attacking if available.
557
+ */
414
558
  readonly cause?: LuaEntity
415
- /** The force that did the attacking if any. */
559
+ /**
560
+ * The force that did the attacking if any.
561
+ */
416
562
  readonly force?: LuaForce
417
- /** Identifier of the event */
563
+ /**
564
+ * Identifier of the event
565
+ */
418
566
  readonly name: typeof defines.events.on_entity_damaged
419
- /** Tick the event was generated. */
567
+ /**
568
+ * Tick the event was generated.
569
+ */
420
570
  readonly tick: uint
421
571
  }
422
572
 
423
573
  /**
424
- * Called after an entity is destroyed that has been registered with
425
- * {@link LuaBootstrap.register_on_entity_destroyed LuaBootstrap::register_on_entity_destroyed}
426
- *
427
- * **Note**: Depending on when a given entity is destroyed this will be fired at the end of the current tick or end of
428
- * the next tick.
574
+ * Called after an entity is destroyed that has been registered with {@link LuaBootstrap#register_on_entity_destroyed LuaBootstrap::register_on_entity_destroyed}.
429
575
  *
430
576
  * {@link https://lua-api.factorio.com/latest/events.html#on_entity_destroyed View documentation}
577
+ * @remarks Depending on when a given entity is destroyed, this event will be fired at the end of the current tick or at the end of the next tick.
431
578
  */
432
579
  interface OnEntityDestroyedEvent extends EventData {
433
- readonly registration_number: uint64
434
- readonly unit_number?: uint
435
- /** Identifier of the event */
580
+ /**
581
+ * The number returned by {@link LuaBootstrap#register_on_entity_destroyed register_on_entity_destroyed} to uniquely identify this entity during this event.
582
+ */
583
+ readonly registration_number: RegistrationNumber
584
+ /**
585
+ * The {@link LuaEntity#unit_number LuaEntity::unit_number} of the destroyed entity, if it had one.
586
+ */
587
+ readonly unit_number?: UnitNumber
588
+ /**
589
+ * Identifier of the event
590
+ */
436
591
  readonly name: typeof defines.events.on_entity_destroyed
437
- /** Tick the event was generated. */
592
+ /**
593
+ * Tick the event was generated.
594
+ */
438
595
  readonly tick: uint
439
596
  }
440
597
 
@@ -444,40 +601,62 @@ interface OnEntityDestroyedEvent extends EventData {
444
601
  * {@link https://lua-api.factorio.com/latest/events.html#on_entity_died View documentation}
445
602
  */
446
603
  interface OnEntityDiedEvent extends EventData {
447
- /** The entity that died. */
604
+ /**
605
+ * The entity that died.
606
+ */
448
607
  readonly entity: LuaEntity
449
- /** The entity that did the killing if available. */
608
+ /**
609
+ * The entity that did the killing if available.
610
+ */
450
611
  readonly cause?: LuaEntity
451
- /** The loot generated by this entity if any. */
612
+ /**
613
+ * The loot generated by this entity if any.
614
+ */
452
615
  readonly loot: LuaInventory
453
- /** The force that did the killing if any. */
616
+ /**
617
+ * The force that did the killing if any.
618
+ */
454
619
  readonly force?: LuaForce
455
- /** The damage type if any. */
620
+ /**
621
+ * The damage type if any.
622
+ */
456
623
  readonly damage_type?: LuaDamagePrototype
457
- /** Identifier of the event */
624
+ /**
625
+ * Identifier of the event
626
+ */
458
627
  readonly name: typeof defines.events.on_entity_died
459
- /** Tick the event was generated. */
628
+ /**
629
+ * Tick the event was generated.
630
+ */
460
631
  readonly tick: uint
461
632
  }
462
633
 
463
634
  /**
464
635
  * Called when one of an entity's personal logistic slots changes.
465
636
  *
466
- * **Note**: "Personal logistic slot" refers to a character or vehicle's personal request / auto-trash slots, not the
467
- * request slots on logistic chests.
468
- *
469
637
  * {@link https://lua-api.factorio.com/latest/events.html#on_entity_logistic_slot_changed View documentation}
638
+ * @remarks "Personal logistic slot" refers to a character or vehicle's personal request / auto-trash slots, not the request slots on logistic chests.
470
639
  */
471
640
  interface OnEntityLogisticSlotChangedEvent extends EventData {
472
- /** The player who changed the slot, or `nil` if changed by script. */
473
- readonly player_index?: uint
474
- /** The entity for whom a logistic slot was changed. */
641
+ /**
642
+ * The player who changed the slot, or `nil` if changed by script.
643
+ */
644
+ readonly player_index?: PlayerIndex
645
+ /**
646
+ * The entity for whom a logistic slot was changed.
647
+ */
475
648
  readonly entity: LuaEntity
476
- /** The slot index that was changed. */
649
+ /**
650
+ * The slot index that was changed.
651
+ */
477
652
  readonly slot_index: uint
478
- /** Identifier of the event */
653
+ /**
654
+ * Identifier of the event
655
+ */
479
656
  readonly name: typeof defines.events.on_entity_logistic_slot_changed
480
- /** Tick the event was generated. */
657
+ /**
658
+ * Tick the event was generated.
659
+ */
481
660
  readonly tick: uint
482
661
  }
483
662
 
@@ -487,14 +666,20 @@ interface OnEntityLogisticSlotChangedEvent extends EventData {
487
666
  * {@link https://lua-api.factorio.com/latest/events.html#on_entity_renamed View documentation}
488
667
  */
489
668
  interface OnEntityRenamedEvent extends EventData {
490
- /** If by_script is true this will not be included. */
491
- readonly player_index?: uint
669
+ /**
670
+ * If by_script is true this will not be included.
671
+ */
672
+ readonly player_index?: PlayerIndex
492
673
  readonly by_script: boolean
493
674
  readonly entity: LuaEntity
494
675
  readonly old_name: string
495
- /** Identifier of the event */
676
+ /**
677
+ * Identifier of the event
678
+ */
496
679
  readonly name: typeof defines.events.on_entity_renamed
497
- /** Tick the event was generated. */
680
+ /**
681
+ * Tick the event was generated.
682
+ */
498
683
  readonly tick: uint
499
684
  }
500
685
 
@@ -504,14 +689,22 @@ interface OnEntityRenamedEvent extends EventData {
504
689
  * {@link https://lua-api.factorio.com/latest/events.html#on_entity_settings_pasted View documentation}
505
690
  */
506
691
  interface OnEntitySettingsPastedEvent extends EventData {
507
- readonly player_index: uint
508
- /** The source entity settings were copied from. */
692
+ readonly player_index: PlayerIndex
693
+ /**
694
+ * The source entity settings were copied from.
695
+ */
509
696
  readonly source: LuaEntity
510
- /** The destination entity settings were copied to. */
697
+ /**
698
+ * The destination entity settings were copied to.
699
+ */
511
700
  readonly destination: LuaEntity
512
- /** Identifier of the event */
701
+ /**
702
+ * Identifier of the event
703
+ */
513
704
  readonly name: typeof defines.events.on_entity_settings_pasted
514
- /** Tick the event was generated. */
705
+ /**
706
+ * Tick the event was generated.
707
+ */
515
708
  readonly tick: uint
516
709
  }
517
710
 
@@ -523,9 +716,13 @@ interface OnEntitySettingsPastedEvent extends EventData {
523
716
  interface OnEntitySpawnedEvent extends EventData {
524
717
  readonly spawner: LuaEntity
525
718
  readonly entity: LuaEntity
526
- /** Identifier of the event */
719
+ /**
720
+ * Identifier of the event
721
+ */
527
722
  readonly name: typeof defines.events.on_entity_spawned
528
- /** Tick the event was generated. */
723
+ /**
724
+ * Tick the event was generated.
725
+ */
529
726
  readonly tick: uint
530
727
  }
531
728
 
@@ -535,13 +732,21 @@ interface OnEntitySpawnedEvent extends EventData {
535
732
  * {@link https://lua-api.factorio.com/latest/events.html#on_equipment_inserted View documentation}
536
733
  */
537
734
  interface OnEquipmentInsertedEvent extends EventData {
538
- /** The equipment grid inserted into. */
735
+ /**
736
+ * The equipment grid inserted into.
737
+ */
539
738
  readonly grid: LuaEquipmentGrid
540
- /** The equipment inserted. */
739
+ /**
740
+ * The equipment inserted.
741
+ */
541
742
  readonly equipment: LuaEquipment
542
- /** Identifier of the event */
743
+ /**
744
+ * Identifier of the event
745
+ */
543
746
  readonly name: typeof defines.events.on_equipment_inserted
544
- /** Tick the event was generated. */
747
+ /**
748
+ * Tick the event was generated.
749
+ */
545
750
  readonly tick: uint
546
751
  }
547
752
 
@@ -551,15 +756,25 @@ interface OnEquipmentInsertedEvent extends EventData {
551
756
  * {@link https://lua-api.factorio.com/latest/events.html#on_equipment_removed View documentation}
552
757
  */
553
758
  interface OnEquipmentRemovedEvent extends EventData {
554
- /** The equipment grid removed from. */
759
+ /**
760
+ * The equipment grid removed from.
761
+ */
555
762
  readonly grid: LuaEquipmentGrid
556
- /** The equipment removed. */
763
+ /**
764
+ * The equipment removed.
765
+ */
557
766
  readonly equipment: string
558
- /** The count of equipment removed. */
767
+ /**
768
+ * The count of equipment removed.
769
+ */
559
770
  readonly count: uint
560
- /** Identifier of the event */
771
+ /**
772
+ * Identifier of the event
773
+ */
561
774
  readonly name: typeof defines.events.on_equipment_removed
562
- /** Tick the event was generated. */
775
+ /**
776
+ * Tick the event was generated.
777
+ */
563
778
  readonly tick: uint
564
779
  }
565
780
 
@@ -569,32 +784,46 @@ interface OnEquipmentRemovedEvent extends EventData {
569
784
  * {@link https://lua-api.factorio.com/latest/events.html#on_force_cease_fire_changed View documentation}
570
785
  */
571
786
  interface OnForceCeaseFireChangedEvent extends EventData {
572
- /** The force who's cease fire changed. */
787
+ /**
788
+ * The force who's cease fire changed.
789
+ */
573
790
  readonly force: LuaForce
574
- /** Which force was added or removed. */
791
+ /**
792
+ * Which force was added or removed.
793
+ */
575
794
  readonly other_force: LuaForce
576
- /** If the other force was added or removed. */
795
+ /**
796
+ * If the other force was added or removed.
797
+ */
577
798
  readonly added: boolean
578
- /** Identifier of the event */
799
+ /**
800
+ * Identifier of the event
801
+ */
579
802
  readonly name: typeof defines.events.on_force_cease_fire_changed
580
- /** Tick the event was generated. */
803
+ /**
804
+ * Tick the event was generated.
805
+ */
581
806
  readonly tick: uint
582
807
  }
583
808
 
584
809
  /**
585
810
  * Called when a new force is created using `game.create_force()`
586
811
  *
587
- * **Note**: This is not called when the default forces (`'player'`, `'enemy'`, `'neutral'`) are created as they will
588
- * always exist.
589
- *
590
812
  * {@link https://lua-api.factorio.com/latest/events.html#on_force_created View documentation}
813
+ * @remarks This is not called when the default forces (`'player'`, `'enemy'`, `'neutral'`) are created as they will always exist.
591
814
  */
592
815
  interface OnForceCreatedEvent extends EventData {
593
- /** The newly created force. */
816
+ /**
817
+ * The newly created force.
818
+ */
594
819
  readonly force: LuaForce
595
- /** Identifier of the event */
820
+ /**
821
+ * Identifier of the event
822
+ */
596
823
  readonly name: typeof defines.events.on_force_created
597
- /** Tick the event was generated. */
824
+ /**
825
+ * Tick the event was generated.
826
+ */
598
827
  readonly tick: uint
599
828
  }
600
829
 
@@ -604,48 +833,71 @@ interface OnForceCreatedEvent extends EventData {
604
833
  * {@link https://lua-api.factorio.com/latest/events.html#on_force_friends_changed View documentation}
605
834
  */
606
835
  interface OnForceFriendsChangedEvent extends EventData {
607
- /** The force who's friends changed. */
836
+ /**
837
+ * The force who's friends changed.
838
+ */
608
839
  readonly force: LuaForce
609
- /** Which force was added or removed. */
840
+ /**
841
+ * Which force was added or removed.
842
+ */
610
843
  readonly other_force: LuaForce
611
- /** If the other force was added or removed. */
612
- readonly added: boolean
613
- /** Identifier of the event */
844
+ /**
845
+ * If the other force was added or removed.
846
+ */
847
+ readonly added: boolean
848
+ /**
849
+ * Identifier of the event
850
+ */
614
851
  readonly name: typeof defines.events.on_force_friends_changed
615
- /** Tick the event was generated. */
852
+ /**
853
+ * Tick the event was generated.
854
+ */
616
855
  readonly tick: uint
617
856
  }
618
857
 
619
858
  /**
620
- * Called when {@link LuaForce.reset LuaForce::reset} is finished.
859
+ * Called when {@link LuaForce#reset LuaForce::reset} is finished.
621
860
  *
622
861
  * {@link https://lua-api.factorio.com/latest/events.html#on_force_reset View documentation}
623
862
  */
624
863
  interface OnForceResetEvent extends EventData {
625
864
  readonly force: LuaForce
626
- /** Identifier of the event */
865
+ /**
866
+ * Identifier of the event
867
+ */
627
868
  readonly name: typeof defines.events.on_force_reset
628
- /** Tick the event was generated. */
869
+ /**
870
+ * Tick the event was generated.
871
+ */
629
872
  readonly tick: uint
630
873
  }
631
874
 
632
875
  /**
633
876
  * Called after two forces have been merged using `game.merge_forces()`.
634
877
  *
635
- * **Note**: The source force is invalidated before this event is called and the name can be re-used in this event if desired.
636
- *
637
878
  * {@link https://lua-api.factorio.com/latest/events.html#on_forces_merged View documentation}
879
+ * @remarks The source force is invalidated before this event is called and the name can be re-used in this event if desired.
638
880
  */
639
881
  interface OnForcesMergedEvent extends EventData {
640
- /** The force destroyed. */
882
+ /**
883
+ * The force destroyed.
884
+ */
641
885
  readonly source_name: string
642
- /** The index of the destroyed force. */
886
+ /**
887
+ * The index of the destroyed force.
888
+ */
643
889
  readonly source_index: uint
644
- /** The force entities where reassigned to. */
890
+ /**
891
+ * The force entities where reassigned to.
892
+ */
645
893
  readonly destination: LuaForce
646
- /** Identifier of the event */
894
+ /**
895
+ * Identifier of the event
896
+ */
647
897
  readonly name: typeof defines.events.on_forces_merged
648
- /** Tick the event was generated. */
898
+ /**
899
+ * Tick the event was generated.
900
+ */
649
901
  readonly tick: uint
650
902
  }
651
903
 
@@ -655,28 +907,38 @@ interface OnForcesMergedEvent extends EventData {
655
907
  * {@link https://lua-api.factorio.com/latest/events.html#on_forces_merging View documentation}
656
908
  */
657
909
  interface OnForcesMergingEvent extends EventData {
658
- /** The force to be destroyed */
910
+ /**
911
+ * The force to be destroyed
912
+ */
659
913
  readonly source: LuaForce
660
- /** The force to reassign entities to. */
914
+ /**
915
+ * The force to reassign entities to.
916
+ */
661
917
  readonly destination: LuaForce
662
- /** Identifier of the event */
918
+ /**
919
+ * Identifier of the event
920
+ */
663
921
  readonly name: typeof defines.events.on_forces_merging
664
- /** Tick the event was generated. */
922
+ /**
923
+ * Tick the event was generated.
924
+ */
665
925
  readonly tick: uint
666
926
  }
667
927
 
668
928
  /**
669
- * Called when a game is created from a scenario. This is fired for every mod, even when the scenario's save data
670
- * already includes it. In those cases however, {@link LuaBootstrap.on_init LuaBootstrap::on_init} is not fired.
671
- *
672
- * **Note**: This event is not fired when the scenario is loaded via the map editor.
929
+ * Called when a game is created from a scenario. This is fired for every mod, even when the scenario's save data already includes it. In those cases however, {@link LuaBootstrap#on_init LuaBootstrap::on_init} is not fired.
673
930
  *
674
931
  * {@link https://lua-api.factorio.com/latest/events.html#on_game_created_from_scenario View documentation}
932
+ * @remarks This event is not fired when the scenario is loaded via the map editor.
675
933
  */
676
934
  interface OnGameCreatedFromScenarioEvent extends EventData {
677
- /** Identifier of the event */
935
+ /**
936
+ * Identifier of the event
937
+ */
678
938
  readonly name: typeof defines.events.on_game_created_from_scenario
679
- /** Tick the event was generated. */
939
+ /**
940
+ * Tick the event was generated.
941
+ */
680
942
  readonly tick: uint
681
943
  }
682
944
 
@@ -686,13 +948,21 @@ interface OnGameCreatedFromScenarioEvent extends EventData {
686
948
  * {@link https://lua-api.factorio.com/latest/events.html#on_gui_checked_state_changed View documentation}
687
949
  */
688
950
  interface OnGuiCheckedStateChangedEvent extends EventData {
689
- /** The element whose checked state changed. */
951
+ /**
952
+ * The element whose checked state changed.
953
+ */
690
954
  readonly element: LuaGuiElement
691
- /** The player who did the change. */
692
- readonly player_index: uint
693
- /** Identifier of the event */
955
+ /**
956
+ * The player who did the change.
957
+ */
958
+ readonly player_index: PlayerIndex
959
+ /**
960
+ * Identifier of the event
961
+ */
694
962
  readonly name: typeof defines.events.on_gui_checked_state_changed
695
- /** Tick the event was generated. */
963
+ /**
964
+ * Tick the event was generated.
965
+ */
696
966
  readonly tick: uint
697
967
  }
698
968
 
@@ -702,56 +972,92 @@ interface OnGuiCheckedStateChangedEvent extends EventData {
702
972
  * {@link https://lua-api.factorio.com/latest/events.html#on_gui_click View documentation}
703
973
  */
704
974
  interface OnGuiClickEvent extends EventData {
705
- /** The clicked element. */
975
+ /**
976
+ * The clicked element.
977
+ */
706
978
  readonly element: LuaGuiElement
707
- /** The player who did the clicking. */
708
- readonly player_index: uint
709
- /** The mouse button used if any. */
979
+ /**
980
+ * The player who did the clicking.
981
+ */
982
+ readonly player_index: PlayerIndex
983
+ /**
984
+ * The mouse button used if any.
985
+ */
710
986
  readonly button: defines.mouse_button_type
711
- /** If alt was pressed. */
987
+ /**
988
+ * If alt was pressed.
989
+ */
712
990
  readonly alt: boolean
713
- /** If control was pressed. */
991
+ /**
992
+ * If control was pressed.
993
+ */
714
994
  readonly control: boolean
715
- /** If shift was pressed. */
995
+ /**
996
+ * If shift was pressed.
997
+ */
716
998
  readonly shift: boolean
717
- /** Identifier of the event */
999
+ /**
1000
+ * Identifier of the event
1001
+ */
718
1002
  readonly name: typeof defines.events.on_gui_click
719
- /** Tick the event was generated. */
1003
+ /**
1004
+ * Tick the event was generated.
1005
+ */
720
1006
  readonly tick: uint
721
1007
  }
722
1008
 
723
1009
  /**
724
1010
  * Called when the player closes the GUI they have open.
725
1011
  *
726
- * **Note**: This is only called if the player explicitly closed the GUI.
727
- *
728
- * **Note**: It's not advised to open any other GUI during this event because if this is run as a request to open a
729
- * different GUI the game will force close the new opened GUI without notice to ensure the original requested GUI is opened.
1012
+ * This can only be raised when the GUI's player controller is still valid. If a GUI is thus closed due to the player disconnecting, dying, or becoming a spectator in other ways, it won't cause this event to be raised.
730
1013
  *
731
1014
  * {@link https://lua-api.factorio.com/latest/events.html#on_gui_closed View documentation}
1015
+ * @remarks It's not advised to open any other GUI during this event because if this is run as a request to open a different GUI the game will force close the new opened GUI without notice to ensure the original requested GUI is opened.
732
1016
  */
733
1017
  interface OnGuiClosedEvent extends EventData {
734
- /** The player. */
735
- readonly player_index: uint
736
- /** The GUI type that was open. */
1018
+ /**
1019
+ * The player.
1020
+ */
1021
+ readonly player_index: PlayerIndex
1022
+ /**
1023
+ * The GUI type that was open.
1024
+ */
737
1025
  readonly gui_type: defines.gui_type
738
- /** The entity that was open */
1026
+ /**
1027
+ * The entity that was open
1028
+ */
739
1029
  readonly entity?: LuaEntity
740
- /** The item that was open */
1030
+ /**
1031
+ * The item that was open
1032
+ */
741
1033
  readonly item?: LuaItemStack
742
- /** The equipment that was open */
1034
+ /**
1035
+ * The equipment that was open
1036
+ */
743
1037
  readonly equipment?: LuaEquipment
744
- /** The other player that was open */
1038
+ /**
1039
+ * The other player that was open
1040
+ */
745
1041
  readonly other_player?: LuaPlayer
746
- /** The custom GUI element that was open */
1042
+ /**
1043
+ * The custom GUI element that was open
1044
+ */
747
1045
  readonly element?: LuaGuiElement
748
- /** The technology that was automatically selected when opening the research GUI */
1046
+ /**
1047
+ * The technology that was automatically selected when opening the research GUI
1048
+ */
749
1049
  readonly technology?: LuaTechnology
750
- /** The tile position that was open */
1050
+ /**
1051
+ * The tile position that was open
1052
+ */
751
1053
  readonly tile_position?: TilePositionTable
752
- /** Identifier of the event */
1054
+ /**
1055
+ * Identifier of the event
1056
+ */
753
1057
  readonly name: typeof defines.events.on_gui_closed
754
- /** Tick the event was generated. */
1058
+ /**
1059
+ * Tick the event was generated.
1060
+ */
755
1061
  readonly tick: uint
756
1062
  }
757
1063
 
@@ -761,19 +1067,33 @@ interface OnGuiClosedEvent extends EventData {
761
1067
  * {@link https://lua-api.factorio.com/latest/events.html#on_gui_confirmed View documentation}
762
1068
  */
763
1069
  interface OnGuiConfirmedEvent extends EventData {
764
- /** The confirmed element. */
1070
+ /**
1071
+ * The confirmed element.
1072
+ */
765
1073
  readonly element: LuaGuiElement
766
- /** The player who did the confirming. */
767
- readonly player_index: uint
768
- /** If alt was pressed. */
1074
+ /**
1075
+ * The player who did the confirming.
1076
+ */
1077
+ readonly player_index: PlayerIndex
1078
+ /**
1079
+ * If alt was pressed.
1080
+ */
769
1081
  readonly alt: boolean
770
- /** If control was pressed. */
1082
+ /**
1083
+ * If control was pressed.
1084
+ */
771
1085
  readonly control: boolean
772
- /** If shift was pressed. */
1086
+ /**
1087
+ * If shift was pressed.
1088
+ */
773
1089
  readonly shift: boolean
774
- /** Identifier of the event */
1090
+ /**
1091
+ * Identifier of the event
1092
+ */
775
1093
  readonly name: typeof defines.events.on_gui_confirmed
776
- /** Tick the event was generated. */
1094
+ /**
1095
+ * Tick the event was generated.
1096
+ */
777
1097
  readonly tick: uint
778
1098
  }
779
1099
 
@@ -783,13 +1103,21 @@ interface OnGuiConfirmedEvent extends EventData {
783
1103
  * {@link https://lua-api.factorio.com/latest/events.html#on_gui_elem_changed View documentation}
784
1104
  */
785
1105
  interface OnGuiElemChangedEvent extends EventData {
786
- /** The element whose element value changed. */
1106
+ /**
1107
+ * The element whose element value changed.
1108
+ */
787
1109
  readonly element: LuaGuiElement
788
- /** The player who did the change. */
789
- readonly player_index: uint
790
- /** Identifier of the event */
1110
+ /**
1111
+ * The player who did the change.
1112
+ */
1113
+ readonly player_index: PlayerIndex
1114
+ /**
1115
+ * Identifier of the event
1116
+ */
791
1117
  readonly name: typeof defines.events.on_gui_elem_changed
792
- /** Tick the event was generated. */
1118
+ /**
1119
+ * Tick the event was generated.
1120
+ */
793
1121
  readonly tick: uint
794
1122
  }
795
1123
 
@@ -799,13 +1127,21 @@ interface OnGuiElemChangedEvent extends EventData {
799
1127
  * {@link https://lua-api.factorio.com/latest/events.html#on_gui_location_changed View documentation}
800
1128
  */
801
1129
  interface OnGuiLocationChangedEvent extends EventData {
802
- /** The element whose location changed. */
1130
+ /**
1131
+ * The element whose location changed.
1132
+ */
803
1133
  readonly element: LuaGuiElement
804
- /** The player who did the change. */
805
- readonly player_index: uint
806
- /** Identifier of the event */
1134
+ /**
1135
+ * The player who did the change.
1136
+ */
1137
+ readonly player_index: PlayerIndex
1138
+ /**
1139
+ * Identifier of the event
1140
+ */
807
1141
  readonly name: typeof defines.events.on_gui_location_changed
808
- /** Tick the event was generated. */
1142
+ /**
1143
+ * Tick the event was generated.
1144
+ */
809
1145
  readonly tick: uint
810
1146
  }
811
1147
 
@@ -815,23 +1151,41 @@ interface OnGuiLocationChangedEvent extends EventData {
815
1151
  * {@link https://lua-api.factorio.com/latest/events.html#on_gui_opened View documentation}
816
1152
  */
817
1153
  interface OnGuiOpenedEvent extends EventData {
818
- /** The player. */
819
- readonly player_index: uint
820
- /** The GUI type that was opened. */
1154
+ /**
1155
+ * The player.
1156
+ */
1157
+ readonly player_index: PlayerIndex
1158
+ /**
1159
+ * The GUI type that was opened.
1160
+ */
821
1161
  readonly gui_type: defines.gui_type
822
- /** The entity that was opened */
1162
+ /**
1163
+ * The entity that was opened
1164
+ */
823
1165
  readonly entity?: LuaEntity
824
- /** The item that was opened */
1166
+ /**
1167
+ * The item that was opened
1168
+ */
825
1169
  readonly item?: LuaItemStack
826
- /** The equipment that was opened */
1170
+ /**
1171
+ * The equipment that was opened
1172
+ */
827
1173
  readonly equipment?: LuaEquipment
828
- /** The other player that was opened */
1174
+ /**
1175
+ * The other player that was opened
1176
+ */
829
1177
  readonly other_player?: LuaPlayer
830
- /** The custom GUI element that was opened */
1178
+ /**
1179
+ * The custom GUI element that was opened
1180
+ */
831
1181
  readonly element?: LuaGuiElement
832
- /** Identifier of the event */
1182
+ /**
1183
+ * Identifier of the event
1184
+ */
833
1185
  readonly name: typeof defines.events.on_gui_opened
834
- /** Tick the event was generated. */
1186
+ /**
1187
+ * Tick the event was generated.
1188
+ */
835
1189
  readonly tick: uint
836
1190
  }
837
1191
 
@@ -841,13 +1195,21 @@ interface OnGuiOpenedEvent extends EventData {
841
1195
  * {@link https://lua-api.factorio.com/latest/events.html#on_gui_selected_tab_changed View documentation}
842
1196
  */
843
1197
  interface OnGuiSelectedTabChangedEvent extends EventData {
844
- /** The tabbed pane whose selected tab changed. */
1198
+ /**
1199
+ * The tabbed pane whose selected tab changed.
1200
+ */
845
1201
  readonly element: LuaGuiElement
846
- /** The player who did the change. */
847
- readonly player_index: uint
848
- /** Identifier of the event */
1202
+ /**
1203
+ * The player who did the change.
1204
+ */
1205
+ readonly player_index: PlayerIndex
1206
+ /**
1207
+ * Identifier of the event
1208
+ */
849
1209
  readonly name: typeof defines.events.on_gui_selected_tab_changed
850
- /** Tick the event was generated. */
1210
+ /**
1211
+ * Tick the event was generated.
1212
+ */
851
1213
  readonly tick: uint
852
1214
  }
853
1215
 
@@ -857,13 +1219,21 @@ interface OnGuiSelectedTabChangedEvent extends EventData {
857
1219
  * {@link https://lua-api.factorio.com/latest/events.html#on_gui_selection_state_changed View documentation}
858
1220
  */
859
1221
  interface OnGuiSelectionStateChangedEvent extends EventData {
860
- /** The element whose selection state changed. */
1222
+ /**
1223
+ * The element whose selection state changed.
1224
+ */
861
1225
  readonly element: LuaGuiElement
862
- /** The player who did the change. */
863
- readonly player_index: uint
864
- /** Identifier of the event */
1226
+ /**
1227
+ * The player who did the change.
1228
+ */
1229
+ readonly player_index: PlayerIndex
1230
+ /**
1231
+ * Identifier of the event
1232
+ */
865
1233
  readonly name: typeof defines.events.on_gui_selection_state_changed
866
- /** Tick the event was generated. */
1234
+ /**
1235
+ * Tick the event was generated.
1236
+ */
867
1237
  readonly tick: uint
868
1238
  }
869
1239
 
@@ -873,13 +1243,21 @@ interface OnGuiSelectionStateChangedEvent extends EventData {
873
1243
  * {@link https://lua-api.factorio.com/latest/events.html#on_gui_switch_state_changed View documentation}
874
1244
  */
875
1245
  interface OnGuiSwitchStateChangedEvent extends EventData {
876
- /** The switch whose switch state changed. */
1246
+ /**
1247
+ * The switch whose switch state changed.
1248
+ */
877
1249
  readonly element: LuaGuiElement
878
- /** The player who did the change. */
879
- readonly player_index: uint
880
- /** Identifier of the event */
1250
+ /**
1251
+ * The player who did the change.
1252
+ */
1253
+ readonly player_index: PlayerIndex
1254
+ /**
1255
+ * Identifier of the event
1256
+ */
881
1257
  readonly name: typeof defines.events.on_gui_switch_state_changed
882
- /** Tick the event was generated. */
1258
+ /**
1259
+ * Tick the event was generated.
1260
+ */
883
1261
  readonly tick: uint
884
1262
  }
885
1263
 
@@ -889,15 +1267,25 @@ interface OnGuiSwitchStateChangedEvent extends EventData {
889
1267
  * {@link https://lua-api.factorio.com/latest/events.html#on_gui_text_changed View documentation}
890
1268
  */
891
1269
  interface OnGuiTextChangedEvent extends EventData {
892
- /** The edited element. */
1270
+ /**
1271
+ * The edited element.
1272
+ */
893
1273
  readonly element: LuaGuiElement
894
- /** The player who did the edit. */
895
- readonly player_index: uint
896
- /** The new text in the element. */
1274
+ /**
1275
+ * The player who did the edit.
1276
+ */
1277
+ readonly player_index: PlayerIndex
1278
+ /**
1279
+ * The new text in the element.
1280
+ */
897
1281
  readonly text: string
898
- /** Identifier of the event */
1282
+ /**
1283
+ * Identifier of the event
1284
+ */
899
1285
  readonly name: typeof defines.events.on_gui_text_changed
900
- /** Tick the event was generated. */
1286
+ /**
1287
+ * Tick the event was generated.
1288
+ */
901
1289
  readonly tick: uint
902
1290
  }
903
1291
 
@@ -907,13 +1295,21 @@ interface OnGuiTextChangedEvent extends EventData {
907
1295
  * {@link https://lua-api.factorio.com/latest/events.html#on_gui_value_changed View documentation}
908
1296
  */
909
1297
  interface OnGuiValueChangedEvent extends EventData {
910
- /** The element whose value changed. */
1298
+ /**
1299
+ * The element whose value changed.
1300
+ */
911
1301
  readonly element: LuaGuiElement
912
- /** The player who did the change. */
913
- readonly player_index: uint
914
- /** Identifier of the event */
1302
+ /**
1303
+ * The player who did the change.
1304
+ */
1305
+ readonly player_index: PlayerIndex
1306
+ /**
1307
+ * Identifier of the event
1308
+ */
915
1309
  readonly name: typeof defines.events.on_gui_value_changed
916
- /** Tick the event was generated. */
1310
+ /**
1311
+ * Tick the event was generated.
1312
+ */
917
1313
  readonly tick: uint
918
1314
  }
919
1315
 
@@ -924,9 +1320,13 @@ interface OnGuiValueChangedEvent extends EventData {
924
1320
  */
925
1321
  interface OnLandMineArmedEvent extends EventData {
926
1322
  readonly mine: LuaEntity
927
- /** Identifier of the event */
1323
+ /**
1324
+ * Identifier of the event
1325
+ */
928
1326
  readonly name: typeof defines.events.on_land_mine_armed
929
- /** Tick the event was generated. */
1327
+ /**
1328
+ * Tick the event was generated.
1329
+ */
930
1330
  readonly tick: uint
931
1331
  }
932
1332
 
@@ -936,45 +1336,59 @@ interface OnLandMineArmedEvent extends EventData {
936
1336
  * {@link https://lua-api.factorio.com/latest/events.html#on_lua_shortcut View documentation}
937
1337
  */
938
1338
  interface OnLuaShortcutEvent extends EventData {
939
- readonly player_index: uint
940
- /** Shortcut prototype name of the shortcut that was clicked. */
1339
+ readonly player_index: PlayerIndex
1340
+ /**
1341
+ * Shortcut prototype name of the shortcut that was clicked.
1342
+ */
941
1343
  readonly prototype_name: string
942
- /** Identifier of the event */
1344
+ /**
1345
+ * Identifier of the event
1346
+ */
943
1347
  readonly name: typeof defines.events.on_lua_shortcut
944
- /** Tick the event was generated. */
1348
+ /**
1349
+ * Tick the event was generated.
1350
+ */
945
1351
  readonly tick: uint
946
1352
  }
947
1353
 
948
1354
  /**
949
- * Called when an entity is marked for deconstruction with the Deconstruction planner or via script. Can be filtered
950
- * using {@link LuaEntityMarkedForDeconstructionEventFilter}.
1355
+ * Called when an entity is marked for deconstruction with the Deconstruction planner or via script. Can be filtered using {@link LuaEntityMarkedForDeconstructionEventFilter}.
951
1356
  *
952
1357
  * {@link https://lua-api.factorio.com/latest/events.html#on_marked_for_deconstruction View documentation}
953
1358
  */
954
1359
  interface OnMarkedForDeconstructionEvent extends EventData {
955
1360
  readonly entity: LuaEntity
956
- readonly player_index?: uint
957
- /** Identifier of the event */
1361
+ readonly player_index?: PlayerIndex
1362
+ /**
1363
+ * Identifier of the event
1364
+ */
958
1365
  readonly name: typeof defines.events.on_marked_for_deconstruction
959
- /** Tick the event was generated. */
1366
+ /**
1367
+ * Tick the event was generated.
1368
+ */
960
1369
  readonly tick: uint
961
1370
  }
962
1371
 
963
1372
  /**
964
- * Called when an entity is marked for upgrade with the Upgrade planner or via script. Can be filtered using
965
- * {@link LuaEntityMarkedForUpgradeEventFilter}.
1373
+ * Called when an entity is marked for upgrade with the Upgrade planner or via script. Can be filtered using {@link LuaEntityMarkedForUpgradeEventFilter}.
966
1374
  *
967
1375
  * {@link https://lua-api.factorio.com/latest/events.html#on_marked_for_upgrade View documentation}
968
1376
  */
969
1377
  interface OnMarkedForUpgradeEvent extends EventData {
970
1378
  readonly entity: LuaEntity
971
1379
  readonly target: LuaEntityPrototype
972
- readonly player_index?: uint
973
- /** The new direction (if any) */
1380
+ readonly player_index?: PlayerIndex
1381
+ /**
1382
+ * The new direction (if any)
1383
+ */
974
1384
  readonly direction?: defines.direction
975
- /** Identifier of the event */
1385
+ /**
1386
+ * Identifier of the event
1387
+ */
976
1388
  readonly name: typeof defines.events.on_marked_for_upgrade
977
- /** Tick the event was generated. */
1389
+ /**
1390
+ * Tick the event was generated.
1391
+ */
978
1392
  readonly tick: uint
979
1393
  }
980
1394
 
@@ -984,17 +1398,29 @@ interface OnMarkedForUpgradeEvent extends EventData {
984
1398
  * {@link https://lua-api.factorio.com/latest/events.html#on_market_item_purchased View documentation}
985
1399
  */
986
1400
  interface OnMarketItemPurchasedEvent extends EventData {
987
- /** The player who did the purchasing. */
988
- readonly player_index: uint
989
- /** The market entity. */
1401
+ /**
1402
+ * The player who did the purchasing.
1403
+ */
1404
+ readonly player_index: PlayerIndex
1405
+ /**
1406
+ * The market entity.
1407
+ */
990
1408
  readonly market: LuaEntity
991
- /** The index of the offer purchased. */
1409
+ /**
1410
+ * The index of the offer purchased.
1411
+ */
992
1412
  readonly offer_index: uint
993
- /** The amount of offers purchased. */
1413
+ /**
1414
+ * The amount of offers purchased.
1415
+ */
994
1416
  readonly count: uint
995
- /** Identifier of the event */
1417
+ /**
1418
+ * Identifier of the event
1419
+ */
996
1420
  readonly name: typeof defines.events.on_market_item_purchased
997
- /** Tick the event was generated. */
1421
+ /**
1422
+ * Tick the event was generated.
1423
+ */
998
1424
  readonly tick: uint
999
1425
  }
1000
1426
 
@@ -1004,13 +1430,21 @@ interface OnMarketItemPurchasedEvent extends EventData {
1004
1430
  * {@link https://lua-api.factorio.com/latest/events.html#on_mod_item_opened View documentation}
1005
1431
  */
1006
1432
  interface OnModItemOpenedEvent extends EventData {
1007
- /** The player. */
1008
- readonly player_index: uint
1009
- /** The item clicked on. */
1433
+ /**
1434
+ * The player.
1435
+ */
1436
+ readonly player_index: PlayerIndex
1437
+ /**
1438
+ * The item clicked on.
1439
+ */
1010
1440
  readonly item: LuaItemPrototype
1011
- /** Identifier of the event */
1441
+ /**
1442
+ * Identifier of the event
1443
+ */
1012
1444
  readonly name: typeof defines.events.on_mod_item_opened
1013
- /** Tick the event was generated. */
1445
+ /**
1446
+ * Tick the event was generated.
1447
+ */
1014
1448
  readonly tick: uint
1015
1449
  }
1016
1450
 
@@ -1020,13 +1454,21 @@ interface OnModItemOpenedEvent extends EventData {
1020
1454
  * {@link https://lua-api.factorio.com/latest/events.html#on_permission_group_added View documentation}
1021
1455
  */
1022
1456
  interface OnPermissionGroupAddedEvent extends EventData {
1023
- /** The player that added the group. */
1024
- readonly player_index: uint
1025
- /** The group added. */
1457
+ /**
1458
+ * The player that added the group.
1459
+ */
1460
+ readonly player_index: PlayerIndex
1461
+ /**
1462
+ * The group added.
1463
+ */
1026
1464
  readonly group: LuaPermissionGroup
1027
- /** Identifier of the event */
1465
+ /**
1466
+ * Identifier of the event
1467
+ */
1028
1468
  readonly name: typeof defines.events.on_permission_group_added
1029
- /** Tick the event was generated. */
1469
+ /**
1470
+ * Tick the event was generated.
1471
+ */
1030
1472
  readonly tick: uint
1031
1473
  }
1032
1474
 
@@ -1036,15 +1478,25 @@ interface OnPermissionGroupAddedEvent extends EventData {
1036
1478
  * {@link https://lua-api.factorio.com/latest/events.html#on_permission_group_deleted View documentation}
1037
1479
  */
1038
1480
  interface OnPermissionGroupDeletedEvent extends EventData {
1039
- /** The player doing the deletion. */
1040
- readonly player_index: uint
1041
- /** The group that was deleted. */
1481
+ /**
1482
+ * The player doing the deletion.
1483
+ */
1484
+ readonly player_index: PlayerIndex
1485
+ /**
1486
+ * The group that was deleted.
1487
+ */
1042
1488
  readonly group_name: string
1043
- /** The group id that was deleted. */
1489
+ /**
1490
+ * The group id that was deleted.
1491
+ */
1044
1492
  readonly id: uint
1045
- /** Identifier of the event */
1493
+ /**
1494
+ * Identifier of the event
1495
+ */
1046
1496
  readonly name: typeof defines.events.on_permission_group_deleted
1047
- /** Tick the event was generated. */
1497
+ /**
1498
+ * Tick the event was generated.
1499
+ */
1048
1500
  readonly tick: uint
1049
1501
  }
1050
1502
 
@@ -1054,11 +1506,17 @@ interface OnPermissionGroupDeletedEvent extends EventData {
1054
1506
  * {@link https://lua-api.factorio.com/latest/events.html#on_permission_group_edited View documentation}
1055
1507
  */
1056
1508
  interface OnPermissionGroupEditedEvent extends EventData {
1057
- /** The player that did the editing. */
1058
- readonly player_index: uint
1059
- /** The group being edited. */
1509
+ /**
1510
+ * The player that did the editing.
1511
+ */
1512
+ readonly player_index: PlayerIndex
1513
+ /**
1514
+ * The group being edited.
1515
+ */
1060
1516
  readonly group: LuaPermissionGroup
1061
- /** The edit type: "add-permission", "remove-permission", "enable-all", "disable-all", "add-player", "remove-player", "rename". */
1517
+ /**
1518
+ * The edit type: "add-permission", "remove-permission", "enable-all", "disable-all", "add-player", "remove-player", "rename".
1519
+ */
1062
1520
  readonly type:
1063
1521
  | "add-permission"
1064
1522
  | "remove-permission"
@@ -1067,17 +1525,29 @@ interface OnPermissionGroupEditedEvent extends EventData {
1067
1525
  | "add-player"
1068
1526
  | "remove-player"
1069
1527
  | "rename"
1070
- /** The action when the `type` is "add-permission" or "remove-permission". */
1528
+ /**
1529
+ * The action when the `type` is "add-permission" or "remove-permission".
1530
+ */
1071
1531
  readonly action: defines.input_action
1072
- /** The other player when the `type` is "add-player" or "remove-player". */
1532
+ /**
1533
+ * The other player when the `type` is "add-player" or "remove-player".
1534
+ */
1073
1535
  readonly other_player_index: uint
1074
- /** The old group name when the `type` is "rename". */
1536
+ /**
1537
+ * The old group name when the `type` is "rename".
1538
+ */
1075
1539
  readonly old_name: string
1076
- /** The new group name when the `type` is "rename". */
1540
+ /**
1541
+ * The new group name when the `type` is "rename".
1542
+ */
1077
1543
  readonly new_name: string
1078
- /** Identifier of the event */
1544
+ /**
1545
+ * Identifier of the event
1546
+ */
1079
1547
  readonly name: typeof defines.events.on_permission_group_edited
1080
- /** Tick the event was generated. */
1548
+ /**
1549
+ * Tick the event was generated.
1550
+ */
1081
1551
  readonly tick: uint
1082
1552
  }
1083
1553
 
@@ -1087,11 +1557,17 @@ interface OnPermissionGroupEditedEvent extends EventData {
1087
1557
  * {@link https://lua-api.factorio.com/latest/events.html#on_permission_string_imported View documentation}
1088
1558
  */
1089
1559
  interface OnPermissionStringImportedEvent extends EventData {
1090
- /** The player that imported the string. */
1091
- readonly player_index: uint
1092
- /** Identifier of the event */
1560
+ /**
1561
+ * The player that imported the string.
1562
+ */
1563
+ readonly player_index: PlayerIndex
1564
+ /**
1565
+ * Identifier of the event
1566
+ */
1093
1567
  readonly name: typeof defines.events.on_permission_string_imported
1094
- /** Tick the event was generated. */
1568
+ /**
1569
+ * Tick the event was generated.
1570
+ */
1095
1571
  readonly tick: uint
1096
1572
  }
1097
1573
 
@@ -1102,10 +1578,14 @@ interface OnPermissionStringImportedEvent extends EventData {
1102
1578
  */
1103
1579
  interface OnPickedUpItemEvent extends EventData {
1104
1580
  readonly item_stack: SimpleItemStack
1105
- readonly player_index: uint
1106
- /** Identifier of the event */
1581
+ readonly player_index: PlayerIndex
1582
+ /**
1583
+ * Identifier of the event
1584
+ */
1107
1585
  readonly name: typeof defines.events.on_picked_up_item
1108
- /** Tick the event was generated. */
1586
+ /**
1587
+ * Tick the event was generated.
1588
+ */
1109
1589
  readonly tick: uint
1110
1590
  }
1111
1591
 
@@ -1115,21 +1595,37 @@ interface OnPickedUpItemEvent extends EventData {
1115
1595
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_alt_selected_area View documentation}
1116
1596
  */
1117
1597
  interface OnPlayerAltSelectedAreaEvent extends EventData {
1118
- /** The player doing the selection. */
1119
- readonly player_index: uint
1120
- /** The surface selected. */
1598
+ /**
1599
+ * The player doing the selection.
1600
+ */
1601
+ readonly player_index: PlayerIndex
1602
+ /**
1603
+ * The surface selected.
1604
+ */
1121
1605
  readonly surface: LuaSurface
1122
- /** The area selected. */
1606
+ /**
1607
+ * The area selected.
1608
+ */
1123
1609
  readonly area: BoundingBoxRead
1124
- /** The item used to select the area. */
1610
+ /**
1611
+ * The item used to select the area.
1612
+ */
1125
1613
  readonly item: string
1126
- /** The entities selected. */
1614
+ /**
1615
+ * The entities selected.
1616
+ */
1127
1617
  readonly entities: LuaEntity[]
1128
- /** The tiles selected. */
1618
+ /**
1619
+ * The tiles selected.
1620
+ */
1129
1621
  readonly tiles: LuaTile[]
1130
- /** Identifier of the event */
1622
+ /**
1623
+ * Identifier of the event
1624
+ */
1131
1625
  readonly name: typeof defines.events.on_player_alt_selected_area
1132
- /** Tick the event was generated. */
1626
+ /**
1627
+ * Tick the event was generated.
1628
+ */
1133
1629
  readonly tick: uint
1134
1630
  }
1135
1631
 
@@ -1139,10 +1635,14 @@ interface OnPlayerAltSelectedAreaEvent extends EventData {
1139
1635
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_ammo_inventory_changed View documentation}
1140
1636
  */
1141
1637
  interface OnPlayerAmmoInventoryChangedEvent extends EventData {
1142
- readonly player_index: uint
1143
- /** Identifier of the event */
1638
+ readonly player_index: PlayerIndex
1639
+ /**
1640
+ * Identifier of the event
1641
+ */
1144
1642
  readonly name: typeof defines.events.on_player_ammo_inventory_changed
1145
- /** Tick the event was generated. */
1643
+ /**
1644
+ * Tick the event was generated.
1645
+ */
1146
1646
  readonly tick: uint
1147
1647
  }
1148
1648
 
@@ -1152,10 +1652,14 @@ interface OnPlayerAmmoInventoryChangedEvent extends EventData {
1152
1652
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_armor_inventory_changed View documentation}
1153
1653
  */
1154
1654
  interface OnPlayerArmorInventoryChangedEvent extends EventData {
1155
- readonly player_index: uint
1156
- /** Identifier of the event */
1655
+ readonly player_index: PlayerIndex
1656
+ /**
1657
+ * Identifier of the event
1658
+ */
1157
1659
  readonly name: typeof defines.events.on_player_armor_inventory_changed
1158
- /** Tick the event was generated. */
1660
+ /**
1661
+ * Tick the event was generated.
1662
+ */
1159
1663
  readonly tick: uint
1160
1664
  }
1161
1665
 
@@ -1165,17 +1669,29 @@ interface OnPlayerArmorInventoryChangedEvent extends EventData {
1165
1669
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_banned View documentation}
1166
1670
  */
1167
1671
  interface OnPlayerBannedEvent extends EventData {
1168
- /** The player banned. */
1169
- readonly player_index?: uint
1170
- /** The banned player name. */
1672
+ /**
1673
+ * The player banned.
1674
+ */
1675
+ readonly player_index?: PlayerIndex
1676
+ /**
1677
+ * The banned player name.
1678
+ */
1171
1679
  readonly player_name: string
1172
- /** The player that did the banning if any. */
1173
- readonly by_player?: uint
1174
- /** The reason given if any. */
1680
+ /**
1681
+ * The player that did the banning if any.
1682
+ */
1683
+ readonly by_player?: PlayerIndex
1684
+ /**
1685
+ * The reason given if any.
1686
+ */
1175
1687
  readonly reason?: string
1176
- /** Identifier of the event */
1688
+ /**
1689
+ * Identifier of the event
1690
+ */
1177
1691
  readonly name: typeof defines.events.on_player_banned
1178
- /** Tick the event was generated. */
1692
+ /**
1693
+ * Tick the event was generated.
1694
+ */
1179
1695
  readonly tick: uint
1180
1696
  }
1181
1697
 
@@ -1185,20 +1701,34 @@ interface OnPlayerBannedEvent extends EventData {
1185
1701
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_built_tile View documentation}
1186
1702
  */
1187
1703
  interface OnPlayerBuiltTileEvent extends EventData {
1188
- readonly player_index: uint
1189
- /** The surface the tile(s) were built on. */
1190
- readonly surface_index: uint
1191
- /** The position data. */
1704
+ readonly player_index: PlayerIndex
1705
+ /**
1706
+ * The surface the tile(s) were built on.
1707
+ */
1708
+ readonly surface_index: SurfaceIndex
1709
+ /**
1710
+ * The position data.
1711
+ */
1192
1712
  readonly tiles: OldTileAndPosition[]
1193
- /** The tile prototype that was placed. */
1713
+ /**
1714
+ * The tile prototype that was placed.
1715
+ */
1194
1716
  readonly tile: LuaTilePrototype
1195
- /** The item type used to build the tiles */
1717
+ /**
1718
+ * The item type used to build the tiles
1719
+ */
1196
1720
  readonly item?: LuaItemPrototype
1197
- /** The stack used to build the tiles (may be empty if all of the items where used to build the tiles). */
1721
+ /**
1722
+ * The stack used to build the tiles (may be empty if all of the items where used to build the tiles).
1723
+ */
1198
1724
  readonly stack?: LuaItemStack
1199
- /** Identifier of the event */
1725
+ /**
1726
+ * Identifier of the event
1727
+ */
1200
1728
  readonly name: typeof defines.events.on_player_built_tile
1201
- /** Tick the event was generated. */
1729
+ /**
1730
+ * Tick the event was generated.
1731
+ */
1202
1732
  readonly tick: uint
1203
1733
  }
1204
1734
 
@@ -1208,17 +1738,29 @@ interface OnPlayerBuiltTileEvent extends EventData {
1208
1738
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_cancelled_crafting View documentation}
1209
1739
  */
1210
1740
  interface OnPlayerCancelledCraftingEvent extends EventData {
1211
- /** The player that did the crafting. */
1212
- readonly player_index: uint
1213
- /** The crafting items returned to the player's inventory. */
1741
+ /**
1742
+ * The player that did the crafting.
1743
+ */
1744
+ readonly player_index: PlayerIndex
1745
+ /**
1746
+ * The crafting items returned to the player's inventory.
1747
+ */
1214
1748
  readonly items: LuaInventory
1215
- /** The recipe that has been cancelled. */
1749
+ /**
1750
+ * The recipe that has been cancelled.
1751
+ */
1216
1752
  readonly recipe: LuaRecipe
1217
- /** The number of crafts that have been cancelled. */
1753
+ /**
1754
+ * The number of crafts that have been cancelled.
1755
+ */
1218
1756
  readonly cancel_count: uint
1219
- /** Identifier of the event */
1757
+ /**
1758
+ * Identifier of the event
1759
+ */
1220
1760
  readonly name: typeof defines.events.on_player_cancelled_crafting
1221
- /** Tick the event was generated. */
1761
+ /**
1762
+ * Tick the event was generated.
1763
+ */
1222
1764
  readonly tick: uint
1223
1765
  }
1224
1766
 
@@ -1228,13 +1770,21 @@ interface OnPlayerCancelledCraftingEvent extends EventData {
1228
1770
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_changed_force View documentation}
1229
1771
  */
1230
1772
  interface OnPlayerChangedForceEvent extends EventData {
1231
- /** The player who changed forces. */
1232
- readonly player_index: uint
1233
- /** The old force. */
1773
+ /**
1774
+ * The player who changed forces.
1775
+ */
1776
+ readonly player_index: PlayerIndex
1777
+ /**
1778
+ * The old force.
1779
+ */
1234
1780
  readonly force: LuaForce
1235
- /** Identifier of the event */
1781
+ /**
1782
+ * Identifier of the event
1783
+ */
1236
1784
  readonly name: typeof defines.events.on_player_changed_force
1237
- /** Tick the event was generated. */
1785
+ /**
1786
+ * Tick the event was generated.
1787
+ */
1238
1788
  readonly tick: uint
1239
1789
  }
1240
1790
 
@@ -1244,29 +1794,42 @@ interface OnPlayerChangedForceEvent extends EventData {
1244
1794
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_changed_position View documentation}
1245
1795
  */
1246
1796
  interface OnPlayerChangedPositionEvent extends EventData {
1247
- /** The player. */
1248
- readonly player_index: uint
1249
- /** Identifier of the event */
1797
+ /**
1798
+ * The player.
1799
+ */
1800
+ readonly player_index: PlayerIndex
1801
+ /**
1802
+ * Identifier of the event
1803
+ */
1250
1804
  readonly name: typeof defines.events.on_player_changed_position
1251
- /** Tick the event was generated. */
1805
+ /**
1806
+ * Tick the event was generated.
1807
+ */
1252
1808
  readonly tick: uint
1253
1809
  }
1254
1810
 
1255
1811
  /**
1256
1812
  * Called after a player changes surfaces.
1257
1813
  *
1258
- * **Note**: In the instance a player is moved off a surface due to it being deleted this is not called.
1259
- *
1260
1814
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_changed_surface View documentation}
1815
+ * @remarks In the instance a player is moved off a surface due to it being deleted this is not called.
1261
1816
  */
1262
1817
  interface OnPlayerChangedSurfaceEvent extends EventData {
1263
- /** The player who changed surfaces. */
1264
- readonly player_index: uint
1265
- /** The surface index the player was on. */
1266
- readonly surface_index: uint
1267
- /** Identifier of the event */
1818
+ /**
1819
+ * The player who changed surfaces.
1820
+ */
1821
+ readonly player_index: PlayerIndex
1822
+ /**
1823
+ * The surface index the player was on.
1824
+ */
1825
+ readonly surface_index: SurfaceIndex
1826
+ /**
1827
+ * Identifier of the event
1828
+ */
1268
1829
  readonly name: typeof defines.events.on_player_changed_surface
1269
- /** Tick the event was generated. */
1830
+ /**
1831
+ * Tick the event was generated.
1832
+ */
1270
1833
  readonly tick: uint
1271
1834
  }
1272
1835
 
@@ -1276,11 +1839,17 @@ interface OnPlayerChangedSurfaceEvent extends EventData {
1276
1839
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_cheat_mode_disabled View documentation}
1277
1840
  */
1278
1841
  interface OnPlayerCheatModeDisabledEvent extends EventData {
1279
- /** The player. */
1280
- readonly player_index: uint
1281
- /** Identifier of the event */
1842
+ /**
1843
+ * The player.
1844
+ */
1845
+ readonly player_index: PlayerIndex
1846
+ /**
1847
+ * Identifier of the event
1848
+ */
1282
1849
  readonly name: typeof defines.events.on_player_cheat_mode_disabled
1283
- /** Tick the event was generated. */
1850
+ /**
1851
+ * Tick the event was generated.
1852
+ */
1284
1853
  readonly tick: uint
1285
1854
  }
1286
1855
 
@@ -1290,11 +1859,17 @@ interface OnPlayerCheatModeDisabledEvent extends EventData {
1290
1859
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_cheat_mode_enabled View documentation}
1291
1860
  */
1292
1861
  interface OnPlayerCheatModeEnabledEvent extends EventData {
1293
- /** The player. */
1294
- readonly player_index: uint
1295
- /** Identifier of the event */
1862
+ /**
1863
+ * The player.
1864
+ */
1865
+ readonly player_index: PlayerIndex
1866
+ /**
1867
+ * Identifier of the event
1868
+ */
1296
1869
  readonly name: typeof defines.events.on_player_cheat_mode_enabled
1297
- /** Tick the event was generated. */
1870
+ /**
1871
+ * Tick the event was generated.
1872
+ */
1298
1873
  readonly tick: uint
1299
1874
  }
1300
1875
 
@@ -1304,15 +1879,25 @@ interface OnPlayerCheatModeEnabledEvent extends EventData {
1304
1879
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_clicked_gps_tag View documentation}
1305
1880
  */
1306
1881
  interface OnPlayerClickedGpsTagEvent extends EventData {
1307
- /** Index of the player */
1308
- readonly player_index: uint
1309
- /** Map position contained in gps tag */
1310
- readonly position: PositionTable
1311
- /** Surface name contained in gps tag, even when such surface does not exists */
1882
+ /**
1883
+ * Index of the player
1884
+ */
1885
+ readonly player_index: PlayerIndex
1886
+ /**
1887
+ * Map position contained in gps tag
1888
+ */
1889
+ readonly position: MapPositionTable
1890
+ /**
1891
+ * Surface name contained in gps tag, even when such surface does not exists
1892
+ */
1312
1893
  readonly surface: string
1313
- /** Identifier of the event */
1894
+ /**
1895
+ * Identifier of the event
1896
+ */
1314
1897
  readonly name: typeof defines.events.on_player_clicked_gps_tag
1315
- /** Tick the event was generated. */
1898
+ /**
1899
+ * Tick the event was generated.
1900
+ */
1316
1901
  readonly tick: uint
1317
1902
  }
1318
1903
 
@@ -1322,11 +1907,17 @@ interface OnPlayerClickedGpsTagEvent extends EventData {
1322
1907
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_configured_blueprint View documentation}
1323
1908
  */
1324
1909
  interface OnPlayerConfiguredBlueprintEvent extends EventData {
1325
- /** The player. */
1326
- readonly player_index: uint
1327
- /** Identifier of the event */
1910
+ /**
1911
+ * The player.
1912
+ */
1913
+ readonly player_index: PlayerIndex
1914
+ /**
1915
+ * Identifier of the event
1916
+ */
1328
1917
  readonly name: typeof defines.events.on_player_configured_blueprint
1329
- /** Tick the event was generated. */
1918
+ /**
1919
+ * Tick the event was generated.
1920
+ */
1330
1921
  readonly tick: uint
1331
1922
  }
1332
1923
 
@@ -1336,32 +1927,49 @@ interface OnPlayerConfiguredBlueprintEvent extends EventData {
1336
1927
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_configured_spider_remote View documentation}
1337
1928
  */
1338
1929
  interface OnPlayerConfiguredSpiderRemoteEvent extends EventData {
1339
- /** The player that configured the remote. */
1340
- readonly player_index: uint
1341
- /** Spider vehicle to which remote was connected to. */
1930
+ /**
1931
+ * The player that configured the remote.
1932
+ */
1933
+ readonly player_index: PlayerIndex
1934
+ /**
1935
+ * Spider vehicle to which remote was connected to.
1936
+ */
1342
1937
  readonly vehicle: LuaEntity
1343
- /** Identifier of the event */
1938
+ /**
1939
+ * Identifier of the event
1940
+ */
1344
1941
  readonly name: typeof defines.events.on_player_configured_spider_remote
1345
- /** Tick the event was generated. */
1942
+ /**
1943
+ * Tick the event was generated.
1944
+ */
1346
1945
  readonly tick: uint
1347
1946
  }
1348
1947
 
1349
1948
  /**
1350
- * Called when the player finishes crafting an item. This event fires just before the results are inserted into the
1351
- * player's inventory, not when the crafting is queued (see {@link OnPrePlayerCraftedItemEvent on_pre_player_crafted_item}).
1949
+ * Called when the player finishes crafting an item. This event fires just before the results are inserted into the player's inventory, not when the crafting is queued (see {@link OnPrePlayerCraftedItemEvent on_pre_player_crafted_item}).
1352
1950
  *
1353
1951
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_crafted_item View documentation}
1354
1952
  */
1355
1953
  interface OnPlayerCraftedItemEvent extends EventData {
1356
- /** The item that has been crafted. */
1954
+ /**
1955
+ * The item that has been crafted.
1956
+ */
1357
1957
  readonly item_stack: LuaItemStack
1358
- /** The player doing the crafting. */
1359
- readonly player_index: uint
1360
- /** The recipe used to craft this item. */
1958
+ /**
1959
+ * The player doing the crafting.
1960
+ */
1961
+ readonly player_index: PlayerIndex
1962
+ /**
1963
+ * The recipe used to craft this item.
1964
+ */
1361
1965
  readonly recipe: LuaRecipe
1362
- /** Identifier of the event */
1966
+ /**
1967
+ * Identifier of the event
1968
+ */
1363
1969
  readonly name: typeof defines.events.on_player_crafted_item
1364
- /** Tick the event was generated. */
1970
+ /**
1971
+ * Tick the event was generated.
1972
+ */
1365
1973
  readonly tick: uint
1366
1974
  }
1367
1975
 
@@ -1371,10 +1979,14 @@ interface OnPlayerCraftedItemEvent extends EventData {
1371
1979
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_created View documentation}
1372
1980
  */
1373
1981
  interface OnPlayerCreatedEvent extends EventData {
1374
- readonly player_index: uint
1375
- /** Identifier of the event */
1982
+ readonly player_index: PlayerIndex
1983
+ /**
1984
+ * Identifier of the event
1985
+ */
1376
1986
  readonly name: typeof defines.events.on_player_created
1377
- /** Tick the event was generated. */
1987
+ /**
1988
+ * Tick the event was generated.
1989
+ */
1378
1990
  readonly tick: uint
1379
1991
  }
1380
1992
 
@@ -1384,10 +1996,14 @@ interface OnPlayerCreatedEvent extends EventData {
1384
1996
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_cursor_stack_changed View documentation}
1385
1997
  */
1386
1998
  interface OnPlayerCursorStackChangedEvent extends EventData {
1387
- readonly player_index: uint
1388
- /** Identifier of the event */
1999
+ readonly player_index: PlayerIndex
2000
+ /**
2001
+ * Identifier of the event
2002
+ */
1389
2003
  readonly name: typeof defines.events.on_player_cursor_stack_changed
1390
- /** Tick the event was generated. */
2004
+ /**
2005
+ * Tick the event was generated.
2006
+ */
1391
2007
  readonly tick: uint
1392
2008
  }
1393
2009
 
@@ -1397,19 +2013,33 @@ interface OnPlayerCursorStackChangedEvent extends EventData {
1397
2013
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_deconstructed_area View documentation}
1398
2014
  */
1399
2015
  interface OnPlayerDeconstructedAreaEvent extends EventData {
1400
- /** The player doing the selection. */
1401
- readonly player_index: uint
1402
- /** The surface selected. */
2016
+ /**
2017
+ * The player doing the selection.
2018
+ */
2019
+ readonly player_index: PlayerIndex
2020
+ /**
2021
+ * The surface selected.
2022
+ */
1403
2023
  readonly surface: LuaSurface
1404
- /** The area selected. */
2024
+ /**
2025
+ * The area selected.
2026
+ */
1405
2027
  readonly area: BoundingBoxRead
1406
- /** The item used to select the area. */
2028
+ /**
2029
+ * The item used to select the area.
2030
+ */
1407
2031
  readonly item: string
1408
- /** If normal selection or alt selection was used. */
2032
+ /**
2033
+ * If normal selection or alt selection was used.
2034
+ */
1409
2035
  readonly alt: boolean
1410
- /** Identifier of the event */
2036
+ /**
2037
+ * Identifier of the event
2038
+ */
1411
2039
  readonly name: typeof defines.events.on_player_deconstructed_area
1412
- /** Tick the event was generated. */
2040
+ /**
2041
+ * Tick the event was generated.
2042
+ */
1413
2043
  readonly tick: uint
1414
2044
  }
1415
2045
 
@@ -1419,11 +2049,17 @@ interface OnPlayerDeconstructedAreaEvent extends EventData {
1419
2049
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_demoted View documentation}
1420
2050
  */
1421
2051
  interface OnPlayerDemotedEvent extends EventData {
1422
- /** The player. */
1423
- readonly player_index: uint
1424
- /** Identifier of the event */
2052
+ /**
2053
+ * The player.
2054
+ */
2055
+ readonly player_index: PlayerIndex
2056
+ /**
2057
+ * Identifier of the event
2058
+ */
1425
2059
  readonly name: typeof defines.events.on_player_demoted
1426
- /** Tick the event was generated. */
2060
+ /**
2061
+ * Tick the event was generated.
2062
+ */
1427
2063
  readonly tick: uint
1428
2064
  }
1429
2065
 
@@ -1433,11 +2069,15 @@ interface OnPlayerDemotedEvent extends EventData {
1433
2069
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_died View documentation}
1434
2070
  */
1435
2071
  interface OnPlayerDiedEvent extends EventData {
1436
- readonly player_index: uint
2072
+ readonly player_index: PlayerIndex
1437
2073
  readonly cause?: LuaEntity
1438
- /** Identifier of the event */
2074
+ /**
2075
+ * Identifier of the event
2076
+ */
1439
2077
  readonly name: typeof defines.events.on_player_died
1440
- /** Tick the event was generated. */
2078
+ /**
2079
+ * Tick the event was generated.
2080
+ */
1441
2081
  readonly tick: uint
1442
2082
  }
1443
2083
 
@@ -1447,13 +2087,21 @@ interface OnPlayerDiedEvent extends EventData {
1447
2087
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_display_resolution_changed View documentation}
1448
2088
  */
1449
2089
  interface OnPlayerDisplayResolutionChangedEvent extends EventData {
1450
- /** The player */
1451
- readonly player_index: uint
1452
- /** The old display resolution */
2090
+ /**
2091
+ * The player
2092
+ */
2093
+ readonly player_index: PlayerIndex
2094
+ /**
2095
+ * The old display resolution
2096
+ */
1453
2097
  readonly old_resolution: DisplayResolution
1454
- /** Identifier of the event */
2098
+ /**
2099
+ * Identifier of the event
2100
+ */
1455
2101
  readonly name: typeof defines.events.on_player_display_resolution_changed
1456
- /** Tick the event was generated. */
2102
+ /**
2103
+ * Tick the event was generated.
2104
+ */
1457
2105
  readonly tick: uint
1458
2106
  }
1459
2107
 
@@ -1463,13 +2111,21 @@ interface OnPlayerDisplayResolutionChangedEvent extends EventData {
1463
2111
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_display_scale_changed View documentation}
1464
2112
  */
1465
2113
  interface OnPlayerDisplayScaleChangedEvent extends EventData {
1466
- /** The player */
1467
- readonly player_index: uint
1468
- /** The old display scale */
2114
+ /**
2115
+ * The player
2116
+ */
2117
+ readonly player_index: PlayerIndex
2118
+ /**
2119
+ * The old display scale
2120
+ */
1469
2121
  readonly old_scale: double
1470
- /** Identifier of the event */
2122
+ /**
2123
+ * Identifier of the event
2124
+ */
1471
2125
  readonly name: typeof defines.events.on_player_display_scale_changed
1472
- /** Tick the event was generated. */
2126
+ /**
2127
+ * Tick the event was generated.
2128
+ */
1473
2129
  readonly tick: uint
1474
2130
  }
1475
2131
 
@@ -1479,12 +2135,18 @@ interface OnPlayerDisplayScaleChangedEvent extends EventData {
1479
2135
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_driving_changed_state View documentation}
1480
2136
  */
1481
2137
  interface OnPlayerDrivingChangedStateEvent extends EventData {
1482
- readonly player_index: uint
1483
- /** The vehicle if any. */
2138
+ readonly player_index: PlayerIndex
2139
+ /**
2140
+ * The vehicle if any.
2141
+ */
1484
2142
  readonly entity?: LuaEntity
1485
- /** Identifier of the event */
2143
+ /**
2144
+ * Identifier of the event
2145
+ */
1486
2146
  readonly name: typeof defines.events.on_player_driving_changed_state
1487
- /** Tick the event was generated. */
2147
+ /**
2148
+ * Tick the event was generated.
2149
+ */
1488
2150
  readonly tick: uint
1489
2151
  }
1490
2152
 
@@ -1494,12 +2156,18 @@ interface OnPlayerDrivingChangedStateEvent extends EventData {
1494
2156
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_dropped_item View documentation}
1495
2157
  */
1496
2158
  interface OnPlayerDroppedItemEvent extends EventData {
1497
- readonly player_index: uint
1498
- /** The item-on-ground entity. */
2159
+ readonly player_index: PlayerIndex
2160
+ /**
2161
+ * The item-on-ground entity.
2162
+ */
1499
2163
  readonly entity: LuaEntity
1500
- /** Identifier of the event */
2164
+ /**
2165
+ * Identifier of the event
2166
+ */
1501
2167
  readonly name: typeof defines.events.on_player_dropped_item
1502
- /** Tick the event was generated. */
2168
+ /**
2169
+ * Tick the event was generated.
2170
+ */
1503
2171
  readonly tick: uint
1504
2172
  }
1505
2173
 
@@ -1509,15 +2177,25 @@ interface OnPlayerDroppedItemEvent extends EventData {
1509
2177
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_fast_transferred View documentation}
1510
2178
  */
1511
2179
  interface OnPlayerFastTransferredEvent extends EventData {
1512
- /** The player transferred from or to. */
1513
- readonly player_index: uint
1514
- /** The entity transferred from or to. */
2180
+ /**
2181
+ * The player transferred from or to.
2182
+ */
2183
+ readonly player_index: PlayerIndex
2184
+ /**
2185
+ * The entity transferred from or to.
2186
+ */
1515
2187
  readonly entity: LuaEntity
1516
- /** Whether the transfer was from player to entity. If `false`, the transfer was from entity to player. */
2188
+ /**
2189
+ * Whether the transfer was from player to entity. If `false`, the transfer was from entity to player.
2190
+ */
1517
2191
  readonly from_player: boolean
1518
- /** Identifier of the event */
2192
+ /**
2193
+ * Identifier of the event
2194
+ */
1519
2195
  readonly name: typeof defines.events.on_player_fast_transferred
1520
- /** Tick the event was generated. */
2196
+ /**
2197
+ * Tick the event was generated.
2198
+ */
1521
2199
  readonly tick: uint
1522
2200
  }
1523
2201
 
@@ -1527,19 +2205,33 @@ interface OnPlayerFastTransferredEvent extends EventData {
1527
2205
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_flushed_fluid View documentation}
1528
2206
  */
1529
2207
  interface OnPlayerFlushedFluidEvent extends EventData {
1530
- /** Index of the player */
1531
- readonly player_index: uint
1532
- /** Name of a fluid that was flushed */
2208
+ /**
2209
+ * Index of the player
2210
+ */
2211
+ readonly player_index: PlayerIndex
2212
+ /**
2213
+ * Name of a fluid that was flushed
2214
+ */
1533
2215
  readonly fluid: string
1534
- /** Amount of fluid that was removed */
2216
+ /**
2217
+ * Amount of fluid that was removed
2218
+ */
1535
2219
  readonly amount: double
1536
- /** Entity from which flush was performed */
2220
+ /**
2221
+ * Entity from which flush was performed
2222
+ */
1537
2223
  readonly entity: LuaEntity
1538
- /** True if flush was requested only on this entity */
2224
+ /**
2225
+ * True if flush was requested only on this entity
2226
+ */
1539
2227
  readonly only_this_entity: boolean
1540
- /** Identifier of the event */
2228
+ /**
2229
+ * Identifier of the event
2230
+ */
1541
2231
  readonly name: typeof defines.events.on_player_flushed_fluid
1542
- /** Tick the event was generated. */
2232
+ /**
2233
+ * Tick the event was generated.
2234
+ */
1543
2235
  readonly tick: uint
1544
2236
  }
1545
2237
 
@@ -1549,10 +2241,14 @@ interface OnPlayerFlushedFluidEvent extends EventData {
1549
2241
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_gun_inventory_changed View documentation}
1550
2242
  */
1551
2243
  interface OnPlayerGunInventoryChangedEvent extends EventData {
1552
- readonly player_index: uint
1553
- /** Identifier of the event */
2244
+ readonly player_index: PlayerIndex
2245
+ /**
2246
+ * Identifier of the event
2247
+ */
1554
2248
  readonly name: typeof defines.events.on_player_gun_inventory_changed
1555
- /** Tick the event was generated. */
2249
+ /**
2250
+ * Tick the event was generated.
2251
+ */
1556
2252
  readonly tick: uint
1557
2253
  }
1558
2254
 
@@ -1562,10 +2258,14 @@ interface OnPlayerGunInventoryChangedEvent extends EventData {
1562
2258
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_joined_game View documentation}
1563
2259
  */
1564
2260
  interface OnPlayerJoinedGameEvent extends EventData {
1565
- readonly player_index: uint
1566
- /** Identifier of the event */
2261
+ readonly player_index: PlayerIndex
2262
+ /**
2263
+ * Identifier of the event
2264
+ */
1567
2265
  readonly name: typeof defines.events.on_player_joined_game
1568
- /** Tick the event was generated. */
2266
+ /**
2267
+ * Tick the event was generated.
2268
+ */
1569
2269
  readonly tick: uint
1570
2270
  }
1571
2271
 
@@ -1575,15 +2275,25 @@ interface OnPlayerJoinedGameEvent extends EventData {
1575
2275
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_kicked View documentation}
1576
2276
  */
1577
2277
  interface OnPlayerKickedEvent extends EventData {
1578
- /** The player kicked. */
1579
- readonly player_index: uint
1580
- /** The player that did the kicking if any. */
1581
- readonly by_player?: uint
1582
- /** The reason given if any. */
2278
+ /**
2279
+ * The player kicked.
2280
+ */
2281
+ readonly player_index: PlayerIndex
2282
+ /**
2283
+ * The player that did the kicking if any.
2284
+ */
2285
+ readonly by_player?: PlayerIndex
2286
+ /**
2287
+ * The reason given if any.
2288
+ */
1583
2289
  readonly reason?: string
1584
- /** Identifier of the event */
2290
+ /**
2291
+ * Identifier of the event
2292
+ */
1585
2293
  readonly name: typeof defines.events.on_player_kicked
1586
- /** Tick the event was generated. */
2294
+ /**
2295
+ * Tick the event was generated.
2296
+ */
1587
2297
  readonly tick: uint
1588
2298
  }
1589
2299
 
@@ -1593,11 +2303,15 @@ interface OnPlayerKickedEvent extends EventData {
1593
2303
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_left_game View documentation}
1594
2304
  */
1595
2305
  interface OnPlayerLeftGameEvent extends EventData {
1596
- readonly player_index: uint
2306
+ readonly player_index: PlayerIndex
1597
2307
  readonly reason: defines.disconnect_reason
1598
- /** Identifier of the event */
2308
+ /**
2309
+ * Identifier of the event
2310
+ */
1599
2311
  readonly name: typeof defines.events.on_player_left_game
1600
- /** Tick the event was generated. */
2312
+ /**
2313
+ * Tick the event was generated.
2314
+ */
1601
2315
  readonly tick: uint
1602
2316
  }
1603
2317
 
@@ -1607,33 +2321,43 @@ interface OnPlayerLeftGameEvent extends EventData {
1607
2321
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_main_inventory_changed View documentation}
1608
2322
  */
1609
2323
  interface OnPlayerMainInventoryChangedEvent extends EventData {
1610
- readonly player_index: uint
1611
- /** Identifier of the event */
2324
+ readonly player_index: PlayerIndex
2325
+ /**
2326
+ * Identifier of the event
2327
+ */
1612
2328
  readonly name: typeof defines.events.on_player_main_inventory_changed
1613
- /** Tick the event was generated. */
2329
+ /**
2330
+ * Tick the event was generated.
2331
+ */
1614
2332
  readonly tick: uint
1615
2333
  }
1616
2334
 
1617
2335
  /**
1618
- * Called after the results of an entity being mined are collected just before the entity is destroyed. After this event
1619
- * any items in the buffer will be transferred into the player as if they came from mining the entity. Can be filtered
1620
- * using {@link LuaPlayerMinedEntityEventFilter}.
1621
- *
1622
- * **Note**: The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding
1623
- * as more items are transferred into it.
2336
+ * Called after the results of an entity being mined are collected just before the entity is destroyed. After this event any items in the buffer will be transferred into the player as if they came from mining the entity. Can be filtered using {@link LuaPlayerMinedEntityEventFilter}.
1624
2337
  *
1625
2338
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_mined_entity View documentation}
2339
+ * @remarks The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding as more items are transferred into it.
1626
2340
  */
1627
2341
  interface OnPlayerMinedEntityEvent extends EventData {
1628
- /** The index of the player doing the mining. */
1629
- readonly player_index: uint
1630
- /** The entity that has been mined. */
2342
+ /**
2343
+ * The index of the player doing the mining.
2344
+ */
2345
+ readonly player_index: PlayerIndex
2346
+ /**
2347
+ * The entity that has been mined.
2348
+ */
1631
2349
  readonly entity: LuaEntity
1632
- /** The temporary inventory that holds the result of mining the entity. */
2350
+ /**
2351
+ * The temporary inventory that holds the result of mining the entity.
2352
+ */
1633
2353
  readonly buffer: LuaInventory
1634
- /** Identifier of the event */
2354
+ /**
2355
+ * Identifier of the event
2356
+ */
1635
2357
  readonly name: typeof defines.events.on_player_mined_entity
1636
- /** Tick the event was generated. */
2358
+ /**
2359
+ * Tick the event was generated.
2360
+ */
1637
2361
  readonly tick: uint
1638
2362
  }
1639
2363
 
@@ -1643,12 +2367,18 @@ interface OnPlayerMinedEntityEvent extends EventData {
1643
2367
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_mined_item View documentation}
1644
2368
  */
1645
2369
  interface OnPlayerMinedItemEvent extends EventData {
1646
- /** The item given to the player */
2370
+ /**
2371
+ * The item given to the player
2372
+ */
1647
2373
  readonly item_stack: SimpleItemStack
1648
- readonly player_index: uint
1649
- /** Identifier of the event */
2374
+ readonly player_index: PlayerIndex
2375
+ /**
2376
+ * Identifier of the event
2377
+ */
1650
2378
  readonly name: typeof defines.events.on_player_mined_item
1651
- /** Tick the event was generated. */
2379
+ /**
2380
+ * Tick the event was generated.
2381
+ */
1652
2382
  readonly tick: uint
1653
2383
  }
1654
2384
 
@@ -1658,14 +2388,22 @@ interface OnPlayerMinedItemEvent extends EventData {
1658
2388
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_mined_tile View documentation}
1659
2389
  */
1660
2390
  interface OnPlayerMinedTileEvent extends EventData {
1661
- readonly player_index: uint
1662
- /** The surface the tile(s) were mined from. */
1663
- readonly surface_index: uint
1664
- /** The position data. */
2391
+ readonly player_index: PlayerIndex
2392
+ /**
2393
+ * The surface the tile(s) were mined from.
2394
+ */
2395
+ readonly surface_index: SurfaceIndex
2396
+ /**
2397
+ * The position data.
2398
+ */
1665
2399
  readonly tiles: OldTileAndPosition[]
1666
- /** Identifier of the event */
2400
+ /**
2401
+ * Identifier of the event
2402
+ */
1667
2403
  readonly name: typeof defines.events.on_player_mined_tile
1668
- /** Tick the event was generated. */
2404
+ /**
2405
+ * Tick the event was generated.
2406
+ */
1669
2407
  readonly tick: uint
1670
2408
  }
1671
2409
 
@@ -1675,11 +2413,17 @@ interface OnPlayerMinedTileEvent extends EventData {
1675
2413
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_muted View documentation}
1676
2414
  */
1677
2415
  interface OnPlayerMutedEvent extends EventData {
1678
- /** The player. */
1679
- readonly player_index: uint
1680
- /** Identifier of the event */
2416
+ /**
2417
+ * The player.
2418
+ */
2419
+ readonly player_index: PlayerIndex
2420
+ /**
2421
+ * Identifier of the event
2422
+ */
1681
2423
  readonly name: typeof defines.events.on_player_muted
1682
- /** Tick the event was generated. */
2424
+ /**
2425
+ * Tick the event was generated.
2426
+ */
1683
2427
  readonly tick: uint
1684
2428
  }
1685
2429
 
@@ -1689,15 +2433,25 @@ interface OnPlayerMutedEvent extends EventData {
1689
2433
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_pipette View documentation}
1690
2434
  */
1691
2435
  interface OnPlayerPipetteEvent extends EventData {
1692
- /** The player */
1693
- readonly player_index: uint
1694
- /** The item put in the cursor */
2436
+ /**
2437
+ * The player
2438
+ */
2439
+ readonly player_index: PlayerIndex
2440
+ /**
2441
+ * The item put in the cursor
2442
+ */
1695
2443
  readonly item: LuaItemPrototype
1696
- /** If cheat mode was used to give a free stack of the item. */
2444
+ /**
2445
+ * If cheat mode was used to give a free stack of the item.
2446
+ */
1697
2447
  readonly used_cheat_mode: boolean
1698
- /** Identifier of the event */
2448
+ /**
2449
+ * Identifier of the event
2450
+ */
1699
2451
  readonly name: typeof defines.events.on_player_pipette
1700
- /** Tick the event was generated. */
2452
+ /**
2453
+ * Tick the event was generated.
2454
+ */
1701
2455
  readonly tick: uint
1702
2456
  }
1703
2457
 
@@ -1707,14 +2461,22 @@ interface OnPlayerPipetteEvent extends EventData {
1707
2461
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_placed_equipment View documentation}
1708
2462
  */
1709
2463
  interface OnPlayerPlacedEquipmentEvent extends EventData {
1710
- readonly player_index: uint
1711
- /** The equipment put in the equipment grid. */
2464
+ readonly player_index: PlayerIndex
2465
+ /**
2466
+ * The equipment put in the equipment grid.
2467
+ */
1712
2468
  readonly equipment: LuaEquipment
1713
- /** The equipment grid the equipment was put in. */
2469
+ /**
2470
+ * The equipment grid the equipment was put in.
2471
+ */
1714
2472
  readonly grid: LuaEquipmentGrid
1715
- /** Identifier of the event */
2473
+ /**
2474
+ * Identifier of the event
2475
+ */
1716
2476
  readonly name: typeof defines.events.on_player_placed_equipment
1717
- /** Tick the event was generated. */
2477
+ /**
2478
+ * Tick the event was generated.
2479
+ */
1718
2480
  readonly tick: uint
1719
2481
  }
1720
2482
 
@@ -1724,26 +2486,37 @@ interface OnPlayerPlacedEquipmentEvent extends EventData {
1724
2486
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_promoted View documentation}
1725
2487
  */
1726
2488
  interface OnPlayerPromotedEvent extends EventData {
1727
- /** The player. */
1728
- readonly player_index: uint
1729
- /** Identifier of the event */
2489
+ /**
2490
+ * The player.
2491
+ */
2492
+ readonly player_index: PlayerIndex
2493
+ /**
2494
+ * Identifier of the event
2495
+ */
1730
2496
  readonly name: typeof defines.events.on_player_promoted
1731
- /** Tick the event was generated. */
2497
+ /**
2498
+ * Tick the event was generated.
2499
+ */
1732
2500
  readonly tick: uint
1733
2501
  }
1734
2502
 
1735
2503
  /**
1736
- * Called when a player is removed (deleted) from the game. Not to be confused with the player logging of this is
1737
- * different in that the player is deleted as if he never existed in the save file.
2504
+ * 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.
1738
2505
  *
1739
2506
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_removed View documentation}
1740
2507
  */
1741
2508
  interface OnPlayerRemovedEvent extends EventData {
1742
- /** The player index that was removed */
1743
- readonly player_index: uint
1744
- /** Identifier of the event */
2509
+ /**
2510
+ * The player index that was removed
2511
+ */
2512
+ readonly player_index: PlayerIndex
2513
+ /**
2514
+ * Identifier of the event
2515
+ */
1745
2516
  readonly name: typeof defines.events.on_player_removed
1746
- /** Tick the event was generated. */
2517
+ /**
2518
+ * Tick the event was generated.
2519
+ */
1747
2520
  readonly tick: uint
1748
2521
  }
1749
2522
 
@@ -1753,16 +2526,26 @@ interface OnPlayerRemovedEvent extends EventData {
1753
2526
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_removed_equipment View documentation}
1754
2527
  */
1755
2528
  interface OnPlayerRemovedEquipmentEvent extends EventData {
1756
- readonly player_index: uint
1757
- /** The equipment grid removed from. */
2529
+ readonly player_index: PlayerIndex
2530
+ /**
2531
+ * The equipment grid removed from.
2532
+ */
1758
2533
  readonly grid: LuaEquipmentGrid
1759
- /** The equipment removed. */
2534
+ /**
2535
+ * The equipment removed.
2536
+ */
1760
2537
  readonly equipment: string
1761
- /** The count of equipment removed. */
2538
+ /**
2539
+ * The count of equipment removed.
2540
+ */
1762
2541
  readonly count: uint
1763
- /** Identifier of the event */
2542
+ /**
2543
+ * Identifier of the event
2544
+ */
1764
2545
  readonly name: typeof defines.events.on_player_removed_equipment
1765
- /** Tick the event was generated. */
2546
+ /**
2547
+ * Tick the event was generated.
2548
+ */
1766
2549
  readonly tick: uint
1767
2550
  }
1768
2551
 
@@ -1772,11 +2555,15 @@ interface OnPlayerRemovedEquipmentEvent extends EventData {
1772
2555
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_repaired_entity View documentation}
1773
2556
  */
1774
2557
  interface OnPlayerRepairedEntityEvent extends EventData {
1775
- readonly player_index: uint
2558
+ readonly player_index: PlayerIndex
1776
2559
  readonly entity: LuaEntity
1777
- /** Identifier of the event */
2560
+ /**
2561
+ * Identifier of the event
2562
+ */
1778
2563
  readonly name: typeof defines.events.on_player_repaired_entity
1779
- /** Tick the event was generated. */
2564
+ /**
2565
+ * Tick the event was generated.
2566
+ */
1780
2567
  readonly tick: uint
1781
2568
  }
1782
2569
 
@@ -1786,30 +2573,43 @@ interface OnPlayerRepairedEntityEvent extends EventData {
1786
2573
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_respawned View documentation}
1787
2574
  */
1788
2575
  interface OnPlayerRespawnedEvent extends EventData {
1789
- readonly player_index: uint
1790
- /** The player port used to respawn if one was used. */
2576
+ readonly player_index: PlayerIndex
2577
+ /**
2578
+ * The player port used to respawn if one was used.
2579
+ */
1791
2580
  readonly player_port?: LuaEntity
1792
- /** Identifier of the event */
2581
+ /**
2582
+ * Identifier of the event
2583
+ */
1793
2584
  readonly name: typeof defines.events.on_player_respawned
1794
- /** Tick the event was generated. */
2585
+ /**
2586
+ * Tick the event was generated.
2587
+ */
1795
2588
  readonly tick: uint
1796
2589
  }
1797
2590
 
1798
2591
  /**
1799
- * Called when the player rotates an entity. This event is only fired when the entity actually changes its orientation
1800
- * -- pressing the rotate key on an entity that can't be rotated won't fire this event.
2592
+ * Called when the player rotates an entity. This event is only fired when the entity actually changes its orientation -- pressing the rotate key on an entity that can't be rotated won't fire this event.
1801
2593
  *
1802
2594
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_rotated_entity View documentation}
1803
2595
  */
1804
2596
  interface OnPlayerRotatedEntityEvent extends EventData {
1805
- /** The rotated entity. */
2597
+ /**
2598
+ * The rotated entity.
2599
+ */
1806
2600
  readonly entity: LuaEntity
1807
- /** The previous direction */
2601
+ /**
2602
+ * The previous direction
2603
+ */
1808
2604
  readonly previous_direction: defines.direction
1809
- readonly player_index: uint
1810
- /** Identifier of the event */
2605
+ readonly player_index: PlayerIndex
2606
+ /**
2607
+ * Identifier of the event
2608
+ */
1811
2609
  readonly name: typeof defines.events.on_player_rotated_entity
1812
- /** Tick the event was generated. */
2610
+ /**
2611
+ * Tick the event was generated.
2612
+ */
1813
2613
  readonly tick: uint
1814
2614
  }
1815
2615
 
@@ -1819,21 +2619,37 @@ interface OnPlayerRotatedEntityEvent extends EventData {
1819
2619
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_selected_area View documentation}
1820
2620
  */
1821
2621
  interface OnPlayerSelectedAreaEvent extends EventData {
1822
- /** The player doing the selection. */
1823
- readonly player_index: uint
1824
- /** The surface selected. */
2622
+ /**
2623
+ * The player doing the selection.
2624
+ */
2625
+ readonly player_index: PlayerIndex
2626
+ /**
2627
+ * The surface selected.
2628
+ */
1825
2629
  readonly surface: LuaSurface
1826
- /** The area selected. */
2630
+ /**
2631
+ * The area selected.
2632
+ */
1827
2633
  readonly area: BoundingBoxRead
1828
- /** The item used to select the area. */
2634
+ /**
2635
+ * The item used to select the area.
2636
+ */
1829
2637
  readonly item: string
1830
- /** The entities selected. */
2638
+ /**
2639
+ * The entities selected.
2640
+ */
1831
2641
  readonly entities: LuaEntity[]
1832
- /** The tiles selected. */
2642
+ /**
2643
+ * The tiles selected.
2644
+ */
1833
2645
  readonly tiles: LuaTile[]
1834
- /** Identifier of the event */
2646
+ /**
2647
+ * Identifier of the event
2648
+ */
1835
2649
  readonly name: typeof defines.events.on_player_selected_area
1836
- /** Tick the event was generated. */
2650
+ /**
2651
+ * Tick the event was generated.
2652
+ */
1837
2653
  readonly tick: uint
1838
2654
  }
1839
2655
 
@@ -1843,10 +2659,14 @@ interface OnPlayerSelectedAreaEvent extends EventData {
1843
2659
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_set_quick_bar_slot View documentation}
1844
2660
  */
1845
2661
  interface OnPlayerSetQuickBarSlotEvent extends EventData {
1846
- readonly player_index: uint
1847
- /** Identifier of the event */
2662
+ readonly player_index: PlayerIndex
2663
+ /**
2664
+ * Identifier of the event
2665
+ */
1848
2666
  readonly name: typeof defines.events.on_player_set_quick_bar_slot
1849
- /** Tick the event was generated. */
2667
+ /**
2668
+ * Tick the event was generated.
2669
+ */
1850
2670
  readonly tick: uint
1851
2671
  }
1852
2672
 
@@ -1856,21 +2676,37 @@ interface OnPlayerSetQuickBarSlotEvent extends EventData {
1856
2676
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_setup_blueprint View documentation}
1857
2677
  */
1858
2678
  interface OnPlayerSetupBlueprintEvent extends EventData {
1859
- /** The player doing the selection. */
1860
- readonly player_index: uint
1861
- /** The surface selected. */
2679
+ /**
2680
+ * The player doing the selection.
2681
+ */
2682
+ readonly player_index: PlayerIndex
2683
+ /**
2684
+ * The surface selected.
2685
+ */
1862
2686
  readonly surface: LuaSurface
1863
- /** The area selected. */
2687
+ /**
2688
+ * The area selected.
2689
+ */
1864
2690
  readonly area: BoundingBoxRead
1865
- /** The item used to select the area. */
2691
+ /**
2692
+ * The item used to select the area.
2693
+ */
1866
2694
  readonly item: string
1867
- /** If normal selection or alt selection was used. */
2695
+ /**
2696
+ * If normal selection or alt selection was used.
2697
+ */
1868
2698
  readonly alt: boolean
1869
- /** The blueprint entity index to source entity mapping. Note: if any mod changes the blueprint this will be incorrect. */
2699
+ /**
2700
+ * The blueprint entity index to source entity mapping. Note: if any mod changes the blueprint this will be incorrect.
2701
+ */
1870
2702
  readonly mapping: LuaLazyLoadedValue<Record<uint, LuaEntity>>
1871
- /** Identifier of the event */
2703
+ /**
2704
+ * Identifier of the event
2705
+ */
1872
2706
  readonly name: typeof defines.events.on_player_setup_blueprint
1873
- /** Tick the event was generated. */
2707
+ /**
2708
+ * Tick the event was generated.
2709
+ */
1874
2710
  readonly tick: uint
1875
2711
  }
1876
2712
 
@@ -1880,15 +2716,18 @@ interface OnPlayerSetupBlueprintEvent extends EventData {
1880
2716
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_toggled_alt_mode View documentation}
1881
2717
  */
1882
2718
  interface OnPlayerToggledAltModeEvent extends EventData {
1883
- readonly player_index: uint
2719
+ readonly player_index: PlayerIndex
1884
2720
  /**
1885
- * The new alt mode value. This value is a shortcut for accessing
1886
- * {@link GameViewSettings.show_entity_info GameViewSettings::show_entity_info} on the player.
2721
+ * The new alt mode value. This value is a shortcut for accessing {@link GameViewSettings#show_entity_info GameViewSettings::show_entity_info} on the player.
1887
2722
  */
1888
2723
  readonly alt_mode: boolean
1889
- /** Identifier of the event */
2724
+ /**
2725
+ * Identifier of the event
2726
+ */
1890
2727
  readonly name: typeof defines.events.on_player_toggled_alt_mode
1891
- /** Tick the event was generated. */
2728
+ /**
2729
+ * Tick the event was generated.
2730
+ */
1892
2731
  readonly tick: uint
1893
2732
  }
1894
2733
 
@@ -1898,10 +2737,14 @@ interface OnPlayerToggledAltModeEvent extends EventData {
1898
2737
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_toggled_map_editor View documentation}
1899
2738
  */
1900
2739
  interface OnPlayerToggledMapEditorEvent extends EventData {
1901
- readonly player_index: uint
1902
- /** Identifier of the event */
2740
+ readonly player_index: PlayerIndex
2741
+ /**
2742
+ * Identifier of the event
2743
+ */
1903
2744
  readonly name: typeof defines.events.on_player_toggled_map_editor
1904
- /** Tick the event was generated. */
2745
+ /**
2746
+ * Tick the event was generated.
2747
+ */
1905
2748
  readonly tick: uint
1906
2749
  }
1907
2750
 
@@ -1911,10 +2754,14 @@ interface OnPlayerToggledMapEditorEvent extends EventData {
1911
2754
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_trash_inventory_changed View documentation}
1912
2755
  */
1913
2756
  interface OnPlayerTrashInventoryChangedEvent extends EventData {
1914
- readonly player_index: uint
1915
- /** Identifier of the event */
2757
+ readonly player_index: PlayerIndex
2758
+ /**
2759
+ * Identifier of the event
2760
+ */
1916
2761
  readonly name: typeof defines.events.on_player_trash_inventory_changed
1917
- /** Tick the event was generated. */
2762
+ /**
2763
+ * Tick the event was generated.
2764
+ */
1918
2765
  readonly tick: uint
1919
2766
  }
1920
2767
 
@@ -1924,17 +2771,29 @@ interface OnPlayerTrashInventoryChangedEvent extends EventData {
1924
2771
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_unbanned View documentation}
1925
2772
  */
1926
2773
  interface OnPlayerUnbannedEvent extends EventData {
1927
- /** The player un-banned. */
1928
- readonly player_index?: uint
1929
- /** The player name un-banned. */
2774
+ /**
2775
+ * The player un-banned.
2776
+ */
2777
+ readonly player_index?: PlayerIndex
2778
+ /**
2779
+ * The player name un-banned.
2780
+ */
1930
2781
  readonly player_name: string
1931
- /** The player that did the un-banning if any. */
1932
- readonly by_player?: uint
1933
- /** The reason the player was banned if any. */
2782
+ /**
2783
+ * The player that did the un-banning if any.
2784
+ */
2785
+ readonly by_player?: PlayerIndex
2786
+ /**
2787
+ * The reason the player was banned if any.
2788
+ */
1934
2789
  readonly reason?: string
1935
- /** Identifier of the event */
2790
+ /**
2791
+ * Identifier of the event
2792
+ */
1936
2793
  readonly name: typeof defines.events.on_player_unbanned
1937
- /** Tick the event was generated. */
2794
+ /**
2795
+ * Tick the event was generated.
2796
+ */
1938
2797
  readonly tick: uint
1939
2798
  }
1940
2799
 
@@ -1944,11 +2803,17 @@ interface OnPlayerUnbannedEvent extends EventData {
1944
2803
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_unmuted View documentation}
1945
2804
  */
1946
2805
  interface OnPlayerUnmutedEvent extends EventData {
1947
- /** The player. */
1948
- readonly player_index: uint
1949
- /** Identifier of the event */
2806
+ /**
2807
+ * The player.
2808
+ */
2809
+ readonly player_index: PlayerIndex
2810
+ /**
2811
+ * Identifier of the event
2812
+ */
1950
2813
  readonly name: typeof defines.events.on_player_unmuted
1951
- /** Tick the event was generated. */
2814
+ /**
2815
+ * Tick the event was generated.
2816
+ */
1952
2817
  readonly tick: uint
1953
2818
  }
1954
2819
 
@@ -1958,15 +2823,25 @@ interface OnPlayerUnmutedEvent extends EventData {
1958
2823
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_used_capsule View documentation}
1959
2824
  */
1960
2825
  interface OnPlayerUsedCapsuleEvent extends EventData {
1961
- /** The player. */
1962
- readonly player_index: uint
1963
- /** The capsule item used. */
2826
+ /**
2827
+ * The player.
2828
+ */
2829
+ readonly player_index: PlayerIndex
2830
+ /**
2831
+ * The capsule item used.
2832
+ */
1964
2833
  readonly item: LuaItemPrototype
1965
- /** The position the capsule was used. */
1966
- readonly position: PositionTable
1967
- /** Identifier of the event */
2834
+ /**
2835
+ * The position the capsule was used.
2836
+ */
2837
+ readonly position: MapPositionTable
2838
+ /**
2839
+ * Identifier of the event
2840
+ */
1968
2841
  readonly name: typeof defines.events.on_player_used_capsule
1969
- /** Tick the event was generated. */
2842
+ /**
2843
+ * Tick the event was generated.
2844
+ */
1970
2845
  readonly tick: uint
1971
2846
  }
1972
2847
 
@@ -1976,17 +2851,29 @@ interface OnPlayerUsedCapsuleEvent extends EventData {
1976
2851
  * {@link https://lua-api.factorio.com/latest/events.html#on_player_used_spider_remote View documentation}
1977
2852
  */
1978
2853
  interface OnPlayerUsedSpiderRemoteEvent extends EventData {
1979
- /** The player that used the remote. */
1980
- readonly player_index: uint
1981
- /** Spider vehicle which was requested to move. */
2854
+ /**
2855
+ * The player that used the remote.
2856
+ */
2857
+ readonly player_index: PlayerIndex
2858
+ /**
2859
+ * Spider vehicle which was requested to move.
2860
+ */
1982
2861
  readonly vehicle: LuaEntity
1983
- /** Goal position to which spidertron was sent to. */
1984
- readonly position: PositionTable
1985
- /** If the use was successful. It may fail when spidertron has different driver or when player is on different surface. */
2862
+ /**
2863
+ * Goal position to which spidertron was sent to.
2864
+ */
2865
+ readonly position: MapPositionTable
2866
+ /**
2867
+ * If the use was successful. It may fail when spidertron has different driver or when player is on different surface.
2868
+ */
1986
2869
  readonly success: boolean
1987
- /** Identifier of the event */
2870
+ /**
2871
+ * Identifier of the event
2872
+ */
1988
2873
  readonly name: typeof defines.events.on_player_used_spider_remote
1989
- /** Tick the event was generated. */
2874
+ /**
2875
+ * Tick the event was generated.
2876
+ */
1990
2877
  readonly tick: uint
1991
2878
  }
1992
2879
 
@@ -1996,25 +2883,45 @@ interface OnPlayerUsedSpiderRemoteEvent extends EventData {
1996
2883
  * {@link https://lua-api.factorio.com/latest/events.html#on_post_entity_died View documentation}
1997
2884
  */
1998
2885
  interface OnPostEntityDiedEvent extends EventData {
1999
- /** The ghost created by the entity dying if any. */
2886
+ /**
2887
+ * The ghost created by the entity dying if any.
2888
+ */
2000
2889
  readonly ghost?: LuaEntity
2001
- /** The force that did the killing if any. */
2890
+ /**
2891
+ * The force that did the killing if any.
2892
+ */
2002
2893
  readonly force?: LuaForce
2003
- /** Position where the entity died. */
2004
- readonly position: PositionTable
2005
- /** The entity prototype of the entity that died. */
2894
+ /**
2895
+ * Position where the entity died.
2896
+ */
2897
+ readonly position: MapPositionTable
2898
+ /**
2899
+ * The entity prototype of the entity that died.
2900
+ */
2006
2901
  readonly prototype: LuaEntityPrototype
2007
- /** The damage type if any. */
2902
+ /**
2903
+ * The damage type if any.
2904
+ */
2008
2905
  readonly damage_type?: LuaDamagePrototype
2009
- /** The corpses created by the entity dying if any. */
2906
+ /**
2907
+ * The corpses created by the entity dying if any.
2908
+ */
2010
2909
  readonly corpses: LuaEntity[]
2011
- /** The surface the entity was on. */
2012
- readonly surface_index: uint
2013
- /** The unit number the entity had if any. */
2014
- readonly unit_number?: uint
2015
- /** Identifier of the event */
2910
+ /**
2911
+ * The surface the entity was on.
2912
+ */
2913
+ readonly surface_index: SurfaceIndex
2914
+ /**
2915
+ * The unit number the entity had if any.
2916
+ */
2917
+ readonly unit_number?: UnitNumber
2918
+ /**
2919
+ * Identifier of the event
2920
+ */
2016
2921
  readonly name: typeof defines.events.on_post_entity_died
2017
- /** Tick the event was generated. */
2922
+ /**
2923
+ * Tick the event was generated.
2924
+ */
2018
2925
  readonly tick: uint
2019
2926
  }
2020
2927
 
@@ -2024,38 +2931,62 @@ interface OnPostEntityDiedEvent extends EventData {
2024
2931
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_build View documentation}
2025
2932
  */
2026
2933
  interface OnPreBuildEvent extends EventData {
2027
- /** The player who did the placing. */
2028
- readonly player_index: uint
2029
- /** Where the item was placed. */
2030
- readonly position: PositionTable
2031
- /** Item was placed using shift building. */
2934
+ /**
2935
+ * The player who did the placing.
2936
+ */
2937
+ readonly player_index: PlayerIndex
2938
+ /**
2939
+ * Where the item was placed.
2940
+ */
2941
+ readonly position: MapPositionTable
2942
+ /**
2943
+ * Item was placed using shift building.
2944
+ */
2032
2945
  readonly shift_build: boolean
2033
- /** The direction the item was facing when placed. */
2946
+ /**
2947
+ * The direction the item was facing when placed.
2948
+ */
2034
2949
  readonly direction: defines.direction
2035
- /** If building this blueprint was flipped horizontally. */
2950
+ /**
2951
+ * If building this blueprint was flipped horizontally.
2952
+ */
2036
2953
  readonly flip_horizontal: boolean
2037
- /** If building this blueprint was flipped vertically. */
2954
+ /**
2955
+ * If building this blueprint was flipped vertically.
2956
+ */
2038
2957
  readonly flip_vertical: boolean
2039
- /** Item was placed while moving. */
2958
+ /**
2959
+ * Item was placed while moving.
2960
+ */
2040
2961
  readonly created_by_moving: boolean
2041
- /** Identifier of the event */
2962
+ /**
2963
+ * Identifier of the event
2964
+ */
2042
2965
  readonly name: typeof defines.events.on_pre_build
2043
- /** Tick the event was generated. */
2966
+ /**
2967
+ * Tick the event was generated.
2968
+ */
2044
2969
  readonly tick: uint
2045
2970
  }
2046
2971
 
2047
2972
  /**
2048
- * Called before one or more chunks are deleted using {@link LuaSurface.delete_chunk LuaSurface::delete_chunk}.
2973
+ * Called before one or more chunks are deleted using {@link LuaSurface#delete_chunk LuaSurface::delete_chunk}.
2049
2974
  *
2050
2975
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_chunk_deleted View documentation}
2051
2976
  */
2052
2977
  interface OnPreChunkDeletedEvent extends EventData {
2053
- readonly surface_index: uint
2054
- /** The chunks to be deleted. */
2978
+ readonly surface_index: SurfaceIndex
2979
+ /**
2980
+ * The chunks to be deleted.
2981
+ */
2055
2982
  readonly positions: ChunkPositionTable[]
2056
- /** Identifier of the event */
2983
+ /**
2984
+ * Identifier of the event
2985
+ */
2057
2986
  readonly name: typeof defines.events.on_pre_chunk_deleted
2058
- /** Tick the event was generated. */
2987
+ /**
2988
+ * Tick the event was generated.
2989
+ */
2059
2990
  readonly tick: uint
2060
2991
  }
2061
2992
 
@@ -2065,30 +2996,43 @@ interface OnPreChunkDeletedEvent extends EventData {
2065
2996
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_entity_settings_pasted View documentation}
2066
2997
  */
2067
2998
  interface OnPreEntitySettingsPastedEvent extends EventData {
2068
- readonly player_index: uint
2069
- /** The source entity settings will be copied from. */
2999
+ readonly player_index: PlayerIndex
3000
+ /**
3001
+ * The source entity settings will be copied from.
3002
+ */
2070
3003
  readonly source: LuaEntity
2071
- /** The destination entity settings will be copied to. */
3004
+ /**
3005
+ * The destination entity settings will be copied to.
3006
+ */
2072
3007
  readonly destination: LuaEntity
2073
- /** Identifier of the event */
3008
+ /**
3009
+ * Identifier of the event
3010
+ */
2074
3011
  readonly name: typeof defines.events.on_pre_entity_settings_pasted
2075
- /** Tick the event was generated. */
3012
+ /**
3013
+ * Tick the event was generated.
3014
+ */
2076
3015
  readonly tick: uint
2077
3016
  }
2078
3017
 
2079
3018
  /**
2080
- * Called before a ghost entity is destroyed as a result of being marked for deconstruction. Can be filtered using
2081
- * {@link LuaPreGhostDeconstructedEventFilter}.
3019
+ * Called before a ghost entity is destroyed as a result of being marked for deconstruction. Can be filtered using {@link LuaPreGhostDeconstructedEventFilter}.
2082
3020
  *
2083
3021
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_ghost_deconstructed View documentation}
2084
3022
  */
2085
3023
  interface OnPreGhostDeconstructedEvent extends EventData {
2086
- /** The player that did the deconstruction if any. */
2087
- readonly player_index?: uint
3024
+ /**
3025
+ * The player that did the deconstruction if any.
3026
+ */
3027
+ readonly player_index?: PlayerIndex
2088
3028
  readonly ghost: LuaEntity
2089
- /** Identifier of the event */
3029
+ /**
3030
+ * Identifier of the event
3031
+ */
2090
3032
  readonly name: typeof defines.events.on_pre_ghost_deconstructed
2091
- /** Tick the event was generated. */
3033
+ /**
3034
+ * Tick the event was generated.
3035
+ */
2092
3036
  readonly tick: uint
2093
3037
  }
2094
3038
 
@@ -2098,13 +3042,21 @@ interface OnPreGhostDeconstructedEvent extends EventData {
2098
3042
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_permission_group_deleted View documentation}
2099
3043
  */
2100
3044
  interface OnPrePermissionGroupDeletedEvent extends EventData {
2101
- /** The player doing the deletion. */
2102
- readonly player_index: uint
2103
- /** The group to be deleted. */
3045
+ /**
3046
+ * The player doing the deletion.
3047
+ */
3048
+ readonly player_index: PlayerIndex
3049
+ /**
3050
+ * The group to be deleted.
3051
+ */
2104
3052
  readonly group: LuaPermissionGroup
2105
- /** Identifier of the event */
3053
+ /**
3054
+ * Identifier of the event
3055
+ */
2106
3056
  readonly name: typeof defines.events.on_pre_permission_group_deleted
2107
- /** Tick the event was generated. */
3057
+ /**
3058
+ * Tick the event was generated.
3059
+ */
2108
3060
  readonly tick: uint
2109
3061
  }
2110
3062
 
@@ -2114,11 +3066,17 @@ interface OnPrePermissionGroupDeletedEvent extends EventData {
2114
3066
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_permission_string_imported View documentation}
2115
3067
  */
2116
3068
  interface OnPrePermissionStringImportedEvent extends EventData {
2117
- /** The player importing the string. */
2118
- readonly player_index: uint
2119
- /** Identifier of the event */
3069
+ /**
3070
+ * The player importing the string.
3071
+ */
3072
+ readonly player_index: PlayerIndex
3073
+ /**
3074
+ * Identifier of the event
3075
+ */
2120
3076
  readonly name: typeof defines.events.on_pre_permission_string_imported
2121
- /** Tick the event was generated. */
3077
+ /**
3078
+ * Tick the event was generated.
3079
+ */
2122
3080
  readonly tick: uint
2123
3081
  }
2124
3082
 
@@ -2128,17 +3086,29 @@ interface OnPrePermissionStringImportedEvent extends EventData {
2128
3086
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_player_crafted_item View documentation}
2129
3087
  */
2130
3088
  interface OnPrePlayerCraftedItemEvent extends EventData {
2131
- /** The player doing the crafting. */
2132
- readonly player_index: uint
2133
- /** The recipe being queued. */
3089
+ /**
3090
+ * The player doing the crafting.
3091
+ */
3092
+ readonly player_index: PlayerIndex
3093
+ /**
3094
+ * The recipe being queued.
3095
+ */
2134
3096
  readonly recipe: LuaRecipe
2135
- /** The items removed from the players inventory to do the crafting. */
3097
+ /**
3098
+ * The items removed from the players inventory to do the crafting.
3099
+ */
2136
3100
  readonly items: LuaInventory
2137
- /** The number of times the recipe is being queued. */
3101
+ /**
3102
+ * The number of times the recipe is being queued.
3103
+ */
2138
3104
  readonly queued_count: uint
2139
- /** Identifier of the event */
3105
+ /**
3106
+ * Identifier of the event
3107
+ */
2140
3108
  readonly name: typeof defines.events.on_pre_player_crafted_item
2141
- /** Tick the event was generated. */
3109
+ /**
3110
+ * Tick the event was generated.
3111
+ */
2142
3112
  readonly tick: uint
2143
3113
  }
2144
3114
 
@@ -2148,11 +3118,15 @@ interface OnPrePlayerCraftedItemEvent extends EventData {
2148
3118
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_player_died View documentation}
2149
3119
  */
2150
3120
  interface OnPrePlayerDiedEvent extends EventData {
2151
- readonly player_index: uint
3121
+ readonly player_index: PlayerIndex
2152
3122
  readonly cause?: LuaEntity
2153
- /** Identifier of the event */
3123
+ /**
3124
+ * Identifier of the event
3125
+ */
2154
3126
  readonly name: typeof defines.events.on_pre_player_died
2155
- /** Tick the event was generated. */
3127
+ /**
3128
+ * Tick the event was generated.
3129
+ */
2156
3130
  readonly tick: uint
2157
3131
  }
2158
3132
 
@@ -2162,42 +3136,56 @@ interface OnPrePlayerDiedEvent extends EventData {
2162
3136
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_player_left_game View documentation}
2163
3137
  */
2164
3138
  interface OnPrePlayerLeftGameEvent extends EventData {
2165
- readonly player_index: uint
3139
+ readonly player_index: PlayerIndex
2166
3140
  readonly reason: defines.disconnect_reason
2167
- /** Identifier of the event */
3141
+ /**
3142
+ * Identifier of the event
3143
+ */
2168
3144
  readonly name: typeof defines.events.on_pre_player_left_game
2169
- /** Tick the event was generated. */
3145
+ /**
3146
+ * Tick the event was generated.
3147
+ */
2170
3148
  readonly tick: uint
2171
3149
  }
2172
3150
 
2173
3151
  /**
2174
- * Called when the player finishes mining an entity, before the entity is removed from map. Can be filtered using
2175
- * {@link LuaPrePlayerMinedEntityEventFilter}.
3152
+ * Called when the player finishes mining an entity, before the entity is removed from map. Can be filtered using {@link LuaPrePlayerMinedEntityEventFilter}.
2176
3153
  *
2177
3154
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_player_mined_item View documentation}
2178
3155
  */
2179
3156
  interface OnPrePlayerMinedItemEvent extends EventData {
2180
- /** The entity being mined */
3157
+ /**
3158
+ * The entity being mined
3159
+ */
2181
3160
  readonly entity: LuaEntity
2182
- readonly player_index: uint
2183
- /** Identifier of the event */
3161
+ readonly player_index: PlayerIndex
3162
+ /**
3163
+ * Identifier of the event
3164
+ */
2184
3165
  readonly name: typeof defines.events.on_pre_player_mined_item
2185
- /** Tick the event was generated. */
3166
+ /**
3167
+ * Tick the event was generated.
3168
+ */
2186
3169
  readonly tick: uint
2187
3170
  }
2188
3171
 
2189
3172
  /**
2190
- * Called before a player is removed (deleted) from the game. Not to be confused with the player logging of this is
2191
- * different in that the player is deleted as if he never existed in the save file.
3173
+ * 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.
2192
3174
  *
2193
3175
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_player_removed View documentation}
2194
3176
  */
2195
3177
  interface OnPrePlayerRemovedEvent extends EventData {
2196
- /** The player index that will be removed */
2197
- readonly player_index: uint
2198
- /** Identifier of the event */
3178
+ /**
3179
+ * The player index that will be removed
3180
+ */
3181
+ readonly player_index: PlayerIndex
3182
+ /**
3183
+ * Identifier of the event
3184
+ */
2199
3185
  readonly name: typeof defines.events.on_pre_player_removed
2200
- /** Tick the event was generated. */
3186
+ /**
3187
+ * Tick the event was generated.
3188
+ */
2201
3189
  readonly tick: uint
2202
3190
  }
2203
3191
 
@@ -2207,10 +3195,14 @@ interface OnPrePlayerRemovedEvent extends EventData {
2207
3195
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_player_toggled_map_editor View documentation}
2208
3196
  */
2209
3197
  interface OnPrePlayerToggledMapEditorEvent extends EventData {
2210
- readonly player_index: uint
2211
- /** Identifier of the event */
3198
+ readonly player_index: PlayerIndex
3199
+ /**
3200
+ * Identifier of the event
3201
+ */
2212
3202
  readonly name: typeof defines.events.on_pre_player_toggled_map_editor
2213
- /** Tick the event was generated. */
3203
+ /**
3204
+ * Tick the event was generated.
3205
+ */
2214
3206
  readonly tick: uint
2215
3207
  }
2216
3208
 
@@ -2222,11 +3214,17 @@ interface OnPrePlayerToggledMapEditorEvent extends EventData {
2222
3214
  interface OnPreRobotExplodedCliffEvent extends EventData {
2223
3215
  readonly robot: LuaEntity
2224
3216
  readonly cliff: LuaEntity
2225
- /** The cliff explosive used. */
3217
+ /**
3218
+ * The cliff explosive used.
3219
+ */
2226
3220
  readonly item: LuaItemPrototype
2227
- /** Identifier of the event */
3221
+ /**
3222
+ * Identifier of the event
3223
+ */
2228
3224
  readonly name: typeof defines.events.on_pre_robot_exploded_cliff
2229
- /** Tick the event was generated. */
3225
+ /**
3226
+ * Tick the event was generated.
3227
+ */
2230
3228
  readonly tick: uint
2231
3229
  }
2232
3230
 
@@ -2236,18 +3234,30 @@ interface OnPreRobotExplodedCliffEvent extends EventData {
2236
3234
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_script_inventory_resized View documentation}
2237
3235
  */
2238
3236
  interface OnPreScriptInventoryResizedEvent extends EventData {
2239
- /** If done by console command; the player who ran the command. */
2240
- readonly player_index?: uint
2241
- /** The mod that did the resizing. This will be `"core"` if done by console command or scenario script. */
3237
+ /**
3238
+ * If done by console command; the player who ran the command.
3239
+ */
3240
+ readonly player_index?: PlayerIndex
3241
+ /**
3242
+ * The mod that did the resizing. This will be `"core"` if done by console command or scenario script.
3243
+ */
2242
3244
  readonly mod: string
2243
3245
  readonly inventory: LuaInventory
2244
- /** The old inventory size. */
3246
+ /**
3247
+ * The old inventory size.
3248
+ */
2245
3249
  readonly old_size: uint
2246
- /** The new inventory size. */
3250
+ /**
3251
+ * The new inventory size.
3252
+ */
2247
3253
  readonly new_size: uint
2248
- /** Identifier of the event */
3254
+ /**
3255
+ * Identifier of the event
3256
+ */
2249
3257
  readonly name: typeof defines.events.on_pre_script_inventory_resized
2250
- /** Tick the event was generated. */
3258
+ /**
3259
+ * Tick the event was generated.
3260
+ */
2251
3261
  readonly tick: uint
2252
3262
  }
2253
3263
 
@@ -2257,10 +3267,14 @@ interface OnPreScriptInventoryResizedEvent extends EventData {
2257
3267
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_surface_cleared View documentation}
2258
3268
  */
2259
3269
  interface OnPreSurfaceClearedEvent extends EventData {
2260
- readonly surface_index: uint
2261
- /** Identifier of the event */
3270
+ readonly surface_index: SurfaceIndex
3271
+ /**
3272
+ * Identifier of the event
3273
+ */
2262
3274
  readonly name: typeof defines.events.on_pre_surface_cleared
2263
- /** Tick the event was generated. */
3275
+ /**
3276
+ * Tick the event was generated.
3277
+ */
2264
3278
  readonly tick: uint
2265
3279
  }
2266
3280
 
@@ -2270,10 +3284,14 @@ interface OnPreSurfaceClearedEvent extends EventData {
2270
3284
  * {@link https://lua-api.factorio.com/latest/events.html#on_pre_surface_deleted View documentation}
2271
3285
  */
2272
3286
  interface OnPreSurfaceDeletedEvent extends EventData {
2273
- readonly surface_index: uint
2274
- /** Identifier of the event */
3287
+ readonly surface_index: SurfaceIndex
3288
+ /**
3289
+ * Identifier of the event
3290
+ */
2275
3291
  readonly name: typeof defines.events.on_pre_surface_deleted
2276
- /** Tick the event was generated. */
3292
+ /**
3293
+ * Tick the event was generated.
3294
+ */
2277
3295
  readonly tick: uint
2278
3296
  }
2279
3297
 
@@ -2283,13 +3301,21 @@ interface OnPreSurfaceDeletedEvent extends EventData {
2283
3301
  * {@link https://lua-api.factorio.com/latest/events.html#on_research_finished View documentation}
2284
3302
  */
2285
3303
  interface OnResearchFinishedEvent extends EventData {
2286
- /** The researched technology */
3304
+ /**
3305
+ * The researched technology
3306
+ */
2287
3307
  readonly research: LuaTechnology
2288
- /** If the technology was researched by script. */
3308
+ /**
3309
+ * If the technology was researched by script.
3310
+ */
2289
3311
  readonly by_script: boolean
2290
- /** Identifier of the event */
3312
+ /**
3313
+ * Identifier of the event
3314
+ */
2291
3315
  readonly name: typeof defines.events.on_research_finished
2292
- /** Tick the event was generated. */
3316
+ /**
3317
+ * Tick the event was generated.
3318
+ */
2293
3319
  readonly tick: uint
2294
3320
  }
2295
3321
 
@@ -2299,13 +3325,21 @@ interface OnResearchFinishedEvent extends EventData {
2299
3325
  * {@link https://lua-api.factorio.com/latest/events.html#on_research_reversed View documentation}
2300
3326
  */
2301
3327
  interface OnResearchReversedEvent extends EventData {
2302
- /** The technology un-researched */
3328
+ /**
3329
+ * The technology un-researched
3330
+ */
2303
3331
  readonly research: LuaTechnology
2304
- /** If the technology was un-researched by script. */
3332
+ /**
3333
+ * If the technology was un-researched by script.
3334
+ */
2305
3335
  readonly by_script: boolean
2306
- /** Identifier of the event */
3336
+ /**
3337
+ * Identifier of the event
3338
+ */
2307
3339
  readonly name: typeof defines.events.on_research_reversed
2308
- /** Tick the event was generated. */
3340
+ /**
3341
+ * Tick the event was generated.
3342
+ */
2309
3343
  readonly tick: uint
2310
3344
  }
2311
3345
 
@@ -2315,12 +3349,18 @@ interface OnResearchReversedEvent extends EventData {
2315
3349
  * {@link https://lua-api.factorio.com/latest/events.html#on_research_started View documentation}
2316
3350
  */
2317
3351
  interface OnResearchStartedEvent extends EventData {
2318
- /** The technology being researched */
3352
+ /**
3353
+ * The technology being researched
3354
+ */
2319
3355
  readonly research: LuaTechnology
2320
3356
  readonly last_research?: LuaTechnology
2321
- /** Identifier of the event */
3357
+ /**
3358
+ * Identifier of the event
3359
+ */
2322
3360
  readonly name: typeof defines.events.on_research_started
2323
- /** Tick the event was generated. */
3361
+ /**
3362
+ * Tick the event was generated.
3363
+ */
2324
3364
  readonly tick: uint
2325
3365
  }
2326
3366
 
@@ -2331,9 +3371,13 @@ interface OnResearchStartedEvent extends EventData {
2331
3371
  */
2332
3372
  interface OnResourceDepletedEvent extends EventData {
2333
3373
  readonly entity: LuaEntity
2334
- /** Identifier of the event */
3374
+ /**
3375
+ * Identifier of the event
3376
+ */
2335
3377
  readonly name: typeof defines.events.on_resource_depleted
2336
- /** Tick the event was generated. */
3378
+ /**
3379
+ * Tick the event was generated.
3380
+ */
2337
3381
  readonly tick: uint
2338
3382
  }
2339
3383
 
@@ -2343,17 +3387,29 @@ interface OnResourceDepletedEvent extends EventData {
2343
3387
  * {@link https://lua-api.factorio.com/latest/events.html#on_robot_built_entity View documentation}
2344
3388
  */
2345
3389
  interface OnRobotBuiltEntityEvent extends EventData {
2346
- /** The robot that did the building. */
3390
+ /**
3391
+ * The robot that did the building.
3392
+ */
2347
3393
  readonly robot: LuaEntity
2348
- /** The entity built. */
3394
+ /**
3395
+ * The entity built.
3396
+ */
2349
3397
  readonly created_entity: LuaEntity
2350
- /** The item used to do the building. */
3398
+ /**
3399
+ * The item used to do the building.
3400
+ */
2351
3401
  readonly stack: LuaItemStack
2352
- /** The tags associated with this entity if any. */
3402
+ /**
3403
+ * The tags associated with this entity if any.
3404
+ */
2353
3405
  readonly tags?: Tags
2354
- /** Identifier of the event */
3406
+ /**
3407
+ * Identifier of the event
3408
+ */
2355
3409
  readonly name: typeof defines.events.on_robot_built_entity
2356
- /** Tick the event was generated. */
3410
+ /**
3411
+ * Tick the event was generated.
3412
+ */
2357
3413
  readonly tick: uint
2358
3414
  }
2359
3415
 
@@ -2363,21 +3419,37 @@ interface OnRobotBuiltEntityEvent extends EventData {
2363
3419
  * {@link https://lua-api.factorio.com/latest/events.html#on_robot_built_tile View documentation}
2364
3420
  */
2365
3421
  interface OnRobotBuiltTileEvent extends EventData {
2366
- /** The robot. */
3422
+ /**
3423
+ * The robot.
3424
+ */
2367
3425
  readonly robot: LuaEntity
2368
- /** The position data. */
3426
+ /**
3427
+ * The position data.
3428
+ */
2369
3429
  readonly tiles: OldTileAndPosition[]
2370
- /** The tile prototype that was placed. */
3430
+ /**
3431
+ * The tile prototype that was placed.
3432
+ */
2371
3433
  readonly tile: LuaTilePrototype
2372
- /** The item type used to build the tiles. */
3434
+ /**
3435
+ * The item type used to build the tiles.
3436
+ */
2373
3437
  readonly item: LuaItemPrototype
2374
- /** The stack used to build the tiles (may be empty if all of the items where used to build the tiles). */
3438
+ /**
3439
+ * The stack used to build the tiles (may be empty if all of the items where used to build the tiles).
3440
+ */
2375
3441
  readonly stack: LuaItemStack
2376
- /** The surface the tile(s) are build on. */
2377
- readonly surface_index: uint
2378
- /** Identifier of the event */
3442
+ /**
3443
+ * The surface the tile(s) are build on.
3444
+ */
3445
+ readonly surface_index: SurfaceIndex
3446
+ /**
3447
+ * Identifier of the event
3448
+ */
2379
3449
  readonly name: typeof defines.events.on_robot_built_tile
2380
- /** Tick the event was generated. */
3450
+ /**
3451
+ * Tick the event was generated.
3452
+ */
2381
3453
  readonly tick: uint
2382
3454
  }
2383
3455
 
@@ -2388,11 +3460,17 @@ interface OnRobotBuiltTileEvent extends EventData {
2388
3460
  */
2389
3461
  interface OnRobotExplodedCliffEvent extends EventData {
2390
3462
  readonly robot: LuaEntity
2391
- /** The cliff explosive used. */
3463
+ /**
3464
+ * The cliff explosive used.
3465
+ */
2392
3466
  readonly item: LuaItemPrototype
2393
- /** Identifier of the event */
3467
+ /**
3468
+ * Identifier of the event
3469
+ */
2394
3470
  readonly name: typeof defines.events.on_robot_exploded_cliff
2395
- /** Tick the event was generated. */
3471
+ /**
3472
+ * Tick the event was generated.
3473
+ */
2396
3474
  readonly tick: uint
2397
3475
  }
2398
3476
 
@@ -2402,36 +3480,50 @@ interface OnRobotExplodedCliffEvent extends EventData {
2402
3480
  * {@link https://lua-api.factorio.com/latest/events.html#on_robot_mined View documentation}
2403
3481
  */
2404
3482
  interface OnRobotMinedEvent extends EventData {
2405
- /** The robot that did the mining. */
3483
+ /**
3484
+ * The robot that did the mining.
3485
+ */
2406
3486
  readonly robot: LuaEntity
2407
- /** The entity the robot just picked up. */
3487
+ /**
3488
+ * The entity the robot just picked up.
3489
+ */
2408
3490
  readonly item_stack: SimpleItemStack
2409
- /** Identifier of the event */
3491
+ /**
3492
+ * Identifier of the event
3493
+ */
2410
3494
  readonly name: typeof defines.events.on_robot_mined
2411
- /** Tick the event was generated. */
3495
+ /**
3496
+ * Tick the event was generated.
3497
+ */
2412
3498
  readonly tick: uint
2413
3499
  }
2414
3500
 
2415
3501
  /**
2416
- * Called after the results of an entity being mined are collected just before the entity is destroyed. After this event
2417
- * any items in the buffer will be transferred into the robot as if they came from mining the entity. Can be filtered
2418
- * using {@link LuaRobotMinedEntityEventFilter}.
2419
- *
2420
- * **Note**: The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding
2421
- * as more items are transferred into it.
3502
+ * Called after the results of an entity being mined are collected just before the entity is destroyed. After this event any items in the buffer will be transferred into the robot as if they came from mining the entity. Can be filtered using {@link LuaRobotMinedEntityEventFilter}.
2422
3503
  *
2423
3504
  * {@link https://lua-api.factorio.com/latest/events.html#on_robot_mined_entity View documentation}
3505
+ * @remarks The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding as more items are transferred into it.
2424
3506
  */
2425
3507
  interface OnRobotMinedEntityEvent extends EventData {
2426
- /** The robot doing the mining. */
3508
+ /**
3509
+ * The robot doing the mining.
3510
+ */
2427
3511
  readonly robot: LuaEntity
2428
- /** The entity that has been mined. */
3512
+ /**
3513
+ * The entity that has been mined.
3514
+ */
2429
3515
  readonly entity: LuaEntity
2430
- /** The temporary inventory that holds the result of mining the entity. */
3516
+ /**
3517
+ * The temporary inventory that holds the result of mining the entity.
3518
+ */
2431
3519
  readonly buffer: LuaInventory
2432
- /** Identifier of the event */
3520
+ /**
3521
+ * Identifier of the event
3522
+ */
2433
3523
  readonly name: typeof defines.events.on_robot_mined_entity
2434
- /** Tick the event was generated. */
3524
+ /**
3525
+ * Tick the event was generated.
3526
+ */
2435
3527
  readonly tick: uint
2436
3528
  }
2437
3529
 
@@ -2441,15 +3533,25 @@ interface OnRobotMinedEntityEvent extends EventData {
2441
3533
  * {@link https://lua-api.factorio.com/latest/events.html#on_robot_mined_tile View documentation}
2442
3534
  */
2443
3535
  interface OnRobotMinedTileEvent extends EventData {
2444
- /** The robot. */
3536
+ /**
3537
+ * The robot.
3538
+ */
2445
3539
  readonly robot: LuaEntity
2446
- /** The position data. */
3540
+ /**
3541
+ * The position data.
3542
+ */
2447
3543
  readonly tiles: OldTileAndPosition[]
2448
- /** The surface the tile(s) were mined on. */
2449
- readonly surface_index: uint
2450
- /** Identifier of the event */
3544
+ /**
3545
+ * The surface the tile(s) were mined on.
3546
+ */
3547
+ readonly surface_index: SurfaceIndex
3548
+ /**
3549
+ * Identifier of the event
3550
+ */
2451
3551
  readonly name: typeof defines.events.on_robot_mined_tile
2452
- /** Tick the event was generated. */
3552
+ /**
3553
+ * Tick the event was generated.
3554
+ */
2453
3555
  readonly tick: uint
2454
3556
  }
2455
3557
 
@@ -2459,13 +3561,21 @@ interface OnRobotMinedTileEvent extends EventData {
2459
3561
  * {@link https://lua-api.factorio.com/latest/events.html#on_robot_pre_mined View documentation}
2460
3562
  */
2461
3563
  interface OnRobotPreMinedEvent extends EventData {
2462
- /** The robot that's about to do the mining. */
3564
+ /**
3565
+ * The robot that's about to do the mining.
3566
+ */
2463
3567
  readonly robot: LuaEntity
2464
- /** The entity which is about to be mined. */
3568
+ /**
3569
+ * The entity which is about to be mined.
3570
+ */
2465
3571
  readonly entity: LuaEntity
2466
- /** Identifier of the event */
3572
+ /**
3573
+ * Identifier of the event
3574
+ */
2467
3575
  readonly name: typeof defines.events.on_robot_pre_mined
2468
- /** Tick the event was generated. */
3576
+ /**
3577
+ * Tick the event was generated.
3578
+ */
2469
3579
  readonly tick: uint
2470
3580
  }
2471
3581
 
@@ -2477,11 +3587,17 @@ interface OnRobotPreMinedEvent extends EventData {
2477
3587
  interface OnRocketLaunchOrderedEvent extends EventData {
2478
3588
  readonly rocket: LuaEntity
2479
3589
  readonly rocket_silo: LuaEntity
2480
- /** The player that is riding the rocket, if any. */
2481
- readonly player_index?: uint
2482
- /** Identifier of the event */
3590
+ /**
3591
+ * The player that is riding the rocket, if any.
3592
+ */
3593
+ readonly player_index?: PlayerIndex
3594
+ /**
3595
+ * Identifier of the event
3596
+ */
2483
3597
  readonly name: typeof defines.events.on_rocket_launch_ordered
2484
- /** Tick the event was generated. */
3598
+ /**
3599
+ * Tick the event was generated.
3600
+ */
2485
3601
  readonly tick: uint
2486
3602
  }
2487
3603
 
@@ -2493,11 +3609,17 @@ interface OnRocketLaunchOrderedEvent extends EventData {
2493
3609
  interface OnRocketLaunchedEvent extends EventData {
2494
3610
  readonly rocket: LuaEntity
2495
3611
  readonly rocket_silo?: LuaEntity
2496
- /** The player that is riding the rocket, if any. */
2497
- readonly player_index?: uint
2498
- /** Identifier of the event */
3612
+ /**
3613
+ * The player that is riding the rocket, if any.
3614
+ */
3615
+ readonly player_index?: PlayerIndex
3616
+ /**
3617
+ * Identifier of the event
3618
+ */
2499
3619
  readonly name: typeof defines.events.on_rocket_launched
2500
- /** Tick the event was generated. */
3620
+ /**
3621
+ * Tick the event was generated.
3622
+ */
2501
3623
  readonly tick: uint
2502
3624
  }
2503
3625
 
@@ -2508,18 +3630,24 @@ interface OnRocketLaunchedEvent extends EventData {
2508
3630
  */
2509
3631
  interface OnRuntimeModSettingChangedEvent extends EventData {
2510
3632
  /**
2511
- * If the `setting_type` is `"global"` and it was changed through the mod settings GUI, this is the index of the
2512
- * player that changed the global setting. If the `setting_type` is `"runtime-per-user"` and it changed a current
2513
- * setting of the player, this is the index of the player whose setting was changed. In all other cases, this is `nil`.
3633
+ * If the `setting_type` is `"global"` and it was changed through the mod settings GUI, this is the index of the player that changed the global setting. If the `setting_type` is `"runtime-per-user"` and it changed a current setting of the player, this is the index of the player whose setting was changed. In all other cases, this is `nil`.
3634
+ */
3635
+ readonly player_index?: PlayerIndex
3636
+ /**
3637
+ * The prototype name of the setting that was changed.
2514
3638
  */
2515
- readonly player_index?: uint
2516
- /** The prototype name of the setting that was changed. */
2517
3639
  readonly setting: string
2518
- /** Either "runtime-per-user" or "runtime-global". */
3640
+ /**
3641
+ * Either "runtime-per-user" or "runtime-global".
3642
+ */
2519
3643
  readonly setting_type: "runtime-per-user" | "runtime-global"
2520
- /** Identifier of the event */
3644
+ /**
3645
+ * Identifier of the event
3646
+ */
2521
3647
  readonly name: typeof defines.events.on_runtime_mod_setting_changed
2522
- /** Tick the event was generated. */
3648
+ /**
3649
+ * Tick the event was generated.
3650
+ */
2523
3651
  readonly tick: uint
2524
3652
  }
2525
3653
 
@@ -2529,38 +3657,62 @@ interface OnRuntimeModSettingChangedEvent extends EventData {
2529
3657
  * {@link https://lua-api.factorio.com/latest/events.html#on_script_inventory_resized View documentation}
2530
3658
  */
2531
3659
  interface OnScriptInventoryResizedEvent extends EventData {
2532
- /** If done by console command; the player who ran the command. */
2533
- readonly player_index?: uint
2534
- /** The mod that did the resizing. This will be `"core"` if done by console command or scenario script. */
3660
+ /**
3661
+ * If done by console command; the player who ran the command.
3662
+ */
3663
+ readonly player_index?: PlayerIndex
3664
+ /**
3665
+ * The mod that did the resizing. This will be `"core"` if done by console command or scenario script.
3666
+ */
2535
3667
  readonly mod: string
2536
3668
  readonly inventory: LuaInventory
2537
- /** The old inventory size. */
3669
+ /**
3670
+ * The old inventory size.
3671
+ */
2538
3672
  readonly old_size: uint
2539
- /** The new inventory size. */
3673
+ /**
3674
+ * The new inventory size.
3675
+ */
2540
3676
  readonly new_size: uint
2541
- /** Any items which didn't fit into the new inventory size. */
3677
+ /**
3678
+ * Any items which didn't fit into the new inventory size.
3679
+ */
2542
3680
  readonly overflow_inventory: LuaInventory
2543
- /** Identifier of the event */
3681
+ /**
3682
+ * Identifier of the event
3683
+ */
2544
3684
  readonly name: typeof defines.events.on_script_inventory_resized
2545
- /** Tick the event was generated. */
3685
+ /**
3686
+ * Tick the event was generated.
3687
+ */
2546
3688
  readonly tick: uint
2547
3689
  }
2548
3690
 
2549
3691
  /**
2550
- * Called when a {@link LuaSurface.request_path LuaSurface::request_path} call completes.
3692
+ * Called when a {@link LuaSurface#request_path LuaSurface::request_path} call completes.
2551
3693
  *
2552
3694
  * {@link https://lua-api.factorio.com/latest/events.html#on_script_path_request_finished View documentation}
2553
3695
  */
2554
3696
  interface OnScriptPathRequestFinishedEvent extends EventData {
2555
- /** The actual path that the pathfinder has determined. `nil` if pathfinding failed. */
3697
+ /**
3698
+ * The actual path that the pathfinder has determined. `nil` if pathfinding failed.
3699
+ */
2556
3700
  readonly path?: PathfinderWaypoint[]
2557
- /** Handle to associate the callback with a particular call to {@link LuaSurface.request_path LuaSurface::request_path}. */
3701
+ /**
3702
+ * Handle to associate the callback with a particular call to {@link LuaSurface#request_path LuaSurface::request_path}.
3703
+ */
2558
3704
  readonly id: uint
2559
- /** Indicates that the pathfinder failed because it is too busy, and that you can retry later. */
3705
+ /**
3706
+ * Indicates that the pathfinder failed because it is too busy, and that you can retry later.
3707
+ */
2560
3708
  readonly try_again_later: boolean
2561
- /** Identifier of the event */
3709
+ /**
3710
+ * Identifier of the event
3711
+ */
2562
3712
  readonly name: typeof defines.events.on_script_path_request_finished
2563
- /** Tick the event was generated. */
3713
+ /**
3714
+ * Tick the event was generated.
3715
+ */
2564
3716
  readonly tick: uint
2565
3717
  }
2566
3718
 
@@ -2570,36 +3722,53 @@ interface OnScriptPathRequestFinishedEvent extends EventData {
2570
3722
  * {@link https://lua-api.factorio.com/latest/events.html#on_script_trigger_effect View documentation}
2571
3723
  */
2572
3724
  interface OnScriptTriggerEffectEvent extends EventData {
2573
- /** The effect_id specified in the trigger effect. */
3725
+ /**
3726
+ * The effect_id specified in the trigger effect.
3727
+ */
2574
3728
  readonly effect_id: string
2575
- /** The surface the effect happened on. */
2576
- readonly surface_index: uint
2577
- readonly source_position?: PositionTable
3729
+ /**
3730
+ * The surface the effect happened on.
3731
+ */
3732
+ readonly surface_index: SurfaceIndex
3733
+ readonly source_position?: MapPositionTable
2578
3734
  readonly source_entity?: LuaEntity
2579
- readonly target_position?: PositionTable
3735
+ readonly target_position?: MapPositionTable
2580
3736
  readonly target_entity?: LuaEntity
2581
- /** Identifier of the event */
3737
+ /**
3738
+ * Identifier of the event
3739
+ */
2582
3740
  readonly name: typeof defines.events.on_script_trigger_effect
2583
- /** Tick the event was generated. */
3741
+ /**
3742
+ * Tick the event was generated.
3743
+ */
2584
3744
  readonly tick: uint
2585
3745
  }
2586
3746
 
2587
3747
  /**
2588
- * Called when an entity of type `radar` finishes scanning a sector. Can be filtered for the radar using
2589
- * {@link LuaSectorScannedEventFilter}.
3748
+ * Called when an entity of type `radar` finishes scanning a sector. Can be filtered for the radar using {@link LuaSectorScannedEventFilter}.
2590
3749
  *
2591
3750
  * {@link https://lua-api.factorio.com/latest/events.html#on_sector_scanned View documentation}
2592
3751
  */
2593
3752
  interface OnSectorScannedEvent extends EventData {
2594
- /** The radar that did the scanning. */
3753
+ /**
3754
+ * The radar that did the scanning.
3755
+ */
2595
3756
  readonly radar: LuaEntity
2596
- /** The chunk scanned. */
3757
+ /**
3758
+ * The chunk scanned.
3759
+ */
2597
3760
  readonly chunk_position: ChunkPositionTable
2598
- /** Area of the scanned chunk. */
3761
+ /**
3762
+ * Area of the scanned chunk.
3763
+ */
2599
3764
  readonly area: BoundingBoxRead
2600
- /** Identifier of the event */
3765
+ /**
3766
+ * Identifier of the event
3767
+ */
2601
3768
  readonly name: typeof defines.events.on_sector_scanned
2602
- /** Tick the event was generated. */
3769
+ /**
3770
+ * Tick the event was generated.
3771
+ */
2603
3772
  readonly tick: uint
2604
3773
  }
2605
3774
 
@@ -2609,13 +3778,21 @@ interface OnSectorScannedEvent extends EventData {
2609
3778
  * {@link https://lua-api.factorio.com/latest/events.html#on_selected_entity_changed View documentation}
2610
3779
  */
2611
3780
  interface OnSelectedEntityChangedEvent extends EventData {
2612
- /** The player whose selected entity changed. */
2613
- readonly player_index: uint
2614
- /** The last selected entity if it still exists and there was one. */
3781
+ /**
3782
+ * The player whose selected entity changed.
3783
+ */
3784
+ readonly player_index: PlayerIndex
3785
+ /**
3786
+ * The last selected entity if it still exists and there was one.
3787
+ */
2615
3788
  readonly last_entity?: LuaEntity
2616
- /** Identifier of the event */
3789
+ /**
3790
+ * Identifier of the event
3791
+ */
2617
3792
  readonly name: typeof defines.events.on_selected_entity_changed
2618
- /** Tick the event was generated. */
3793
+ /**
3794
+ * Tick the event was generated.
3795
+ */
2619
3796
  readonly tick: uint
2620
3797
  }
2621
3798
 
@@ -2625,32 +3802,49 @@ interface OnSelectedEntityChangedEvent extends EventData {
2625
3802
  * {@link https://lua-api.factorio.com/latest/events.html#on_spider_command_completed View documentation}
2626
3803
  */
2627
3804
  interface OnSpiderCommandCompletedEvent extends EventData {
2628
- /** Spider vehicle which was requested to move. */
3805
+ /**
3806
+ * Spider vehicle which was requested to move.
3807
+ */
2629
3808
  readonly vehicle: LuaEntity
2630
- /** Identifier of the event */
3809
+ /**
3810
+ * Identifier of the event
3811
+ */
2631
3812
  readonly name: typeof defines.events.on_spider_command_completed
2632
- /** Tick the event was generated. */
3813
+ /**
3814
+ * Tick the event was generated.
3815
+ */
2633
3816
  readonly tick: uint
2634
3817
  }
2635
3818
 
2636
3819
  /**
2637
- * Called when a translation request generated through
2638
- * {@link LuaPlayer.request_translation LuaPlayer::request_translation} is translated.
3820
+ * Called when a translation request generated through {@link LuaPlayer#request_translation LuaPlayer::request_translation} is translated.
2639
3821
  *
2640
3822
  * {@link https://lua-api.factorio.com/latest/events.html#on_string_translated View documentation}
2641
3823
  */
2642
3824
  interface OnStringTranslatedEvent extends EventData {
2643
- /** The player whose locale was used for the translation. */
2644
- readonly player_index: uint
2645
- /** The localised string being translated. */
3825
+ /**
3826
+ * The player whose locale was used for the translation.
3827
+ */
3828
+ readonly player_index: PlayerIndex
3829
+ /**
3830
+ * The localised string being translated.
3831
+ */
2646
3832
  readonly localised_string: LocalisedString
2647
- /** The translated `localised_string`. */
3833
+ /**
3834
+ * The translated `localised_string`.
3835
+ */
2648
3836
  readonly result: string
2649
- /** Whether the requested localised string was valid and could be translated. */
3837
+ /**
3838
+ * Whether the requested localised string was valid and could be translated.
3839
+ */
2650
3840
  readonly translated: boolean
2651
- /** Identifier of the event */
3841
+ /**
3842
+ * Identifier of the event
3843
+ */
2652
3844
  readonly name: typeof defines.events.on_string_translated
2653
- /** Tick the event was generated. */
3845
+ /**
3846
+ * Tick the event was generated.
3847
+ */
2654
3848
  readonly tick: uint
2655
3849
  }
2656
3850
 
@@ -2660,25 +3854,32 @@ interface OnStringTranslatedEvent extends EventData {
2660
3854
  * {@link https://lua-api.factorio.com/latest/events.html#on_surface_cleared View documentation}
2661
3855
  */
2662
3856
  interface OnSurfaceClearedEvent extends EventData {
2663
- readonly surface_index: uint
2664
- /** Identifier of the event */
3857
+ readonly surface_index: SurfaceIndex
3858
+ /**
3859
+ * Identifier of the event
3860
+ */
2665
3861
  readonly name: typeof defines.events.on_surface_cleared
2666
- /** Tick the event was generated. */
3862
+ /**
3863
+ * Tick the event was generated.
3864
+ */
2667
3865
  readonly tick: uint
2668
3866
  }
2669
3867
 
2670
3868
  /**
2671
3869
  * Called when a surface is created.
2672
3870
  *
2673
- * **Note**: This is not called when the default surface is created as it will always exist.
2674
- *
2675
3871
  * {@link https://lua-api.factorio.com/latest/events.html#on_surface_created View documentation}
3872
+ * @remarks This is not called when the default surface is created as it will always exist.
2676
3873
  */
2677
3874
  interface OnSurfaceCreatedEvent extends EventData {
2678
- readonly surface_index: uint
2679
- /** Identifier of the event */
3875
+ readonly surface_index: SurfaceIndex
3876
+ /**
3877
+ * Identifier of the event
3878
+ */
2680
3879
  readonly name: typeof defines.events.on_surface_created
2681
- /** Tick the event was generated. */
3880
+ /**
3881
+ * Tick the event was generated.
3882
+ */
2682
3883
  readonly tick: uint
2683
3884
  }
2684
3885
 
@@ -2688,10 +3889,14 @@ interface OnSurfaceCreatedEvent extends EventData {
2688
3889
  * {@link https://lua-api.factorio.com/latest/events.html#on_surface_deleted View documentation}
2689
3890
  */
2690
3891
  interface OnSurfaceDeletedEvent extends EventData {
2691
- readonly surface_index: uint
2692
- /** Identifier of the event */
3892
+ readonly surface_index: SurfaceIndex
3893
+ /**
3894
+ * Identifier of the event
3895
+ */
2693
3896
  readonly name: typeof defines.events.on_surface_deleted
2694
- /** Tick the event was generated. */
3897
+ /**
3898
+ * Tick the event was generated.
3899
+ */
2695
3900
  readonly tick: uint
2696
3901
  }
2697
3902
 
@@ -2701,12 +3906,18 @@ interface OnSurfaceDeletedEvent extends EventData {
2701
3906
  * {@link https://lua-api.factorio.com/latest/events.html#on_surface_imported View documentation}
2702
3907
  */
2703
3908
  interface OnSurfaceImportedEvent extends EventData {
2704
- readonly surface_index: uint
2705
- /** The original surface name. */
3909
+ readonly surface_index: SurfaceIndex
3910
+ /**
3911
+ * The original surface name.
3912
+ */
2706
3913
  readonly original_name: string
2707
- /** Identifier of the event */
3914
+ /**
3915
+ * Identifier of the event
3916
+ */
2708
3917
  readonly name: typeof defines.events.on_surface_imported
2709
- /** Tick the event was generated. */
3918
+ /**
3919
+ * Tick the event was generated.
3920
+ */
2710
3921
  readonly tick: uint
2711
3922
  }
2712
3923
 
@@ -2716,25 +3927,33 @@ interface OnSurfaceImportedEvent extends EventData {
2716
3927
  * {@link https://lua-api.factorio.com/latest/events.html#on_surface_renamed View documentation}
2717
3928
  */
2718
3929
  interface OnSurfaceRenamedEvent extends EventData {
2719
- readonly surface_index: uint
3930
+ readonly surface_index: SurfaceIndex
2720
3931
  readonly old_name: string
2721
3932
  readonly new_name: string
2722
- /** Identifier of the event */
3933
+ /**
3934
+ * Identifier of the event
3935
+ */
2723
3936
  readonly name: typeof defines.events.on_surface_renamed
2724
- /** Tick the event was generated. */
3937
+ /**
3938
+ * Tick the event was generated.
3939
+ */
2725
3940
  readonly tick: uint
2726
3941
  }
2727
3942
 
2728
3943
  /**
2729
- * Called when {@link LuaForce.reset_technology_effects LuaForce::reset_technology_effects} is finished.
3944
+ * Called when {@link LuaForce#reset_technology_effects LuaForce::reset_technology_effects} is finished.
2730
3945
  *
2731
3946
  * {@link https://lua-api.factorio.com/latest/events.html#on_technology_effects_reset View documentation}
2732
3947
  */
2733
3948
  interface OnTechnologyEffectsResetEvent extends EventData {
2734
3949
  readonly force: LuaForce
2735
- /** Identifier of the event */
3950
+ /**
3951
+ * Identifier of the event
3952
+ */
2736
3953
  readonly name: typeof defines.events.on_technology_effects_reset
2737
- /** Tick the event was generated. */
3954
+ /**
3955
+ * Tick the event was generated.
3956
+ */
2738
3957
  readonly tick: uint
2739
3958
  }
2740
3959
 
@@ -2744,9 +3963,13 @@ interface OnTechnologyEffectsResetEvent extends EventData {
2744
3963
  * {@link https://lua-api.factorio.com/latest/events.html#on_tick View documentation}
2745
3964
  */
2746
3965
  interface OnTickEvent extends EventData {
2747
- /** Identifier of the event */
3966
+ /**
3967
+ * Identifier of the event
3968
+ */
2748
3969
  readonly name: typeof defines.events.on_tick
2749
- /** Tick the event was generated. */
3970
+ /**
3971
+ * Tick the event was generated.
3972
+ */
2750
3973
  readonly tick: uint
2751
3974
  }
2752
3975
 
@@ -2758,9 +3981,13 @@ interface OnTickEvent extends EventData {
2758
3981
  interface OnTrainChangedStateEvent extends EventData {
2759
3982
  readonly train: LuaTrain
2760
3983
  readonly old_state: defines.train_state
2761
- /** Identifier of the event */
3984
+ /**
3985
+ * Identifier of the event
3986
+ */
2762
3987
  readonly name: typeof defines.events.on_train_changed_state
2763
- /** Tick the event was generated. */
3988
+ /**
3989
+ * Tick the event was generated.
3990
+ */
2764
3991
  readonly tick: uint
2765
3992
  }
2766
3993
 
@@ -2771,13 +3998,21 @@ interface OnTrainChangedStateEvent extends EventData {
2771
3998
  */
2772
3999
  interface OnTrainCreatedEvent extends EventData {
2773
4000
  readonly train: LuaTrain
2774
- /** The first old train id when splitting/merging trains. */
4001
+ /**
4002
+ * The first old train id when splitting/merging trains.
4003
+ */
2775
4004
  readonly old_train_id_1?: uint
2776
- /** The second old train id when splitting/merging trains. */
4005
+ /**
4006
+ * The second old train id when splitting/merging trains.
4007
+ */
2777
4008
  readonly old_train_id_2?: uint
2778
- /** Identifier of the event */
4009
+ /**
4010
+ * Identifier of the event
4011
+ */
2779
4012
  readonly name: typeof defines.events.on_train_created
2780
- /** Tick the event was generated. */
4013
+ /**
4014
+ * Tick the event was generated.
4015
+ */
2781
4016
  readonly tick: uint
2782
4017
  }
2783
4018
 
@@ -2788,41 +4023,53 @@ interface OnTrainCreatedEvent extends EventData {
2788
4023
  */
2789
4024
  interface OnTrainScheduleChangedEvent extends EventData {
2790
4025
  readonly train: LuaTrain
2791
- /** The player who made the change if any. */
2792
- readonly player_index?: uint
2793
- /** Identifier of the event */
4026
+ /**
4027
+ * The player who made the change if any.
4028
+ */
4029
+ readonly player_index?: PlayerIndex
4030
+ /**
4031
+ * Identifier of the event
4032
+ */
2794
4033
  readonly name: typeof defines.events.on_train_schedule_changed
2795
- /** Tick the event was generated. */
4034
+ /**
4035
+ * Tick the event was generated.
4036
+ */
2796
4037
  readonly tick: uint
2797
4038
  }
2798
4039
 
2799
4040
  /**
2800
- * Called when an entity with a trigger prototype (such as capsules) create an entity AND that trigger prototype defined
2801
- * `trigger_created_entity="true"`.
4041
+ * Called when an entity with a trigger prototype (such as capsules) create an entity AND that trigger prototype defined `trigger_created_entity="true"`.
2802
4042
  *
2803
4043
  * {@link https://lua-api.factorio.com/latest/events.html#on_trigger_created_entity View documentation}
2804
4044
  */
2805
4045
  interface OnTriggerCreatedEntityEvent extends EventData {
2806
4046
  readonly entity: LuaEntity
2807
4047
  readonly source?: LuaEntity
2808
- /** Identifier of the event */
4048
+ /**
4049
+ * Identifier of the event
4050
+ */
2809
4051
  readonly name: typeof defines.events.on_trigger_created_entity
2810
- /** Tick the event was generated. */
4052
+ /**
4053
+ * Tick the event was generated.
4054
+ */
2811
4055
  readonly tick: uint
2812
4056
  }
2813
4057
 
2814
4058
  /**
2815
- * Called when an entity with a trigger prototype (such as capsules) fire an artillery projectile AND that trigger
2816
- * prototype defined `trigger_fired_artillery="true"`.
4059
+ * Called when an entity with a trigger prototype (such as capsules) fire an artillery projectile AND that trigger prototype defined `trigger_fired_artillery="true"`.
2817
4060
  *
2818
4061
  * {@link https://lua-api.factorio.com/latest/events.html#on_trigger_fired_artillery View documentation}
2819
4062
  */
2820
4063
  interface OnTriggerFiredArtilleryEvent extends EventData {
2821
4064
  readonly entity: LuaEntity
2822
4065
  readonly source?: LuaEntity
2823
- /** Identifier of the event */
4066
+ /**
4067
+ * Identifier of the event
4068
+ */
2824
4069
  readonly name: typeof defines.events.on_trigger_fired_artillery
2825
- /** Tick the event was generated. */
4070
+ /**
4071
+ * Tick the event was generated.
4072
+ */
2826
4073
  readonly tick: uint
2827
4074
  }
2828
4075
 
@@ -2834,9 +4081,13 @@ interface OnTriggerFiredArtilleryEvent extends EventData {
2834
4081
  interface OnUnitAddedToGroupEvent extends EventData {
2835
4082
  readonly unit: LuaEntity
2836
4083
  readonly group: LuaUnitGroup
2837
- /** Identifier of the event */
4084
+ /**
4085
+ * Identifier of the event
4086
+ */
2838
4087
  readonly name: typeof defines.events.on_unit_added_to_group
2839
- /** Tick the event was generated. */
4088
+ /**
4089
+ * Tick the event was generated.
4090
+ */
2840
4091
  readonly tick: uint
2841
4092
  }
2842
4093
 
@@ -2847,9 +4098,13 @@ interface OnUnitAddedToGroupEvent extends EventData {
2847
4098
  */
2848
4099
  interface OnUnitGroupCreatedEvent extends EventData {
2849
4100
  readonly group: LuaUnitGroup
2850
- /** Identifier of the event */
4101
+ /**
4102
+ * Identifier of the event
4103
+ */
2851
4104
  readonly name: typeof defines.events.on_unit_group_created
2852
- /** Tick the event was generated. */
4105
+ /**
4106
+ * Tick the event was generated.
4107
+ */
2853
4108
  readonly tick: uint
2854
4109
  }
2855
4110
 
@@ -2860,9 +4115,13 @@ interface OnUnitGroupCreatedEvent extends EventData {
2860
4115
  */
2861
4116
  interface OnUnitGroupFinishedGatheringEvent extends EventData {
2862
4117
  readonly group: LuaUnitGroup
2863
- /** Identifier of the event */
4118
+ /**
4119
+ * Identifier of the event
4120
+ */
2864
4121
  readonly name: typeof defines.events.on_unit_group_finished_gathering
2865
- /** Tick the event was generated. */
4122
+ /**
4123
+ * Tick the event was generated.
4124
+ */
2866
4125
  readonly tick: uint
2867
4126
  }
2868
4127
 
@@ -2874,9 +4133,13 @@ interface OnUnitGroupFinishedGatheringEvent extends EventData {
2874
4133
  interface OnUnitRemovedFromGroupEvent extends EventData {
2875
4134
  readonly unit: LuaEntity
2876
4135
  readonly group: LuaUnitGroup
2877
- /** Identifier of the event */
4136
+ /**
4137
+ * Identifier of the event
4138
+ */
2878
4139
  readonly name: typeof defines.events.on_unit_removed_from_group
2879
- /** Tick the event was generated. */
4140
+ /**
4141
+ * Tick the event was generated.
4142
+ */
2880
4143
  readonly tick: uint
2881
4144
  }
2882
4145
 
@@ -2887,81 +4150,101 @@ interface OnUnitRemovedFromGroupEvent extends EventData {
2887
4150
  */
2888
4151
  interface OnWorkerRobotExpiredEvent extends EventData {
2889
4152
  readonly robot: LuaEntity
2890
- /** Identifier of the event */
4153
+ /**
4154
+ * Identifier of the event
4155
+ */
2891
4156
  readonly name: typeof defines.events.on_worker_robot_expired
2892
- /** Tick the event was generated. */
4157
+ /**
4158
+ * Tick the event was generated.
4159
+ */
2893
4160
  readonly tick: uint
2894
4161
  }
2895
4162
 
2896
4163
  /**
2897
- * A static event mods can use to tell other mods they built something by script. This event is only raised if a mod
2898
- * does so with {@link LuaBootstrap.raise_event LuaBootstrap::raise_event} or
2899
- * {@link LuaBootstrap.raise_script_built LuaBootstrap::raise_script_built}, or when `raise_built` is passed to
2900
- * {@link LuaSurface.create_entity LuaSurface::create_entity}. Can be filtered using {@link LuaScriptRaisedBuiltEventFilter}.
4164
+ * A static event mods can use to tell other mods they built 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_built LuaBootstrap::raise_script_built}, or when `raise_built` is passed to {@link LuaSurface#create_entity LuaSurface::create_entity}. Can be filtered using {@link LuaScriptRaisedBuiltEventFilter}.
2901
4165
  *
2902
4166
  * {@link https://lua-api.factorio.com/latest/events.html#script_raised_built View documentation}
2903
4167
  */
2904
4168
  interface ScriptRaisedBuiltEvent extends EventData {
2905
- /** The entity that has been built. */
4169
+ /**
4170
+ * The entity that has been built.
4171
+ */
2906
4172
  readonly entity: LuaEntity
2907
- /** Identifier of the event */
4173
+ /**
4174
+ * Identifier of the event
4175
+ */
2908
4176
  readonly name: typeof defines.events.script_raised_built
2909
- /** Tick the event was generated. */
4177
+ /**
4178
+ * Tick the event was generated.
4179
+ */
2910
4180
  readonly tick: uint
2911
4181
  }
2912
4182
 
2913
4183
  /**
2914
- * A static event mods can use to tell other mods they destroyed something by script. This event is only raised if a mod
2915
- * does so with {@link LuaBootstrap.raise_event LuaBootstrap::raise_event} or
2916
- * {@link LuaBootstrap.raise_script_destroy LuaBootstrap::raise_script_destroy}, or when `raise_destroy` is passed to
2917
- * {@link LuaEntity.destroy LuaEntity::destroy}. Can be filtered using {@link LuaScriptRaisedDestroyEventFilter}.
4184
+ * A static event mods can use to tell other mods they destroyed 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_destroy LuaBootstrap::raise_script_destroy}, or when `raise_destroy` is passed to {@link LuaEntity#destroy LuaEntity::destroy}. Can be filtered using {@link LuaScriptRaisedDestroyEventFilter}.
2918
4185
  *
2919
4186
  * {@link https://lua-api.factorio.com/latest/events.html#script_raised_destroy View documentation}
2920
4187
  */
2921
4188
  interface ScriptRaisedDestroyEvent extends EventData {
2922
- /** The entity that was destroyed. */
4189
+ /**
4190
+ * The entity that was destroyed.
4191
+ */
2923
4192
  readonly entity: LuaEntity
2924
- /** Identifier of the event */
4193
+ /**
4194
+ * Identifier of the event
4195
+ */
2925
4196
  readonly name: typeof defines.events.script_raised_destroy
2926
- /** Tick the event was generated. */
4197
+ /**
4198
+ * Tick the event was generated.
4199
+ */
2927
4200
  readonly tick: uint
2928
4201
  }
2929
4202
 
2930
4203
  /**
2931
- * A static event mods can use to tell other mods they revived something by script. This event is only raised if a mod
2932
- * does so with {@link LuaBootstrap.raise_event LuaBootstrap::raise_event} or
2933
- * {@link LuaBootstrap.raise_script_revive LuaBootstrap::raise_script_revive}, or when `raise_revive` is passed to
2934
- * {@link LuaEntity.revive LuaEntity::revive}. Can be filtered using {@link LuaScriptRaisedReviveEventFilter}.
4204
+ * A static event mods can use to tell other mods they revived 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_revive LuaBootstrap::raise_script_revive}, or when `raise_revive` is passed to {@link LuaEntity#revive LuaEntity::revive}. Can be filtered using {@link LuaScriptRaisedReviveEventFilter}.
2935
4205
  *
2936
4206
  * {@link https://lua-api.factorio.com/latest/events.html#script_raised_revive View documentation}
2937
4207
  */
2938
4208
  interface ScriptRaisedReviveEvent extends EventData {
2939
- /** The entity that was revived. */
4209
+ /**
4210
+ * The entity that was revived.
4211
+ */
2940
4212
  readonly entity: LuaEntity
2941
- /** The tags associated with this entity, if any. */
4213
+ /**
4214
+ * The tags associated with this entity, if any.
4215
+ */
2942
4216
  readonly tags?: Tags
2943
- /** Identifier of the event */
4217
+ /**
4218
+ * Identifier of the event
4219
+ */
2944
4220
  readonly name: typeof defines.events.script_raised_revive
2945
- /** Tick the event was generated. */
4221
+ /**
4222
+ * Tick the event was generated.
4223
+ */
2946
4224
  readonly tick: uint
2947
4225
  }
2948
4226
 
2949
4227
  /**
2950
- * A static event mods can use to tell other mods they changed tiles on a surface by script. This event is only raised
2951
- * if a mod does so with {@link LuaBootstrap.raise_event LuaBootstrap::raise_event} or
2952
- * {@link LuaBootstrap.raise_script_set_tiles LuaBootstrap::raise_script_set_tiles}, or when `raise_event` is passed to
2953
- * {@link LuaSurface.set_tiles LuaSurface::set_tiles}.
4228
+ * A static event mods can use to tell other mods they changed tiles on a surface 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_set_tiles LuaBootstrap::raise_script_set_tiles}, or when `raise_event` is passed to {@link LuaSurface#set_tiles LuaSurface::set_tiles}.
2954
4229
  *
2955
4230
  * {@link https://lua-api.factorio.com/latest/events.html#script_raised_set_tiles View documentation}
2956
4231
  */
2957
4232
  interface ScriptRaisedSetTilesEvent extends EventData {
2958
- /** The surface whose tiles were changed. */
2959
- readonly surface_index: uint
2960
- /** The tiles that were changed. */
4233
+ /**
4234
+ * The surface whose tiles were changed.
4235
+ */
4236
+ readonly surface_index: SurfaceIndex
4237
+ /**
4238
+ * The tiles that were changed.
4239
+ */
2961
4240
  readonly tiles: TileRead[]
2962
- /** Identifier of the event */
4241
+ /**
4242
+ * Identifier of the event
4243
+ */
2963
4244
  readonly name: typeof defines.events.script_raised_set_tiles
2964
- /** Tick the event was generated. */
4245
+ /**
4246
+ * Tick the event was generated.
4247
+ */
2965
4248
  readonly tick: uint
2966
4249
  }
2967
4250
 
@@ -2972,8 +4255,8 @@ type EventId<T extends table, F = unknown> = uint & {
2972
4255
  }
2973
4256
 
2974
4257
  /**
2975
- * An event id generated by {@link LuaBootstrap.generate_event_name LuaBootstrap::generate_event_name} and raiseable via
2976
- * {@link LuaBootstrap.raise_event LuaBootstrap::raise_event}.
4258
+ * An event id generated by {@link LuaBootstrap#generate_event_name LuaBootstrap::generate_event_name} and raiseable via
4259
+ * {@link LuaBootstrap#raise_event LuaBootstrap::raise_event}.
2977
4260
  */
2978
4261
  type CustomEventId<T extends table> = EventId<T> & {
2979
4262
  _customEventIdBrand: any