import type { Problem } from "../problems.js";
import { DecisionAnyMatch, InjectionResult } from "../constants.js";
import { Label } from "../logger.js";
import { Metafile } from "../parseTorrent.js";
import { Result } from "../Result.js";
import { Searchee, SearcheeClient, SearcheeWithInfoHash } from "../searchee.js";
export declare function setClientsForTesting(clients: TorrentClient[]): void;
export declare function resetClientsForTesting(): void;
type TorrentClientType = Label.QBITTORRENT | Label.RTORRENT | Label.TRANSMISSION | Label.DELUGE;
export type Tracker = {
    url: string;
    tier: number;
};
export interface TorrentMetadataInClient {
    infoHash: string;
    category?: string;
    tags?: string[];
    trackers?: string[];
}
export interface ClientSearcheeResult {
    searchees: SearcheeClient[];
    newSearchees: SearcheeClient[];
}
export interface TorrentClient {
    clientHost: string;
    clientPriority: number;
    clientType: TorrentClientType;
    readonly: boolean;
    label: string;
    isTorrentInClient: (infoHash: string) => Promise<Result<boolean, Error>>;
    isTorrentComplete: (infoHash: string) => Promise<Result<boolean, "NOT_FOUND">>;
    isTorrentChecking: (infoHash: string) => Promise<Result<boolean, "NOT_FOUND">>;
    getAllTorrents: () => Promise<TorrentMetadataInClient[]>;
    /**
     * Get all searchees from the client and update the db
     * @param options.newSearcheesOnly only return searchees that are not in the db
     * @param options.refresh undefined uses the cache, [] refreshes all searchees, or a list of infoHashes to refresh
     * @param options.includeFiles include files in the torrents info request
     * @param options.includeTrackers include trackers in the torrents info request
     * @return an object containing all searchees and new searchees (refreshed searchees are considered new)
     */
    getClientSearchees: (options?: {
        newSearcheesOnly?: boolean;
        refresh?: string[];
        includeFiles?: boolean;
        includeTrackers?: boolean;
    }) => Promise<ClientSearcheeResult>;
    getDownloadDir: (meta: SearcheeWithInfoHash | Metafile, options: {
        onlyCompleted: boolean;
    }) => Promise<Result<string, "NOT_FOUND" | "TORRENT_NOT_COMPLETE" | "INVALID_DATA" | "UNKNOWN_ERROR">>;
    getAllDownloadDirs: (options: {
        metas: SearcheeWithInfoHash[] | Metafile[];
        onlyCompleted: boolean;
        v1HashOnly?: boolean;
    }) => Promise<Map<string, string>>;
    resumeInjection: (meta: Metafile, decision: DecisionAnyMatch, options: {
        checkOnce: boolean;
    }) => Promise<void>;
    inject: (newTorrent: Metafile, searchee: Searchee, decision: DecisionAnyMatch, options: {
        onlyCompleted: boolean;
        destinationDir?: string;
    }) => Promise<InjectionResult>;
    recheckTorrent: (infoHash: string) => Promise<void>;
    validateConfig: () => Promise<void>;
}
export declare function parseClientEntry(clientEntry: string): {
    clientType: TorrentClientType;
    readonly: boolean;
    url: string;
} | null;
export declare function clientsAreUnique(torrentClients: string[]): {
    uniqueHosts: boolean;
    uniqueWithPathname: boolean;
};
export declare function instantiateDownloadClients(): void;
export declare function reloadDownloadClients(): void;
export declare function getClients(): TorrentClient[];
export declare function byClientHostPriority(clientHost: string | undefined): number;
export declare function clientSearcheeModified(label: string, dbTorrent: any, name: string, savePath: string, options?: {
    category?: string;
    tags?: string[];
}): boolean;
export declare function organizeTrackers(trackers: Tracker[]): string[];
export declare function waitForTorrentToComplete(client: TorrentClient, infoHash: string, options?: {
    retries: number;
}): Promise<boolean>;
export declare function shouldRecheck(meta: Metafile, decision: DecisionAnyMatch): boolean;
export declare function getMaxRemainingBytes(meta: Metafile, decision: DecisionAnyMatch, options?: {
    torrentLog: string;
    label: string;
}): number;
export declare const resumeSleepTime: number;
export declare const resumeErrSleepTime: number;
export declare function getResumeStopTime(): number;
/**
 * Checks if the torrent should be resumed based on excluded files
 *
 * @param meta metafile object containing torrent information
 * @param remainingSize remaining size of the torrent
 * @param options.torrentLog torrent log string
 * @param options.label torrent client label
 * @returns boolean determining if the torrent should be resumed
 */
export declare function shouldResumeFromNonRelevantFiles(meta: Metafile, remainingSize: number, decision: DecisionAnyMatch, options?: {
    torrentLog: string;
    label: string;
}): boolean;
export declare function estimatePausedStatus(meta: Metafile, searchee: Searchee, decision: DecisionAnyMatch): boolean;
export declare function collectClientProblems(): Promise<Problem[]>;
export declare function collectClientLinkingProblems(): Promise<Problem[]>;
export {};
