/** * SearXNG API client implementation * Provides interface to SearXNG search API with Basic Auth support */ export interface SearchOptions { /** List of search engines to use (optional) */ engines?: string[]; /** Search categories like general, images, news (optional) */ categories?: string[]; /** Response format, always json for API usage */ format?: "json"; /** Safe search level (0-2) */ safesearch?: number; /** Search language code */ language?: string; } export interface SearchResultItem { /** Complete URL of the result page */ url: string; /** Page title */ title: string; /** Page content summary */ content: string; /** Thumbnail URL (may be null) */ thumbnail?: string | null; /** Search engine that provided this result */ engine: string; /** Result template type */ template: string; /** Parsed URL components [protocol, domain, path, query, fragment, other] */ parsed_url: [string, string, string, string, string, string]; /** Image source URL */ img_src?: string; /** Result priority */ priority?: string; /** List of all search engines that provided this result */ engines: string[]; /** Ranking positions in various search engines */ positions: number[]; /** Relevance score */ score: number; /** Search category */ category: string; } export interface AnswerItem { /** Answer source URL */ url: string; /** Answer template type */ template: string; /** Search engine that provided the answer */ engine: string; /** Parsed URL components */ parsed_url: [string, string, string, string, string, string]; /** Answer content */ answer: string; } export interface InfoboxItem { /** Infobox title */ infobox: string; /** Infobox unique identifier */ id: string; /** Infobox content description */ content: string; /** Infobox image URL */ img_src?: string; /** Related links list */ urls: Array<{ /** Link title */ title: string; /** Link URL */ url: string; /** Whether this is an official link */ official?: boolean; }>; /** Attribute information list */ attributes: Array<{ /** Attribute label */ label: string; /** Attribute value */ value: string; /** Entity identifier */ entity: string; }>; /** Search engine that provided the information */ engine: string; /** Associated URL for the infobox */ url: string | null; /** Infobox template type */ template: string; /** Parsed URL components */ parsed_url: [string, string, string, string, string, string] | null; /** Infobox title */ title: string; /** Thumbnail URL */ thumbnail: string; /** Priority */ priority: string; /** List of search engines */ engines: string[]; /** Ranking position */ positions: string | number; /** Relevance score */ score: number; /** Search category */ category: string; } export interface SearchResult { /** Search query string */ query: string; /** Total number of search results */ number_of_results: number; /** List of search results */ results: SearchResultItem[]; /** Direct answers (like Wikipedia summaries) */ answers?: AnswerItem[]; /** Spelling correction suggestions */ corrections?: string[]; /** Infobox data */ infoboxes?: InfoboxItem[]; /** Search suggestions */ suggestions?: string[]; /** Unresponsive engines with error messages */ unresponsive_engines?: [string, string][]; } export interface MultiSearchResult { /** List of search queries */ queries: string[]; /** Results for each query */ results: Array<{ query: string; success: boolean; data: SearchResult | null; error: string | null; }>; /** Summary statistics */ summary: { total: number; successful: number; failed: number; }; } /** * SearXNG API client with Basic Auth support */ export declare class SearXNGApiClient { private baseUrl; private auth?; private timeout; constructor(baseUrl: string, auth?: { username: string; password: string; }, timeout?: number); /** * Generate Basic Auth headers if credentials are provided */ private getAuthHeaders; /** * Execute a single search query */ private searchSingle; /** * Execute multiple search queries in parallel */ search(queries: string[], options?: SearchOptions): Promise; /** * Test connection to SearXNG instance */ testConnection(): Promise; }