declare namespace imageToAscii {
  interface Size {
    width?: number | string;
    height?: number | string;
  }

  interface SizeOptions {
    screen_size?: {
      width?: number;
      height?: number;
    };
    preserve_aspect_ratio?: boolean;
    fit_screen?: boolean;
    px_size?: {
      width?: number;
      height?: number;
    };
  }

  interface Options {
    pxWidth?: number;
    size?: Size;
    size_options?: SizeOptions;
    stringify?: boolean;
    concat?: boolean;
    pixels?: string | string[];
    reverse?: boolean;
    colored?: boolean;
    bg?: boolean;
    fg?: boolean;
    white_bg?: boolean;
    px_background?: { r: number; g: number; b: number };
    image_type?: string;
    timeout?: number;
    timeoutMs?: number;
    stringify_fn?: (pixels: unknown, options: Options) => unknown;
  }

  type Callback = (err: Error | null, converted?: unknown) => void;
}

declare function imageToAscii(
  source: string | Buffer,
  options: imageToAscii.Options | imageToAscii.Callback,
  callback?: imageToAscii.Callback,
): void | Promise<unknown>;

export = imageToAscii;
