alex8088 / quick-start

An easy way to start a front-end project.
MIT License
248 stars 34 forks source link

refactor: update preloader d.ts #33

Open unliar opened 5 months ago

unliar commented 5 months ago

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?

Before submitting the PR, please make sure you do the following