/** * Check HTTP promise response for server error response (non 2XX status) and reject promise is error * * @param promise the HTTP promise to check for HTTP status code of 2XX for success * * @returns promise for the HTTP connection with catch supporting error */ export declare const handlePromiseErrors: (promise: Promise) => Promise; /** * Make params into string for query params * * @param params object of key:value pairs * * @returns a string of query params that is URL safe */ export declare const getQueryString: (params: any) => string; /** * Create URL with query params if params are set * * @param url the url string * @param params object of key:value pairs * * @returns a string of url and query params together */ export declare const getUrlWithQueryParams: (url: string, params: any) => string; /** * Add required headers and additional headers together for network requests * * @param additionalHeaders object of key:value of extra header items * * @returns an object of key:value of all headers (additional and required) */ export declare const getHeaders: (additionalHeaders?: any) => any; /** * Make a GET for retrieving data from a server * * @param url the url string of the resource on the server * @param queryParams an object of key:value to be used for the query params * @param additionalHeaders an object of key:value to be used for additional headers * * @returns a promise that will resolve with the response from the server or reject if network/server error */ export declare const apiGet: (url: string, queryParams?: any, additionalHeaders?: any) => Promise; /** * Make a POST for creating data on the server * * @param url the url string of the resource on the server * @param data the data (JSON) to send to the server * @param queryParams an object of key:value to be used for the query params * @param additionalHeaders an object of key:value to be used for additional headers * * @returns a promise that will resolve with the response from the server or reject if network/server error */ export declare const apiPost: (url: string, data: any, queryParams?: any, additionalHeaders?: any) => Promise; /** * Make a PUT for creating data on the server * * @param url the url string of the resource on the server * @param data the data (JSON) to send to the server * @param queryParams an object of key:value to be used for the query params * @param additionalHeaders an object of key:value to be used for additional headers * * @returns a promise that will resolve with the response from the server or reject if network/server error */ export declare const apiPut: (url: string, data: any, queryParams?: any, additionalHeaders?: any) => Promise; /** * Make a DELETE on a resource on the server * * @param url the url string of the resource on the server * @param queryParams an object of key:value to be used for the query params * @param additionalHeaders an object of key:value to be used for additional headers * * @returns a promise that will resolve with the response from the server or reject if network/server error */ export declare const apiDelete: (url: string, queryParams?: any, additionalHeaders?: any) => Promise; declare const _default: { apiGet: (url: string, queryParams?: any, additionalHeaders?: any) => Promise; apiPost: (url: string, data: any, queryParams?: any, additionalHeaders?: any) => Promise; apiPut: (url: string, data: any, queryParams?: any, additionalHeaders?: any) => Promise; apiDelete: (url: string, queryParams?: any, additionalHeaders?: any) => Promise; getHeaders: (additionalHeaders?: any) => any; getUrlWithQueryParams: (url: string, params: any) => string; getQueryString: (params: any) => string; handlePromiseErrors: (promise: Promise) => Promise; }; export default _default;