2021-06-22 07:46:42 -07:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import { Bytes } from './Bytes';
|
2021-09-23 17:49:05 -07:00
|
|
|
import { Crypto } from './Crypto';
|
2021-09-17 18:24:21 -04:00
|
|
|
import {
|
|
|
|
createNativeThemeListener,
|
|
|
|
MinimalIPC,
|
|
|
|
} from './createNativeThemeListener';
|
2021-06-22 07:46:42 -07:00
|
|
|
|
|
|
|
export class Context {
|
|
|
|
public readonly bytes = new Bytes();
|
2021-06-30 11:57:43 -07:00
|
|
|
|
2021-09-23 17:49:05 -07:00
|
|
|
public readonly crypto = new Crypto();
|
|
|
|
|
2021-06-30 11:57:43 -07:00
|
|
|
public readonly nativeThemeListener;
|
|
|
|
|
2021-09-28 14:00:22 -05:00
|
|
|
constructor(private readonly ipc: MinimalIPC) {
|
2021-09-17 18:24:21 -04:00
|
|
|
this.nativeThemeListener = createNativeThemeListener(ipc, window);
|
2021-06-30 11:57:43 -07:00
|
|
|
}
|
2021-09-28 14:00:22 -05:00
|
|
|
|
|
|
|
setIsCallActive(isCallActive: boolean): void {
|
|
|
|
this.ipc.send('set-is-call-active', isCallActive);
|
|
|
|
}
|
2021-06-22 07:46:42 -07:00
|
|
|
}
|