1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-16 11:41:50 +00:00
tobspr_shapez.io/src/js/mods/mod_signals.js
Bagel03 6db782d66a
Add Most Useful TS files (#13)
* Update Signal

* Update modal_dialogs

* Inputs

* Update factories

* Update tracked state

* Changed let to const where possible

* Add HUD typings

* improvements to typings

* fix exports not being exposed to mods

* fix signal typings

* remove TypedSignal

* fix all reported type errors

---------

Co-authored-by: Thomas B <t.ferb1@gmail.com>
Co-authored-by: EmeraldBlock <yygengjunior@gmail.com>
2023-11-17 16:02:08 -06:00

40 lines
1.4 KiB
JavaScript

/* typehints:start */
import { BaseHUDPart } from "../game/hud/base_hud_part";
import { GameRoot } from "../game/root";
import { GameState } from "../core/game_state";
import { InGameState } from "../states/ingame";
/* typehints:end */
import { Signal } from "../core/signal";
// Single file to avoid circular deps
export const MOD_SIGNALS = {
// Called when the application has booted and instances like the app settings etc are available
appBooted: new Signal(),
modifyLevelDefinitions: /** @type {Signal<[Array[Object]]>} */ (new Signal()),
modifyUpgrades: /** @type {Signal<[Object]>} */ (new Signal()),
hudElementInitialized: /** @type {Signal<[BaseHUDPart]>} */ (new Signal()),
hudElementFinalized: /** @type {Signal<[BaseHUDPart]>} */ (new Signal()),
hudInitializer: /** @type {Signal<[GameRoot]>} */ (new Signal()),
gameInitialized: /** @type {Signal<[GameRoot]>} */ (new Signal()),
gameLoadingStageEntered: /** @type {Signal<[InGameState, string]>} */ (new Signal()),
gameStarted: /** @type {Signal<[GameRoot]>} */ (new Signal()),
stateEntered: /** @type {Signal<[GameState]>} */ (new Signal()),
gameSerialized:
/** @type {Signal<[GameRoot, import("../savegame/savegame_typedefs").SerializedGame]>} */ (
new Signal()
),
gameDeserialized:
/** @type {Signal<[GameRoot, import("../savegame/savegame_typedefs").SerializedGame]>} */ (
new Signal()
),
};