Use auto inferred type on electronAPI.Terminal (#1719)

This commit is contained in:
Chenlei Hu
2024-11-27 13:14:30 -08:00
committed by GitHub
parent c4d3c672ad
commit 08f3370828
3 changed files with 6 additions and 17 deletions

8
package-lock.json generated
View File

@@ -9,7 +9,7 @@
"version": "1.4.13",
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.3.6",
"@comfyorg/comfyui-electron-types": "^0.3.19",
"@comfyorg/litegraph": "^0.8.37",
"@primevue/themes": "^4.0.5",
"@vueuse/core": "^11.0.0",
@@ -1917,9 +1917,9 @@
"dev": true
},
"node_modules/@comfyorg/comfyui-electron-types": {
"version": "0.3.6",
"resolved": "https://registry.npmjs.org/@comfyorg/comfyui-electron-types/-/comfyui-electron-types-0.3.6.tgz",
"integrity": "sha512-wgMgESnCcRzvVkk8CwWiTAUJxC4LBvw5uTENxzaWkEL0qrnmiGrVLore00yX3cYz04hJaTA6PqasLqgVLDOenw==",
"version": "0.3.19",
"resolved": "https://registry.npmjs.org/@comfyorg/comfyui-electron-types/-/comfyui-electron-types-0.3.19.tgz",
"integrity": "sha512-VNr542eaLVmaeSJIvGv/Y5OiC2vYiLy+FtjwYtP+J8M5BSy88GCikX2K9NIkLPtcw9DLolVK3XWuIvFpsOK0zg==",
"license": "GPL-3.0-only"
},
"node_modules/@comfyorg/litegraph": {

View File

@@ -72,7 +72,7 @@
},
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.3.6",
"@comfyorg/comfyui-electron-types": "^0.3.19",
"@comfyorg/litegraph": "^0.8.37",
"@primevue/themes": "^4.0.5",
"@vueuse/core": "^11.0.0",

View File

@@ -13,18 +13,7 @@ const terminalCreated = (
{ terminal, useAutoSize }: ReturnType<typeof useTerminal>,
root: Ref<HTMLElement>
) => {
// TODO: use types from electron package
const terminalApi = electronAPI()['Terminal'] as {
onOutput(cb: (message: string) => void): () => void
resize(cols: number, rows: number): void
restore(): Promise<{
buffer: string[]
pos: { x: number; y: number }
size: { cols: number; rows: number }
}>
storePos(x: number, y: number): void
write(data: string): void
}
const terminalApi = electronAPI().Terminal
let offData: IDisposable
let offOutput: () => void