fix: add missing properties declared in preload to Window in renderer
This commit is contained in:
parent
4c9ac9c43e
commit
40b89a1de8
3 changed files with 10 additions and 11 deletions
8
src/preload/index.d.ts
vendored
8
src/preload/index.d.ts
vendored
|
|
@ -1,8 +0,0 @@
|
|||
import { ElectronAPI } from '@electron-toolkit/preload'
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
electron: ElectronAPI
|
||||
api: unknown
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,15 @@
|
|||
import { mount } from 'svelte'
|
||||
import './app.css'
|
||||
import App from './App.svelte'
|
||||
import type { ElectronAPI } from '@electron-toolkit/preload'
|
||||
|
||||
// Extend Window with preload
|
||||
declare global {
|
||||
interface Window {
|
||||
electron: ElectronAPI,
|
||||
api: unknown
|
||||
}
|
||||
}
|
||||
|
||||
const app = mount(App, {
|
||||
target: document.getElementById('app')!
|
||||
|
|
|
|||
|
|
@ -17,10 +17,8 @@
|
|||
"moduleDetection": "force"
|
||||
},
|
||||
"include": [
|
||||
"src/renderer/src/env.d.ts",
|
||||
"src/renderer/src/**/*",
|
||||
"src/renderer/src/**/*.svelte",
|
||||
"src/preload/*.d.ts"
|
||||
"src/renderer/src/**/*.svelte"
|
||||
],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue