dsr/src/main.ts

30 lines
694 B
TypeScript
Raw Normal View History

2023-07-29 16:23:38 +02:00
import { BrowserWindow, app, ipcMain } from "electron";
import path = require("path");
/* import ffmpegPath = require("ffmpeg-static"); */
2023-07-28 02:46:49 +02:00
2023-07-28 02:32:18 +02:00
const createWindow = () => {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, "preload.js"),
},
2023-07-28 02:32:18 +02:00
});
2023-07-29 15:30:41 +02:00
win.loadFile(path.join(path.resolve(__dirname, ".."), "pages", "index.html"));
2023-07-28 02:32:18 +02:00
};
2023-07-29 15:30:41 +02:00
2023-07-28 02:32:18 +02:00
app.whenReady().then(() => {
2023-07-29 16:23:38 +02:00
ipcMain.handle("ping", () => "pong");
2023-07-28 02:32:18 +02:00
createWindow();
app.on("activate", () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow();
});
});
app.on("window-all-closed", () => {
if (process.platform !== "darwin") app.quit();
2023-07-28 02:32:18 +02:00
});