import { Texts, TrTr } from "../const/texts";
import { RTMT } from "../rtmt/rtmt";
import { RTMTWS } from "../rtmt/rtmt_websocket";
import { UserKeyStore, UserKeyStoreImpl } from "../store/key_store";
import ThemeManager from "../theme/ThemeManager";

export type Context = {
  rtmt: RTMT;
  userKeyStore: UserKeyStore;
  texts: Texts;
  themeManager: ThemeManager;
};

export const initContext = () : Context =>  {
  const rtmt = new RTMTWS();
  const userKeyStore = new UserKeyStoreImpl();
  const texts = TrTr;
  const themeManager = new ThemeManager();
  return {
    rtmt: rtmt,
    userKeyStore: userKeyStore,
    texts: texts,
    themeManager,
  };
};
