2022-04-16 21:14:03 +08:00
|
|
|
import { IpcChannelsParams, IpcChannelsReturns } from '@/shared/IpcChannels'
|
2022-04-16 13:30:25 +08:00
|
|
|
import { ElectronLog } from 'electron-log'
|
2022-04-09 00:28:37 +08:00
|
|
|
|
2022-03-13 14:40:38 +08:00
|
|
|
export {}
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
interface Window {
|
2022-04-09 00:28:37 +08:00
|
|
|
ipcRenderer?: {
|
2022-04-16 21:14:03 +08:00
|
|
|
sendSync: <T extends keyof IpcChannelsParams>(
|
|
|
|
channel: T,
|
|
|
|
params?: IpcChannelsParams[T]
|
|
|
|
) => IpcChannelsReturns[T]
|
|
|
|
send: <T extends keyof IpcChannelsParams>(
|
|
|
|
channel: T,
|
|
|
|
params?: IpcChannelsParams[T]
|
|
|
|
) => void
|
|
|
|
on: <T extends keyof IpcChannelsParams>(
|
|
|
|
channel: T,
|
|
|
|
listener: (
|
|
|
|
event: Electron.IpcRendererEvent,
|
|
|
|
value: IpcChannelsReturns[T]
|
|
|
|
) => void
|
2022-04-09 00:28:37 +08:00
|
|
|
) => void
|
|
|
|
}
|
2022-04-04 17:51:07 +08:00
|
|
|
env?: {
|
|
|
|
isElectron: boolean
|
2022-04-09 00:19:58 +08:00
|
|
|
isEnableTitlebar: boolean
|
2022-04-04 17:51:07 +08:00
|
|
|
isLinux: boolean
|
|
|
|
isMac: boolean
|
2022-05-13 01:47:55 +08:00
|
|
|
isWindows: boolean
|
2022-04-04 17:51:07 +08:00
|
|
|
}
|
2022-04-16 13:30:25 +08:00
|
|
|
log?: ElectronLog
|
2022-03-13 14:40:38 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
declare module 'valtio' {
|
|
|
|
function useSnapshot<T extends object>(p: T): T
|
|
|
|
}
|