UNPKG

arrakis-js

Version:

Arrakis Javascript client library

41 lines (40 loc) 2.44 kB
import { Channel } from "./channel.js"; import { SeriesBlock } from "./block.js"; /** * 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 */ export declare function 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 */ export declare function find(pattern?: string, dataType?: string | Array<string>, minRate?: number, maxRate?: number, publisher?: string | Array<string>): AsyncGenerator<Channel>; /** * 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 a SeriesBlock containing the requested data */ export declare function stream(channels: string[], start: number, end: number): AsyncGenerator<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 */ export declare function describe(channels: string[]): Promise<Record<string, Channel>>;