import { SeriesBlock } from "./block.js";
import { Channel } from "./channel.js";
/**
 * Client to fetch or publish timeseries.
 *
 * @param url - The URL to connect to.
 *              If the URL is not set, connect to a default server
 *              or one set by ARRAKIS_SERVER.
 */
export default class Client {
    /** The URL to connect to the Arrakis server */
    readonly initialUrl: string;
    readonly apiUrl: string;
    /**
     * Creates a new Client instance.
     *
     * @param url - The URL to connect to. If not provided, will use the ARRAKIS_SERVER
     *              environment variable or default to /arrakis
     */
    constructor(url?: string | null);
    /**
     * Count channels matching a set of conditions
     *
     * @param {string} [pattern] - Channel pattern to match channels with, using regular expressions
     * @param {string|Array<string>} [dataType] - If set, find all channels with these data types
     * @param {number} [minRate] - Minimum sample rate for channels
     * @param {number} [maxRate] - Maximum sample rate for channels
     * @param {string|Array<string>} [publisher] - If set, find all channels associated with these publishers
     * @returns {Promise<number>} A promise that resolves to the number of channels matching query
     */
    count(pattern?: string, dataType?: string | Array<string>, minRate?: number, maxRate?: number, publisher?: string | Array<string>): Promise<number>;
    /**
     * Find channels matching a set of conditions and stream results via Server-Sent Events (SSE)
     *
     * @param {string} [pattern] - Channel pattern to match channels with, using regular expressions
     * @param {string|Array<string>} [dataType] - If set, find all channels with these data types
     * @param {number} [minRate] - Minimum sample rate for channels
     * @param {number} [maxRate] - Maximum sample rate for channels
     * @param {string|Array<string>} [publisher] - If set, find all channels associated with these publishers
     * @returns {AsyncGenerator<Channel>} An async generator that yields channel objects as they are received via SSE
     */
    find(pattern?: string, dataType?: string | Array<string>, minRate?: number, maxRate?: number, publisher?: string | Array<string>): AsyncGenerator<Channel>;
    /**
     * Stream timeseries data for a list of channels within a time range
     *
     * @param {string[]} channels - A list of channels to request
     * @param {number} [start] - GPS start time, in seconds; streams from now if omitted
     * @param {number} [end] - GPS end time, in seconds; streams indefinitely if omitted
     * @returns {AsyncGenerator<SeriesBlock>} An async generator yielding `SeriesBlock`s as they stream in
     */
    stream(channels: string[], start?: number, end?: number): AsyncGenerator<SeriesBlock>;
    /**
     * Fetch timeseries data for a list of channels within a time range
     *
     * @param {string[]} channels - A list of channels to request
     * @param {number} start - GPS start time, in seconds
     * @param {number} end - GPS end time, in seconds
     * @returns {Promise<SeriesBlock>} A promise that resolves to the block of timeseries data
     */
    fetch(channels: string[], start: number, end: number): Promise<SeriesBlock>;
    /**
     * Get channel metadata for channels requested
     *
     * @param {string[]} channels - List of channels to request
     * @returns {Promise<Record<string, Channel>>} A promise that resolves to a mapping of channel names to channel metadata
     */
    describe(channels: string[]): Promise<Record<string, Channel>>;
    /**
     * Build a human-readable message from a failed HTTP response (JSON `{ detail }` or raw body).
     */
    private static fetchErrorMessage;
    /**
     * Parses and validates a URL, falling back to environment variable or default server
     * @param {string | null | undefined} url - The URL to parse, or null/undefined to use environment/default
     * @returns {string} The parsed and validated URL
     */
    private static parseUrl;
}
