UNPKG

@ng-app-framework/api

Version:

![Travis CI](https://travis-ci.org/ng-app-framework/api.svg?branch=master)

22 lines (21 loc) 1.08 kB
import { HttpRequest, HttpResponse } from "@angular/common/http"; import { EventEmitter } from "@angular/core"; import { Observable } from "rxjs/Rx"; import { Callable } from "../Interface/Callable"; import { Requestable } from "../Interface/Requestable"; import { EndpointConfig } from "./EndpointConfig"; export declare class EndpointCaller implements Callable { http: Requestable; config: EndpointConfig; lastRequest: any; lastResponse: HttpResponse<any>; onApiStart: EventEmitter<any>; onApiFinish: EventEmitter<any>; constructor(http: Requestable, config?: EndpointConfig); call(absoluteUrl: string, method: string, requestData?: any): Observable<HttpResponse<any> | any>; protected createRequestObject(path: string, method: string, requestData: any): HttpRequest<any>; protected execute(request: HttpRequest<any>): Observable<HttpResponse<any>>; protected map(response: HttpResponse<any>): Observable<any>; protected getObjectFromResponse(response: HttpResponse<any>): any; protected transformResponse(response: any): any; }