arrakis-js
Version:
Arrakis Javascript client library
50 lines (49 loc) • 2.96 kB
TypeScript
import type { SeriesBlock } from "./block.js";
import type { Channel } from "./channel.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>;
/**
* 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
*/
export declare function 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
*/
export declare function 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
*/
export declare function describe(channels: string[]): Promise<Record<string, Channel>>;