UNPKG

@tdallau/nativescript

Version:

some helper functions for nativescript

33 lines (32 loc) 922 B
import { RequestHistory } from "./requestHistory"; declare type BaseRequestProps = { target: string; headers?: { [key: string]: any; }; url?: string; saveInHistory?: boolean; }; declare type PostRequestProps = BaseRequestProps & { body?: object; }; declare type GetRequestProps = BaseRequestProps & { query?: object; }; export declare class Http { private _baseUrl; private _headers; private _saveHistory; private _debugging; private _history; constructor(baseUrl: string, baseHeaders?: any, saveHistory?: boolean, debugging?: boolean); private request; private saveHistory; get history(): RequestHistory[]; private createQueryString; post<T>(props: PostRequestProps): Promise<T>; get<T>(props: GetRequestProps): Promise<T>; put<T>(props: PostRequestProps): Promise<T>; delete<T>(props: GetRequestProps): Promise<T>; } export {};