/// <reference types="vite/client" />

declare namespace Electron {
  interface WebviewTag extends HTMLElement {
    src: string
    reload(): void
    getURL(): string
    getWebContentsId(): number
    isLoading(): boolean
    capturePage(): Promise<Electron.NativeImage>
    setAttribute(name: string, value: string): void
    getAttribute(name: string): string | null
  }

  interface NativeImage {
    isEmpty(): boolean
    toPNG(): Buffer
    toJPEG(quality: number): Buffer
    toDataURL(): string
    getSize(): { width: number; height: number }
    resize(options: { width?: number; height?: number; quality?: string }): NativeImage
  }
}
