28 lines
692 B
TypeScript
28 lines
692 B
TypeScript
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 = () => {
|
|
const rtmt = new RTMTWS();
|
|
const userKeyStore = new UserKeyStoreImpl();
|
|
const texts = TrTr;
|
|
const themeManager = new ThemeManager();
|
|
return {
|
|
rtmt: rtmt,
|
|
userKeyStore: userKeyStore,
|
|
texts: texts,
|
|
themeManager,
|
|
};
|
|
};
|
|
|
|
export const context: Context = initContext();
|