/* auto-generated by NAPI-RS */
/* eslint-disable */
export declare class Keyboard {
  constructor()
  /** Tap a key (press and release) */
  keyTap(key: string, modifier?: Array<string> | undefined | null): void
  /** Toggle a key (press or release) */
  keyToggle(key: string, down: string, modifier?: Array<string> | undefined | null): void
  /** Type a string */
  typeString(string: string): void
  /** Type a string with delay between characters */
  typeStringDelayed(string: string, cpm: number): void
  /** Set the keyboard delay in milliseconds */
  setKeyboardDelay(delayMs: number): void
}

export declare class Mouse {
  constructor()
  /** Move the mouse to the specified coordinates */
  moveMouse(x: number, y: number): void
  /** Move the mouse smoothly to the specified coordinates */
  moveMouseSmooth(x: number, y: number): void
  /** Move the mouse smoothly with custom speed */
  moveMouseSmoothWithSpeed(x: number, y: number, speed: number): void
  /** Get the current mouse position */
  getMousePos(): MousePosition
  /** Click the mouse button */
  mouseClick(button?: string | undefined | null, double?: boolean | undefined | null): void
  /** Toggle mouse button (press or release) */
  mouseToggle(down: string, button?: string | undefined | null): void
  /** Drag the mouse to the specified coordinates */
  dragMouse(x: number, y: number): void
  /** Scroll the mouse wheel */
  scrollMouse(x: number, y: number): void
  /** Set the mouse delay in milliseconds */
  setMouseDelay(delayMs: number): void
}

/** Screen capture interface */
export declare class Screen {
  constructor()
  /** Capture screen region */
  capture(x?: number | undefined | null, y?: number | undefined | null, width?: number | undefined | null, height?: number | undefined | null): Promise<Bitmap>
}

/** Bitmap structure for screen capture */
export interface Bitmap {
  width: number
  height: number
  image: Buffer
  byteWidth: number
  bitsPerPixel: number
  bytesPerPixel: number
}

/** Get color at specific coordinates in a bitmap (returns hex string like "#RRGGBB") */
export declare function bitmapColorAt(bitmap: Bitmap, x: number, y: number): string

/** Capture entire screen */
export declare function captureScreen(): Promise<ScreenCapture>

/** Capture screen region */
export declare function captureScreenRegion(x: number, y: number, width: number, height: number): Promise<ScreenCapture>

/** Clear clipboard */
export declare function clearClipboard(): void

/** Drag mouse */
export declare function dragMouse(x: number, y: number): void

/** Find windows by process name (case-insensitive partial match) */
export declare function findWindowsByProcess(processName: string): Array<WindowInfo>

/** Find windows by title (case-insensitive partial match) */
export declare function findWindowsByTitle(title: string): Array<WindowInfo>

/** Get the currently active (focused) window */
export declare function getActiveWindow(): WindowInfo

/** Get a list of all visible windows */
export declare function getAllWindows(): Array<WindowInfo>

/** Get text from clipboard */
export declare function getClipboard(): string

/** Get image from clipboard (returns PNG-encoded buffer) */
export declare function getClipboardImage(): Buffer

/** Get mouse position */
export declare function getMousePos(): MousePosition

/** Get pixel color (returns hex string) */
export declare function getPixelColor(x: number, y: number): Promise<string>

/** Get global screen instance (exported as screen variable) */
export declare function getScreen(): Screen

/** Get screen size */
export declare function getScreenSize(): ScreenSize

/** Tap a key */
export declare function keyTap(key: string, modifier?: Array<string> | undefined | null): void

/** Toggle a key */
export declare function keyToggle(key: string, down: string, modifier?: Array<string> | undefined | null): void

/** Mouse click */
export declare function mouseClick(button?: string | undefined | null, double?: boolean | undefined | null): void

export interface MousePosition {
  x: number
  y: number
}

/** Mouse toggle */
export declare function mouseToggle(down?: string | undefined | null, button?: string | undefined | null): void

/** Move mouse */
export declare function moveMouse(x: number, y: number): void

/** Move mouse smoothly */
export declare function moveMouseSmooth(x: number, y: number, speed?: number | undefined | null): void

/** Pixel color information */
export interface PixelColor {
  r: number
  g: number
  b: number
  a: number
}

/** Screen capture result containing image data */
export interface ScreenCapture {
  width: number
  height: number
  image: Buffer
}

/** Screen size information */
export interface ScreenSize {
  width: number
  height: number
}

/** Scroll mouse */
export declare function scrollMouse(x: number, y: number): void

/** Set text to clipboard */
export declare function setClipboard(text: string): void

/** Set image to clipboard (accepts PNG-encoded buffer) */
export declare function setClipboardImage(imageBuffer: Buffer): void

/** Set keyboard delay */
export declare function setKeyboardDelay(ms: number): void

/** Set mouse delay */
export declare function setMouseDelay(delay: number): void

/** Type a string */
export declare function typeString(string: string): void

/** Type a string with delay */
export declare function typeStringDelayed(string: string, cpm: number): void

/** Tap a Unicode character */
export declare function unicodeTap(value: number): void

/** Update screen metrics (no-op for now, can be used to refresh screen info) */
export declare function updateScreenMetrics(): void

/** Window information structure */
export interface WindowInfo {
  /** Window title */
  title: string
  /** Process ID */
  processId: number
  /** Process path/name */
  processPath: string
  /** Window position X */
  x: number
  /** Window position Y */
  y: number
  /** Window width */
  width: number
  /** Window height */
  height: number
  /** Window ID (platform-specific) */
  windowId: string
}
