index.ts 798 B

1234567891011121314151617181920212223242526272829
  1. import { ModuleRoot } from "queenjs";
  2. import { actions } from "./actions";
  3. import { components } from "./components";
  4. import { stores } from "./stores";
  5. import { BusController } from "@/controllers/natsController";
  6. import { IAppKeys } from "./objects/Application/types";
  7. import { queentreeApi } from "./apis/queentree";
  8. export class LauncherModule extends ModuleRoot {
  9. config = this.setConfig({
  10. supportApps: ["queentree"] as IAppKeys[],
  11. });
  12. components = this.useComponents(components);
  13. store = this.createStore(stores);
  14. actions = this.createActions(actions);
  15. queentreeApi = this.use(queentreeApi);
  16. controls = {
  17. natsCtrl: new BusController(),
  18. };
  19. onReady() {
  20. this.actions.init();
  21. }
  22. }
  23. export const { initLauncher, useLauncher } = LauncherModule.hook("Launcher");