Skip to content

Commit a13ef15

Browse files
committed
refactor: add typing for electorn API
Signed-off-by: tylerslaton <[email protected]>
1 parent bc31a17 commit a13ef15

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

components/chat/chatBar/upload/files.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ const Files: React.FC<FilesProps> = ({ files, setFiles }) => {
4848
radius="full"
4949
onPress={async () =>
5050
// This submits a request to the electron main process to open the file
51-
(window as any).electronAPI.openFile(
52-
path.join(file.path, file.name)
53-
)
51+
window.electronAPI.openFile(path.join(file.path, file.name))
5452
}
5553
/>
5654
<Button

types/window.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
declare global {
2+
interface Window {
3+
electronAPI: {
4+
openFile: (path: string) => void;
5+
};
6+
}
7+
}
8+
9+
export {};

0 commit comments

Comments
 (0)