import { APICursorHelper } from "../helpers/apiCursor.helper"; export declare type QueryStringParam = { key: string; value: string; }; export declare abstract class Resource { protected baseResource: string; protected _subResources: { [key: string]: any; }; protected resourceIdentifyingMetadata: { [key: string]: any; }; protected resourceIdentifier: string | number; protected getSubresourceValue(obj: { [key: string]: any; }, key: string): any; } export declare type SimpleDetailHttpResponse = { [key: string]: string; detail: string; }; export declare type HttpMethods = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; export interface HttpConf { method: HttpMethods; url: string; body: { [key: string]: any; }; cursorId: string; } export interface MultichatHttpSettings { BASE_URL: string; DEBUG: boolean; } export declare let MultichatChatClientConf: { confPipes: Array; headers: { [key: string]: any; }; }; export declare class BaseHttpResource extends Resource { protected cursors: { [key: string]: APICursorHelper; }; protected readonly confPipes: Function[]; protected readonly baseUrl: string; constructor(); protected registerConfPipe(pipe: Function): void; /** * Wrap a HTTP call * @param conf * @return {{then: BaseHttpResource.then}} * @private */ protected _wrapHttp(conf: HttpConf | any): Promise; /** * @param response * @returns {boolean} */ private isPaginatedResponse(response); decodeQuerystring: (queryString: string) => { [key: string]: any; }; encodeQuerystring(qs: string | QueryStringParam[] | { [key: string]: any; }): string | undefined; extractQuerystring(url: string): any; list(id?: string, url?: string): Promise; post(url?: string, body?: object, queryParam?: string): Promise; request(url?: string, queryParams?: string | QueryStringParam[], method?: HttpMethods, body?: object, cursorId?: string): Promise; getUrl(url: string, cursorId?: string): Promise; /** * Generic function to do a request() call to a subresource of this class. */ requestSubResource(resource: string, url?: string, queryParams?: any, method?: HttpMethods, body?: object): Promise; }