Skip to content

Commit

Permalink
refactor: add typing for electorn API
Browse files Browse the repository at this point in the history
Signed-off-by: tylerslaton <[email protected]>
  • Loading branch information
tylerslaton committed Sep 11, 2024
1 parent bc31a17 commit 83c8f48
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions components/chat/chatBar/upload/files.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ const Files: React.FC<FilesProps> = ({ files, setFiles }) => {
radius="full"
onPress={async () =>
// This submits a request to the electron main process to open the file
(window as any).electronAPI.openFile(
path.join(file.path, file.name)
)
window.electronAPI.openFile(path.join(file.path, file.name))
}
/>
<Button
Expand Down
9 changes: 9 additions & 0 deletions types/window.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
declare global {
interface Window {
electronAPI: {
openFile: (path: string) => void;
};
}
}

export {};

0 comments on commit 83c8f48

Please sign in to comment.