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

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