import { Observable } from 'rxjs/Observable'; import { AxiosInstance } from 'axios'; import { Source, ExpandedSource, Metric } from '../types'; import { DataClient } from './data-client'; import { LayerClient } from './layer-client'; export declare class CotClient { protected host: string; protected ax: AxiosInstance; private lastReceivedTime; /** * Creates a new CotClient, with optional Basic Auth credentials * @param host The host url of the new City of things client. (e.g. http://www.cot-backend.com/api); * @param credentials {CotClientCredentials=} Optional credentials object */ constructor(host: string, credentials?: CotClientCredentials); /** * Returns all available sources as an array of Source objects * @returns An Observable containing a Source array. */ getSources(): Observable; /** * Returns the metadata of a source as a Source object. * @param sourceId {string} The id of the Source to get the metadata from. * @param expanded {boolean} Whether to expand the typeRefs or metrics from ids to full Types Metrics (default: false) * @returns An Observable containing a *Source* object. */ getSource(sourceId: string, expanded?: boolean): Observable; /** * Lists all Metric definitions. * @returns An Observable cotaining an array of *Metric* objects. */ getMetrics(): Observable; /** * Returns the definition of a Metric. * @param The id of a metric * @returns An Observable containing a *Metric* object. */ getMetric(metricId: string): Observable; /** * Returns the ids of the city data layers. */ getCityIds(): Observable; /** * Returns a MultiClient that internally iterates over all given sourceIds when requesting data or stats. * @param sourceIds {string[]} The sourceIds to do simultaneous queries on. * @returns A new SourcesClient object. */ withSources(...sourceIds: string[]): DataClient; /** * Returns a MultiClient that internally iterates over all given geohashes when requesting data or stats. * @param geohashes {string[]} The geohashes to do simultaneous queries in. * @returns A new LocationsClient object. */ withLocations(...geohashes: string[]): DataClient; /** * Returns a LayerClient that provides an entry point to layer data per metric for the given cityId * @param cityId An id that signifies both the city location and the data granularity */ withCityId(cityId: string): LayerClient; } export interface CotClientCredentials { username: string; password: string; }