import type { Problem } from "./problems.js";
export declare enum IndexerStatus {
    /**
     * equivalent to null
     */
    OK = "OK",
    RATE_LIMITED = "RATE_LIMITED",
    UNKNOWN_ERROR = "UNKNOWN_ERROR"
}
export interface DbIndexer {
    id: number;
    name: string | null;
    url: string;
    apikey: string;
    trackers: string | null;
    /**
     * When false, the indexer has been disabled by the user and should not be
     * used for searching or RSS, but can be used for fetching caps or
     * cross-seed restore.
     * Corresponds to indexer enabled bit in Prowlarr.
     */
    enabled: boolean;
    status: IndexerStatus;
    retryAfter: number;
    searchCap: boolean;
    tvSearchCap: boolean;
    movieSearchCap: boolean;
    musicSearchCap: boolean;
    audioSearchCap: boolean;
    bookSearchCap: boolean;
    tvIdCaps: string | null;
    movieIdCaps: string | null;
    catCaps: string | null;
    limitsCaps: string | null;
}
export interface IndexerCategories {
    tv: boolean;
    movie: boolean;
    anime: boolean;
    xxx: boolean;
    audio: boolean;
    book: boolean;
    /**
     * If the indexer has a category not covered by the above.
     */
    additional: boolean;
}
export interface IndexerLimits {
    default: number;
    max: number;
}
export interface Caps {
    search: boolean;
    tvSearch: boolean;
    movieSearch: boolean;
    musicSearch: boolean;
    audioSearch: boolean;
    bookSearch: boolean;
    movieIdSearch: IdSearchCaps;
    tvIdSearch: IdSearchCaps;
    categories: IndexerCategories;
    limits: IndexerLimits;
}
export interface IdSearchCaps {
    tvdbId?: boolean;
    tmdbId?: boolean;
    imdbId?: boolean;
    tvMazeId?: boolean;
}
export interface Indexer {
    id: number;
    name: string | null;
    url: string;
    apikey: string;
    trackers: string[] | null;
    enabled: boolean;
    status: IndexerStatus;
    retryAfter: number;
    searchCap: boolean;
    tvSearchCap: boolean;
    movieSearchCap: boolean;
    musicSearchCap: boolean;
    audioSearchCap: boolean;
    bookSearchCap: boolean;
    tvIdCaps: IdSearchCaps;
    movieIdCaps: IdSearchCaps;
    categories: IndexerCategories;
    limits: IndexerLimits;
}
export declare const ALL_CAPS: Caps;
export declare function deserialize(dbIndexer: DbIndexer): Indexer;
/**
 * All indexers that users currently have configured regardless of whether they are working.
 */
export declare function getAllIndexers(): Promise<Indexer[]>;
/**
 * Indexers that are currently working and enabled.
 */
export declare function getEnabledIndexers(): Promise<Indexer[]>;
export declare function updateIndexerStatus(status: IndexerStatus, retryAfter: number, indexerIds: number[], indexerNames: Set<string>): Promise<void>;
export declare function updateSearchTimestamps(name: string, indexerIds: number[]): Promise<void>;
export declare function updateIndexerCapsById(indexerId: number, caps: Caps): Promise<void>;
export declare function clearIndexerFailures(): Promise<void>;
export declare function getHostToNameMap(): Promise<Map<string, string>>;
export declare function collectIndexerProblems(): Promise<Problem[]>;
