30 lines
862 B
TypeScript
30 lines
862 B
TypeScript
import {NativeClientBackend} from "tc-shared/backend/NativeClient";
|
|
import {ipcRenderer} from "electron";
|
|
import {Arguments, processArguments} from "../../shared/process-arguments";
|
|
|
|
const call_basic_action = (name: string, ...args: any[]) => ipcRenderer.send('basic-action', name, ...args);
|
|
export class NativeClientBackendImpl implements NativeClientBackend {
|
|
openChangeLog(): void {
|
|
call_basic_action("open-changelog");
|
|
}
|
|
|
|
openClientUpdater(): void {
|
|
call_basic_action("check-native-update");
|
|
}
|
|
|
|
openDeveloperTools(): void {
|
|
call_basic_action("open-dev-tools");
|
|
}
|
|
|
|
quit(): void {
|
|
call_basic_action("quit");
|
|
}
|
|
|
|
reloadWindow(): void {
|
|
call_basic_action("reload-window")
|
|
}
|
|
|
|
showDeveloperOptions(): boolean {
|
|
return processArguments.has_flag(Arguments.DEV_TOOLS);
|
|
}
|
|
} |