summaryrefslogtreecommitdiff
path: root/src/renderer/runtime.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer/runtime.ts')
-rw-r--r--src/renderer/runtime.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/renderer/runtime.ts b/src/renderer/runtime.ts
new file mode 100644
index 0000000..9e4a887
--- /dev/null
+++ b/src/renderer/runtime.ts
@@ -0,0 +1,20 @@
+import { ipcRenderer, shell } from "electron";
+
+class Runtime {
+ async getScreenshots(
+ server_address: string
+ ): Promise<{ dir: string; screenshots: string[] }> {
+ return await ipcRenderer.invoke("getScreenshots", server_address);
+ }
+
+ /** used to drag n' drop screenshots out of the window */
+ dragFileOut(filepath: string): void {
+ ipcRenderer.send("dragFileOut", filepath);
+ }
+
+ openFolder(dir: string) {
+ shell.openPath(dir);
+ }
+}
+
+export const ML_Runtime = new Runtime();