/** * Copyright Linkurious SAS 2012 - 2019 * * - Created on 2019-09-26. */ import { GenericObject } from '../api/commonTypes'; import { ConnectionRefusedError, ErrorResponses, LkError, LkErrorKey, Response } from './response'; import { FetchConfig, ModuleProps, RawFetchConfig, SendBeaconConfig } from './types'; export declare abstract class Request { readonly props: ModuleProps; constructor(props: ModuleProps); /** * Render `config.url` using `config.params` * and subtract the params used from `config.params`. */ private static renderURL; /** * Return object in input with keys transformed from camelCase to snake_case */ static toSnakeCaseKeys(obj: GenericObject): GenericObject; /** * - Split `config.params` into body and query-string parameters depending on the HTTP method. * - Set `guest` and `_` query-string params. * - Normalize query-string params to snake_case, as this is what the Linkurious server expects. * - Construct the URL by merging `baseUrl`, `config.url` and the query-string parameters. */ static getFetchConfig(config: Required, moduleProps: ModuleProps, now?: number): FetchConfig; private static getUrlWithQueryString; /** * Send a post request using the Navigator.sendBeacon api. * - Note that only url parameters are supported. * - The sendBeacon api does not return any response. * * This is useful to send a query while the page is closing (for example releasing a viz lock) */ sendBeacon(rawFetchConfig: SendBeaconConfig): Promise; request(rawFetchConfig: RawFetchConfig): Promise | Response | ErrorResponses>; isLkError(body: unknown): body is LkError; private isDataSourceUnavailableError; private doRequest; }