/**
 * Type declarations for ruhend-scraper
 * @see https://www.npmjs.com/package/ruhend-scraper
 */

declare module "ruhend-scraper" {
  // YouTube MP3 result
  export interface Ytmp3Result {
    title: string;
    audio: string;
    author: string;
    description: string;
    duration: string;
    views: string;
    upload: string;
    thumbnail: string;
  }

  // YouTube MP4 result
  export interface Ytmp4Result {
    title: string;
    audio: string;
    author: string;
    description: string;
    duration: string;
    views: string;
    upload: string;
    thumbnail: string;
  }

  // TikTok result
  export interface TtdlResult {
    title: string;
    author: string;
    username: string;
    published: string;
    like: string;
    comment: string;
    share: string;
    views: string;
    bookmark: string;
    video: string;
    cover: string;
    music: string;
    profilePicture: string;
  }

  // Instagram/Facebook media item
  export interface MediaItem {
    url: string;
  }

  // Instagram/Facebook response
  export interface MediaResponse {
    data: MediaItem[];
  }

  // YouTube search video result
  export interface YtSearchVideo {
    type: "video";
    title: string;
    url: string;
    durationH: string;
    publishedTime: string;
    view: string;
    thumbnail: string;
  }

  // YouTube search channel result
  export interface YtSearchChannel {
    type: "channel";
    channelName: string;
    url: string;
    subscriberH: string;
    videoCount: string;
  }

  // YouTube search result
  export interface YtSearchResult {
    video: YtSearchVideo[];
    channel: YtSearchChannel[];
  }

  // Export functions
  export function ytmp3(url: string): Promise<Ytmp3Result>;
  export function ytmp4(url: string): Promise<Ytmp4Result>;
  export function ttdl(url: string): Promise<TtdlResult>;
  export function igdl(url: string): Promise<MediaResponse>;
  export function fbdl(url: string): Promise<MediaResponse>;
  export function ytsearch(query: string): Promise<YtSearchResult>;
}