quick-start
quick-start copied to clipboard
refactor: update preloader d.ts
Description
Using typeof
to resolve manual type definition.
// preloader index.ts
export type api = typeof api
// preloader index.d.ts
import { ElectronAPI } from '@electron-toolkit/preload'
import type { api } from './index'
declare global {
interface Window {
electron: ElectronAPI
api: api
}
}
Additional context
What is the purpose of this pull request?
- [ ] Bug fix
- [ ] New Feature
- [ ] Documentation update
- [ ] Other
Before submitting the PR, please make sure you do the following
- [ ] Read the Contributing Guidelines.
- [ ] Read the Pull Request Guidelines and follow the Commit Convention.
- [ ] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g.
fixes #123
).