Skip to content

Conversation

@unliar
Copy link

@unliar unliar commented Mar 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant