import { AxiosResponse, AxiosInstance } from 'axios'; import { Observable } from 'rxjs/Rx'; import { TemporalPage, TemporalPageLink, Data, NamedData, BatchedData } from './types'; export declare const enum TemporalPageData { EMPTY = 0, BUCKET = 1, STATS_UNIT = 2, STATS_BATCH = 3, } export declare class InternalUtils { static getDataType(link: TemporalPageLink): TemporalPageData; /** * Mapping function that takes a response and maps it to a *TemporalPage*. * @param response The response to map. * @param readUntil {number=} Until which timestamp we already read, so up untill (inclusive) that one, will be filtered out. * @throws Error when no link header is present. * @returns A *TemporalPage* object containing the **data** field and the **link** field. */ static mapToTemporalPage(response: AxiosResponse, readUntil?: number): TemporalPage; /** * Parses the value of the link header, to make a *TemporalPageLink* object of the relevant information in there. * @param value The value of the link header to be parsed * @returns A *TemporalPageLink* object, containing at least a **self** link. */ static parseLinkHeader(value: string): TemporalPageLink; /** * Perform a GET request to the url and map the result to a TemporalPage object. * @param url {string} The FULL url to GET query * @param axiosInstance {AxiosInstance} Custom axios instance to perform * requests with, else the defaul axios.create() is used. * @param readUntil {number=} Until which timestamp we already read, so up untill (inclusive) that one, will be filtered out. */ static getAsTemporalPage(url: string, axiosInstance: AxiosInstance, readUntil?: number): Observable; /** * Recursively follows links to get the complete interval as specified in the url * * @param host {string} The actual host endpoint as given to a Client instance * @param url {string} Url containing a *from* and *to* parameter * @param axiosInstance {AxiosInstance=} Optional custom axios instance to perform * requests with, else the defaul axios.create() is used. */ static getCompleteInterval(host: string, url: string, axiosInstance?: AxiosInstance): Observable; /** * Returns the last timestamp that has been returned in the TemporalPage or null if there was no data. */ static getLastTimestamp(tpage: TemporalPage): number | null; /** * * @param b1 * @param b2 */ static mergeStatsBatchedData(b1: BatchedData, b2: BatchedData): BatchedData; /** * Merges 2 stat Data object. * @param d1 Data 1 * @param d2 Data 2 * @return A new Data containing the merged results */ static mergeStatsData(d1: Data, d2: Data): Data; /** * Merges two DataLayer Buckets. * @param b1 Bucket 1 * @param b2 Bucket 2 * @return A new DataLayer Bucket with merged data */ static mergeDataLayerData(b1: NamedData, b2: NamedData): NamedData; /** * Merge one stats record with one other record (record == row from Data.values) * @param r1 Record 1 * @param r2 Record 2 * @return A new record with merged data */ private static unifyStatsRecord(r1, r2); /** * Merge one DataLayer record with one other record (record == row from Data.values) * @param r1 Record 1 * @param r2 Record 2 * @return A new record with merged data */ private static unifyDataLayerRecord(r1, r2); /** * The test that picks how to expand the initial result of a query. * @param tpage TemporalPage incoming object * @param last The Link header *last* field * @param axiosInstance {AxiosInstance=} Optional custom axios instance to perform * requests with, else the defaul axios.create() is used. */ private static expandTest(tpage, host, last, axiosInstance?); } export declare function join(delim: string, ...parts: string[]): string; export declare function url(...parts: string[]): string;