import { Observable } from 'rxjs' ; import { ODataClient } from '../client' ; import { ODataActionResource , ODataEntities , ODataEntity , ODataFunctionResource , ODataNavigationPropertyResource , ODataProperty , ODataQueryArgumentsOptions , } from '../resources' ; export abstract class ODataBaseService { constructor ( protected client , protected name , protected apiNameOrEntityType ? ) { } get api ( ) { return this . client . apiFor ( this . apiNameOrEntityType ) ; } protected callFunction < P , R > ( params , resource , responseType , options ? ) ; protected callFunction < P , R > ( params , resource , responseType , options ? ) ; protected callFunction < P , R > ( params , resource , responseType , options ? ) ; protected callFunction < P , R > ( params , resource , responseType , options ? ) ; protected callFunction < P , R > ( params , resource , responseType , options = { } ) { resource . query ( ( q ) => q . apply ( options ) ) ; return resource . call ( params , { responseType : responseType as any , ... options , } ) ; } protected callAction < P , R > ( params , resource , responseType , options ? ) ; protected callAction < P , R > ( params , resource , responseType , options ? ) ; protected callAction < P , R > ( params , resource , responseType , options ? ) ; protected callAction < P , R > ( params , resource , responseType , options ? ) ; protected callAction < P , R > ( params , resource , responseType , options = { } ) { resource . query ( ( q ) => q . apply ( options ) ) ; return resource . call ( params , { responseType : responseType as any , ... options , } ) ; } protected fetchNavigationProperty < S > ( resource , responseType , options ? ) ; protected fetchNavigationProperty < S > ( resource , responseType , options ? ) ; protected fetchNavigationProperty < S > ( resource , responseType , options = { } ) { resource . query ( ( q ) => q . apply ( options ) ) ; return resource . fetch ( { responseType : responseType as any , ... options } ) ; } }