Skip to content

Commit

Permalink
Use Electron types instead
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeichestakov committed Aug 9, 2023
1 parent d6af07b commit 40d635c
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ function makeEventHandler(event: events) {
};
}

// See: https://www.electronjs.org/docs/latest/api/dialog#dialogshowmessageboxbrowserwindow-options
interface ShowMessageBoxParams {
message: string;
title?: string;
detail?: string;
defaultId?: number;
cancelId?: number;
buttons: Array<string>;
type?: "none" | "info" | "error" | "question" | "warning";
}

contextBridge.exposeInMainWorld("replitDesktop", {
closeCurrentWindow: () => ipcRenderer.send(events.CLOSE_CURRENT_WINDOW),
openReplWindow: (replSlug: string) =>
Expand All @@ -48,7 +37,7 @@ contextBridge.exposeInMainWorld("replitDesktop", {
ipcRenderer.removeListener(events.AUTH_TOKEN_RECEIVED, listener);
};
},
showMessageBox: async (params: ShowMessageBoxParams) =>
showMessageBox: async (params: Electron.MessageBoxOptions) =>
ipcRenderer.invoke(events.SHOW_MESSAGE_BOX, params),
onEnterFullscreen: makeEventHandler(events.ON_ENTER_FULLSCREEN),
onLeaveFullscreen: makeEventHandler(events.ON_LEAVE_FULLSCREEN),
Expand Down

0 comments on commit 40d635c

Please sign in to comment.