Taobin-Recipe-Manager/client-electron/electron/electron-env.d.ts
2024-03-15 14:10:24 +07:00

38 lines
1.1 KiB
TypeScript

/* eslint-disable @typescript-eslint/consistent-type-imports */
/// <reference types="vite-plugin-electron/electron-env" />
declare namespace NodeJS {
interface ProcessEnv {
/**
* The built directory structure
*
* ```tree
* ├─┬─┬ dist
* │ │ └── index.html
* │ │
* │ ├─┬ dist-electron
* │ │ ├── main.js
* │ │ └── preload.js
* │
* ```
*/
DIST: string
/** /dist/ or /public/ */
VITE_PUBLIC: string
}
}
// Used in Renderer process, expose in `preload.ts`
interface Window {
ipcRenderer: import('electron').IpcRenderer
electronRuntime: boolean
platform: NodeJS.Platform
adbNativeTcpSocket: {
getProp(serial: string, key: string): Promise<string>
getDevices(): Promise<{ name: string; serial: string }[]>
connect(host: string, port: number): Promise<{ name: string; serial: string }>
shell(serial: string, command: string, callback: (chunk: Uint8Array) => void): Promise<void>
spawn(serial: string, command: string, callback: (chunk: Uint8Array) => void): Promise<void>
disconnect(): Promise<void>
}
}