mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-30 12:59:55 +00:00
* lint: turn on type import rules setting up for verbatimModuleSyntax * lint: --fix for type imports
18 lines
450 B
TypeScript
18 lines
450 B
TypeScript
import type { ElectronAPI } from '@comfyorg/comfyui-electron-types'
|
|
|
|
export function isElectron() {
|
|
return 'electronAPI' in window && window.electronAPI !== undefined
|
|
}
|
|
|
|
export function electronAPI() {
|
|
return (window as any).electronAPI as ElectronAPI
|
|
}
|
|
|
|
export function showNativeSystemMenu() {
|
|
electronAPI()?.showContextMenu()
|
|
}
|
|
|
|
export function isNativeWindow() {
|
|
return isElectron() && !!window.navigator.windowControlsOverlay?.visible
|
|
}
|