typed-factorio 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -241,11 +241,6 @@ type RaiseableEvents =
241
241
  | typeof defines.events.script_raised_revive
242
242
  | typeof defines.events.script_raised_set_tiles
243
243
 
244
- /** A custom event id created by {@link LuaBootstrap.generate_event_name}, with type data of the event. */
245
- type CustomEventId<T extends table> = uint & {
246
- _eventData: T
247
- }
248
-
249
244
  /**
250
245
  * Entry point for registering event handlers. It is accessible through the global object named `script`.
251
246
  *
@@ -336,14 +331,13 @@ interface LuaBootstrap {
336
331
  * @param f - The handler for this event. Passing `nil` will unregister it.
337
332
  * @param filters - The filters for this event. Can only be used when registering for individual events.
338
333
  */
339
- on_event<E extends keyof EventFilters>(
334
+ on_event<E extends EventId<any, table>>(
340
335
  event: E,
341
- f: ((data: EventTypes[E]) => void) | undefined,
342
- filters?: EventFilters[E][]
336
+ f: ((data: E["_eventData"]) => void) | undefined,
337
+ filters?: E["_filter"][]
343
338
  ): void
344
- on_event<E extends defines.events>(event: E | E[], f: ((data: EventTypes[E]) => void) | undefined): void
339
+ on_event<E extends EventId<any, any>>(event: E | E[], f: ((data: E["_eventData"]) => void) | undefined): void
345
340
  on_event(event: string, f: ((data: CustomInputEvent) => void) | undefined): void
346
- on_event<T extends table>(event: CustomEventId<T>, f: ((data: T) => void) | undefined): void
347
341
  /**
348
342
  * Register a handler to run every nth-tick(s). When the game is on tick 0 it will trigger all registered handlers.
349
343
  *
@@ -388,9 +382,8 @@ interface LuaBootstrap {
388
382
  * @param event - The event identifier to get a handler for.
389
383
  * @returns Reference to the function currently registered as the handler.
390
384
  */
391
- get_event_handler<E extends defines.events>(event: E): (data: EventTypes[E]) => void
385
+ get_event_handler<E extends EventId<any>>(event: E): (data: E["_eventData"]) => void
392
386
  get_event_handler(event: string): (data: CustomInputEvent) => void
393
- get_event_handler<T extends table>(event: CustomEventId<T>): (data: T) => void
394
387
  /**
395
388
  * Gets the mod event order as a string.
396
389
  *
@@ -427,7 +420,7 @@ interface LuaBootstrap {
427
420
  * @param event - ID of the event to filter.
428
421
  * @param filters - The filters or `nil` to clear them.
429
422
  */
430
- set_event_filter<E extends keyof EventFilters>(event: E, filters: EventFilters[E][] | undefined): void
423
+ set_event_filter<E extends EventId<any, table>>(event: E, filters: E["_filter"][] | undefined): void
431
424
  /**
432
425
  * Gets the filters for the given event.
433
426
  *
@@ -436,7 +429,7 @@ interface LuaBootstrap {
436
429
  * @param event - ID of the event to get.
437
430
  * @returns The filters or `nil` if none are defined.
438
431
  */
439
- get_event_filter<E extends keyof EventFilters>(event: E): EventFilters[E][] | undefined
432
+ get_event_filter<E extends EventId<any, table>>(event: E): E["_filter"][] | undefined
440
433
  /**
441
434
  * Raise an event. Only events generated with
442
435
  * {@link LuaBootstrap.generate_event_name LuaBootstrap::generate_event_name} and the following can be raised:
@@ -464,8 +457,10 @@ interface LuaBootstrap {
464
457
  * @param event - ID of the event to raise.
465
458
  * @param data - Table with extra data that will be passed to the event handler.
466
459
  */
467
- raise_event<T extends table>(event: CustomEventId<T>, data: T): void
468
- raise_event<E extends RaiseableEvents>(event: E, data: Omit<EventTypes[E], keyof EventData>): void
460
+ raise_event<E extends RaiseableEvents | CustomEventId<any>>(
461
+ event: E,
462
+ data: Omit<E["_eventData"], keyof EventData>
463
+ ): void
469
464
  /**
470
465
  * Raises {@link OnConsoleChatEvent on_console_chat} with the given parameters.
471
466
  *
@@ -2735,7 +2735,7 @@ type Alignment =
2735
2735
  */
2736
2736
  interface EventData {
2737
2737
  /** The identifier of the event this handler was registered to. */
2738
- readonly name: defines.events
2738
+ readonly name: EventId<EventData>
2739
2739
  /** The tick during which the event happened. */
2740
2740
  readonly tick: uint
2741
2741
  /** The name of the mod that raised the event if it was raised using {@link LuaBootstrap.raise_event LuaBootstrap::raise_event}. */
@@ -649,359 +649,438 @@ declare namespace defines {
649
649
  */
650
650
  namespace events {
651
651
  /** Event type: {@link OnTickEvent} */
652
- const on_tick: unique symbol
652
+ const on_tick: EventId<OnTickEvent>
653
653
  /** Event type: {@link OnGuiClickEvent} */
654
- const on_gui_click: unique symbol
654
+ const on_gui_click: EventId<OnGuiClickEvent>
655
655
  /** Event type: {@link OnGuiConfirmedEvent} */
656
- const on_gui_confirmed: unique symbol
656
+ const on_gui_confirmed: EventId<OnGuiConfirmedEvent>
657
657
  /** Event type: {@link OnGuiTextChangedEvent} */
658
- const on_gui_text_changed: unique symbol
658
+ const on_gui_text_changed: EventId<OnGuiTextChangedEvent>
659
659
  /** Event type: {@link OnGuiCheckedStateChangedEvent} */
660
- const on_gui_checked_state_changed: unique symbol
661
- /** Event type: {@link OnEntityDiedEvent} */
662
- const on_entity_died: unique symbol
663
- /** Event type: {@link OnPostEntityDiedEvent} */
664
- const on_post_entity_died: unique symbol
665
- /** Event type: {@link OnEntityDamagedEvent} */
666
- const on_entity_damaged: unique symbol
660
+ const on_gui_checked_state_changed: EventId<OnGuiCheckedStateChangedEvent>
661
+ /**
662
+ * Event type: {@link OnEntityDiedEvent}
663
+ *
664
+ * Event filter: {@link LuaEntityDiedEventFilter}
665
+ */
666
+ const on_entity_died: EventId<OnEntityDiedEvent, LuaEntityDiedEventFilter>
667
+ /**
668
+ * Event type: {@link OnPostEntityDiedEvent}
669
+ *
670
+ * Event filter: {@link LuaPostEntityDiedEventFilter}
671
+ */
672
+ const on_post_entity_died: EventId<OnPostEntityDiedEvent, LuaPostEntityDiedEventFilter>
673
+ /**
674
+ * Event type: {@link OnEntityDamagedEvent}
675
+ *
676
+ * Event filter: {@link LuaEntityDamagedEventFilter}
677
+ */
678
+ const on_entity_damaged: EventId<OnEntityDamagedEvent, LuaEntityDamagedEventFilter>
667
679
  /** Event type: {@link OnPickedUpItemEvent} */
668
- const on_picked_up_item: unique symbol
669
- /** Event type: {@link OnBuiltEntityEvent} */
670
- const on_built_entity: unique symbol
671
- /** Event type: {@link OnSectorScannedEvent} */
672
- const on_sector_scanned: unique symbol
680
+ const on_picked_up_item: EventId<OnPickedUpItemEvent>
681
+ /**
682
+ * Event type: {@link OnBuiltEntityEvent}
683
+ *
684
+ * Event filter: {@link LuaPlayerBuiltEntityEventFilter}
685
+ */
686
+ const on_built_entity: EventId<OnBuiltEntityEvent, LuaPlayerBuiltEntityEventFilter>
687
+ /**
688
+ * Event type: {@link OnSectorScannedEvent}
689
+ *
690
+ * Event filter: {@link LuaSectorScannedEventFilter}
691
+ */
692
+ const on_sector_scanned: EventId<OnSectorScannedEvent, LuaSectorScannedEventFilter>
673
693
  /** Event type: {@link OnPlayerMinedItemEvent} */
674
- const on_player_mined_item: unique symbol
694
+ const on_player_mined_item: EventId<OnPlayerMinedItemEvent>
675
695
  /** Event type: {@link OnPreBuildEvent} */
676
- const on_pre_build: unique symbol
696
+ const on_pre_build: EventId<OnPreBuildEvent>
677
697
  /** Event type: {@link OnRocketLaunchedEvent} */
678
- const on_rocket_launched: unique symbol
679
- /** Event type: {@link OnPrePlayerMinedItemEvent} */
680
- const on_pre_player_mined_item: unique symbol
698
+ const on_rocket_launched: EventId<OnRocketLaunchedEvent>
699
+ /**
700
+ * Event type: {@link OnPrePlayerMinedItemEvent}
701
+ *
702
+ * Event filter: {@link LuaPrePlayerMinedEntityEventFilter}
703
+ */
704
+ const on_pre_player_mined_item: EventId<OnPrePlayerMinedItemEvent, LuaPrePlayerMinedEntityEventFilter>
681
705
  /** Event type: {@link OnChunkGeneratedEvent} */
682
- const on_chunk_generated: unique symbol
706
+ const on_chunk_generated: EventId<OnChunkGeneratedEvent>
683
707
  /** Event type: {@link OnPlayerCraftedItemEvent} */
684
- const on_player_crafted_item: unique symbol
685
- /** Event type: {@link OnRobotBuiltEntityEvent} */
686
- const on_robot_built_entity: unique symbol
687
- /** Event type: {@link OnRobotPreMinedEvent} */
688
- const on_robot_pre_mined: unique symbol
708
+ const on_player_crafted_item: EventId<OnPlayerCraftedItemEvent>
709
+ /**
710
+ * Event type: {@link OnRobotBuiltEntityEvent}
711
+ *
712
+ * Event filter: {@link LuaRobotBuiltEntityEventFilter}
713
+ */
714
+ const on_robot_built_entity: EventId<OnRobotBuiltEntityEvent, LuaRobotBuiltEntityEventFilter>
715
+ /**
716
+ * Event type: {@link OnRobotPreMinedEvent}
717
+ *
718
+ * Event filter: {@link LuaPreRobotMinedEntityEventFilter}
719
+ */
720
+ const on_robot_pre_mined: EventId<OnRobotPreMinedEvent, LuaPreRobotMinedEntityEventFilter>
689
721
  /** Event type: {@link OnRobotMinedEvent} */
690
- const on_robot_mined: unique symbol
722
+ const on_robot_mined: EventId<OnRobotMinedEvent>
691
723
  /** Event type: {@link OnResearchStartedEvent} */
692
- const on_research_started: unique symbol
724
+ const on_research_started: EventId<OnResearchStartedEvent>
693
725
  /** Event type: {@link OnResearchFinishedEvent} */
694
- const on_research_finished: unique symbol
726
+ const on_research_finished: EventId<OnResearchFinishedEvent>
695
727
  /** Event type: {@link OnResearchReversedEvent} */
696
- const on_research_reversed: unique symbol
728
+ const on_research_reversed: EventId<OnResearchReversedEvent>
697
729
  /** Event type: {@link OnPlayerRotatedEntityEvent} */
698
- const on_player_rotated_entity: unique symbol
699
- /** Event type: {@link OnMarkedForDeconstructionEvent} */
700
- const on_marked_for_deconstruction: unique symbol
701
- /** Event type: {@link OnCancelledDeconstructionEvent} */
702
- const on_cancelled_deconstruction: unique symbol
730
+ const on_player_rotated_entity: EventId<OnPlayerRotatedEntityEvent>
731
+ /**
732
+ * Event type: {@link OnMarkedForDeconstructionEvent}
733
+ *
734
+ * Event filter: {@link LuaEntityMarkedForDeconstructionEventFilter}
735
+ */
736
+ const on_marked_for_deconstruction: EventId<
737
+ OnMarkedForDeconstructionEvent,
738
+ LuaEntityMarkedForDeconstructionEventFilter
739
+ >
740
+ /**
741
+ * Event type: {@link OnCancelledDeconstructionEvent}
742
+ *
743
+ * Event filter: {@link LuaEntityDeconstructionCancelledEventFilter}
744
+ */
745
+ const on_cancelled_deconstruction: EventId<
746
+ OnCancelledDeconstructionEvent,
747
+ LuaEntityDeconstructionCancelledEventFilter
748
+ >
703
749
  /** Event type: {@link OnTriggerCreatedEntityEvent} */
704
- const on_trigger_created_entity: unique symbol
750
+ const on_trigger_created_entity: EventId<OnTriggerCreatedEntityEvent>
705
751
  /** Event type: {@link OnTriggerFiredArtilleryEvent} */
706
- const on_trigger_fired_artillery: unique symbol
752
+ const on_trigger_fired_artillery: EventId<OnTriggerFiredArtilleryEvent>
707
753
  /** Event type: {@link OnTrainChangedStateEvent} */
708
- const on_train_changed_state: unique symbol
754
+ const on_train_changed_state: EventId<OnTrainChangedStateEvent>
709
755
  /** Event type: {@link OnPlayerCreatedEvent} */
710
- const on_player_created: unique symbol
756
+ const on_player_created: EventId<OnPlayerCreatedEvent>
711
757
  /** Event type: {@link OnResourceDepletedEvent} */
712
- const on_resource_depleted: unique symbol
758
+ const on_resource_depleted: EventId<OnResourceDepletedEvent>
713
759
  /** Event type: {@link OnPlayerDrivingChangedStateEvent} */
714
- const on_player_driving_changed_state: unique symbol
760
+ const on_player_driving_changed_state: EventId<OnPlayerDrivingChangedStateEvent>
715
761
  /** Event type: {@link OnForceCreatedEvent} */
716
- const on_force_created: unique symbol
762
+ const on_force_created: EventId<OnForceCreatedEvent>
717
763
  /** Event type: {@link OnForcesMergingEvent} */
718
- const on_forces_merging: unique symbol
764
+ const on_forces_merging: EventId<OnForcesMergingEvent>
719
765
  /** Event type: {@link OnPlayerCursorStackChangedEvent} */
720
- const on_player_cursor_stack_changed: unique symbol
766
+ const on_player_cursor_stack_changed: EventId<OnPlayerCursorStackChangedEvent>
721
767
  /** Event type: {@link OnPreEntitySettingsPastedEvent} */
722
- const on_pre_entity_settings_pasted: unique symbol
768
+ const on_pre_entity_settings_pasted: EventId<OnPreEntitySettingsPastedEvent>
723
769
  /** Event type: {@link OnEntitySettingsPastedEvent} */
724
- const on_entity_settings_pasted: unique symbol
770
+ const on_entity_settings_pasted: EventId<OnEntitySettingsPastedEvent>
725
771
  /** Event type: {@link OnPlayerMainInventoryChangedEvent} */
726
- const on_player_main_inventory_changed: unique symbol
772
+ const on_player_main_inventory_changed: EventId<OnPlayerMainInventoryChangedEvent>
727
773
  /** Event type: {@link OnPlayerArmorInventoryChangedEvent} */
728
- const on_player_armor_inventory_changed: unique symbol
774
+ const on_player_armor_inventory_changed: EventId<OnPlayerArmorInventoryChangedEvent>
729
775
  /** Event type: {@link OnPlayerAmmoInventoryChangedEvent} */
730
- const on_player_ammo_inventory_changed: unique symbol
776
+ const on_player_ammo_inventory_changed: EventId<OnPlayerAmmoInventoryChangedEvent>
731
777
  /** Event type: {@link OnPlayerGunInventoryChangedEvent} */
732
- const on_player_gun_inventory_changed: unique symbol
778
+ const on_player_gun_inventory_changed: EventId<OnPlayerGunInventoryChangedEvent>
733
779
  /** Event type: {@link OnPlayerPlacedEquipmentEvent} */
734
- const on_player_placed_equipment: unique symbol
780
+ const on_player_placed_equipment: EventId<OnPlayerPlacedEquipmentEvent>
735
781
  /** Event type: {@link OnPlayerRemovedEquipmentEvent} */
736
- const on_player_removed_equipment: unique symbol
782
+ const on_player_removed_equipment: EventId<OnPlayerRemovedEquipmentEvent>
737
783
  /** Event type: {@link OnPrePlayerDiedEvent} */
738
- const on_pre_player_died: unique symbol
784
+ const on_pre_player_died: EventId<OnPrePlayerDiedEvent>
739
785
  /** Event type: {@link OnPlayerDiedEvent} */
740
- const on_player_died: unique symbol
786
+ const on_player_died: EventId<OnPlayerDiedEvent>
741
787
  /** Event type: {@link OnPlayerRespawnedEvent} */
742
- const on_player_respawned: unique symbol
788
+ const on_player_respawned: EventId<OnPlayerRespawnedEvent>
743
789
  /** Event type: {@link OnPlayerJoinedGameEvent} */
744
- const on_player_joined_game: unique symbol
790
+ const on_player_joined_game: EventId<OnPlayerJoinedGameEvent>
745
791
  /** Event type: {@link OnPlayerLeftGameEvent} */
746
- const on_player_left_game: unique symbol
792
+ const on_player_left_game: EventId<OnPlayerLeftGameEvent>
747
793
  /** Event type: {@link OnPlayerBuiltTileEvent} */
748
- const on_player_built_tile: unique symbol
794
+ const on_player_built_tile: EventId<OnPlayerBuiltTileEvent>
749
795
  /** Event type: {@link OnPlayerMinedTileEvent} */
750
- const on_player_mined_tile: unique symbol
796
+ const on_player_mined_tile: EventId<OnPlayerMinedTileEvent>
751
797
  /** Event type: {@link OnRobotBuiltTileEvent} */
752
- const on_robot_built_tile: unique symbol
798
+ const on_robot_built_tile: EventId<OnRobotBuiltTileEvent>
753
799
  /** Event type: {@link OnRobotMinedTileEvent} */
754
- const on_robot_mined_tile: unique symbol
800
+ const on_robot_mined_tile: EventId<OnRobotMinedTileEvent>
755
801
  /** Event type: {@link OnPlayerSelectedAreaEvent} */
756
- const on_player_selected_area: unique symbol
802
+ const on_player_selected_area: EventId<OnPlayerSelectedAreaEvent>
757
803
  /** Event type: {@link OnPlayerAltSelectedAreaEvent} */
758
- const on_player_alt_selected_area: unique symbol
804
+ const on_player_alt_selected_area: EventId<OnPlayerAltSelectedAreaEvent>
759
805
  /** Event type: {@link OnPlayerChangedSurfaceEvent} */
760
- const on_player_changed_surface: unique symbol
806
+ const on_player_changed_surface: EventId<OnPlayerChangedSurfaceEvent>
761
807
  /** Event type: {@link OnSelectedEntityChangedEvent} */
762
- const on_selected_entity_changed: unique symbol
808
+ const on_selected_entity_changed: EventId<OnSelectedEntityChangedEvent>
763
809
  /** Event type: {@link OnMarketItemPurchasedEvent} */
764
- const on_market_item_purchased: unique symbol
810
+ const on_market_item_purchased: EventId<OnMarketItemPurchasedEvent>
765
811
  /** Event type: {@link OnPlayerDroppedItemEvent} */
766
- const on_player_dropped_item: unique symbol
812
+ const on_player_dropped_item: EventId<OnPlayerDroppedItemEvent>
767
813
  /** Event type: {@link OnBiterBaseBuiltEvent} */
768
- const on_biter_base_built: unique symbol
814
+ const on_biter_base_built: EventId<OnBiterBaseBuiltEvent>
769
815
  /** Event type: {@link OnPlayerChangedForceEvent} */
770
- const on_player_changed_force: unique symbol
816
+ const on_player_changed_force: EventId<OnPlayerChangedForceEvent>
771
817
  /** Event type: {@link OnEntityRenamedEvent} */
772
- const on_entity_renamed: unique symbol
818
+ const on_entity_renamed: EventId<OnEntityRenamedEvent>
773
819
  /** Event type: {@link OnGuiSelectionStateChangedEvent} */
774
- const on_gui_selection_state_changed: unique symbol
820
+ const on_gui_selection_state_changed: EventId<OnGuiSelectionStateChangedEvent>
775
821
  /** Event type: {@link OnRuntimeModSettingChangedEvent} */
776
- const on_runtime_mod_setting_changed: unique symbol
822
+ const on_runtime_mod_setting_changed: EventId<OnRuntimeModSettingChangedEvent>
777
823
  /** Event type: {@link OnDifficultySettingsChangedEvent} */
778
- const on_difficulty_settings_changed: unique symbol
824
+ const on_difficulty_settings_changed: EventId<OnDifficultySettingsChangedEvent>
779
825
  /** Event type: {@link OnSurfaceCreatedEvent} */
780
- const on_surface_created: unique symbol
826
+ const on_surface_created: EventId<OnSurfaceCreatedEvent>
781
827
  /** Event type: {@link OnSurfaceDeletedEvent} */
782
- const on_surface_deleted: unique symbol
828
+ const on_surface_deleted: EventId<OnSurfaceDeletedEvent>
783
829
  /** Event type: {@link OnPreSurfaceDeletedEvent} */
784
- const on_pre_surface_deleted: unique symbol
785
- /** Event type: {@link OnPlayerMinedEntityEvent} */
786
- const on_player_mined_entity: unique symbol
787
- /** Event type: {@link OnRobotMinedEntityEvent} */
788
- const on_robot_mined_entity: unique symbol
830
+ const on_pre_surface_deleted: EventId<OnPreSurfaceDeletedEvent>
831
+ /**
832
+ * Event type: {@link OnPlayerMinedEntityEvent}
833
+ *
834
+ * Event filter: {@link LuaPlayerMinedEntityEventFilter}
835
+ */
836
+ const on_player_mined_entity: EventId<OnPlayerMinedEntityEvent, LuaPlayerMinedEntityEventFilter>
837
+ /**
838
+ * Event type: {@link OnRobotMinedEntityEvent}
839
+ *
840
+ * Event filter: {@link LuaRobotMinedEntityEventFilter}
841
+ */
842
+ const on_robot_mined_entity: EventId<OnRobotMinedEntityEvent, LuaRobotMinedEntityEventFilter>
789
843
  /** Event type: {@link OnTrainCreatedEvent} */
790
- const on_train_created: unique symbol
844
+ const on_train_created: EventId<OnTrainCreatedEvent>
791
845
  /** Event type: {@link OnGuiElemChangedEvent} */
792
- const on_gui_elem_changed: unique symbol
846
+ const on_gui_elem_changed: EventId<OnGuiElemChangedEvent>
793
847
  /** Event type: {@link OnPlayerSetupBlueprintEvent} */
794
- const on_player_setup_blueprint: unique symbol
848
+ const on_player_setup_blueprint: EventId<OnPlayerSetupBlueprintEvent>
795
849
  /** Event type: {@link OnPlayerDeconstructedAreaEvent} */
796
- const on_player_deconstructed_area: unique symbol
850
+ const on_player_deconstructed_area: EventId<OnPlayerDeconstructedAreaEvent>
797
851
  /** Event type: {@link OnPlayerConfiguredBlueprintEvent} */
798
- const on_player_configured_blueprint: unique symbol
852
+ const on_player_configured_blueprint: EventId<OnPlayerConfiguredBlueprintEvent>
799
853
  /** Event type: {@link OnConsoleChatEvent} */
800
- const on_console_chat: unique symbol
854
+ const on_console_chat: EventId<OnConsoleChatEvent>
801
855
  /** Event type: {@link OnConsoleCommandEvent} */
802
- const on_console_command: unique symbol
856
+ const on_console_command: EventId<OnConsoleCommandEvent>
803
857
  /** Event type: {@link OnPlayerRemovedEvent} */
804
- const on_player_removed: unique symbol
858
+ const on_player_removed: EventId<OnPlayerRemovedEvent>
805
859
  /** Event type: {@link OnPrePlayerRemovedEvent} */
806
- const on_pre_player_removed: unique symbol
860
+ const on_pre_player_removed: EventId<OnPrePlayerRemovedEvent>
807
861
  /** Event type: {@link OnPlayerUsedCapsuleEvent} */
808
- const on_player_used_capsule: unique symbol
809
- /** Event type: {@link ScriptRaisedBuiltEvent} */
810
- const script_raised_built: unique symbol
811
- /** Event type: {@link ScriptRaisedDestroyEvent} */
812
- const script_raised_destroy: unique symbol
813
- /** Event type: {@link ScriptRaisedReviveEvent} */
814
- const script_raised_revive: unique symbol
862
+ const on_player_used_capsule: EventId<OnPlayerUsedCapsuleEvent>
863
+ /**
864
+ * Event type: {@link ScriptRaisedBuiltEvent}
865
+ *
866
+ * Event filter: {@link LuaScriptRaisedBuiltEventFilter}
867
+ */
868
+ const script_raised_built: EventId<ScriptRaisedBuiltEvent, LuaScriptRaisedBuiltEventFilter>
869
+ /**
870
+ * Event type: {@link ScriptRaisedDestroyEvent}
871
+ *
872
+ * Event filter: {@link LuaScriptRaisedDestroyEventFilter}
873
+ */
874
+ const script_raised_destroy: EventId<ScriptRaisedDestroyEvent, LuaScriptRaisedDestroyEventFilter>
875
+ /**
876
+ * Event type: {@link ScriptRaisedReviveEvent}
877
+ *
878
+ * Event filter: {@link LuaScriptRaisedReviveEventFilter}
879
+ */
880
+ const script_raised_revive: EventId<ScriptRaisedReviveEvent, LuaScriptRaisedReviveEventFilter>
815
881
  /** Event type: {@link ScriptRaisedSetTilesEvent} */
816
- const script_raised_set_tiles: unique symbol
882
+ const script_raised_set_tiles: EventId<ScriptRaisedSetTilesEvent>
817
883
  /** Event type: {@link OnPlayerPromotedEvent} */
818
- const on_player_promoted: unique symbol
884
+ const on_player_promoted: EventId<OnPlayerPromotedEvent>
819
885
  /** Event type: {@link OnPlayerDemotedEvent} */
820
- const on_player_demoted: unique symbol
886
+ const on_player_demoted: EventId<OnPlayerDemotedEvent>
821
887
  /** Event type: {@link OnCombatRobotExpiredEvent} */
822
- const on_combat_robot_expired: unique symbol
888
+ const on_combat_robot_expired: EventId<OnCombatRobotExpiredEvent>
823
889
  /** Event type: {@link OnWorkerRobotExpiredEvent} */
824
- const on_worker_robot_expired: unique symbol
890
+ const on_worker_robot_expired: EventId<OnWorkerRobotExpiredEvent>
825
891
  /** Event type: {@link OnPlayerChangedPositionEvent} */
826
- const on_player_changed_position: unique symbol
892
+ const on_player_changed_position: EventId<OnPlayerChangedPositionEvent>
827
893
  /** Event type: {@link OnModItemOpenedEvent} */
828
- const on_mod_item_opened: unique symbol
894
+ const on_mod_item_opened: EventId<OnModItemOpenedEvent>
829
895
  /** Event type: {@link OnGuiOpenedEvent} */
830
- const on_gui_opened: unique symbol
896
+ const on_gui_opened: EventId<OnGuiOpenedEvent>
831
897
  /** Event type: {@link OnGuiClosedEvent} */
832
- const on_gui_closed: unique symbol
898
+ const on_gui_closed: EventId<OnGuiClosedEvent>
833
899
  /** Event type: {@link OnGuiValueChangedEvent} */
834
- const on_gui_value_changed: unique symbol
900
+ const on_gui_value_changed: EventId<OnGuiValueChangedEvent>
835
901
  /** Event type: {@link OnPlayerMutedEvent} */
836
- const on_player_muted: unique symbol
902
+ const on_player_muted: EventId<OnPlayerMutedEvent>
837
903
  /** Event type: {@link OnPlayerUnmutedEvent} */
838
- const on_player_unmuted: unique symbol
904
+ const on_player_unmuted: EventId<OnPlayerUnmutedEvent>
839
905
  /** Event type: {@link OnPlayerCheatModeEnabledEvent} */
840
- const on_player_cheat_mode_enabled: unique symbol
906
+ const on_player_cheat_mode_enabled: EventId<OnPlayerCheatModeEnabledEvent>
841
907
  /** Event type: {@link OnPlayerCheatModeDisabledEvent} */
842
- const on_player_cheat_mode_disabled: unique symbol
908
+ const on_player_cheat_mode_disabled: EventId<OnPlayerCheatModeDisabledEvent>
843
909
  /** Event type: {@link OnCharacterCorpseExpiredEvent} */
844
- const on_character_corpse_expired: unique symbol
845
- /** Event type: {@link OnPreGhostDeconstructedEvent} */
846
- const on_pre_ghost_deconstructed: unique symbol
910
+ const on_character_corpse_expired: EventId<OnCharacterCorpseExpiredEvent>
911
+ /**
912
+ * Event type: {@link OnPreGhostDeconstructedEvent}
913
+ *
914
+ * Event filter: {@link LuaPreGhostDeconstructedEventFilter}
915
+ */
916
+ const on_pre_ghost_deconstructed: EventId<OnPreGhostDeconstructedEvent, LuaPreGhostDeconstructedEventFilter>
847
917
  /** Event type: {@link OnPlayerPipetteEvent} */
848
- const on_player_pipette: unique symbol
918
+ const on_player_pipette: EventId<OnPlayerPipetteEvent>
849
919
  /** Event type: {@link OnPlayerDisplayResolutionChangedEvent} */
850
- const on_player_display_resolution_changed: unique symbol
920
+ const on_player_display_resolution_changed: EventId<OnPlayerDisplayResolutionChangedEvent>
851
921
  /** Event type: {@link OnPlayerDisplayScaleChangedEvent} */
852
- const on_player_display_scale_changed: unique symbol
922
+ const on_player_display_scale_changed: EventId<OnPlayerDisplayScaleChangedEvent>
853
923
  /** Event type: {@link OnPrePlayerCraftedItemEvent} */
854
- const on_pre_player_crafted_item: unique symbol
924
+ const on_pre_player_crafted_item: EventId<OnPrePlayerCraftedItemEvent>
855
925
  /** Event type: {@link OnPlayerCancelledCraftingEvent} */
856
- const on_player_cancelled_crafting: unique symbol
926
+ const on_player_cancelled_crafting: EventId<OnPlayerCancelledCraftingEvent>
857
927
  /** Event type: {@link OnChunkChartedEvent} */
858
- const on_chunk_charted: unique symbol
928
+ const on_chunk_charted: EventId<OnChunkChartedEvent>
859
929
  /** Event type: {@link OnTechnologyEffectsResetEvent} */
860
- const on_technology_effects_reset: unique symbol
930
+ const on_technology_effects_reset: EventId<OnTechnologyEffectsResetEvent>
861
931
  /** Event type: {@link OnForceResetEvent} */
862
- const on_force_reset: unique symbol
932
+ const on_force_reset: EventId<OnForceResetEvent>
863
933
  /** Event type: {@link OnLandMineArmedEvent} */
864
- const on_land_mine_armed: unique symbol
934
+ const on_land_mine_armed: EventId<OnLandMineArmedEvent>
865
935
  /** Event type: {@link OnForcesMergedEvent} */
866
- const on_forces_merged: unique symbol
936
+ const on_forces_merged: EventId<OnForcesMergedEvent>
867
937
  /** Event type: {@link OnPlayerTrashInventoryChangedEvent} */
868
- const on_player_trash_inventory_changed: unique symbol
938
+ const on_player_trash_inventory_changed: EventId<OnPlayerTrashInventoryChangedEvent>
869
939
  /** Event type: {@link OnPrePlayerLeftGameEvent} */
870
- const on_pre_player_left_game: unique symbol
940
+ const on_pre_player_left_game: EventId<OnPrePlayerLeftGameEvent>
871
941
  /** Event type: {@link OnPreSurfaceClearedEvent} */
872
- const on_pre_surface_cleared: unique symbol
942
+ const on_pre_surface_cleared: EventId<OnPreSurfaceClearedEvent>
873
943
  /** Event type: {@link OnSurfaceClearedEvent} */
874
- const on_surface_cleared: unique symbol
944
+ const on_surface_cleared: EventId<OnSurfaceClearedEvent>
875
945
  /** Event type: {@link OnChunkDeletedEvent} */
876
- const on_chunk_deleted: unique symbol
946
+ const on_chunk_deleted: EventId<OnChunkDeletedEvent>
877
947
  /** Event type: {@link OnPreChunkDeletedEvent} */
878
- const on_pre_chunk_deleted: unique symbol
948
+ const on_pre_chunk_deleted: EventId<OnPreChunkDeletedEvent>
879
949
  /** Event type: {@link OnTrainScheduleChangedEvent} */
880
- const on_train_schedule_changed: unique symbol
950
+ const on_train_schedule_changed: EventId<OnTrainScheduleChangedEvent>
881
951
  /** Event type: {@link OnPlayerBannedEvent} */
882
- const on_player_banned: unique symbol
952
+ const on_player_banned: EventId<OnPlayerBannedEvent>
883
953
  /** Event type: {@link OnPlayerKickedEvent} */
884
- const on_player_kicked: unique symbol
954
+ const on_player_kicked: EventId<OnPlayerKickedEvent>
885
955
  /** Event type: {@link OnPlayerUnbannedEvent} */
886
- const on_player_unbanned: unique symbol
956
+ const on_player_unbanned: EventId<OnPlayerUnbannedEvent>
887
957
  /** Event type: {@link OnRocketLaunchOrderedEvent} */
888
- const on_rocket_launch_ordered: unique symbol
958
+ const on_rocket_launch_ordered: EventId<OnRocketLaunchOrderedEvent>
889
959
  /** Event type: {@link OnScriptPathRequestFinishedEvent} */
890
- const on_script_path_request_finished: unique symbol
960
+ const on_script_path_request_finished: EventId<OnScriptPathRequestFinishedEvent>
891
961
  /** Event type: {@link OnAiCommandCompletedEvent} */
892
- const on_ai_command_completed: unique symbol
893
- /** Event type: {@link OnMarkedForUpgradeEvent} */
894
- const on_marked_for_upgrade: unique symbol
895
- /** Event type: {@link OnCancelledUpgradeEvent} */
896
- const on_cancelled_upgrade: unique symbol
962
+ const on_ai_command_completed: EventId<OnAiCommandCompletedEvent>
963
+ /**
964
+ * Event type: {@link OnMarkedForUpgradeEvent}
965
+ *
966
+ * Event filter: {@link LuaEntityMarkedForUpgradeEventFilter}
967
+ */
968
+ const on_marked_for_upgrade: EventId<OnMarkedForUpgradeEvent, LuaEntityMarkedForUpgradeEventFilter>
969
+ /**
970
+ * Event type: {@link OnCancelledUpgradeEvent}
971
+ *
972
+ * Event filter: {@link LuaUpgradeCancelledEventFilter}
973
+ */
974
+ const on_cancelled_upgrade: EventId<OnCancelledUpgradeEvent, LuaUpgradeCancelledEventFilter>
897
975
  /** Event type: {@link OnPlayerToggledMapEditorEvent} */
898
- const on_player_toggled_map_editor: unique symbol
899
- /** Event type: {@link OnEntityClonedEvent} */
900
- const on_entity_cloned: unique symbol
976
+ const on_player_toggled_map_editor: EventId<OnPlayerToggledMapEditorEvent>
977
+ /**
978
+ * Event type: {@link OnEntityClonedEvent}
979
+ *
980
+ * Event filter: {@link LuaEntityClonedEventFilter}
981
+ */
982
+ const on_entity_cloned: EventId<OnEntityClonedEvent, LuaEntityClonedEventFilter>
901
983
  /** Event type: {@link OnAreaClonedEvent} */
902
- const on_area_cloned: unique symbol
984
+ const on_area_cloned: EventId<OnAreaClonedEvent>
903
985
  /** Event type: {@link OnBrushClonedEvent} */
904
- const on_brush_cloned: unique symbol
986
+ const on_brush_cloned: EventId<OnBrushClonedEvent>
905
987
  /** Event type: {@link OnGameCreatedFromScenarioEvent} */
906
- const on_game_created_from_scenario: unique symbol
988
+ const on_game_created_from_scenario: EventId<OnGameCreatedFromScenarioEvent>
907
989
  /** Event type: {@link OnSurfaceImportedEvent} */
908
- const on_surface_imported: unique symbol
990
+ const on_surface_imported: EventId<OnSurfaceImportedEvent>
909
991
  /** Event type: {@link OnSurfaceRenamedEvent} */
910
- const on_surface_renamed: unique symbol
992
+ const on_surface_renamed: EventId<OnSurfaceRenamedEvent>
911
993
  /** Event type: {@link OnPlayerToggledAltModeEvent} */
912
- const on_player_toggled_alt_mode: unique symbol
913
- /** Event type: {@link OnPlayerRepairedEntityEvent} */
914
- const on_player_repaired_entity: unique symbol
994
+ const on_player_toggled_alt_mode: EventId<OnPlayerToggledAltModeEvent>
995
+ /**
996
+ * Event type: {@link OnPlayerRepairedEntityEvent}
997
+ *
998
+ * Event filter: {@link LuaPlayerRepairedEntityEventFilter}
999
+ */
1000
+ const on_player_repaired_entity: EventId<OnPlayerRepairedEntityEvent, LuaPlayerRepairedEntityEventFilter>
915
1001
  /** Event type: {@link OnPlayerFastTransferredEvent} */
916
- const on_player_fast_transferred: unique symbol
1002
+ const on_player_fast_transferred: EventId<OnPlayerFastTransferredEvent>
917
1003
  /** Event type: {@link OnPreRobotExplodedCliffEvent} */
918
- const on_pre_robot_exploded_cliff: unique symbol
1004
+ const on_pre_robot_exploded_cliff: EventId<OnPreRobotExplodedCliffEvent>
919
1005
  /** Event type: {@link OnRobotExplodedCliffEvent} */
920
- const on_robot_exploded_cliff: unique symbol
1006
+ const on_robot_exploded_cliff: EventId<OnRobotExplodedCliffEvent>
921
1007
  /** Event type: {@link OnEntitySpawnedEvent} */
922
- const on_entity_spawned: unique symbol
1008
+ const on_entity_spawned: EventId<OnEntitySpawnedEvent>
923
1009
  /** Event type: {@link OnCutsceneWaypointReachedEvent} */
924
- const on_cutscene_waypoint_reached: unique symbol
1010
+ const on_cutscene_waypoint_reached: EventId<OnCutsceneWaypointReachedEvent>
925
1011
  /** Event type: {@link OnUnitGroupCreatedEvent} */
926
- const on_unit_group_created: unique symbol
1012
+ const on_unit_group_created: EventId<OnUnitGroupCreatedEvent>
927
1013
  /** Event type: {@link OnUnitAddedToGroupEvent} */
928
- const on_unit_added_to_group: unique symbol
1014
+ const on_unit_added_to_group: EventId<OnUnitAddedToGroupEvent>
929
1015
  /** Event type: {@link OnUnitRemovedFromGroupEvent} */
930
- const on_unit_removed_from_group: unique symbol
1016
+ const on_unit_removed_from_group: EventId<OnUnitRemovedFromGroupEvent>
931
1017
  /** Event type: {@link OnUnitGroupFinishedGatheringEvent} */
932
- const on_unit_group_finished_gathering: unique symbol
1018
+ const on_unit_group_finished_gathering: EventId<OnUnitGroupFinishedGatheringEvent>
933
1019
  /** Event type: {@link OnBuildBaseArrivedEvent} */
934
- const on_build_base_arrived: unique symbol
1020
+ const on_build_base_arrived: EventId<OnBuildBaseArrivedEvent>
935
1021
  /** Event type: {@link OnChartTagAddedEvent} */
936
- const on_chart_tag_added: unique symbol
1022
+ const on_chart_tag_added: EventId<OnChartTagAddedEvent>
937
1023
  /** Event type: {@link OnChartTagModifiedEvent} */
938
- const on_chart_tag_modified: unique symbol
1024
+ const on_chart_tag_modified: EventId<OnChartTagModifiedEvent>
939
1025
  /** Event type: {@link OnChartTagRemovedEvent} */
940
- const on_chart_tag_removed: unique symbol
1026
+ const on_chart_tag_removed: EventId<OnChartTagRemovedEvent>
941
1027
  /** Event type: {@link OnLuaShortcutEvent} */
942
- const on_lua_shortcut: unique symbol
1028
+ const on_lua_shortcut: EventId<OnLuaShortcutEvent>
943
1029
  /** Event type: {@link OnGuiLocationChangedEvent} */
944
- const on_gui_location_changed: unique symbol
1030
+ const on_gui_location_changed: EventId<OnGuiLocationChangedEvent>
945
1031
  /** Event type: {@link OnGuiSelectedTabChangedEvent} */
946
- const on_gui_selected_tab_changed: unique symbol
1032
+ const on_gui_selected_tab_changed: EventId<OnGuiSelectedTabChangedEvent>
947
1033
  /** Event type: {@link OnGuiSwitchStateChangedEvent} */
948
- const on_gui_switch_state_changed: unique symbol
1034
+ const on_gui_switch_state_changed: EventId<OnGuiSwitchStateChangedEvent>
949
1035
  /** Event type: {@link OnForceCeaseFireChangedEvent} */
950
- const on_force_cease_fire_changed: unique symbol
1036
+ const on_force_cease_fire_changed: EventId<OnForceCeaseFireChangedEvent>
951
1037
  /** Event type: {@link OnForceFriendsChangedEvent} */
952
- const on_force_friends_changed: unique symbol
1038
+ const on_force_friends_changed: EventId<OnForceFriendsChangedEvent>
953
1039
  /** Event type: {@link OnStringTranslatedEvent} */
954
- const on_string_translated: unique symbol
1040
+ const on_string_translated: EventId<OnStringTranslatedEvent>
955
1041
  /** Event type: {@link OnScriptTriggerEffectEvent} */
956
- const on_script_trigger_effect: unique symbol
1042
+ const on_script_trigger_effect: EventId<OnScriptTriggerEffectEvent>
957
1043
  /** Event type: {@link OnPlayerSetQuickBarSlotEvent} */
958
- const on_player_set_quick_bar_slot: unique symbol
1044
+ const on_player_set_quick_bar_slot: EventId<OnPlayerSetQuickBarSlotEvent>
959
1045
  /** Event type: {@link OnPrePlayerToggledMapEditorEvent} */
960
- const on_pre_player_toggled_map_editor: unique symbol
1046
+ const on_pre_player_toggled_map_editor: EventId<OnPrePlayerToggledMapEditorEvent>
961
1047
  /** Event type: {@link OnPreScriptInventoryResizedEvent} */
962
- const on_pre_script_inventory_resized: unique symbol
1048
+ const on_pre_script_inventory_resized: EventId<OnPreScriptInventoryResizedEvent>
963
1049
  /** Event type: {@link OnScriptInventoryResizedEvent} */
964
- const on_script_inventory_resized: unique symbol
1050
+ const on_script_inventory_resized: EventId<OnScriptInventoryResizedEvent>
965
1051
  /** Event type: {@link OnEntityDestroyedEvent} */
966
- const on_entity_destroyed: unique symbol
1052
+ const on_entity_destroyed: EventId<OnEntityDestroyedEvent>
967
1053
  /** Event type: {@link OnPlayerClickedGpsTagEvent} */
968
- const on_player_clicked_gps_tag: unique symbol
1054
+ const on_player_clicked_gps_tag: EventId<OnPlayerClickedGpsTagEvent>
969
1055
  /** Event type: {@link OnPlayerFlushedFluidEvent} */
970
- const on_player_flushed_fluid: unique symbol
1056
+ const on_player_flushed_fluid: EventId<OnPlayerFlushedFluidEvent>
971
1057
  /** Event type: {@link OnPermissionGroupEditedEvent} */
972
- const on_permission_group_edited: unique symbol
1058
+ const on_permission_group_edited: EventId<OnPermissionGroupEditedEvent>
973
1059
  /** Event type: {@link OnPrePermissionStringImportedEvent} */
974
- const on_pre_permission_string_imported: unique symbol
1060
+ const on_pre_permission_string_imported: EventId<OnPrePermissionStringImportedEvent>
975
1061
  /** Event type: {@link OnPermissionStringImportedEvent} */
976
- const on_permission_string_imported: unique symbol
1062
+ const on_permission_string_imported: EventId<OnPermissionStringImportedEvent>
977
1063
  /** Event type: {@link OnPrePermissionGroupDeletedEvent} */
978
- const on_pre_permission_group_deleted: unique symbol
1064
+ const on_pre_permission_group_deleted: EventId<OnPrePermissionGroupDeletedEvent>
979
1065
  /** Event type: {@link OnPermissionGroupDeletedEvent} */
980
- const on_permission_group_deleted: unique symbol
1066
+ const on_permission_group_deleted: EventId<OnPermissionGroupDeletedEvent>
981
1067
  /** Event type: {@link OnPermissionGroupAddedEvent} */
982
- const on_permission_group_added: unique symbol
1068
+ const on_permission_group_added: EventId<OnPermissionGroupAddedEvent>
983
1069
  /** Event type: {@link OnCutsceneCancelledEvent} */
984
- const on_cutscene_cancelled: unique symbol
1070
+ const on_cutscene_cancelled: EventId<OnCutsceneCancelledEvent>
985
1071
  /** Event type: {@link OnPlayerConfiguredSpiderRemoteEvent} */
986
- const on_player_configured_spider_remote: unique symbol
1072
+ const on_player_configured_spider_remote: EventId<OnPlayerConfiguredSpiderRemoteEvent>
987
1073
  /** Event type: {@link OnPlayerUsedSpiderRemoteEvent} */
988
- const on_player_used_spider_remote: unique symbol
1074
+ const on_player_used_spider_remote: EventId<OnPlayerUsedSpiderRemoteEvent>
989
1075
  /** Event type: {@link OnSpiderCommandCompletedEvent} */
990
- const on_spider_command_completed: unique symbol
1076
+ const on_spider_command_completed: EventId<OnSpiderCommandCompletedEvent>
991
1077
  /** Event type: {@link OnEntityLogisticSlotChangedEvent} */
992
- const on_entity_logistic_slot_changed: unique symbol
1078
+ const on_entity_logistic_slot_changed: EventId<OnEntityLogisticSlotChangedEvent>
993
1079
  /** Event type: {@link OnEquipmentInsertedEvent} */
994
- const on_equipment_inserted: unique symbol
1080
+ const on_equipment_inserted: EventId<OnEquipmentInsertedEvent>
995
1081
  /** Event type: {@link OnEquipmentRemovedEvent} */
996
- const on_equipment_removed: unique symbol
1082
+ const on_equipment_removed: EventId<OnEquipmentRemovedEvent>
997
1083
  }
998
- /**
999
- * See the {@link https://lua-api.factorio.com/next/events.html events page} for more info on what events contain and
1000
- * when they get raised.
1001
- *
1002
- * {@link https://lua-api.factorio.com/next/defines.html#defines.events View documentation}
1003
- */
1004
- type events = typeof events[keyof typeof events]
1005
1084
  enum flow_precision_index {
1006
1085
  five_seconds,
1007
1086
  one_minute,
@@ -15,7 +15,7 @@ interface CustomInputEvent {
15
15
  /** Information about the prototype that is selected when the custom input is used. `nil` if none is selected. */
16
16
  readonly selected_prototype?: SelectedPrototypeData
17
17
  /** Identifier of the event */
18
- readonly name: defines.events
18
+ readonly name: string
19
19
  /** Tick the event was generated. */
20
20
  readonly tick: uint
21
21
  }
@@ -2961,201 +2961,16 @@ interface ScriptRaisedSetTilesEvent {
2961
2961
  readonly tick: uint
2962
2962
  }
2963
2963
 
2964
- interface EventTypes {
2965
- [defines.events.on_tick]: OnTickEvent
2966
- [defines.events.on_gui_click]: OnGuiClickEvent
2967
- [defines.events.on_gui_confirmed]: OnGuiConfirmedEvent
2968
- [defines.events.on_gui_text_changed]: OnGuiTextChangedEvent
2969
- [defines.events.on_gui_checked_state_changed]: OnGuiCheckedStateChangedEvent
2970
- [defines.events.on_entity_died]: OnEntityDiedEvent
2971
- [defines.events.on_post_entity_died]: OnPostEntityDiedEvent
2972
- [defines.events.on_entity_damaged]: OnEntityDamagedEvent
2973
- [defines.events.on_picked_up_item]: OnPickedUpItemEvent
2974
- [defines.events.on_built_entity]: OnBuiltEntityEvent
2975
- [defines.events.on_sector_scanned]: OnSectorScannedEvent
2976
- [defines.events.on_player_mined_item]: OnPlayerMinedItemEvent
2977
- [defines.events.on_pre_build]: OnPreBuildEvent
2978
- [defines.events.on_rocket_launched]: OnRocketLaunchedEvent
2979
- [defines.events.on_pre_player_mined_item]: OnPrePlayerMinedItemEvent
2980
- [defines.events.on_chunk_generated]: OnChunkGeneratedEvent
2981
- [defines.events.on_player_crafted_item]: OnPlayerCraftedItemEvent
2982
- [defines.events.on_robot_built_entity]: OnRobotBuiltEntityEvent
2983
- [defines.events.on_robot_pre_mined]: OnRobotPreMinedEvent
2984
- [defines.events.on_robot_mined]: OnRobotMinedEvent
2985
- [defines.events.on_research_started]: OnResearchStartedEvent
2986
- [defines.events.on_research_finished]: OnResearchFinishedEvent
2987
- [defines.events.on_research_reversed]: OnResearchReversedEvent
2988
- [defines.events.on_player_rotated_entity]: OnPlayerRotatedEntityEvent
2989
- [defines.events.on_marked_for_deconstruction]: OnMarkedForDeconstructionEvent
2990
- [defines.events.on_cancelled_deconstruction]: OnCancelledDeconstructionEvent
2991
- [defines.events.on_trigger_created_entity]: OnTriggerCreatedEntityEvent
2992
- [defines.events.on_trigger_fired_artillery]: OnTriggerFiredArtilleryEvent
2993
- [defines.events.on_train_changed_state]: OnTrainChangedStateEvent
2994
- [defines.events.on_player_created]: OnPlayerCreatedEvent
2995
- [defines.events.on_resource_depleted]: OnResourceDepletedEvent
2996
- [defines.events.on_player_driving_changed_state]: OnPlayerDrivingChangedStateEvent
2997
- [defines.events.on_force_created]: OnForceCreatedEvent
2998
- [defines.events.on_forces_merging]: OnForcesMergingEvent
2999
- [defines.events.on_player_cursor_stack_changed]: OnPlayerCursorStackChangedEvent
3000
- [defines.events.on_pre_entity_settings_pasted]: OnPreEntitySettingsPastedEvent
3001
- [defines.events.on_entity_settings_pasted]: OnEntitySettingsPastedEvent
3002
- [defines.events.on_player_main_inventory_changed]: OnPlayerMainInventoryChangedEvent
3003
- [defines.events.on_player_armor_inventory_changed]: OnPlayerArmorInventoryChangedEvent
3004
- [defines.events.on_player_ammo_inventory_changed]: OnPlayerAmmoInventoryChangedEvent
3005
- [defines.events.on_player_gun_inventory_changed]: OnPlayerGunInventoryChangedEvent
3006
- [defines.events.on_player_placed_equipment]: OnPlayerPlacedEquipmentEvent
3007
- [defines.events.on_player_removed_equipment]: OnPlayerRemovedEquipmentEvent
3008
- [defines.events.on_pre_player_died]: OnPrePlayerDiedEvent
3009
- [defines.events.on_player_died]: OnPlayerDiedEvent
3010
- [defines.events.on_player_respawned]: OnPlayerRespawnedEvent
3011
- [defines.events.on_player_joined_game]: OnPlayerJoinedGameEvent
3012
- [defines.events.on_player_left_game]: OnPlayerLeftGameEvent
3013
- [defines.events.on_player_built_tile]: OnPlayerBuiltTileEvent
3014
- [defines.events.on_player_mined_tile]: OnPlayerMinedTileEvent
3015
- [defines.events.on_robot_built_tile]: OnRobotBuiltTileEvent
3016
- [defines.events.on_robot_mined_tile]: OnRobotMinedTileEvent
3017
- [defines.events.on_player_selected_area]: OnPlayerSelectedAreaEvent
3018
- [defines.events.on_player_alt_selected_area]: OnPlayerAltSelectedAreaEvent
3019
- [defines.events.on_player_changed_surface]: OnPlayerChangedSurfaceEvent
3020
- [defines.events.on_selected_entity_changed]: OnSelectedEntityChangedEvent
3021
- [defines.events.on_market_item_purchased]: OnMarketItemPurchasedEvent
3022
- [defines.events.on_player_dropped_item]: OnPlayerDroppedItemEvent
3023
- [defines.events.on_biter_base_built]: OnBiterBaseBuiltEvent
3024
- [defines.events.on_player_changed_force]: OnPlayerChangedForceEvent
3025
- [defines.events.on_entity_renamed]: OnEntityRenamedEvent
3026
- [defines.events.on_gui_selection_state_changed]: OnGuiSelectionStateChangedEvent
3027
- [defines.events.on_runtime_mod_setting_changed]: OnRuntimeModSettingChangedEvent
3028
- [defines.events.on_difficulty_settings_changed]: OnDifficultySettingsChangedEvent
3029
- [defines.events.on_surface_created]: OnSurfaceCreatedEvent
3030
- [defines.events.on_surface_deleted]: OnSurfaceDeletedEvent
3031
- [defines.events.on_pre_surface_deleted]: OnPreSurfaceDeletedEvent
3032
- [defines.events.on_player_mined_entity]: OnPlayerMinedEntityEvent
3033
- [defines.events.on_robot_mined_entity]: OnRobotMinedEntityEvent
3034
- [defines.events.on_train_created]: OnTrainCreatedEvent
3035
- [defines.events.on_gui_elem_changed]: OnGuiElemChangedEvent
3036
- [defines.events.on_player_setup_blueprint]: OnPlayerSetupBlueprintEvent
3037
- [defines.events.on_player_deconstructed_area]: OnPlayerDeconstructedAreaEvent
3038
- [defines.events.on_player_configured_blueprint]: OnPlayerConfiguredBlueprintEvent
3039
- [defines.events.on_console_chat]: OnConsoleChatEvent
3040
- [defines.events.on_console_command]: OnConsoleCommandEvent
3041
- [defines.events.on_player_removed]: OnPlayerRemovedEvent
3042
- [defines.events.on_pre_player_removed]: OnPrePlayerRemovedEvent
3043
- [defines.events.on_player_used_capsule]: OnPlayerUsedCapsuleEvent
3044
- [defines.events.script_raised_built]: ScriptRaisedBuiltEvent
3045
- [defines.events.script_raised_destroy]: ScriptRaisedDestroyEvent
3046
- [defines.events.script_raised_revive]: ScriptRaisedReviveEvent
3047
- [defines.events.script_raised_set_tiles]: ScriptRaisedSetTilesEvent
3048
- [defines.events.on_player_promoted]: OnPlayerPromotedEvent
3049
- [defines.events.on_player_demoted]: OnPlayerDemotedEvent
3050
- [defines.events.on_combat_robot_expired]: OnCombatRobotExpiredEvent
3051
- [defines.events.on_worker_robot_expired]: OnWorkerRobotExpiredEvent
3052
- [defines.events.on_player_changed_position]: OnPlayerChangedPositionEvent
3053
- [defines.events.on_mod_item_opened]: OnModItemOpenedEvent
3054
- [defines.events.on_gui_opened]: OnGuiOpenedEvent
3055
- [defines.events.on_gui_closed]: OnGuiClosedEvent
3056
- [defines.events.on_gui_value_changed]: OnGuiValueChangedEvent
3057
- [defines.events.on_player_muted]: OnPlayerMutedEvent
3058
- [defines.events.on_player_unmuted]: OnPlayerUnmutedEvent
3059
- [defines.events.on_player_cheat_mode_enabled]: OnPlayerCheatModeEnabledEvent
3060
- [defines.events.on_player_cheat_mode_disabled]: OnPlayerCheatModeDisabledEvent
3061
- [defines.events.on_character_corpse_expired]: OnCharacterCorpseExpiredEvent
3062
- [defines.events.on_pre_ghost_deconstructed]: OnPreGhostDeconstructedEvent
3063
- [defines.events.on_player_pipette]: OnPlayerPipetteEvent
3064
- [defines.events.on_player_display_resolution_changed]: OnPlayerDisplayResolutionChangedEvent
3065
- [defines.events.on_player_display_scale_changed]: OnPlayerDisplayScaleChangedEvent
3066
- [defines.events.on_pre_player_crafted_item]: OnPrePlayerCraftedItemEvent
3067
- [defines.events.on_player_cancelled_crafting]: OnPlayerCancelledCraftingEvent
3068
- [defines.events.on_chunk_charted]: OnChunkChartedEvent
3069
- [defines.events.on_technology_effects_reset]: OnTechnologyEffectsResetEvent
3070
- [defines.events.on_force_reset]: OnForceResetEvent
3071
- [defines.events.on_land_mine_armed]: OnLandMineArmedEvent
3072
- [defines.events.on_forces_merged]: OnForcesMergedEvent
3073
- [defines.events.on_player_trash_inventory_changed]: OnPlayerTrashInventoryChangedEvent
3074
- [defines.events.on_pre_player_left_game]: OnPrePlayerLeftGameEvent
3075
- [defines.events.on_pre_surface_cleared]: OnPreSurfaceClearedEvent
3076
- [defines.events.on_surface_cleared]: OnSurfaceClearedEvent
3077
- [defines.events.on_chunk_deleted]: OnChunkDeletedEvent
3078
- [defines.events.on_pre_chunk_deleted]: OnPreChunkDeletedEvent
3079
- [defines.events.on_train_schedule_changed]: OnTrainScheduleChangedEvent
3080
- [defines.events.on_player_banned]: OnPlayerBannedEvent
3081
- [defines.events.on_player_kicked]: OnPlayerKickedEvent
3082
- [defines.events.on_player_unbanned]: OnPlayerUnbannedEvent
3083
- [defines.events.on_rocket_launch_ordered]: OnRocketLaunchOrderedEvent
3084
- [defines.events.on_script_path_request_finished]: OnScriptPathRequestFinishedEvent
3085
- [defines.events.on_ai_command_completed]: OnAiCommandCompletedEvent
3086
- [defines.events.on_marked_for_upgrade]: OnMarkedForUpgradeEvent
3087
- [defines.events.on_cancelled_upgrade]: OnCancelledUpgradeEvent
3088
- [defines.events.on_player_toggled_map_editor]: OnPlayerToggledMapEditorEvent
3089
- [defines.events.on_entity_cloned]: OnEntityClonedEvent
3090
- [defines.events.on_area_cloned]: OnAreaClonedEvent
3091
- [defines.events.on_brush_cloned]: OnBrushClonedEvent
3092
- [defines.events.on_game_created_from_scenario]: OnGameCreatedFromScenarioEvent
3093
- [defines.events.on_surface_imported]: OnSurfaceImportedEvent
3094
- [defines.events.on_surface_renamed]: OnSurfaceRenamedEvent
3095
- [defines.events.on_player_toggled_alt_mode]: OnPlayerToggledAltModeEvent
3096
- [defines.events.on_player_repaired_entity]: OnPlayerRepairedEntityEvent
3097
- [defines.events.on_player_fast_transferred]: OnPlayerFastTransferredEvent
3098
- [defines.events.on_pre_robot_exploded_cliff]: OnPreRobotExplodedCliffEvent
3099
- [defines.events.on_robot_exploded_cliff]: OnRobotExplodedCliffEvent
3100
- [defines.events.on_entity_spawned]: OnEntitySpawnedEvent
3101
- [defines.events.on_cutscene_waypoint_reached]: OnCutsceneWaypointReachedEvent
3102
- [defines.events.on_unit_group_created]: OnUnitGroupCreatedEvent
3103
- [defines.events.on_unit_added_to_group]: OnUnitAddedToGroupEvent
3104
- [defines.events.on_unit_removed_from_group]: OnUnitRemovedFromGroupEvent
3105
- [defines.events.on_unit_group_finished_gathering]: OnUnitGroupFinishedGatheringEvent
3106
- [defines.events.on_build_base_arrived]: OnBuildBaseArrivedEvent
3107
- [defines.events.on_chart_tag_added]: OnChartTagAddedEvent
3108
- [defines.events.on_chart_tag_modified]: OnChartTagModifiedEvent
3109
- [defines.events.on_chart_tag_removed]: OnChartTagRemovedEvent
3110
- [defines.events.on_lua_shortcut]: OnLuaShortcutEvent
3111
- [defines.events.on_gui_location_changed]: OnGuiLocationChangedEvent
3112
- [defines.events.on_gui_selected_tab_changed]: OnGuiSelectedTabChangedEvent
3113
- [defines.events.on_gui_switch_state_changed]: OnGuiSwitchStateChangedEvent
3114
- [defines.events.on_force_cease_fire_changed]: OnForceCeaseFireChangedEvent
3115
- [defines.events.on_force_friends_changed]: OnForceFriendsChangedEvent
3116
- [defines.events.on_string_translated]: OnStringTranslatedEvent
3117
- [defines.events.on_script_trigger_effect]: OnScriptTriggerEffectEvent
3118
- [defines.events.on_player_set_quick_bar_slot]: OnPlayerSetQuickBarSlotEvent
3119
- [defines.events.on_pre_player_toggled_map_editor]: OnPrePlayerToggledMapEditorEvent
3120
- [defines.events.on_pre_script_inventory_resized]: OnPreScriptInventoryResizedEvent
3121
- [defines.events.on_script_inventory_resized]: OnScriptInventoryResizedEvent
3122
- [defines.events.on_entity_destroyed]: OnEntityDestroyedEvent
3123
- [defines.events.on_player_clicked_gps_tag]: OnPlayerClickedGpsTagEvent
3124
- [defines.events.on_player_flushed_fluid]: OnPlayerFlushedFluidEvent
3125
- [defines.events.on_permission_group_edited]: OnPermissionGroupEditedEvent
3126
- [defines.events.on_pre_permission_string_imported]: OnPrePermissionStringImportedEvent
3127
- [defines.events.on_permission_string_imported]: OnPermissionStringImportedEvent
3128
- [defines.events.on_pre_permission_group_deleted]: OnPrePermissionGroupDeletedEvent
3129
- [defines.events.on_permission_group_deleted]: OnPermissionGroupDeletedEvent
3130
- [defines.events.on_permission_group_added]: OnPermissionGroupAddedEvent
3131
- [defines.events.on_cutscene_cancelled]: OnCutsceneCancelledEvent
3132
- [defines.events.on_player_configured_spider_remote]: OnPlayerConfiguredSpiderRemoteEvent
3133
- [defines.events.on_player_used_spider_remote]: OnPlayerUsedSpiderRemoteEvent
3134
- [defines.events.on_spider_command_completed]: OnSpiderCommandCompletedEvent
3135
- [defines.events.on_entity_logistic_slot_changed]: OnEntityLogisticSlotChangedEvent
3136
- [defines.events.on_equipment_inserted]: OnEquipmentInsertedEvent
3137
- [defines.events.on_equipment_removed]: OnEquipmentRemovedEvent
3138
- }
3139
-
3140
- interface EventFilters {
3141
- [defines.events.on_entity_died]: LuaEntityDiedEventFilter
3142
- [defines.events.on_post_entity_died]: LuaPostEntityDiedEventFilter
3143
- [defines.events.on_entity_damaged]: LuaEntityDamagedEventFilter
3144
- [defines.events.on_built_entity]: LuaPlayerBuiltEntityEventFilter
3145
- [defines.events.on_sector_scanned]: LuaSectorScannedEventFilter
3146
- [defines.events.on_pre_player_mined_item]: LuaPrePlayerMinedEntityEventFilter
3147
- [defines.events.on_robot_built_entity]: LuaRobotBuiltEntityEventFilter
3148
- [defines.events.on_robot_pre_mined]: LuaPreRobotMinedEntityEventFilter
3149
- [defines.events.on_marked_for_deconstruction]: LuaEntityMarkedForDeconstructionEventFilter
3150
- [defines.events.on_cancelled_deconstruction]: LuaEntityDeconstructionCancelledEventFilter
3151
- [defines.events.on_player_mined_entity]: LuaPlayerMinedEntityEventFilter
3152
- [defines.events.on_robot_mined_entity]: LuaRobotMinedEntityEventFilter
3153
- [defines.events.script_raised_built]: LuaScriptRaisedBuiltEventFilter
3154
- [defines.events.script_raised_destroy]: LuaScriptRaisedDestroyEventFilter
3155
- [defines.events.script_raised_revive]: LuaScriptRaisedReviveEventFilter
3156
- [defines.events.on_pre_ghost_deconstructed]: LuaPreGhostDeconstructedEventFilter
3157
- [defines.events.on_marked_for_upgrade]: LuaEntityMarkedForUpgradeEventFilter
3158
- [defines.events.on_cancelled_upgrade]: LuaUpgradeCancelledEventFilter
3159
- [defines.events.on_entity_cloned]: LuaEntityClonedEventFilter
3160
- [defines.events.on_player_repaired_entity]: LuaPlayerRepairedEntityEventFilter
2964
+ /** An event id. */
2965
+ type EventId<T extends table, F extends table | void = void> = uint & {
2966
+ readonly _eventData: T
2967
+ readonly _filter: F
2968
+ }
2969
+
2970
+ /**
2971
+ * An event id generated by {@link LuaBootstrap.generate_event_name LuaBootstrap::generate_event_name} and raisable via
2972
+ * {@link LuaBootstrap.raise_event LuaBootstrap::raise_event}.
2973
+ */
2974
+ type CustomEventId<T extends table> = EventId<T> & {
2975
+ _customEventIdBrand: any
3161
2976
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typed-factorio",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "Featureful typescript definitions for the the Factorio modding lua api.",
5
5
  "keywords": [
6
6
  "factorio",