mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-04 20:50:06 +00:00
[Refactor] Remove old workarounds (#2242)
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
import { ElectronAPI } from '@comfyorg/comfyui-electron-types'
|
||||
|
||||
export type InstallOptions = Parameters<ElectronAPI['installComfyUI']>[0]
|
||||
export type TorchDeviceType = InstallOptions['device']
|
||||
import {
|
||||
ElectronAPI,
|
||||
ElectronContextMenuOptions
|
||||
} from '@comfyorg/comfyui-electron-types'
|
||||
|
||||
export function isElectron() {
|
||||
return 'electronAPI' in window && window['electronAPI'] !== undefined
|
||||
return 'electronAPI' in window && window.electronAPI !== undefined
|
||||
}
|
||||
|
||||
export function electronAPI() {
|
||||
return (window as any)['electronAPI'] as ElectronAPI
|
||||
return (window as any).electronAPI as ElectronAPI
|
||||
}
|
||||
|
||||
type NativeContextOptions = Parameters<ElectronAPI['showContextMenu']>[0]
|
||||
export function showNativeMenu(options?: NativeContextOptions) {
|
||||
export function showNativeMenu(options?: ElectronContextMenuOptions) {
|
||||
electronAPI()?.showContextMenu(options)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user