quick-start icon indicating copy to clipboard operation
quick-start copied to clipboard

refactor: update preloader d.ts

Open unliar opened this issue 10 months ago • 0 comments

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

unliar avatar Mar 29 '24 11:03 unliar