This repository has been archived on 2026-07-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
vynte-connect/src/preload.ts
T

17 lines
842 B
TypeScript

// See the Electron documentation for details on how to use preload scripts:
// https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts
import { contextBridge, ipcRenderer } from "electron";
import { UIStatus } from "./types";
contextBridge.exposeInMainWorld('vynte', {
getStatus: () => ipcRenderer.invoke('status:get'),
refresh: () => ipcRenderer.invoke('status:refresh'),
connect: () => ipcRenderer.invoke('vpn:connect'),
disconnect: () => ipcRenderer.invoke('vpn:disconnect'),
logout: () => ipcRenderer.invoke('vpn:logout'),
toggleAuto: () => ipcRenderer.invoke('auto:toggle'),
quit: () => ipcRenderer.invoke('app:quit'),
openGateway: () => ipcRenderer.invoke('external:openGateway'),
onStatus: (callback: (status: UIStatus) => void) => ipcRenderer.on('status', (_, status) => callback(status))
})