electron.d.ts 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Type definitions for Electron API exposed via preload script
  2. interface ElectronAPI {
  3. // File system operations
  4. selectSaveDirectory(): Promise<string | null>
  5. selectCookieFile(): Promise<string | null>
  6. // Binary management
  7. checkBinaryVersions(): Promise<{
  8. ytDlp: { version?: string; available: boolean }
  9. ffmpeg: { version?: string; available: boolean }
  10. }>
  11. // Video operations
  12. downloadVideo(options: {
  13. url: string
  14. quality: string
  15. format: string
  16. savePath: string
  17. cookieFile?: string
  18. }): Promise<{ success: boolean; output: string }>
  19. getVideoMetadata(url: string): Promise<{
  20. title: string
  21. duration: string
  22. thumbnail: string
  23. uploader: string
  24. }>
  25. // Event listeners
  26. onDownloadProgress(callback: (event: any, data: { url: string; progress: number }) => void): void
  27. removeDownloadProgressListener(callback: Function): void
  28. // App info
  29. getAppVersion(): string
  30. getPlatform(): string
  31. }
  32. declare global {
  33. interface Window {
  34. electronAPI: ElectronAPI
  35. }
  36. }
  37. export {}