2021-07-02 23:13:38 +03:00
|
|
|
import { Texts, TrTr } from "./const/texts"
|
2021-06-27 19:28:55 +03:00
|
|
|
import { RTMT } from "./rtmt/rtmt"
|
|
|
|
|
import { RTMTWS } from "./rtmt/rtmt_websocket"
|
|
|
|
|
import { UserKeyStore, UserKeyStoreImpl } from "./store/key_store"
|
|
|
|
|
|
|
|
|
|
type Context = {
|
|
|
|
|
rtmt : RTMT
|
|
|
|
|
userKeyStore : UserKeyStore
|
2021-07-02 23:13:38 +03:00
|
|
|
texts : Texts
|
2021-06-27 19:28:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const initContext = ()=> {
|
|
|
|
|
const rtmt = new RTMTWS()
|
|
|
|
|
const userKeyStore = new UserKeyStoreImpl()
|
2021-07-02 23:13:38 +03:00
|
|
|
const texts = TrTr
|
2021-06-27 19:28:55 +03:00
|
|
|
return {
|
|
|
|
|
rtmt : rtmt,
|
|
|
|
|
userKeyStore : userKeyStore,
|
2021-07-02 23:13:38 +03:00
|
|
|
texts : texts,
|
2021-06-27 19:28:55 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const context : Context = initContext()
|