interface NewsAPIConfig {
    baseUrl?: string;
    timeout?: number;
}
interface SearchOptions {
    q?: string;
    startDate?: string | Date;
    endDate?: string | Date;
    content?: boolean;
    lang?: string | string[];
    country?: string | string[];
    region?: string | string[];
    category?: string | string[];
    max?: number;
    attributes?: string | string[];
    page?: number;
    sortby?: 'publishedAt' | 'relevance';
    publisher?: string | string[];
    format?: 'json' | 'csv' | 'xlsx';
    ai_sentiment?: string;
    ai_entity_name?: string;
    ai_entity_type?: string;
}
interface Source {
    name: string;
    url: string;
}
interface Entity {
    name: string;
    type: string;
}
interface Article {
    title: string;
    description: string;
    category: string;
    content: string;
    country: string;
    region: string;
    lang: string;
    authors: string[];
    ai_sentiment: string;
    ai_sentiment_scores: Record<string, number>;
    ai_entities: Entity[];
    ai_summary: string;
    url: string;
    image: string;
    publishedAt: string;
    source: Source;
}
interface SearchResponse {
    totalArticles: number;
    currentPage: number;
    nextPage: number | null;
    articles: Article[];
}
interface UsageResponse {
    plan: string;
    requestsUsed24Hours: number;
    requestsLimit24Hours: number;
    requestsRemaining24Hours: number;
    requestsUsed30Days: number;
}

declare class NewsAPI {
    private readonly apiKey;
    private readonly baseUrl;
    private readonly timeout;
    constructor(apiKey: string, config?: NewsAPIConfig);
    search(options?: SearchOptions): Promise<SearchResponse | ArrayBuffer>;
    headlines(options?: SearchOptions): Promise<SearchResponse | ArrayBuffer>;
    usage(): Promise<UsageResponse>;
    private request;
    private serializeParams;
    private makeRequest;
    private extractErrorMessage;
}

declare class NewsAPIError extends Error {
    readonly statusCode: number;
    constructor(statusCode: number, message: string);
}

export { type Article, type Entity, NewsAPI, type NewsAPIConfig, NewsAPIError, type SearchOptions, type SearchResponse, type Source, type UsageResponse };
