import * as cheerio from "cheerio"; import { CheerioLoadRequest, CheerioLoadResult, ProviderContext, TProviderSelectors } from "../types/index.ts"; /** * Mimics a browser request by setting appropriate headers and using Cheerio to load the HTML content of a page. */ export declare const BrowserHeader: { readonly Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"; }; /** * Loads a webpage using Cheerio, mimicking a browser request with appropriate headers and optional proxy support. * @param page - The URL of the page to load * @param request - The requester information, including media details, user agent, proxy agent, and any extra headers * - Example usage: * ```ts * const { $, response } = await cheerioLoad(new URL("https://example.com"), { * media: { type: "movie", title: "Example Movie", releaseYear: 2023 }, * targetLanguageISO: "en", * userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36" * }); * ``` */ export declare function cheerioLoad(page: URL, request: CheerioLoadRequest, context: ProviderContext["xhr"]): Promise; /** * Sorts search results based on their similarity to the requester's media information, using a scoring algorithm that considers title, year, date, and duration matches. * @param $page - The Cheerio instance containing the loaded page content * @param selector - The selectors for extracting relevant information from each search result entry * - requester - The requester's media information used for calculating similarity scores * @returns An array of search results sorted by their similarity score, with each result containing the original Cheerio element and its calculated score * * `Score ranges:` * - `For movies/series`: [0 <-> 170] * - `For channels`: [0 <-> 100] * @see {@link calculateMatchScore} for the scoring algorithm that considers title, year, date, and duration matches to determine the similarity of search results to the requester's media information. */ export declare function cheerioSortResults($page: cheerio.CheerioAPI, selector: TProviderSelectors, requester: CheerioLoadRequest): Promise<{ element: import("domhandler").AnyNode; score: number; }[]>; declare const context: ProviderContext["cheerio"]; export default context;