import type { HttpClientRequest , HttpClientResponse , HttpClient } from './httpClient' ; export abstract class ApiService < Request extends HttpClientRequest = HttpClientRequest > { constructor ( public readonly httpClient ) { } request < R = any > ( request ) { return this . httpClient . request ( request ) ; } get < R = any > ( path , payload ? , config ? ) { return this . request ( { path , ... payload , ... config , method : 'GET' , } as Request ) ; } post < R = any > ( path , payload ? , config ? ) { return this . request < R > ( { path , requestType : 'json' , ... payload , ... config , method : 'POST' , } as Request ) ; } put < R = any > ( path , payload ? , config ? ) { return this . request < R > ( { path , requestType : 'json' , ... payload , ... config , method : 'PUT' , } as Request ) ; } delete < R = any > ( path , payload ? , config ? ) { return this . request < R > ( { path , ... payload , ... config , method : 'DELETE' , } as Request ) ; } }