Add comfyui-electron-types dependency (#1459)

This commit is contained in:
Chenlei Hu
2024-11-07 16:05:26 -05:00
committed by GitHub
parent 073638672d
commit 9568d63820
3 changed files with 15 additions and 0 deletions

8
package-lock.json generated
View File

@@ -28,6 +28,7 @@
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/preset-env": "^7.22.20",
"@comfyorg/comfyui-electron-types": "^0.2.9",
"@eslint/js": "^9.8.0",
"@iconify/json": "^2.2.245",
"@pinia/testing": "^0.1.5",
@@ -1910,6 +1911,13 @@
"integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==",
"dev": true
},
"node_modules/@comfyorg/comfyui-electron-types": {
"version": "0.2.9",
"resolved": "https://registry.npmjs.org/@comfyorg/comfyui-electron-types/-/comfyui-electron-types-0.2.9.tgz",
"integrity": "sha512-wXmeGrQnuiEXlUkWDAnfkPgb8YTICX8EsNKSIWDb5uMSx46fW8gJQjTc1ehawV/fw1MmuqjhOpw+rV1f2+DAtw==",
"dev": true,
"license": "GPL-3.0-only"
},
"node_modules/@comfyorg/litegraph": {
"version": "0.8.21",
"resolved": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.8.21.tgz",

View File

@@ -26,6 +26,7 @@
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/preset-env": "^7.22.20",
"@comfyorg/comfyui-electron-types": "^0.2.9",
"@eslint/js": "^9.8.0",
"@iconify/json": "^2.2.245",
"@pinia/testing": "^0.1.5",

View File

@@ -1,3 +1,9 @@
import { ElectronAPI } from '@comfyorg/comfyui-electron-types'
export function isElectron() {
return 'electronAPI' in window && window['electronAPI'] !== undefined
}
export function electronAPI() {
return window['electronAPI'] as ElectronAPI
}